Damus
Fabian Giesen · 2w
OK everyone on here and following me probably already knows this but I want to get it off my chest anyway: *please* stop attributing reciprocal-square-root-by-IEEE-bit-twiddling to John Carmack/Quake...
Fabian Giesen profile picture
That paper was never formally published (that I can track down anyhow) but note it has both regular and reciprocal square root versions (the latter on the way to computing a square root) as well as instructions for getting correctly rounded (=equivalent to doing the calculation exactly then rounding in active rounding mode) results.

That paper was 1986.

The only thing that ever changes is the exact choice of magic number constant; the paper didn't sweat it because it used a 64-entry LUT.
1
Fabian Giesen · 2w
That paper was concerned with doubles and getting the initial approximation to slightly under 8 bits was sufficient to get a correctly rounded double sqrt within 3 iterations. Tweaking the magic value to get rid of the initial LUT altogether is reasonable for float32, for the correctly rounded floa...