\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 r1991605 = 1.0;
double r1991606 = t;
double r1991607 = 2e-16;
double r1991608 = r1991606 * r1991607;
double r1991609 = r1991605 + r1991608;
double r1991610 = r1991609 * r1991609;
double r1991611 = -1.0;
double r1991612 = 2.0;
double r1991613 = r1991612 * r1991608;
double r1991614 = r1991611 - r1991613;
double r1991615 = r1991610 + r1991614;
return r1991615;
}
double f(double t) {
double r1991616 = 3.9999999999999997e-32;
double r1991617 = t;
double r1991618 = r1991616 * r1991617;
double r1991619 = r1991618 * r1991617;
return r1991619;
}




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 +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)))))