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 r88716 = x;
double r88717 = exp(r88716);
double r88718 = 1.0;
double r88719 = r88717 - r88718;
return r88719;
}
double f(double x) {
double r88720 = 0.5;
double r88721 = x;
double r88722 = 2.0;
double r88723 = pow(r88721, r88722);
double r88724 = 0.16666666666666666;
double r88725 = 3.0;
double r88726 = pow(r88721, r88725);
double r88727 = fma(r88724, r88726, r88721);
double r88728 = fma(r88720, r88723, r88727);
return r88728;
}




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