shz_asinf
SHZ_INLINE float shz_asinf(float x) SHZ_NOEXCEPT;Fast arcsine approximation; equivalent to C's asinf().
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
x | float |
Returns
Section titled “Returns”float
Details
Section titled “Details”Returns the arcsine of x in radians, within [-pi/2, pi/2].
Accuracy: |shz_asinf(x) - asin(x)| <= 8e-6 radians (SHZ_ASINF_ERROR_MAX) over [-1, 1]. The error is absolute, not relative: near zero the result has the sign of x and lies within the bound of it.
- Arguments outside of
[-1, 1]are clamped rather than producing a NaN:x >= 1returnspi/2andx <= -1returns-pi/2. 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::asinf - Type-generic form: none
- Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_trig.h:206 - Module: Trigonometry, section "Inverse Functions"