expm1

Calculates the value of the natural logarithm base (e) raised to the power of x, minus 1.

For very small x, expm1(x) is more accurate than exp(x)-1.

Special Values
xex-1
±0.0±0.0
+∞+∞
-∞-1.0
NaNNaN
  1. real expm1(real x)
  2. double expm1(double x)
  3. float expm1(float x)
    pragma(inline, true) @safe pure nothrow @nogc
    float
    expm1
    (
    float x
    )

Examples

import std.math.traits : isIdentical;
import std.math.operations : feqrel;

assert(isIdentical(expm1(0.0), 0.0));
assert(expm1(1.0).feqrel(1.71828) > 16);
assert(expm1(2.0).feqrel(6.3890) > 16);

Meta