Łukasz jagiełło - fast inverse square root - papers we love sf 2017
TRANSCRIPT
https://github.com/id-Software/Quake-III-Arena/blob/master/code/game/q_math.c#L552
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%
modern CPU - Intel Xeon E5-2667v3
the hack is actually ~x2 slower in 2017 used to be ~x4 times faster back in ~2003