\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 r2423834 = 1.0;
double r2423835 = t;
double r2423836 = 2e-16;
double r2423837 = r2423835 * r2423836;
double r2423838 = r2423834 + r2423837;
double r2423839 = r2423838 * r2423838;
double r2423840 = -1.0;
double r2423841 = 2.0;
double r2423842 = r2423841 * r2423837;
double r2423843 = r2423840 - r2423842;
double r2423844 = r2423839 + r2423843;
return r2423844;
}
double f(double t) {
double r2423845 = 3.9999999999999997e-32;
double r2423846 = t;
double r2423847 = r2423845 * r2423846;
double r2423848 = r2423847 * r2423846;
return r2423848;
}




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