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 r85147 = x;
double r85148 = exp(r85147);
double r85149 = 1.0;
double r85150 = r85148 - r85149;
return r85150;
}
double f(double x) {
double r85151 = 0.5;
double r85152 = x;
double r85153 = 2.0;
double r85154 = pow(r85152, r85153);
double r85155 = 0.16666666666666666;
double r85156 = 3.0;
double r85157 = pow(r85152, r85156);
double r85158 = fma(r85155, r85157, r85152);
double r85159 = fma(r85151, r85154, r85158);
return r85159;
}




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