Possible Duplicate:
How does C compute sin() and other math functions?
I'm curious how sin
and cos
the are implemented on a low level.
I just had a look inside the math.h and couldn't find the declaration for sin
and cos
. But since this was a dead end to me, I'm turning to you, SO.
I would like to know how many operations it takes to calculate a sine and what tricks are used for speed-up. Are they implemented differently on different hardware and are there processors that support this as a native instruction? How fast are they compared to an addition, for example?
Thanks!