e^{x} - 1\mathsf{fma}\left({x}^{2}, \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right), x\right)double f(double x) {
double r75433 = x;
double r75434 = exp(r75433);
double r75435 = 1.0;
double r75436 = r75434 - r75435;
return r75436;
}
double f(double x) {
double r75437 = x;
double r75438 = 2.0;
double r75439 = pow(r75437, r75438);
double r75440 = 0.16666666666666666;
double r75441 = 0.5;
double r75442 = fma(r75440, r75437, r75441);
double r75443 = fma(r75439, r75442, r75437);
return r75443;
}




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