Sin() and Cos()

Miscellaneous Forums/General Discussion/Sin() and Cos()

The problem is : how did you do the benchmark? Cache issues are very important. It's very easy in one little benchmark to have the whole table in the cache, but how will it behave in actual real life use? If the table is not entirely in cach when you access it, you'll most certainly have a higher speed hit than if you had just let the CPU compute the value.

So to say things simply, if you have a tiny speed critical loop where you constantly use Sin/Cos, then a LUT may still be a win as in the old days, but otherwise (if the code in interleaved with a bunch of other code) it's not so likely.