English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

The taylor series converges for all values of cosine, but very slowely for large inputs. I am seeking an assymptotic expansion that approximates for cos(x) reasonably well for values of x greater than 100. Does anyone know of such an expansion? Is it possible for one to exist?

2006-09-30 09:23:52 · 5 answers · asked by Ed S 1 in Science & Mathematics Mathematics

5 answers

I may be missing something, but why would you want to calculate this for large numbers? as the cosine is periodic, you can always take that number modulo 2*pi, and calculate that! so you'd never need to calculate any number larger than 6.3 anyhow. about an expansion that converges fast - sorry, don't know much about this. you might find something here, but it's quite cumbersome: http://www.convertit.com/Go/ConvertIt/Reference/AMS55.ASP?Res=150&Page=-1

o and by the way, it is definitely possible that there exists an expansion which converges faster.

2006-09-30 09:37:04 · answer #1 · answered by No Mo 2 · 0 0

Like every one above said, since it's periodic, why use large values. Of course, the usual Taylor expansion uses arguments in radians, not degrees. The only reason that I can see for an argument of 100 is if it were degrees. You do need to convert to radians first and reduce your argument to 0-2*pi.

Even then the expansion can take a while time to converg. For an argument of 2*pi it takes 10 terms to get to 1%. You can avoind this 2 ways. The easy way is to convert your argument to the range of 0-pi/2 and apply the appropriate zero shifts and sign changes. You can also construct your own expansion. The general form of a Taytlor expansion is:

SumOver_n(f(n)(a) * (x-a)^n / n!)

Where f(n)(a) is the nth derivative of the function evaluated at 'a'. The usual cosine expansion is expanded around zero (meaning a=0) and therefore converges quickly near zero) you can construct a custom expansion about any point, just by selecting a value of 'a' that is near your point of interest.

2006-09-30 17:53:03 · answer #2 · answered by Pretzels 5 · 0 0

As other people have pointed out, the periodicity of cosine means you can always work in the interval from 0 to 2pi. However, that does require an accurate division by 2pi, finding the fractional part of the quotient and multiplying *that* by 2pi again.

It's fairly easy to see that there cannot be an accurate asymptotic expansion because it would essentially have to do the previous computation in order to get the answer. If you really need to do the cosine of a hundred digit number, you simply need to have enough memory to do the division accurately. For x in your range, just do the division.

2006-09-30 21:41:13 · answer #3 · answered by mathematician 7 · 0 0

Since cos is 2pi-periodic, you could always apply the Taylor series to x-2k*pi, where k is the nearest integer to x/(2*pi), and obtain fast convergence.

2006-09-30 16:29:00 · answer #4 · answered by James L 5 · 0 0

After using u = mod(x,2pi), make use of symmetry and trig relationships to make your variable still smaller:
cos(pi-x) = -cos(x)
cos((pi/2)-x) = sin (x)
until you arrive at a variable x <= pi/4

As far as I know, there is no other calculation method which converges faster.

2006-09-30 16:41:50 · answer #5 · answered by Helmut 7 · 0 0

fedest.com, questions and answers