Previous | Next --- Slide 5 of 66
Back to Lecture Thumbnails
ak47

Does anyone know how most computers actually calculate sine? I have heard that Taylors are too slow.

kayvonf

My understanding is that typically a hardware lookup table provides a starting point for an approximate answer and then there's a few instructions of an iterative method to refine to a required amount of precision.

ak47

So I hardware lookup table...is that just stored somewhere on disk?

msebek

@ak47, I believe it's stored in the processor itself. Check out http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-1-manual.pdf, and search for 'transcendental', or 'fsin', which is the x87 (the floating point co-processor) instruction to do sin.

Also check out the Pentium FDIV bug, which was allegedly a result of a bad lookup table on the processor. http://en.wikipedia.org/wiki/Pentium_FDIV_bug

Sherry

Gee, thanks. I didn't even know x87 has these fancy "transcendental" instructions besides the fmul stuff I know. I tried to find the SIMD version of fsin and I didn't find any. It doesn't exist so far, right?