\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)t \cdot \left(t \cdot 3.9999999999999997 \cdot 10^{-32}\right)double f(double t) {
double r56829 = 1.0;
double r56830 = t;
double r56831 = 2e-16;
double r56832 = r56830 * r56831;
double r56833 = r56829 + r56832;
double r56834 = r56833 * r56833;
double r56835 = -1.0;
double r56836 = 2.0;
double r56837 = r56836 * r56832;
double r56838 = r56835 - r56837;
double r56839 = r56834 + r56838;
return r56839;
}
double f(double t) {
double r56840 = t;
double r56841 = 3.9999999999999997e-32;
double r56842 = r56840 * r56841;
double r56843 = r56840 * r56842;
return r56843;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Taylor expanded around 0 0.3
rmApplied sqr-pow0.3
Applied associate-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020062
(FPCore (t)
:name "fma_test1"
:precision binary64
: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)))))