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 r104767 = x;
double r104768 = exp(r104767);
double r104769 = 1.0;
double r104770 = r104768 - r104769;
return r104770;
}
double f(double x) {
double r104771 = 0.5;
double r104772 = x;
double r104773 = 2.0;
double r104774 = pow(r104772, r104773);
double r104775 = 0.16666666666666666;
double r104776 = 3.0;
double r104777 = pow(r104772, r104776);
double r104778 = fma(r104775, r104777, r104772);
double r104779 = fma(r104771, r104774, r104778);
return r104779;
}




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 2020060 +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))