[–] echeese 9y ago ↗ 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 [–] popey456963 9y ago ↗ 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 9y ago ↗ More accurate numbers are 0.25 and 2.8284271247461900976033774484194 respectively. [–] echeese 9y ago ↗ You can compare it to the native implementation here. Looks okay, if a little inaccurate to me: http://codepen.io/anon/pen/KavzKK
[–] popey456963 9y ago ↗ 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 9y ago ↗ More accurate numbers are 0.25 and 2.8284271247461900976033774484194 respectively. [–] echeese 9y ago ↗ You can compare it to the native implementation here. Looks okay, if a little inaccurate to me: http://codepen.io/anon/pen/KavzKK
[–] Koshkin 9y ago ↗ More accurate numbers are 0.25 and 2.8284271247461900976033774484194 respectively.
[–] echeese 9y ago ↗ You can compare it to the native implementation here. Looks okay, if a little inaccurate to me: http://codepen.io/anon/pen/KavzKK
4 comments
[ 2.5 ms ] story [ 36.9 ms ] threadhttp://codepen.io/anon/pen/OWgYaP