Trigonometric functions?
I was just wondering... Does anyone know how computers and calculators handle sine, cosine and such functions? I mean, how does the computer calculate that sine(0.5)=0.4794.....
Does it have a table and just look it up? or is there some ingenious equation for calculating the values?
And while I''m at it, how fast are they?
//Ksero
I don''t know the exact spec but for sine and cosine, I think they derive the values from the equation of a circle. As for how fast they are, well you could always benchmark them. I''d say probably twice as fast as a square root call.
Okay, I don''t know how they do it either, but I was skeptical of NBGH response. So looking at the Pentium Developers Manual from Intel a fcos takes 18-124 cycles, a fsin 16-126, and a sqrt 70.
I would guess that the computer uses the taylor series expansion to get sin and cos values. but just a guess.
I would guess that the computer uses the taylor series expansion to get sin and cos values. but just a guess.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement