Re: Question about trig functions approximation Message #2 Posted by Eddie W. Shore on 9 Jan 2013, 9:45 a.m., in response to message #1 by Namir
Quote:
Hi All,
In your opinion, among the sin, cos, and tan functions (as you get any two trig functions from the value of the third trig function), which one is easier to calculate using polynomial approximations or special approximation? If you are referring to a special approximation can you please state it or offer a link to that information?
Thanks,
Namir
Namir,
I tend to lean towards sine. However, I find the convergence for the Taylor Series for sine to be super slow. The approximations listed are stated to be good for eight-digit accuracy for the interval [0 to pi/2].
From "Scientific Analysis on the Pocket Calculator" by Jon M. Smith (published 1975):
Sine and Cosine: error < 2 x 10^-9 with 0 <= x <= pi/2
sin x = x*(1 + x^2*(a2 + x^2*(a4 + x^2*(a6 + x^2*(a8 + a10*x^2)))))
a2 = -0.16666 66664
a4 = 0.00833 33315
a6 = -0.00019 84090
a8 = 0.00000 27526
a10 = -0.00000 00239
cos x = 1 + x^2*(a2 + x^2*(a4 + x^2*(a6 + x^2*(a8 + a10*x^2)))))
a2 = -0.49999 99963
a4 = 0.04166 66418
a6 = -0.00138 88397
a8 = 0.00002 47609
a10 = -0.00000 26050
The "compacted" approximations are said to give three-digit accuracy for [0, pi/2].
Sine and Cosine: Error = 2 * 10^-4 and 2 * 10^-9, respectively, for 0 <= x <= pi/2
sin x = x * (1 + x^2*(a2 + a4*x^2))
a2 = -0.16605
a4 = 0.00761
cos x = 1 + x^2*(a2 + a4*x^2))
a2 = -0.49670
a4 = 0.03705
There was also a thread of calculating trig functions with the HP 12C, that was a while ago.
Hope this helps,
Eddie
|