\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 r2209146 = 1.0;
double r2209147 = t;
double r2209148 = 2e-16;
double r2209149 = r2209147 * r2209148;
double r2209150 = r2209146 + r2209149;
double r2209151 = r2209150 * r2209150;
double r2209152 = -1.0;
double r2209153 = 2.0;
double r2209154 = r2209153 * r2209149;
double r2209155 = r2209152 - r2209154;
double r2209156 = r2209151 + r2209155;
return r2209156;
}
double f(double t) {
double r2209157 = 3.9999999999999997e-32;
double r2209158 = t;
double r2209159 = r2209157 * r2209158;
double r2209160 = r2209159 * r2209158;
return r2209160;
}




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