Skip to content

shz_divf_fsrra

Markdown
SHZ_INLINE float shz_divf_fsrra(float num, float denom) SHZ_NOEXCEPT;

Fast approximate division by an unsigned denominator.

NameTypeDescription
numfloatNumerator to divide into.
denomfloatUnsigned denominoator to divide by.

The approximated quotient num / fabsf(denom).

This routine performs a fast division approximation that takes fewer clock cycles to perform than using a regular division operator on two floats.

  • The vector forms of this routine automatically handle optimal parallelization of this operation across multiple lanes.
  • The denominator is treated as though it were an unsigned value.
  • No division-by-zero protection: denom == 0.0f returns infinity, or NaN when num is also 0.0f.
  • _fsrra: Uses FSRRA (fast approximate 1/sqrt(x)). The argument or denominator must be positive. Faster, less precise. (Naming and Suffixes)

shz_divf, shz_vec2_divf_fsrra, shz_vec3_divf_fsrra, shz_vec4_divf_fsrra