\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(3.9999999999999997 \cdot 10^{-32} \cdot t\right) \cdot tdouble f(double t) {
double r1748385 = 1.0;
double r1748386 = t;
double r1748387 = 2e-16;
double r1748388 = r1748386 * r1748387;
double r1748389 = r1748385 + r1748388;
double r1748390 = r1748389 * r1748389;
double r1748391 = -1.0;
double r1748392 = 2.0;
double r1748393 = r1748392 * r1748388;
double r1748394 = r1748391 - r1748393;
double r1748395 = r1748390 + r1748394;
return r1748395;
}
double f(double t) {
double r1748396 = 3.9999999999999997e-32;
double r1748397 = t;
double r1748398 = r1748396 * r1748397;
double r1748399 = r1748398 * r1748397;
return r1748399;
}




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