Download ) cos(),( ) sin(),( ) sin(),12( ),( + = + a a anMa anN dtat t nP

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Pi wikipedia , lookup

Trigonometric functions wikipedia , lookup

Approximations of π wikipedia , lookup

Transcript
Oct.10, 2011-Pre-print of Trig Approximation Paper
A NEW APPROXIMATION METHOD FOR TRIGNOMETRIC FUNCTIONS
USING QUOTIENTS BASED ON LEGENDRE POLYNOMIALS
U.H.Kurzweg
and S.P.Timmins
University of Florida
Sabre Systems, US Census Bureau
INTRODUCTION- Finding rational approximations to trigonometric functions has a
long history with most efforts devoted to approximating the function by polynomials.
Many of these approximations and the degree of error produced in a given indicated
range are found in Ref.[1]. Use of rational approximations using ratios of polynomials
has received less attention although Pade approximates for the trigonometric functions to
a high order of accuracy are known Ref[2]. It is our purpose here to introduce a new
rational approximation technique (Ref[3]) based on polynomial quotients derived by
solving integrals whose integrand consists of the product of odd Legendre polynomials
and the sin(at) function . After generating a set of approximations for tan(a)≈T(n,a), and
evaluating things numerically in the range 0<a<π/4, we show how this data is used to
generate highly accurate approximations to sine and cosine and other trignometric
functions over the entire range of -∞<a<∞. Numerous examples of trigonometric
approximations in terms of the T(n,a) polynomial quotients are presented including
evaluations of the sine integral and Bessel functions.
QUOTIENT APPROXIMATION METHOD
Recently, while evaluating some integrals involving the Legendre polynomials, we ran
across the definite integralx =1
I (n, a ) = ∫ P(2n + 1, t ) sin( at )dt =
x =0
N (n, a) sin( a ) + M (n, a ) cos(a)
a 2 ( n+1)
where P(2n+1,1) are the odd Legendre polynomials and N(n,a) and M(n,a) are
polynomials in ‘a’ for fixed n . What is interesting about this equality is that, when n gets
large, the integrand P(2n+1,t)sin(at) closely approximates P(2n+1,t) with the zeros of the
product located at n+1 points over the interval 0≤t≤1. We demonstrate this point via the
following figureFig.1-Comparison of the Integrands P(9,t) and P(9,t) sin(t) in 0<t<1
It is known that the integral of P(2n+1,t) over the interval 0<t<1 is exactly zero, so that it
seems reasonable to conclude that I(n,a) will be very small for larger values of n and
small ‘a’. This fact allows us to make the approximation-
I (n, a)a 2 ( n +1)
≈ 0 = N (n, a ) tan(a ) + M (n, a )
cos(a )
We thus have the estimate that -
tan(a ) ≈ T (n, a ) = − [
M ( n, a )
]
N (n, a )
with the order of the approximation determined by the value of n. A measure of the error
for a given n and a is determined by the value of ε= I(n,a)a2(n+1)/[N(n,a)cos(a)]. Working
out the first four approximations for tan(a), we find-
15a − a 3
T (1, a ) =
15 − 6a 2
945a − 105a 3 + a 5
T (2, a ) =
945 − 420a 2 + 15a 4
135135a − 17325a 3 + 378a 5 − a 7
T (3, a ) =
135135 − 62370a 2 + 3150a 4 − 28a 6
34459425a − 4729725a 3 + 135135a 5 − 990a 7 + a 9
T (4, a ) =
34459425 − 16216200a 2 + 945945a 4 − 13860a 6 + 45a 8
One notices that when ‘a’ gets very small the tangent approximation simply becomes
tan(a)≈a. In general, the larger one sets n the more accurate the estimates for tan(a) will
be. For T(4,1) we get an error estimate of ε=1.439x10-16. In addition, one has the
equality-
tan(a ) =
lim
T ( n, a )
n→∞
The above quotients are very easy to generate compared to standard Pade approximates
and generally are more accurate for the same polynomial powers in the quotients. The
only drawback noticed with the present approximation method is that the quotients
become rather lengthy as n is increased beyond n=5 or so.
To test the accuracy of our approximations, take the case of n=4 and a=1. There we are
dealing with the integrand shown in Fig.[1] and the odd P(9,x) Legendre polynomial.
Substituting in the numbers, we find-
T (4,1) = 1.55740772465489020866...
compared to
tan(1) = 1.5574077246549022305...
Thus one has , as expected, a 16 digit accurate estimate for tan(1). By decreasing the
value of ‘a’ or increasing n this accuracy will improve further. For n=4 and a=1/10, one
finds a result accurate to 35 digits. One also obtains a very accurate representation of the
standard tan(a) curve in –π<a<π as shown.
Fig.2-Plot of the Quotient Approximation T(4,a)
The T(4,a) approximation also predicts the location of singularities of the tan(a) function
at –π/2 and π/2 to twelve digit accuracy. This is gotten by setting the denominator of
T(4,a) to zero. The Taylor series expansion for T(4,a) agrees exactly with the expansion
for tan(a) out to order a17. We find-
1
2
17 7
62 9 1382 11
T (4, a ) = a + a 3 + a 5 +
a +
a +
a
3
15
315
2835
155925
+
21844 13
929569 15
6404582 17
a +
a +
a + ...
6081075
638512875
1085471887
To generate approximate values for other trigonometric functions we start with T(n,a)
and note the following-
2a − π 2
)
T ( n, a )
4
=
sin( a) ≈ S (n, a ) =
2
1 + T (n, a ) 1 + T (n, 2a − π ) 2
4
1 − T ( n,
and-
a
1 − T (n, ) 2
1
2
=
cos(a ) ≈ C (n, a ) =
2
1 + T (n, a ) 1 + T (n, a ) 2
2
Note that the second form for the functions S(n,a) and C(n,a) do not involve the root of a
function and so are somewhat simpler to handle for numerical evaluation purposes. The
approximations for sine and cosine will have an accuracy comparable with that of the
tangent approximation. Looking at T(4,π/6), S(4,π/6) and C(4,π/6) we find the numerical
results-
π
T ( 4, ) = 0.5773502691 8962576453 ...
6
π
S ( 4, ) = 0.5000000000 0000000003 ...
6
π
C ( 4, ) = 0.8660254037 8443864678 ...
6
In all three cases we find these values are accurate to 18 places when compared to the
known exact values of 1/sqrt(3), 1/2, and sqrt(3)/2, respectively. Once T(n,a) has been
determined approximations for any other trigonometric function values will follow. As an
example, we have -
1 + [ K (4,0.5)]2
= 1.850815717680925617911...
sec(1) ≈
1 − [ K (4,0.5)]2
good to 22 places.
FURTHER MANIPULATIONS AND RESULTS
It is is clear from the above theoretical results and the properties of trignometric
functions , that one really requires only highly accurate approximations for tan(a) in the
limited range 0<a<π/4 in order to find tan(a) and the other trigonometric function at any
any other point. This fact follows from well known identities involving tan(a) plus the
less well known identity-
π
π
tan( + A) tan( − A) = 1
4
4
Thus, to find an approximation for tan(13π/9) using n=4, we have-
1
4π
13π
) = tan( ) ≈
tan(
π
9
9
T (4, )
18
= 5.67128181961770953099441843986
a 30 digit accurate result.
Having a way to accurately approximate trigonometric functions, it also becomes
possible to estimate the values of various definite integrals. Consider first the following
tan(t) integral and apply the n=4 approximation1
tan(t ) 4
T (4, a ) 4
da
S= ∫
dt ≈ ∫
t
a
t =0
a=0
1
We find at once the 15 place accurate approximation S≈0.815400592038350 for this
integral which cannot be evaluated in closed form.
As another example consider the zeroth order Bessel Function of the First Kind. It can be
defined by the integral-
J 0 ( x) =
2
π
π /2
Re ∫ exp[ix sin(t )]dt
t =0
Note here that the range 0<t<π/2 remains sufficiently small so that sin(t) will be well
approximated its T(n,a) form. Using n=3, x=1 and t=a, we find the 10 place accurate
result-
J 0 (1) ≈
2
π
a =π / 2
Re ∫ exp[i T (3, a ) / 1 + T (3, a ) 2 ]da = 0.7651976865...
a =0
Another integral which can be well approximated by our quotient method is the sine
integral-
sin(t )
π π /2
dt = − ∫ exp[− x(cos(t )][cos( x sin(t ))]dt
Si ( x) = ∫
t
2 t =0
t =0
x
The second integral form is found on pg 232 of the Abramowitz and Stegun ”Handbook
of Mathematical Functions”, (Dover Pub.NY, 1972). It is also well suited for
approximations using the T(n,a) function. A little manipulation yields-
Si ( x) ≈
π
2
π /2
− Re ∫ exp − x[
t =0
1 − iT (n, t )
]dt
1 + T (n, t ) 2
Plotting this approximation using the simplest and least accurate approximation T(1,t)
corresponding to n=1 and comparing it to the exact values of Si(x) shows very good
agreement over the entire range 0<x<15.
Fig.3-Comparison of Si(x) and the T(1,a) Approximation
Small departures from Si(x) are observed to occur only at the peaks and troughs of the
oscillations.
One can also obtain excellent approximations to the derivatives of functions at fixed
points . Take the case of-
−[
d {exp[− tan( x)]}
π
π
] π ≈ [1 + T (n, ) 2 ] exp[−T (n, )]
x=
dx
2
2
2
At n=4, we have the 34 digit accurate approximation-
2
≈ 0.7357588823428846431910475403229217...
e
OBTAINING HIGHLY ACCURATE NUMERICAL VALUES BY A TWO-SIDED
BOUNDING METHOD
A way to still further improve the numerical accuracy of our estimates for tan(a) is to
apply the T(n,a) approximation at a point within 0<a<π/4 as close as possible to a known
exact value of the tangent function. These exact values can be obtained starting with the
known values of tan(π/4)=1 and tan(π/6)=1/sqrt(3) and then applying the half angle
formula-

1  1
b
−
1
tan( ) =
2 tan(b)  cos(b) 
We thus have the additional exact values tan(π/8)=sqrt(2)-1 and tan(π/12)=2-sqrt(3). Let
us now find tan(π/7). We know this value must lie between the exact values sqrt(2)-1 and
1/sqrt(3). Using the approximation-
tan(a + ∆a ) ≈
this means-
tan( a ) + T (n, ∆a )
1 − tan(a )T (n, ∆a )
( 2 − 1) + T (n,
π
)
56 < tan(π ) <
π
7
1 − ( 2 − 1)T (n, )
56
1 − 3T (n,
3 + T (n,
π
42
π
42
)
)
A numerical evaluation of this inequality for n=4, brackets tan(π/7) between the values
shown0.4815746188075286443321623530569705752193…
<tan(π/7)<0.4815746188075286443321623530569705752410…
Thus tan(π/7) has been approximated to 37 digit accuracy. This accuracy is consistent
with what the error term ε given above predicts. The reason for the high accuracy has
clearly to do with the small values of ‘a’ appearing in the T(n,a) approximations.
Accuracy increases with both increasing n and decreasing ‘a’. The value of π/10 can be
bracketed as-
( 2 − 3 ) + T ( n,
π
)
( 2 − 1) − T (n,
π
)
60 < tan( π ) <
40
π
10 1 + ( 2 − 1)T (n, π )
1 − (2 − 3 )T (n, )
60
40
This yields a value accurate to 17 digits when n=2 and 39 digits when n=4.
We have automated this two sided approximation approach for determining tan(a) for any
point within 0<a<π/4.
CONCLUSION
We have derived and applied a new quotient approximation method base on the use of
Legendre Polynomials to approximate values for the trigonometric functions to a high
order of accuracy. After obtaining approximation formulas for tan(a), we apply these to
obtain very accurate approximations for sine and cosine and also show how these
approximations may be used to find numerical values for definite integrals and
derivatives of functions. A two sided bracketing approach is developed to allow an
accurate measure of the digit accuracy of a given approximation to a trignometric
function at any point in 0<a<π/4.
REFERENCES
[1]-M.Abramowitz and I.Stegun,”Handbook of Mathematical Functions”, Dover
Pub.NY,8th printing 1972.
[2]- J.H.Mathews,”Pade Approximations”
http://math.fullerton.edu/mathews/n2003/pade/PadeApproximationProof.pdf , 2003.
[3]-U.H.Kurzweg, “ Polynomial Quotient Approximations for Trignometric Functions”,
http://www.mae.ufl.edu/~uhk/TRIG-APPROX.pdf, 2011,