Inverting an algorithm for $\arctan x$ to get an algorithm for $\tan x$

343 Views Asked by At

In the article "An algorithm for computing logarithms and arctangents", by B. C. Carlson, the following iterative algorithm for arctangents is given:

enter image description here

This makes me wonder the following. Is it possible to apply some inversion process to this algorithm to generate an algorithm to compute the function $\tan x$?

Is there any similar iterative algorithm-which uses square roots-to calculate trigonometric functions?

1

There are 1 best solutions below

0
On

Long comment on the algorithm:

The algorithm uses that $2^n\tan(2^{-n}\arctan(x))=\arctan(x)+e(4^{-n})$ where the coefficients of the power series $e$ do not depend on $n$, and uses Richardson extrapolation to accelerate the convergence by increasing the convergence order.

More precisely, with $x=\tan(t)$ one has $a_n=\frac{x}{2^n\tan(2^{-n}t)}$, $g_n=\frac{x}{2^n\sin(2^{-n}t)}$. Both converge towards $\frac{x}{t}=\frac{x}{\arctan x}$. The error $a_n-\frac{x}{t}$ is a power series in $4^{-n}$ coefficients depending on $x$. The derived sequences from the Richardson extrapolation are denoted as $d_{n,k}=d(n,k)$.


To replicate this idea for the tangent computation you would need to find some iterative procedure for the computation of $t_n= 2^n\arctan(2^{-n}\tan x)$ as then $\tan x=t_n+e(4^{-n})$ would again an error term that has constant coefficients for the powers of $4^{-n}$ so that convergence can be sped up using Richardson extrapolation. However, I see no way to do this. For small arguments one has $$ 2\arctan u=\arctan \frac{2u}{1-u^2}\iff 2\arctan\frac{v}{1+\sqrt{1+v^2}}=\arctan v $$ as close as I get to an argument doubling formula.