float my_rsqrt( float number ) { float x2; union { float y; long i; } u; const float threehalfs = 1.5F; x2 = number * 0.5F; u.y = number; u.i = 0x5f3759df - ( u.i >> 1 ); // what the fuck? u.y = u.y * ( threehalfs - ( x2 * u.y * u.y ) ); // 1st iteration return u.y; }