expm1
Exponential of the argument, minus one.
Syntax
R = expm1(x)
Inputs
- x
- Type: double | complex
Outputs
- R
- The returned values.
Example
Show that expm1(x) has better accuracy than exp(x) - 1 for small real values of x
.x = 1e-18;
a = exp(x)-1
a = 0
b = expm1(x)
b = 1e-18
The value of a has lost precision, but b has not.