PWL SF 2017
19th August 2005
https://github.com/id-Software/Quake-III-Arena/blob/master/
code/game/q_math.c#L552
Newton’s Method of Approximation
n = 2
1 / sqrt(n) = 0.70710678119
g = 1
n = 2
1 / sqrt(n) = 0.70710678119
g = 1
1st ng = g*(1.5 - (n/2)*g*g) 0.5 70.71067811831%
n = 2
1 / sqrt(n) = 0.70710678119
g = 1
1st ng = g*(1.5 - (n/2)*g*g) 0.5 70.71067811831%
2nd ng = g*(1.5 - (n/2)*g*g) 0.625 88.38834764789%
n = 2
1 / sqrt(n) = 0.70710678119
g = 1
1st ng = g*(1.5 - (n/2)*g*g) 0.5 70.71067811831%
2nd ng = g*(1.5 - (n/2)*g*g) 0.625 88.38834764789%
3rd ng = g*(1.5 - (n/2)*g*g) 0.693359375 98.05582317187%
4th ng = g*(1.5 - (n/2)*g*g) 0.7067084685 99.94367007917%
5th ng = g*(1.5 - (n/2)*g*g) 0.7071064447 99.99995241313%
0x5f3759df
http://www.netlib.org/fdlibm/e_sqrt.c
May 2017
modern CPU - Intel Xeon E5-2667v3
the hack is actually ~x2 slower in 2017
used to be ~x4 times faster back in ~2003
?

Łukasz Jagiełło - Fast Inverse Square Root - Papers We Love SF 2017