\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 r1278879 = 1.0;
double r1278880 = t;
double r1278881 = 2e-16;
double r1278882 = r1278880 * r1278881;
double r1278883 = r1278879 + r1278882;
double r1278884 = r1278883 * r1278883;
double r1278885 = -1.0;
double r1278886 = 2.0;
double r1278887 = r1278886 * r1278882;
double r1278888 = r1278885 - r1278887;
double r1278889 = r1278884 + r1278888;
return r1278889;
}
double f(double t) {
double r1278890 = 2e-16;
double r1278891 = t;
double r1278892 = r1278890 * r1278891;
double r1278893 = r1278890 * r1278892;
double r1278894 = r1278893 * r1278891;
return r1278894;
}




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
Final simplification0.3
herbie shell --seed 2019128 +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)))))