\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)\left(2 \cdot 10^{-16} \cdot \left(2 \cdot 10^{-16} \cdot t\right)\right) \cdot tdouble f(double t) {
double r8010507 = 1.0;
double r8010508 = t;
double r8010509 = 2e-16;
double r8010510 = r8010508 * r8010509;
double r8010511 = r8010507 + r8010510;
double r8010512 = r8010511 * r8010511;
double r8010513 = -1.0;
double r8010514 = 2.0;
double r8010515 = r8010514 * r8010510;
double r8010516 = r8010513 - r8010515;
double r8010517 = r8010512 + r8010516;
return r8010517;
}
double f(double t) {
double r8010518 = 2e-16;
double r8010519 = t;
double r8010520 = r8010518 * r8010519;
double r8010521 = r8010518 * r8010520;
double r8010522 = r8010521 * r8010519;
return r8010522;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.5 |
| Herbie | 0.3 |
Initial program 61.8
Simplified0.4
rmApplied associate-*r*0.3
Final simplification0.3
herbie shell --seed 2019120
(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)))))