First because is periodic with period and has other symmetries we need only calculate it for

Then:

where

Also:

So if is small enough so that the error in is acceptable then use . If the error is too big use and in with choosen to give acceptable error.

In practice a better polynomial approximation is used as are neater ways of doing the calculations in general.