COS Function

The COS function accepts a number that indicates the number of radians in an angle, and returns the cosine of that angle. The angle is first reduced to lie between 0 and pi/2, using the following identities:

COS(-x) = COS(x)
COS(2*N* pi + x) = COS(x)
COS(pi + x) = COS(pi/2 - x)

The final calculation is one of two polynomial approximations, depending on the value of the reduced argument.