21#ifdef QLIBS_USE_STD_MATH
24 #define QLIB_ABS fabsf
29 #define QLIB_SQRT sqrtf
30 #define QLIB_ISNAN isnan
31 #define QLIB_ISINF isinf
32 #define QLIB_MAX fmaxf
33 #define QLIB_MIN fminf
35 #define QLIB_MOD fmodf
36 #define QLIB_ROUND roundf
40 #define QLIB_ABS qFFMath_Abs
41 #define QLIB_COS qFFMath_Cos
42 #define QLIB_POW qFFMath_Pow
43 #define QLIB_EXP qFFMath_Exp
44 #define QLIB_LOG qFFMath_Log
45 #define QLIB_SQRT qFFMath_Sqrt
46 #define QLIB_ISNAN qFFMath_IsNaN
47 #define QLIB_ISINF qFFMath_IsInf
48 #define QLIB_MAX qFFMath_Max
49 #define QLIB_MIN qFFMath_Min
50 #define QLIB_NAN QFFM_NAN
51 #define QLIB_FMOD qFFMath_Mod
52 #define QLIB_ROUND qFFMath_Round
62 float _qFFMath_GetAbnormal(
const int i );
66 #define QFFM_E ( 2.7182818284590452354F )
68 #define QFFM_LOG2E ( 1.4426950408889634074F )
70 #define QFFM_LOG10E ( 0.43429448190325182765F )
72 #define QFFM_LN2 ( 0.69314718055994530942F )
74 #define QFFM_LN10 ( 2.30258509299404568402F )
76 #define QFFM_PI ( 3.14159265358979323846F )
78 #define QFFM_PI_2 ( 1.57079632679489661923F )
80 #define QFFM_PI_4 ( 0.78539816339744830962F )
82 #define QFFM_1_PI ( 0.31830988618379067154F )
84 #define QFFM_2_PI ( 0.63661977236758134308F )
86 #define QFFM_2_SQRTPI ( 1.12837916709551257390F )
88 #define QFFM_SQRT2 ( 1.41421356237309504880F )
90 #define QFFM_SQRT1_2 ( 0.70710678118654752440F )
92 #define QFFM_LN_SQRT_2PI ( 0.918938533204672669540968854562379419F )
95 #define QFFM_GAMMA_E ( 0.577215664901532860606512090082402431F )
97 #define QFFM_2PI ( 6.283185307179586231995926937088370323F )
99 #define QFFM_LN_PI ( 1.144729885849400163877476188645232468F )
102 #define QFFM_MAXFLOAT ( 3.40282347e+38F )
104 #define QFFM_INFINITY _qFFMath_GetAbnormal( 0 )
106 #define QFFM_NAN _qFFMath_GetAbnormal( 1 )
109 #define QFFM_FP_ZERO ( 0 )
112 #define QFFM_FP_SUBNORMAL ( 1 )
116 #define QFFM_FP_NORMAL ( 2 )
120 #define QFFM_FP_INFINITE ( 3 )
123 #define QFFM_FP_NAN ( 4 )
175 bool qFFMath_IsEqual(
const float a,
178 bool qFFMath_IsAlmostEqual(
const float a,
674 const float upperL );
688 const float *
const px,
689 const float *
const py,
float qFFMath_Trunc(float x)
Computes the nearest integer not greater in magnitude than x.
Definition qffmath.c:382
bool qFFMath_IsNaN(const float x)
Determine if x is Not-A-Number (NaN) aka QFFM_NAN.
Definition qffmath.c:125
float qFFMath_Tanh(float x)
Computes hyperbolic tangent of x.
Definition qffmath.c:613
float qFFMath_Hermite(size_t n, float x)
Computes the (physicist's) Hermite polynomials of the degree n and argument x.
Definition qffmath.c:2074
bool qFFMath_InCircle(const float x, const float y, const float cx, const float cy, const float r)
Determines if the point at ( x, y) is inside the circle with radius r located at cx and cy.
Definition qffmath.c:915
float qFFMath_Log10(float x)
Computes the common (base-10) logarithm of x.
Definition qffmath.c:588
float qFFMath_NextAfter(float x, float y)
Returns the next representable value of x in the direction of y. If x equals to y,...
Definition qffmath.c:758
float qFFMath_Ellint_1(float k, float phi)
Computes the incomplete elliptic integral of the first kind of k and phi.
Definition qffmath.c:1827
float qFFMath_Legendre(size_t n, float x)
Computes the unassociated Legendre polynomials of the degree n, and argument x.
Definition qffmath.c:2120
float qFFMath_Assoc_legendre(size_t n, size_t m, float x)
Computes the associated Legendre polynomials of the degree n, order m, and argument x.
Definition qffmath.c:1451
float qFFMath_Cyl_neumann(float nu, float x)
Computes the cylindrical Neumann function ( also known as Bessel function of the second kind or Weber...
Definition qffmath.c:2866
float qFFMath_Sinh(float x)
Computes hyperbolic sine of x.
Definition qffmath.c:599
float qFFMath_RSqrt(float x)
Computes the reciprocal square-root of x denoted as 1/sqrt(x)
Definition qffmath.c:202
float qFFMath_Cyl_bessel_i(float nu, float x)
Computes the regular modified cylindrical Bessel function of nu and x.
Definition qffmath.c:2756
float qFFMath_ATan2(float y, float x)
Computes the arc tangent of y/x using the signs of arguments to determine the correct quadrant.
Definition qffmath.c:479
float qFFMath_Cosh(float x)
Computes hyperbolic cosine of x.
Definition qffmath.c:606
float qFFMath_ACosh(float x)
Computes the inverse hyperbolic cosine of x.
Definition qffmath.c:624
float qFFMath_TGamma(float x)
Computes the gamma function of x.
Definition qffmath.c:925
float qFFMath_ASinh(float x)
Computes the inverse hyperbolic sine of x.
Definition qffmath.c:619
float qFFMath_Comp_ellint_1(float k)
Computes the complete elliptic integral of the first kind of k.
Definition qffmath.c:1770
float qFFMath_Exp10(float x)
Computes the value of 10 raised to the power of x.
Definition qffmath.c:578
float qFFMath_Mod(float x, float y)
Computes the floating-point remainder of the division operation x/y.
Definition qffmath.c:414
float qFFMath_Sph_bessel(size_t n, float x)
Computes the spherical Bessel function of the first kind n, and x.
Definition qffmath.c:2514
float qFFMath_Log(float x)
Computes the natural (base e) logarithm of x.
Definition qffmath.c:583
float qFFMath_Min(float x, float y)
Returns the smaller of two floating point arguments.
Definition qffmath.c:681
float qFFMath_Riemann_zeta(float s)
Computes the Riemann zeta function of s.
Definition qffmath.c:2240
float qFFMath_RExp(float x, int32_t *pw2)
Decomposes given floating point value x into a normalized fraction and an integral power of two.
Definition qffmath.c:687
float qFFMath_Sph_legendre(size_t l, size_t m, float theta)
1-3) Computes the spherical associated Legendre function of degree l, order m, and polar angle theta
Definition qffmath.c:2889
float qFFMath_Sin(float x)
Computes the sine of x (measured in radians).
Definition qffmath.c:421
float qFFMath_WrapTo180(float x)
Wraps angle x, in degrees, to the interval [–180, 180] such that 180 maps to 180 and -180 maps to -18...
Definition qffmath.c:645
float qFFMath_WrapTo360(float x)
Wraps angle x, in degrees, to the interval [0, 360] such that 0 maps to 0 and 360 maps to 360....
Definition qffmath.c:650
float qFFMath_Remainder(float x, float y)
Computes the IEEE remainder of the floating point division operation x/y.
Definition qffmath.c:408
int qFFMath_FPClassify(const float f)
Categorizes the floating-point number x. This function determines whether its argument is a normal fl...
Definition qffmath.c:97
float qFFMath_Recip(float x)
Computes the multiplicative inverse or reciprocal for the value x, denoted by 1/x or x^(−1)
Definition qffmath.c:163
bool qFFMath_InRangeCoerce(float *const x, const float lowerL, const float upperL)
Determines if the value pointed by x falls within a range specified by the upper limit and lower limi...
Definition qffmath.c:856
float qFFMath_Assoc_laguerre(size_t n, size_t m, float x)
Computes the associated Laguerre polynomials of the degree n, order m, and argument x.
Definition qffmath.c:1367
float qFFMath_Tan(float x)
Computes the tangent of x (measured in radians).
Definition qffmath.c:453
float qFFMath_WrapToPi(float x)
Wraps angle x, in radians, to the interval [−pi, pi] such that pi maps to pi and -pi maps to -pi....
Definition qffmath.c:635
float qFFMath_Pow(float b, float e)
Computes the value of b raised to the power e.
Definition qffmath.c:593
float qFFMath_Ceil(float x)
Computes the smallest integer value not less than x.
Definition qffmath.c:340
float qFFMath_Frac(float x)
Obtain the fractional part of x.
Definition qffmath.c:403
float qFFMath_Normalize(const float x, const float xMin, const float xMax)
Normalize the given input x in value range given by xMin and xMax to value range between 0 and 1.
Definition qffmath.c:840
float qFFMath_Hypot(float x, float y)
Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at...
Definition qffmath.c:727
float qFFMath_Midpoint(float a, float b)
Computes the midpoint of the floating-points a and b.
Definition qffmath.c:794
bool qFFMath_IsNormal(const float x)
Determines if the given floating point number x is normal, i.e. is neither zero, subnormal,...
Definition qffmath.c:140
float qFFMath_Log2(float x)
Computes the base 2 logarithm of x.
Definition qffmath.c:524
float qFFMath_Ellint_3(float k, float nu, float phi)
Computes the incomplete elliptic integral of the third kind of k, nu and phi.
Definition qffmath.c:1885
float qFFMath_ACos(float x)
Computes the principal value of the arc cosine of x.
Definition qffmath.c:464
float qFFMath_Beta(float x, float y)
Computes the Beta function of x and y.
Definition qffmath.c:1509
float qFFMath_Exp2(float x)
Computes 2 raised to the given power x.
Definition qffmath.c:490
float qFFMath_RCbrt(float x)
Computes the reciprocal cubic-root of x denoted as 1/cbrt(x)
Definition qffmath.c:257
float qFFMath_Sph_neumann(size_t n, float x)
Computes the spherical Bessel function of the second kind also known as the spherical Neumann functio...
Definition qffmath.c:2535
float qFFMath_Cyl_bessel_j(float nu, float x)
Computes the cylindrical Bessel function of the first kind of nu and x.
Definition qffmath.c:2821
float qFFMath_Factorial(float x)
Return the factorial of the integer part of x.
Definition qffmath.c:1230
float qFFMath_Comp_ellint_2(float k)
Computes the complete elliptic integral of the second kind of k.
Definition qffmath.c:1784
float qFFMath_ATan(float x)
Computes the principal value of the arc tangent of x.
Definition qffmath.c:469
float qFFMath_Erfc(float x)
Computes the complementary error function of x.
Definition qffmath.c:670
float qFFMath_Expint(float num)
Computes the Exponential integral of num.
Definition qffmath.c:2069
bool qFFMath_InPolygon(const float x, const float y, const float *const px, const float *const py, const size_t p)
Determines if the point at ( x, y ) is inside the polygon given by the set of points on px and py.
Definition qffmath.c:880
float qFFMath_Cyl_bessel_k(float nu, float x)
Computes the irregular modified cylindrical Bessel function (also known as modified Bessel function o...
Definition qffmath.c:2848
float qFFMath_Abs(float x)
Computes the absolute value of a floating point value x.
Definition qffmath.c:158
float qFFMath_LDExp(float x, int32_t pw2)
Multiplies a floating point value x by the number 2 raised to the pw2 power.
Definition qffmath.c:707
float qFFMath_Cos(float x)
Computes the cosine of x (measured in radians).
Definition qffmath.c:438
float qFFMath_WrapTo2Pi(float x)
Wraps angle x, in radians, to the interval [0, 2*pi] such that 0 maps to 0 and 2*pi and 2*pi maps to ...
Definition qffmath.c:640
bool qFFMath_IsInf(const float x)
Determine if x is Infinity.
Definition qffmath.c:130
float qFFMath_ATanh(float x)
Computes the inverse hyperbolic tangent of x.
Definition qffmath.c:630
float qFFMath_Exp(float x)
Computes the e (Euler's number, 2.7182818) raised to the given power x.
Definition qffmath.c:573
float qFFMath_Floor(float x)
Computes the largest integer value not greater than x.
Definition qffmath.c:296
float qFFMath_ASin(float x)
Computes the principal value of the arc sine of x.
Definition qffmath.c:458
float qFFMath_Round(float x)
Computes the nearest integer value to x (in floating-point format), rounding halfway cases away from ...
Definition qffmath.c:263
float qFFMath_Map(const float x, const float xMin, const float xMax, const float yMin, const float yMax)
Scales the given input x in value range given by xMin and xMax to value range specified by the yMin a...
Definition qffmath.c:847
float qFFMath_Sqrt(float x)
Computes the square-root of x.
Definition qffmath.c:177
float qFFMath_Max(float x, float y)
Returns the larger of two floating point arguments.
Definition qffmath.c:675
bool qFFMath_IsFinite(const float x)
Determines if the given floating point number x has finite value i.e. it is normal,...
Definition qffmath.c:135
float qFFMath_Lerp(float a, float b, float t)
Computes the linear interpolation between a and b, if the parameter t is inside [0,...
Definition qffmath.c:819
float qFFMath_Erf(float x)
Computes the error function of x.
Definition qffmath.c:655
float qFFMath_Ellint_2(float k, float phi)
Computes the incomplete elliptic integral of the second kind of k and phi.
Definition qffmath.c:1852
float qFFMath_LGamma(float x)
Computes the natural logarithm of the absolute value of the gamma function of x.
Definition qffmath.c:1189
float qFFMath_Laguerre(size_t n, float x)
Computes the non-associated Laguerre polynomials of the degree n, and argument x.
Definition qffmath.c:2114
float qFFMath_Cbrt(float x)
Computes the cubic-root of x.
Definition qffmath.c:252
float qFFMath_Comp_ellint_3(float k, float nu)
Computes the complete elliptic integral of the third kind of k and nu.
Definition qffmath.c:1806