shz_acosf
SHZ_INLINE float shz_acosf(float x) SHZ_NOEXCEPT;Fast arccosine approximation; equivalent to C's acosf().
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
x | float |
Returns
Section titled “Returns”float
Details
Section titled “Details”Returns the arccosine of x in radians, within [0, pi].
Accuracy: |shz_acosf(x) - acos(x)| <= 8e-6 radians (SHZ_ASINF_ERROR_MAX) over [-1, 1].
- Arguments outside of
[-1, 1]are clamped rather than producing a NaN:x >= 1returns0andx <= -1returnspi. A dot product of two unit vectors which lands just beyond 1 from rounding is safe to pass in.
Availability
Section titled “Availability”- C++ equivalent:
shz::acosf - Type-generic form: none
- Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_trig.h:222 - Module: Trigonometry, section "Inverse Functions"