# Approximating $\arctan x$ for large $|x|$

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.

• $$\operatorname{atan}x=\int_0^x \frac{1}{1+t^2}d\,t$$ may be a starting point. Oct 6 '12 at 12:31
• 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. Oct 6 '12 at 12:31

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.