The functions in this section are smoothed equivalents of the original math functions and can be used to allow computing derivatives around discontinuities.
#!c++ T smooth_abs(T x, T c = 0.001)
is a smoothed version of abs
, defined as:
x
is the input valuec
is the cut-off point for the spline-approximated area (default:0.001
)- returns: The smoothed absolute value, defined as above.
#!c++ T smooth_max(T x, T y, T c = 0.001)
is a smoothed version of max
, defined as:
x
First argument to maxy
Second argument to maxc
Cut-off point for the spline-approximated area (default:0.001
)- returns: The smoothed max function, defined as above
#!c++ T smooth_min(T x, T y, T c = 0.001)
is a smoothed version of min
, defined as:
x
First argument to miny
Second argument to minc
Cut-off point for the spline-approximated area (default:0.001
)- returns: The smoothed min function, defined as above