A good idea is to not to compute the values of cos from 0-2pi, but further reduce the range, using
cos(a) = cos(-a), and cos(2a) = 1-2cos(a), or cos(a+pi/4) =...
So we really only ever need to be able to compute cos in the range 0-pi/4.
Then for further accuracy we can do the taylor expansion around pi/8. (or other approximations)
finally the number of terms for a fixed accuracy varies with the distance from pi/8,