Quake's Fast Inverse Square Root
betterexplained.com
betterexplained.com
If this was a universally effective optimization with no potential downside, it would already be built in to your standard math library...
It's a cool hack but very mid-90s centric and not that all applicable today. In modern pipelined processors with segregated register files the cost of moving a piece of data from floating point registers to integer registers and back again -- along with pretty much all modern instruction sets (SSE, AltiVec, NEON) coming with instructions that give you a means to calculate a reciprocal square root (either directly or with an estimate + refine) -- means that such a trick is no longer practical.
And for more analysis and improvements see those papers:
http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf
http://www.daxia.com/bibis/upload/406Fast_Inverse_Square_Roo...
http://www.geometrictools.com/Documentation/FastInverseSqrt....
Image text: Some engineer out there has solved P=NP and it's locked up in an electric eggbeater calibration routine. For every 0x5f375a86 we learn about, there are thousands we never see.
(yes, this "trick" has been making rounds for a decade now; I predict another HN article within 6 months)
I think your interpretation is actually the more correct one, here. Squaring and square-rooting are the inverse of each other.
They are really talking about calculating the reciprocal of the square root of X. They are calling it the 'inverse square root', but thats just them abusing terminology, which people do all the time, rightly or wrongly.
But you weren't wrong to be initially confused by this abuse of terminology, and it doesn't have anything to do with your native language not being English.
(Newton-Raphson Method)
Came across something similar a couple of days ago while browsing the source code of Marathon (one of the early games of Jason Jones and Bungie, later of Halo fame). At the time, Bungie were the Mac equivalent of id software, and Jason Jones the equivalent of John Carmack.
http://marathon.svn.sourceforge.net/viewvc/marathon/branches... (look for isqrt())
There's a great explanation in the comments.
This code was most likely written by Jason, probably around '93-'94.