Hacker News new | ask | show | jobs
by t-3 832 days ago
Link doesn't appear to be valid, but aren't these usually precalculated and stored in a lookup table?
2 comments

Think about how big that lookup table would be for an 64bit double float.

They use a lookup table for nπ/16, and then a polynomial to approximate the difference to other values.

That would be quite a big lookup table... Half of float numbers are in -1…+1 range. You don't need the negative part, so that's a quarter of float numbers, over one billion numbers. And then some to get from 1 to π/2.

And that's only float32!