MathOverflow will be down for maintenance for approximately 3 hours, starting Monday evening (06/24/2013) at approximately 9:00 PM Eastern time (UTC-4).

Trig and inverse trig functions are expensive to compute on a computer. In high performance code you want to eliminate them if possible. Quite often, for the above case, you can eliminate the trig functions. For example $\cos(2\cos^{-1} x) = 2x^2-1$ (for $x$ in a suitable range) but the version on the right runs much faster.
The catch is remembering all those trig formulae. It'd be nice to make the compiler do all the work. A solution is to use complex numbers. Instead of storing $\theta$ we store $(\cos\theta,\sin\theta)$. We can add angles by using complex multiplication, multiply angles by integers and rational numbers using powers and roots and so on. As long as you don't actually need the numerical value of the angle in radians you need never use trig functions. Obviously there comes a point where the work of doing operations on complex numbers may outweigh the saving of avoiding trig. But often in real code the complex number route is faster.