2
3
4
5
6
7
8
9
10
11
19 constexpr float fipr_max_error = 0.1f;
22
23
24
38
39
40
58
59
60
84
85
86
119
120
121
141
142
143
155
156
157
Namespace enclosing the SH4ZAM C++ API.
constexpr auto remapf
C++ alias for shz_remapf().
constexpr auto fdimf
C++ alias for shz_fdimf().
constexpr auto fmaf
C++ alias for shz_fmacf().
constexpr auto lerpf
C++ alias for shz_lerpf().
constexpr auto saturatef
C++ alias for shz_saturatef().
constexpr auto truncf
C++ alias for shz_truncf().
constexpr auto fmodf
C++ alias for shz_fmodf().
constexpr auto signf
C++ alias for shz_signf().
constexpr auto smoothstepf_safe
C++ alias for shz_smoothstepf_safe()
constexpr auto invf_fsrra
C++ alias for shz_invf_fsrra().
constexpr auto normalizef_fsrra
C++ alias for shz_normalizef_fsrra().
constexpr auto fabsf
C++ alias for shz_fabsf().
constexpr auto stepf
C++ alias for shz_stepf()
constexpr auto copysignf
C++ alias for shz_copysignf().
constexpr auto remainderf
C++ alias for shz_remainderf().
constexpr auto wrapf_fsrra
C++ alias for shz_wrapf_fsrra().
constexpr auto powf
C++ alias for shz_powf().
constexpr auto roundf
C++ alias for shz_roundf().
constexpr auto fminf
C++ alias for shz_fminf()
constexpr auto fmaxf
C++ alias for shz_fmaxf()
constexpr auto fractf
C++ alias for shz_fractf().
constexpr auto quadratic_roots
C++ alias for shz_quadratic_roots().
constexpr auto clampf
C++ alias for shz_clampf().
constexpr auto ceilf
C++ alias for shz_ceilf().
constexpr auto log2f
C++ alias for shz_log2f().
constexpr auto pow2f
C++ alias for shz_pow2f().
constexpr auto dot8f
C++ alias for shz_dot8f().
constexpr auto randf
C++ alias for shz_randf().
constexpr auto pow10f
C++ alias for shz_pow10f().
constexpr auto equalf_abs
C++ alias for shz_equalf_abs()
constexpr auto log10f
C++ alias for shz_log10f().
constexpr auto divf_fsrra
C++ alias for shz_divf_fsrra().
constexpr auto remapf_fsrra
C++ alias for shz_remapf_fsrra().
float cbrtf(float x) noexcept
C++ wrapper for shz_cbrtf().
constexpr auto sqrtf
C++ alias for shz_sqrtf().
constexpr auto floorf
C++ alias for shz_floorf().
constexpr auto remquof
C++ alias for shz_remquof().
constexpr auto sqrtf_fsrra
C++ alias for shz_sqrtf_fsrra().
constexpr auto smoothstepf
C++ alias for shz_smoothstepf()
constexpr auto randf_range
C++ alias for shz_randf_range()
constexpr auto invf
C++ alias for shz_invf().
constexpr auto dot6f
C++ alias for shz_dot6f().
constexpr auto divf
C++ alias for shz_divf().
constexpr auto logf
C++ alias for shz_logf().
constexpr auto hypotf
C++ alias for shz_hypotf().
constexpr auto equalf
C++ alias for shz_equalf()
constexpr auto equalf_rel
C++ alias for shz_equalf_rel()
constexpr auto normalizef
C++ alias for shz_normalizef().
constexpr auto inv_sqrtf_fsrra
C++ alias for shz_inv_sqrtf_fsrra().
constexpr auto inv_sqrtf
C++ alias for shz_inv_sqrtf().
constexpr auto barycentric_lerpf
C++ alias for shz_barycentric_lerpf().
constexpr auto mag_sqr3f
C++ alias for shz_mag_sqr3f().
constexpr auto wrapf
C++ alias for shz_wrapf().
constexpr auto mag_sqr4f
C++ alias for shz_mag_sqr4f().
float shz_mag_sqr3f(float x, float y, float z) SHZ_NOEXCEPT
Takes a 3D vector as 3 floats and calculates its squared magnitude using a fast approximation.
float shz_powf(float x, float p) SHZ_NOEXCEPT
Fast approximation for C's powf().
bool shz_equalf_abs(float a, float b) SHZ_NOEXCEPT
Checks for equality based on the absolute tolerance using SHZ_FLT_EPSILON.
float shz_remquof(float num, float denom, float *quot) SHZ_NOEXCEPT
(Sorta) Replacement for the <math.h> routine, remquof().
float shz_expf(float p) SHZ_NOEXCEPT
Fast approximation for C's expf().
float shz_normalizef_fsrra(float current, float from, float to) SHZ_NOEXCEPT
Maps a value within the given range from to to, to be within the range of 0.0f + 1....
float shz_randf(int *seed) SHZ_NOEXCEPT
Returns a random floating-point number between 0.0f and 1.0f, using and updating the given seed.
float shz_log10f(float x) SHZ_NOEXCEPT
Fast approximation for C's log10f().
float shz_floorf(float x) SHZ_NOEXCEPT
Replacement for the <math.h> routine, floorf().
float shz_wrapf_fsrra(float value, float min, float max) SHZ_NOEXCEPT
Wraps the given value back to be within the range of min to max more quickly, provided max - min is a...
float shz_normalizef(float current, float from, float to) SHZ_NOEXCEPT
Maps a value within the given range from to to, to be within the range of 0.0f += 1....
float shz_log2f(float x) SHZ_NOEXCEPT
Fast approximation for C's log2f().
float shz_mag_sqr4f(float x, float y, float z, float w) SHZ_NOEXCEPT
Takes a 4D vector as 4 floats and calculates its squared magnitude using a fast approximation.
float shz_smoothstepf(float x, float edge0, float edge1) SHZ_NOEXCEPT
Returns 0.0f at/below edge0, 1.0f at/above edge1, smoothly varying in-between. edge0 must be less tha...
float shz_dot8f(float x1, float y1, float z1, float w1, float x2, float y2, float z2, float w2) SHZ_NOEXCEPT
Takes two sets of 4D vectors as 4 floats and calculates their dot product using an approximation.
float shz_fmaxf(float a, float b) SHZ_NOEXCEPT
Returns the maximum value of two given floats.
float shz_signf(float x) SHZ_NOEXCEPT
Returns -1.0f if x < 0, 0.0f if x == 0, or 1.0f if x > 0.
float shz_fdimf(float x, float y) SHZ_NOEXCEPT
Replacement for the <math.h> routine, fdimf(),.
float shz_sqrtf_fsrra(float x) SHZ_NOEXCEPT
Returns the fast approximate square root of the given value, x.
float shz_pow10f(float x) SHZ_NOEXCEPT
Fast approximation of POSIX's pow10f().
bool shz_quadratic_roots(float a, float b, float c, float *root1, float *root2) SHZ_NOEXCEPT
Uses the quadratic formula with the given coefficients to solve for the two roots,...
float shz_dot6f(float x1, float y1, float z1, float x2, float y2, float z2) SHZ_NOEXCEPT
Takes two sets of 3D vectors as 3 floats and calculates their dot product using an approximation.
float shz_ceilf(float x) SHZ_NOEXCEPT
Replacement for the <math.h> routine, ceilf().
float shz_remapf_fsrra(float value, float inputStart, float inputEnd, float outputStart, float outputEnd) SHZ_NOEXCEPT
Maps a value within the given range inputStart to inputEnd, to be within the range of outputStart to ...
float shz_hypotf(float x, float y) SHZ_NOEXCEPT
Replacement for the <math.h> routine, hypotf().
float shz_copysignf(float x, float y) SHZ_NOEXCEPT
Replacement for the <math.h> routine, copysignf().
float shz_invf(float x) SHZ_NOEXCEPT
Takes the inverse of x using a slighty faster approximation than doing a full division,...
float shz_wrapf(float value, float min, float max) SHZ_NOEXCEPT
Wraps the given value back to be within the range of min to max.
float shz_saturatef(float x) SHZ_NOEXCEPT
Clamps x to the range [0.0f, 1.0f].
float shz_truncf(float x) SHZ_NOEXCEPT
Replacement for the <math.h> routine, truncf().
float shz_invf_fsrra(float x) SHZ_NOEXCEPT
Takes the inverse of x using a very fast approximation, returning a positive result.
float shz_sqrtf(float x) SHZ_NOEXCEPT
Returns the fast approximate square root of the given value, x, safely returning 0....
float shz_fmaf(float a, float b, float c) SHZ_NOEXCEPT
Replacement for the <math.h> routine, fmaf().
float shz_barycentric_lerpf(float a, float b, float c, float u, float v) SHZ_NOEXCEPT
Returns a value that is barycentrically interpolated between a, b, and c using the given barycentric ...
bool shz_equalf(float a, float b) SHZ_NOEXCEPT
Checks for equality based on EITHER the absolute tolerance or relative tolerance, using SHZ_FLT_EPSIL...
float shz_smoothstepf_safe(float x, float edge0, float edge1) SHZ_NOEXCEPT
Returns 0.0f at/below edge0, 1.0f at/above edge1, smoothly varying in-between. Accepts inverse edges.
float shz_inv_sqrtf_fsrra(float x) SHZ_NOEXCEPT
Calculates 1.0f/sqrtf( x), using a fast approximation.
float shz_cbrtf(float x) SHZ_NOEXCEPT
Replacement for the <math.h> routine, cbrtf().
bool shz_equalf_rel(float a, float b) SHZ_NOEXCEPT
Checks for equality based on the relative tolerance using SHZ_FLT_EPSILON.
float shz_fractf(float x) SHZ_NOEXCEPT
Returns the fractional part of x, equivalent to GLSL fract().
float shz_fmodf(float num, float denom) SHZ_NOEXCEPT
Replacement for the <math.h> routine, fmodf().
float shz_lerpf(float a, float b, float t) SHZ_NOEXCEPT
Returns a value that is linearly interpolated between a and b by the given ratio, t.
float shz_remainderf(float num, float denom) SHZ_NOEXCEPT
Replacement for the <math.h> routine, remainderf().
float shz_divf_fsrra(float num, float denom) SHZ_NOEXCEPT
Divides num by denom using a very fast approximation, which requires denom be a positive value.
float shz_divf(float num, float denom) SHZ_NOEXCEPT
Divides num by denom using a slightly faster approximation, allowing denom to be negative.
float shz_fminf(float a, float b) SHZ_NOEXCEPT
Returns the minimum value of two given floats.
float shz_inv_sqrtf(float x) SHZ_NOEXCEPT
Calculates 1.0f/sqrtf( x ), using a fast approximation, while safely protecting against division-by-z...
float shz_randf_range(int *seed, float min, float max) SHZ_NOEXCEPT
Returns a random floating-point number between min and max, using and updating the given seed.
float shz_clampf(float value, float min, float max) SHZ_NOEXCEPT
Clamps a floating-point value by the given min and max values.
float shz_roundf(float x) SHZ_NOEXCEPT
Replacement for the <math.h> routine, roundf().
float shz_fabsf(float x) SHZ_NOEXCEPT
Replacement for the <math.h> routine, fabsf().
float shz_logf(float x) SHZ_NOEXCEPT
Fast approximation for C's logf().
float shz_remapf(float value, float inputStart, float inputEnd, float outputStart, float outputEnd) SHZ_NOEXCEPT
Maps a value within the given range inputStart to inputEnd, to be within the range of outputStart to ...
float shz_stepf(float x, float edge) SHZ_NOEXCEPT
returns 0.0f if x < edge, otherwise 1.0f
float shz_pow2f(float p) SHZ_NOEXCEPT
Fast approximation for raising 2 to a floating-point power.