7
$\begingroup$

I would like to know if there is reasonably fast converging method for computing large arguments of arctan.

Until now I've came across Taylor series that converges only on interval $(-1,1)$ and for increasing $|x|$ the rate decreases. Also I've found about continued fractions for arctan, which seems to converge more rapidly and can be used for any real number, but again with increasing $|x|$ I need to perform way too much iterations until I get at least 3 digits precision.

I'm therefore looking for a method that would allow me to compute arctan for large arguments with good precision and in reasonable amount of iterations.

$\endgroup$
2
  • $\begingroup$ $$\operatorname{atan}x=\int_0^x \frac{1}{1+t^2}d\,t$$ may be a starting point. $\endgroup$
    – Daryl
    Oct 6 '12 at 12:31
  • $\begingroup$ I wonder if this works: expand sine and cosine in Taylor series at $\pi/2$; divide to get an expansion for tangent; invert to get an expansion for arctangent. $\endgroup$ Oct 6 '12 at 12:31
25
$\begingroup$

Why don't you consider that $$ \arctan x + \arctan \frac{1}{x}=\frac{\pi}{2}, $$ so that, for large values of $x>0$, $$ \arctan x = \frac{\pi}{2}-\arctan {1 \over x} = \frac{\pi}{2}-\frac{1}{x}+\frac{1}{3x^3}-\frac{1}{5x^5} +\ldots ? $$ See also this discussion.

$\endgroup$
1
  • $\begingroup$ Thanks! I forgot about this law.. elegant and easy $\endgroup$
    – Raven
    Oct 6 '12 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.