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 r61344 = x;
double r61345 = exp(r61344);
double r61346 = 1.0;
double r61347 = r61345 - r61346;
return r61347;
}
double f(double x) {
double r61348 = 0.5;
double r61349 = x;
double r61350 = 2.0;
double r61351 = pow(r61349, r61350);
double r61352 = 0.16666666666666666;
double r61353 = 3.0;
double r61354 = pow(r61349, r61353);
double r61355 = fma(r61352, r61354, r61349);
double r61356 = fma(r61348, r61351, r61355);
return r61356;
}




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