\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 r3309701 = 1.0;
double r3309702 = t;
double r3309703 = 2e-16;
double r3309704 = r3309702 * r3309703;
double r3309705 = r3309701 + r3309704;
double r3309706 = r3309705 * r3309705;
double r3309707 = -1.0;
double r3309708 = 2.0;
double r3309709 = r3309708 * r3309704;
double r3309710 = r3309707 - r3309709;
double r3309711 = r3309706 + r3309710;
return r3309711;
}
double f(double t) {
double r3309712 = 3.9999999999999997e-32;
double r3309713 = t;
double r3309714 = r3309712 * r3309713;
double r3309715 = r3309714 * r3309713;
return r3309715;
}




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