powered by
Smooth approximation to the absolute value function
abs_smooth(x, epsilon = 1e-06)
Smooth absolute value of x.
x
vector of evaluation points
smoothing constant
We approximate the absolute value here as $$\vert x \vert \approx \sqrt{x^2 + \epsilon}$$
abs(0) abs_smooth(0, 1e-4)
Run the code above in your browser using DataLab