
Fast inverse square root - taejavu
https://en.wikipedia.org/wiki/Fast_inverse_square_root
======
echeese
I tried implementing it in JS just for fun. I don't get how/why it works, but
it does.

[http://codepen.io/anon/pen/OWgYaP](http://codepen.io/anon/pen/OWgYaP)

~~~
popey456963
Is your implementation correct? I get strange values.

    
    
        Q_rsqrt(16) = 0.24957678739619552
    

I'm not sure if I'm just not doing something correctly. Even if I go to a
smaller number I get:

    
    
        Q_rsqrt(0.125) = 2.828426859705843
    

Which is vastly off (10x ish)

~~~
Koshkin
More accurate numbers are

    
    
      0.25
    

and

    
    
      2.8284271247461900976033774484194
    

respectively.

