I want to compute $a = \tan(f \theta)$ for $f\in [0,1]$, given $g = \tan\theta$. Obviously, I can compute $a = \tan(f\tan^{-1}g)$, but I'm wondering if there's a more efficient way that avoids having to evaluate two transcendental functions.I happen to also want the quantity $b = \tan[(1-f)\theta]$, and I believe the identity$$ a+b+gab-g=0 $$holds. I can be reasonably assured that $0\le g \lesssim \frac{1}{2}$, so that tangent and arctangent are both somewhat linear. I figure this assumption should greatly help, if there happens to be any efficient method. The emphasis here is on accuracy and robustness.
Efficient computation of tangent of fraction of angle
numerical analysis;special functions
I cannot think of any useful trigonometric identity that could help evaluating\begin{equation}a = \tan ( f \tan^{-1} g)\end{equation}so I would try a series expansion\begin{equation}fg + \frac{1}{3}f(f^2-1)g^3 + \frac{1}{15}f(2 f^4 - 5f^2 + 3) g^5 + \ldots\end{equation}but I doubt that if focus is on accuracy and robustness you can do much better than calling tan(f*atan(g)).Once you know $a$ and $g$ you can compute $b$ by the tangent angle subtraction formula\begin{equation}\tan(\alpha - \beta) = \frac{\tan\alpha - \tan\beta}{1+\tan\alpha \, \tan\beta}\end{equation}with $\alpha = \theta$, $\beta = f\theta$, leading to\begin{equation}b = \frac{g-a}{1+ga}\end{equation}which proves your identity.(Disclaimer: I'm not an expert in this field, but at high school I was very good in trigonometry, so I could not resist answering the question...)