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 r103365 = x;
double r103366 = exp(r103365);
double r103367 = 1.0;
double r103368 = r103366 - r103367;
return r103368;
}
double f(double x) {
double r103369 = 0.5;
double r103370 = x;
double r103371 = 2.0;
double r103372 = pow(r103370, r103371);
double r103373 = 0.16666666666666666;
double r103374 = 3.0;
double r103375 = pow(r103370, r103374);
double r103376 = fma(r103373, r103375, r103370);
double r103377 = fma(r103369, r103372, r103376);
return r103377;
}




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