Fast inverse square root
0x5f3759df - Better magic value (HN)
see also
Originaly from quake 3/nvidia source code
The bits of a float as an integer literal are proportional to its log2 value (plus a constant), which is handy for computing a reciprocal square root in logspace, which when converted back to a float gets exponentiated, yielding the answer (after a couple more refinement steps). If you actually take the time to manually hammer out the bitwise manipulations, the fast inverse square root is quite simple, but it is nonetheless regarded as black magic, likely due to the totally non-explanatory comments in the Quake source code. - HN / Fast Inverse Square Root — A Quake III Algorithm
Intel impl
It is worth noting that with AVX-512, Intel has introduced a native inverse sqrt approximation (VRSQRT14). Inverse sqrt approximation is available since SSE1 with rsqrtss & rsqrtps instructions. VRSQRT28 too, which has max 2^-28 rel error.