shz_divf_fsrra
SHZ_INLINE float shz_divf_fsrra(float num, float denom) SHZ_NOEXCEPT;Fast approximate division by an unsigned denominator.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
num | float | Numerator to divide into. |
denom | float | Unsigned denominoator to divide by. |
Returns
Section titled “Returns”The approximated quotient num / fabsf(denom).
Details
Section titled “Details”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.
Warnings
Section titled “Warnings”- The denominator is treated as though it were an unsigned value.
- No division-by-zero protection:
denom==0.0freturns infinity, or NaN whennumis also0.0f.
Naming and requirements
Section titled “Naming and requirements”_fsrra: UsesFSRRA(fast approximate 1/sqrt(x)). The argument or denominator must be positive. Faster, less precise. (Naming and Suffixes)
Availability
Section titled “Availability”- C++ equivalent:
shz::divf_fsrra - Type-generic form: none
- Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_scalar.h:358 - Module: Scalar, section "FSRRA"
See also
Section titled “See also”shz_divf, shz_vec2_divf_fsrra, shz_vec3_divf_fsrra, shz_vec4_divf_fsrra