Inverse Sqrt and Fourth Root approximations
Fast InvSqrt approxumation, with an error of less than 4%.
This was coded by Lippold Haken of Haken Audio, 2010.
This approximation is attributed to Greg Walsh.
// Fast InvSqrt approxumation, with an error of less than 4%.
// This approximation is attributed to Greg Walsh.
inline void InvSqrt(float *x) { *(int *)x = 0x5f3759df - (*(int *)x >> 1); }
inline float SqrtSqrt(float x) { InvSqrt(&x); InvSqrt(&x); return x; }