4 ms·
The implementation can be more concisely written (and without reassigning variables) as float InvSqrt(float x) { long yl; float y; yl = 0x5
by augustk 6y ago
The implementation can be more concisely written (and without reassigning variables) as
float InvSqrt(float x)
{
long yl;
float y;
yl = 0x5f3759df - ((*(long *) &x) >> 1);
y = *(float *) &yl;
return y * (1.5F - (x * 0.5F * y * y));
}