sincos implementation Many computational libraries contain a routine called sincos that allows one to compute sin and cos simultaneously. The existence of this routine suggests that calling this routine is more efficient than making a call to sin followed by a call to cos.
I am interested in knowing how sincos is (or can be) implemented to make it more efficient than making two calls.
 A: If you compute the cosine-sine pair as point on the unit circle using complex multiplication, which is equivalent to trigonometric theorems, then you automatically get both values at once. 


*

*) To compute $z=e^{ix}$ compute first $z_n=e^{ix/2^n}$ using the Taylor series or polynomials with a more globally reduced error, then perform $n$ squarings $z_{k-1}=z_k^2$.

*) The CORDIC algorithm matches a set of angles and directions in the complex plane. These directions can, step-by-step or in the end, translated into points on the unit circle. In total, $\tan(x)$ is computed first via standard CORDIC and then the pair $(\tan(x),1)$ is scaled to unit length to give the point $(\sin(x),\cos(x))$. This obviously requires a frame procedure around it to account for the cases where $\cos x$ is negative.
However, most modern implementation work via reduction by $\pi$ or smaller fractions of $\pi$ and error-minimized polynomials on the resulting interval to get the required precision. And this procedure in the end has less complexity than the more "geometric" algorithms.
A: There's always $\sin(x) = \sqrt{1 -\cos(x)^2}$ and vice versa that allows you to compute one and compute the other with a square root.
However, both glibc and musl libc actually just use two separate calls to $\sin$ and $\cos$ because the above square root has rounding errors around $x = 0$.
Modern CPUs often have a dedicated sincos instruction that computes both values simultaneously. So a sincos function could be used as an interface for that. However, for example on Intel the  CPU implementation of trigonometry functions can be quite inaccurate and can not be used  by C libraries as the default implementation.
