2 ms·
Note that you’re actually using 3 distinct magic numbers - not only the single 0x5f3759df, but also 0.5 and 1.5; So for further accuracy we can instead have:
by DrNosferatu 2y ago
Note that you’re actually using 3 distinct magic numbers - not only the single 0x5f3759df, but also 0.5 and 1.5;
So for further accuracy we can instead have:
conv.i = 0x5F1FFFF9 - ( conv.i >> 1 );
conv.f = 0.703952253f ( 2.38924456f - x * conv.f * conv.f );
return conv.f;
[from Wikipedia]