![]() |
SH4ZAM! 0.1.0
Fast math library for the Sega Dreamcast's SH4 CPU
|


Go to the source code of this file.
Data Structures | |
| struct | shz_sincos_t |
Macros | |
| #define | SHZ_F_PI |
| #define | SHZ_F_PI_2 |
| #define | SHZ_F_PI_4 |
| #define | SHZ_FSCA_RAD_FACTOR |
| #define | SHZ_FSCA_DEG_FACTOR |
| #define | SHZ_FSCA_ERROR_MAX |
| #define | SHZ_DEG_TO_RAD(deg) |
| #define | SHZ_RAD_TO_DEG(rad) |
Typedefs | |
| typedef shz_sincos_t | shz_sincos |
Functions | |
Sin/Cos Pairs | |
Routines involving precomputed sine + cosine pairs. | |
| shz_sincos_t | shz_sincosu16 (uint16_t radians16) SHZ_NOEXCEPT |
| shz_sincos_t | shz_sincosf (float radians) SHZ_NOEXCEPT |
| shz_sincos_t | shz_sincosf_deg (float degrees) SHZ_NOEXCEPT |
| float | shz_sincos_tanf (shz_sincos_t sincos) SHZ_NOEXCEPT |
| float | shz_sincos_secf (shz_sincos_t sincos) SHZ_NOEXCEPT |
| float | shz_sincos_cscf (shz_sincos_t sincos) SHZ_NOEXCEPT |
| float | shz_sincos_cotf (shz_sincos_t sincos) SHZ_NOEXCEPT |
Independent Functions | |
Routines providing single trigonometric functions. | |
| float | shz_sinf (float radians) SHZ_NOEXCEPT |
| float | shz_sinf_deg (float degrees) SHZ_NOEXCEPT |
| float | shz_cosf (float radians) SHZ_NOEXCEPT |
| float | shz_cosf_deg (float degrees) SHZ_NOEXCEPT |
| float | shz_tanf (float radians) SHZ_NOEXCEPT |
| float | shz_tanf_deg (float degrees) SHZ_NOEXCEPT |
| float | shz_secf (float radians) SHZ_NOEXCEPT |
| float | shz_secf_deg (float degrees) SHZ_NOEXCEPT |
| float | shz_cscf (float radians) SHZ_NOEXCEPT |
| float | shz_cscf_deg (float degrees) SHZ_NOEXCEPT |
| float | shz_cotf (float radians) SHZ_NOEXCEPT |
| float | shz_cotf_deg (float degrees) SHZ_NOEXCEPT |
Inverse Functions | |
Routines providing inverse trigonometric functions. | |
| float | shz_asinf (float x) SHZ_NOEXCEPT |
| float | shz_acosf (float x) SHZ_NOEXCEPT |
| float | shz_atanf_unit (float x) SHZ_NOEXCEPT |
| float | shz_atanf_q1 (float x) SHZ_NOEXCEPT |
| float | shz_atanf (float x) SHZ_NOEXCEPT |
| float | shz_atan2f (float y, float x) SHZ_NOEXCEPT |
| float | shz_asecf (float x) SHZ_NOEXCEPT |
| float | shz_acscf (float x) SHZ_NOEXCEPT |
| float | shz_acotf (float x) SHZ_NOEXCEPT |
Hyperbolic Functions | |
Trigonometric functions for hyperbolas | |
| float | shz_sinhf (float x) SHZ_NOEXCEPT |
| float | shz_coshf (float x) SHZ_NOEXCEPT |
| float | shz_tanhf (float x) SHZ_NOEXCEPT |
| float | shz_cschf (float x) SHZ_NOEXCEPT |
| float | shz_sechf (float x) SHZ_NOEXCEPT |
| float | shz_cothf (float x) SHZ_NOEXCEPT |
Inverse Hyperbolic Functions | |
Inverse trigonometric functions for hyperbolas | |
| float | shz_asinhf (float x) SHZ_NOEXCEPT |
| float | shz_acoshf (float x) SHZ_NOEXCEPT |
| float | shz_atanhf (float x) SHZ_NOEXCEPT |
| float | shz_acschf (float x) SHZ_NOEXCEPT |
| float | shz_asechf (float x) SHZ_NOEXCEPT |
| float | shz_acothf (float x) SHZ_NOEXCEPT |
Trigonometry functions and macros.
This file provides an API offering fast versions of trigonometry functions.
Definition in file shz_trig.h.
| #define SHZ_F_PI |
Single-precision floating-point PI approximation (do not use M_PI!)
Definition at line 27 of file shz_trig.h.
| #define SHZ_F_PI_2 |
Single-precision FP PI approximation divided by 2.
Definition at line 29 of file shz_trig.h.
| #define SHZ_F_PI_4 |
Single-precision FP PI approximation divided by 4.
Definition at line 31 of file shz_trig.h.
| #define SHZ_FSCA_RAD_FACTOR |
Multiplicative factor for passing the FSCA instruction angles in radians.
Definition at line 33 of file shz_trig.h.
| #define SHZ_FSCA_DEG_FACTOR |
Multiplicative factor for passing the FSCA instrution angles in degrees.
Definition at line 35 of file shz_trig.h.
| #define SHZ_FSCA_ERROR_MAX |
Maximum FP error for FSCA instruction.
Definition at line 37 of file shz_trig.h.
| #define SHZ_DEG_TO_RAD | ( | deg | ) |
Converts the given angle in degrees to radians.
Definition at line 40 of file shz_trig.h.
| #define SHZ_RAD_TO_DEG | ( | rad | ) |
Converts the given angle in radians to degrees.
Definition at line 42 of file shz_trig.h.
| typedef shz_sincos_t shz_sincos |
Alternate C shz_sincos_t typedef for those who hate POSIX style.
Definition at line 61 of file shz_trig.h.
| shz_sincos_t shz_sincosu16 | ( | uint16_t | radians16 | ) |
Returns sinf()/cosf() pairs for the given unsigned 16-bit angle in radians.
| shz_sincos_t shz_sincosf | ( | float | radians | ) |
Returns sinf()/cosf() pairs for the given floating-point angle in radians.
| shz_sincos_t shz_sincosf_deg | ( | float | degrees | ) |
Returns sinf/cosf() pairs for the given floating-point angle in degrees.
| float shz_sincos_tanf | ( | shz_sincos_t | sincos | ) |
Returns tanf() from the given pre-computed sincos pair.
| float shz_sincos_secf | ( | shz_sincos_t | sincos | ) |
Returns the floating-point secant (1.0f / cosf(x)) from the given pre-computed sincos pair.
| float shz_sincos_cscf | ( | shz_sincos_t | sincos | ) |
Returns the floating-point cosecant (1.0f / sinf(x)) from the given pre-computed sincos pair.
| float shz_sincos_cotf | ( | shz_sincos_t | sincos | ) |
Returns the floating-point cotangent (1.0f / tanf(x)) from the given pre-computed sincos pair.
| float shz_sinf | ( | float | radians | ) |
One-off routine for returning only sinf() from an angle in radians.
| float shz_sinf_deg | ( | float | degrees | ) |
One-off routine for returning only sinf() from an angle in degrees.
| float shz_cosf | ( | float | radians | ) |
One-off routine for returning only cosf() from an angle in radians.
| float shz_cosf_deg | ( | float | degrees | ) |
One-off routine for returning only cosf() from an angle in degrees.
| float shz_tanf | ( | float | radians | ) |
One-off routine for returning only tanf() from an angle in radians.
| float shz_tanf_deg | ( | float | degrees | ) |
One-off routine for returning only tanf() from an angle in degrees.
| float shz_secf | ( | float | radians | ) |
One-off routine for returning only secant (1 / cos(x)) from an angle in radians.
| float shz_secf_deg | ( | float | degrees | ) |
One-off routine for returning only secant (1 / cos(x)) from an angle in degrees.
| float shz_cscf | ( | float | radians | ) |
One-off routine for returning only cosecant (1 / sin(x)) from an angle in radians.
| float shz_cscf_deg | ( | float | degrees | ) |
One-off routine for returning only cosecant (1 / sin(x)) from an angle in degrees.
| float shz_cotf | ( | float | radians | ) |
One-off routine for returning only cotangent (1 / tan(x)) from an angle in radians.
| float shz_cotf_deg | ( | float | degrees | ) |
One-off routine for returning only cotangent (1 / cot(x)) from an angle in degrees.
| float shz_asinf | ( | float | x | ) |
Fast arcsine approximation; equivalent to C's asinf().
| float shz_acosf | ( | float | x | ) |
Fast arccosine approximation; equivalent to C's acosf().
| float shz_atanf_unit | ( | float | x | ) |
Fast arctangent approximation for unit values between 0.0f and 1.0f.
| float shz_atanf_q1 | ( | float | x | ) |
Fast arctangent approximation for values lying within the first quadrant (>= 0.0f).
| float shz_atanf | ( | float | x | ) |
Fast arctangent approximation; equvalent to C's atanf().
| float shz_atan2f | ( | float | y, |
| float | x ) |
Computes arctangent of y / x, using the signs of arguments to determine correct quadtrant. Equivalent to C's atan2f().
| float shz_asecf | ( | float | x | ) |
Fast arcsecant/inverse secant approximation, taking units in radians.
| float shz_acscf | ( | float | x | ) |
Fast arccosecant/inverse cosecant approximation; taking units in radians.
| float shz_acotf | ( | float | x | ) |
Fast arccotangent/inverse cotangent approximation; taking units in radians.
| float shz_sinhf | ( | float | x | ) |
Fast hyperbolic sine function.
| float shz_coshf | ( | float | x | ) |
Fast hyperbolic cosine function.
| float shz_tanhf | ( | float | x | ) |
Fast hyperbolic tangent function.
| float shz_cschf | ( | float | x | ) |
Fast hyperbolic cosecant function.
| float shz_sechf | ( | float | x | ) |
Fast hyperbolic secant function.
| float shz_cothf | ( | float | x | ) |
Fast hyperbolic cotangent function.
| float shz_asinhf | ( | float | x | ) |
Fast hyperbolic arcsine function.
| float shz_acoshf | ( | float | x | ) |
Fast hyperbolic arccosine function.
| float shz_atanhf | ( | float | x | ) |
Fast hyperbolic arctangent function.
| float shz_acschf | ( | float | x | ) |
Fast hyperbolic arccosecant function.
| float shz_asechf | ( | float | x | ) |
Fast hyperbolic arcsecant function.
| float shz_acothf | ( | float | x | ) |
Fast hyperbolic arccotangent function.