55 if (a > b) std::swap(a, b);
56 return 0.414f * a + b;
73 conv.i = 0x5f3759df - (conv.i >> 1);
74 conv.f *= 1.5F - (a * 0.5F * conv.f * conv.f);
110float gain(
float x,
float factor);
127float lerp(
float a,
float b,
float t);
156float r_min(
float f1,
float f2,
float alpha = 0.f);
173float r_max(
float f1,
float f2,
float alpha = 0.f);
254float threshold(
float x,
float x0,
float x1);
276float trapeze(
float x,
float x0,
float x1,
float width);
296float triangle(
float x,
float vmin,
float vmax);
Definition algebra.hpp:23
Array smoothstep3_upper(const Array &array)
Cubic smoothstep (zero derivative at 1 only).
Definition math.cpp:369
float trapeze_smooth(float x, float x0, float x1, float width)
Smooth trapezoidal pulse using cubic smoothstep interpolation.
Definition core.cpp:162
Array sigmoid(const Array &array, float width=1.f, float vmin=0.f, float vmax=1.f, float x0=0.f)
Sigmoid function.
Definition math.cpp:308
float fast_log(float x)
Fast natural logarithm approximation.
Definition core.cpp:47
Array smoothstep7(const Array &array)
Seventh-order smoothstep.
Definition math.cpp:462
Array smoothstep5_upper(const Array &array)
Quintic smoothstep (zero derivative at 1 only).
Definition math.cpp:450
Array almost_unit_identity(const Array &array)
Almost unit identity function.
Definition math.cpp:78
Array threshold(const Array &array, float x0, float x1)
Linear threshold.
Definition math.cpp:498
Array smoothstep3(const Array &array, float vmin=0.f, float vmax=1.f)
Cubic smoothstep.
Definition math.cpp:333
Array threshold_smooth(const Array &array, float x0, float x1)
Smooth threshold.
Definition math.cpp:510
float trapeze(float x, float x0, float x1, float width)
Computes a trapezoidal pulse function.
Definition core.cpp:149
int ceil_div(int a, int b)
Integer ceiling division.
Definition core.cpp:31
float approx_rsqrt(float a)
Fast inverse square root approximation.
Definition core.hpp:65
float approx_hypot(float a, float b)
Approximate hypotenuse.
Definition core.hpp:51
Array smoothstep3_lower(const Array &array)
Cubic smoothstep (zero derivative at 0 only).
Definition math.cpp:357
Array smoothstep5_lower(const Array &array)
Quintic smoothstep (zero derivative at 0 only).
Definition math.cpp:438
int highest_power_of_2(int n)
Highest power of 2 less than or equal to n.
Definition pyramid_decomposition.cpp:205
Array smoothstep5(const Array &array, float vmin=0.f, float vmax=1.f)
Quintic smoothstep.
Definition math.cpp:381
Array r_max(const Array &array1, const Array &array2, float alpha=0.f)
Generalized Rvachev R-function for smooth maximum / union (exact zero-set).
Definition math.cpp:294
Array abs_smooth(const Array &array, float mu, const Array &vshift)
Smooth absolute value.
Definition math.cpp:59
void gain(Array &array, float factor, const Array *p_mask)
Apply a gain correction to the array elements.
Definition filters.cpp:198
float fast_exp(float x)
Fast exponential approximation.
Definition core.cpp:36
Array almost_unit_identity_c2(const Array &array)
Almost unit identity function (C2 variant).
Definition math.cpp:90
Point lerp(const Point &p1, const Point &p2, float t)
Linearly interpolates between two points.
Definition points.cpp:225
Array r_min(const Array &array1, const Array &array2, float alpha=0.f)
Generalized Rvachev R-function for smooth minimum / intersection (exact zero-set).
Definition math.cpp:280
float power_curve(float x, float a, float b)
Smooth asymmetric bell-shaped curve on [0,1].
Definition core.cpp:68
float triangle(float x, float vmin, float vmax)
Triangle function between bounds.
Definition core.cpp:167