How are sin (x) or cos (x) implemented in math.h?

Possible duplicate:
How does C compute sin () and other math functions?

I am curious how sin and cos implemented at a low level.

I just looked in math.h and could not find the declaration for sin and cos . But since it was dead to me, I am turning to you, SO.

I would like to know how many operations are required to calculate the sine and what tricks are used to speed up. Are they implemented differently on different hardware and are there any processors that support this as their own instruction? How quickly do they compare with the addition, for example?

Thanks!

+4
source share

All Articles