Return the exponential of the elements in the array minus one.
Parameters: | x : array_like
|
---|---|
Returns: | out : ndarray
|
See also
Notes
This function provides greater precision than using exp(x)-1 for small values of x.
Examples
Since the series expansion of e**x = 1 + x + x**2/2! + x**3/3! + ..., for very small x we expect that e**x -1 ~ x + x**2/2:
>>> np.expm1(1e-10)
1.00000000005e-10
>>> np.exp(1e-10) - 1
1.000000082740371e-10