presto said:
OK. But I compute arccos, not cos.
I used the degrees by accident only... the calc keeps degs as default setting.
Now I can see:
[itex]\arccos x \to \sqrt{1-x^2},\ for\ x \to 1[/itex]
but what is a full - exact expansion at x = 1?
Namely: what is a further correction to the sqrt(1-x^2) to get better result of arccos near x=1?
There is a Taylor Series for arccos, but it's messy.
If we only go to the second term in the cosine Taylor series, we have:
[itex]\quad C_2[/itex] is 2-term cosine: [itex]\quad C_2(\theta) = 1-{\theta^2 \over 2!} = 1-{\theta^2 \over 2}[/itex]
[itex]\quad A_2[/itex] is corresponding arc cosine: [itex]\quad A_2(C_2(\theta)) = \theta = A_2(1-{\theta^2 \over 2})[/itex]
Let x be defined as follows: [itex]1-{\theta^2 \over 2}=x[/itex], so [itex]\theta^2=2-2x[/itex] and [itex]\theta=\sqrt{2-2x}[/itex]
Giving: [itex]A_2(x)=\sqrt{2-2x}[/itex]
Taking in one more term:
[itex]\quad C_3[/itex] is 3-term cosine: [itex]\quad C_3(\theta) = 1-{\theta^2 \over 2!}+{\theta^4 \over 4!} = 1-{\theta^2 \over 2}+{\theta^4 \over 24}[/itex]
[itex]\quad A_3[/itex] is corresponding arc cosine: [itex]\quad A_3(C_3(\theta)) = \theta = A_3(1-{\theta^2 \over 2}+{\theta^4 \over 24})[/itex]
This time, let x be defined as follows: [itex]1-{\theta^2 \over 2}+{\theta^4 \over 24}=x[/itex]
[itex]\quad \theta^4 - 12\theta^2 + 24(1-x) = 0[/itex]
[itex]\quad \theta^2 = {12\pm \sqrt{12^2-4(24(1-x))} \over 2}[/itex]
For [itex]\theta[/itex] near 1, only the minus of the plus/minus works.
[itex]\quad \theta^2 = 6 - \sqrt{6^2-24+24x}[/itex]
[itex]\quad \theta^2 = 6 - 2\sqrt{3+6x}[/itex]
[itex]\quad \theta = \sqrt{6 - 2\sqrt{3+6x}}[/itex]
Giving: [itex]A_3(x)=\sqrt{6 - 2\sqrt{3+6x}}[/itex]
For example:
[itex]\arccos(.999) = 0.0447250871687334[/itex]
[itex]A_2(.999) = 0.0447213595499958[/itex] (4-place accuracy)
[itex]A_3(.999) = 0.0447250874173630[/itex] (8-place accuracy)
http://www.wolframalpha.com/input/?i=arccos(x)-sqrt(6-2sqrt(3 + 6x))