Via Roy, the Origin of Quake3's Fast InvSqrt()- an interesting investigation and history lesson on a function found in the now open source Quake3 code. While hardcore graphics programming is beyond my area of expertise, it did make me nostalgic for the era when writing very efficient code was important (rather than throwing fast and faster hardware at it, which is how the majority of problems are solved these days.) Great material for a Programming Pearls 3rd edition...
A couple choice quotes:
- I wrote a very fast (pipelineable) & accurate invsqrt() 5+ years ago, to help a Swede with a computational fluid chemistry problem.
- I especially like the integer ops i = 0x5f3759df - (i >> 1); which actually is doing a floating point computation in integer - it took a long time to figure out how and why this works, and I can't remember the details anymore.
