Skip to content

shz_invf_fsrra

Markdown
SHZ_INLINE float shz_invf_fsrra(float x) SHZ_NOEXCEPT;

Fast unsigned approximate inverse of a number.

NameTypeDescription
xfloatThe unsigned number to reciprocate.

The approximated value 1.0f / fabsf(x).

This routine returns a fast unsigned reciprocal, which is approximately equal to 1.0f / fabsf(x). It can also be paired with a real floating-point reciprocal in the same form with both computing in parallel.

  • The vector forms of this routine automatically handle optimal parallelization of this operation across multiple lanes.
  • The result value is always positive, regardless of the sign of x.
  • No division-by-zero protection: x == 0.0f returns infinity.
  • _fsrra: Uses FSRRA (fast approximate 1/sqrt(x)). The argument or denominator must be positive. Faster, less precise. (Naming and Suffixes)

shz_invf, shz_vec2_inv_fsrra, shz_vec3_inv_fsrra, shz_vec4_inv_fsrra