3 ms·
If you're using a square root anyway it's also possible to only fit the part between 0 and pi/4, and use the square root to calculate the sine or cosine (whiche
by contravariant 3y ago
If you're using a square root anyway it's also possible to only fit the part between 0 and pi/4, and use the square root to calculate the sine or cosine (whichever is greater).
However you need to be a bit careful that you return exactly sqrt(1/2) at pi/4 otherwise you get a discontinuity.