e^{x} - 1\mathsf{fma}\left({x}^{2}, \mathsf{fma}\left(x, \frac{1}{6}, \frac{1}{2}\right), x\right)double f(double x) {
double r95143 = x;
double r95144 = exp(r95143);
double r95145 = 1.0;
double r95146 = r95144 - r95145;
return r95146;
}
double f(double x) {
double r95147 = x;
double r95148 = 2.0;
double r95149 = pow(r95147, r95148);
double r95150 = 0.16666666666666666;
double r95151 = 0.5;
double r95152 = fma(r95147, r95150, r95151);
double r95153 = fma(r95149, r95152, r95147);
return r95153;
}




Bits error versus x
| Original | 58.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 58.7
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019325 +o rules:numerics
(FPCore (x)
:name "expm1 (example 3.7)"
:precision binary64
:pre (< -0.00017 x)
:herbie-target
(* x (+ (+ 1 (/ x 2)) (/ (* x x) 6)))
(- (exp x) 1))