\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(t \cdot 3.9999999999999997 \cdot 10^{-32}\right) \cdot tdouble f(double t) {
double r58296 = 1.0;
double r58297 = t;
double r58298 = 2e-16;
double r58299 = r58297 * r58298;
double r58300 = r58296 + r58299;
double r58301 = r58300 * r58300;
double r58302 = -1.0;
double r58303 = 2.0;
double r58304 = r58303 * r58299;
double r58305 = r58302 - r58304;
double r58306 = r58301 + r58305;
return r58306;
}
double f(double t) {
double r58307 = t;
double r58308 = 3.9999999999999997e-32;
double r58309 = r58307 * r58308;
double r58310 = r58309 * r58307;
return r58310;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Simplified57.6
Taylor expanded around 0 0.3
rmApplied unpow20.3
Applied associate-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020025 +o rules:numerics
(FPCore (t)
:name "fma_test1"
:precision binary64
: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)))))