braincore.math.exprel#
- braincore.math.exprel(x)#
Relative error exponential,
(exp(x) - 1)/x.When
xis near zero,exp(x)is near 1, so the numerical calculation ofexp(x) - 1can suffer from catastrophic loss of precision.exprel(x)is implemented to avoid the loss of precision that occurs whenxis near zero.- Parameters:
x – ndarray. Input array.
xmust contain real numbers.- Returns:
(exp(x) - 1)/x, computed element-wise.