src/cusmath.cpp
float cusInvSqrt(float x) 
{
	float xhalf = 0.5f * x;
        int i = *(int*)&x;            // store floating-point bits in integer
        i = 0x5f3759df - (i >> 1);    // initial guess for Newton's method
        x = *(float*)&i;              // convert new bits into float
        x = x*(1.5f - xhalf*x*x);     // One round of Newton's method
        return x;
}
// Fast inverse square root of a number
Fast inverse square root of a number
Fast inverse square root of a number
float cusInvSqrt(float x) 
{
	float xhalf = 0.5f * x;
        int i = *(int*)&x;            
        i = 0x5f3759df - (i >> 1);    
        x = *(float*)&i;              
        x = x*(1.5f - xhalf*x*x);     
        return x;
}
float cusInvSqrt ( float x ) { float xhalf = 0.5f * x ; int i = * ( int * ) & x ; i = 0x5f3759df - ( i >> 1 ) ; x = * ( float * ) & i ; x = x * ( 1.5f - xhalf * x * x ) ; return x ; }
Fast inverse square root of a number
Fast inverse square root of a number
// store floating-point bits in integer // initial guess for Newton's method // convert new bits into float // One round of Newton's method