\left(1 + t \cdot 2 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 2 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 2 \cdot 10^{-16}\right)\right)3.9999999999999997 \cdot 10^{-32} \cdot \left(t \cdot t\right)double f(double t) {
double r5137379 = 1.0;
double r5137380 = t;
double r5137381 = 2e-16;
double r5137382 = r5137380 * r5137381;
double r5137383 = r5137379 + r5137382;
double r5137384 = r5137383 * r5137383;
double r5137385 = -1.0;
double r5137386 = 2.0;
double r5137387 = r5137386 * r5137382;
double r5137388 = r5137385 - r5137387;
double r5137389 = r5137384 + r5137388;
return r5137389;
}
double f(double t) {
double r5137390 = 3.9999999999999997e-32;
double r5137391 = t;
double r5137392 = r5137391 * r5137391;
double r5137393 = r5137390 * r5137392;
return r5137393;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.4 |
Initial program 61.8
Simplified50.3
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019119 +o rules:numerics
(FPCore (t)
:name "fma_test1"
:pre (<= 0.9 t 1.1)
:herbie-target
(fma (+ 1 (* t 2e-16)) (+ 1 (* t 2e-16)) (- -1 (* 2 (* t 2e-16))))
(+ (* (+ 1 (* t 2e-16)) (+ 1 (* t 2e-16))) (- -1 (* 2 (* t 2e-16)))))