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 r85786 = x;
double r85787 = exp(r85786);
double r85788 = 1.0;
double r85789 = r85787 - r85788;
return r85789;
}
double f(double x) {
double r85790 = 0.5;
double r85791 = x;
double r85792 = 2.0;
double r85793 = pow(r85791, r85792);
double r85794 = 0.16666666666666666;
double r85795 = 3.0;
double r85796 = pow(r85791, r85795);
double r85797 = fma(r85794, r85796, r85791);
double r85798 = fma(r85790, r85793, r85797);
return r85798;
}




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