tnd_test/finv_math.cc
/*
 * Modification of the fast inverse square root function.
 *
 * Gets an approximation of the inverse of x.
 */
Modification of the fast inverse square root function.
Gets an approximation of the inverse of x.
Modification of the fast inverse square root function . Gets an approximation of the inverse of x .
[[gnu::pure]] float fast_inv(float x) {
  union { float f; uint32_t i; } hack = { .f = x };
  hack.i = 0x7EF4FB9D - hack.i;
  return hack.f * (2.0f - hack.f * x);
}
[[ gnu :: pure ]] float fast_inv ( float x ) { union { float f ; uint32_t i ; } hack = { . f = x } ; hack . i = 0x7EF4FB9D - hack . i ; return hack . f * ( 2.0f - hack . f * x ) ; }
Modification of the fast inverse square root function.
Modification of the fast inverse square root function .