Unlike a common belief, most calculators do not use Taylor series to compute trigonometric functions, but the much more efficient CORDIC algorithm, namely COordinate Rotation DIgital Computer. It was developed by Volder in 1959 although the ideas can already be found in the work of Briggs in the XVIIth century.
How to efficiently approximate ?
Let be a point on the trigonometric circle such that . Let be an initial point on the same circle. The idea consists of applying a sequence of rotations of angles to approximate . The sequence of angles must be decreasing such that and we will see below that their values can be precomputed.
We can factorize by
In order to optimize the calculations, we inject into the product of rotations and redefine the problem as follows
It is worth to notice that the product of cosines disappears in the ratio , so it can be ignored in the algorithm.
Now, the smart idea consists of choosing
In this way, we have very simple formulas
All these operations are easy and fast to compute. It suffices to precompute in memory. The choice of can actually be replaced by to optimize the binary representation on computers.