e^{x} - 1\mathsf{fma}\left(\frac{1}{2}, {x}^{2}, \mathsf{fma}\left(\frac{1}{6}, {x}^{3}, x\right)\right)double f(double x) {
double r88272 = x;
double r88273 = exp(r88272);
double r88274 = 1.0;
double r88275 = r88273 - r88274;
return r88275;
}
double f(double x) {
double r88276 = 0.5;
double r88277 = x;
double r88278 = 2.0;
double r88279 = pow(r88277, r88278);
double r88280 = 0.16666666666666666;
double r88281 = 3.0;
double r88282 = pow(r88277, r88281);
double r88283 = fma(r88280, r88282, r88277);
double r88284 = fma(r88276, r88279, r88283);
return r88284;
}




Bits error versus x
| Original | 58.7 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
Initial program 58.7
Taylor expanded around 0 0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2020001 +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))