\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(2 \cdot 10^{-16} \cdot \left(2 \cdot 10^{-16} \cdot t\right)\right) \cdot tdouble f(double t) {
double r1486335 = 1.0;
double r1486336 = t;
double r1486337 = 2e-16;
double r1486338 = r1486336 * r1486337;
double r1486339 = r1486335 + r1486338;
double r1486340 = r1486339 * r1486339;
double r1486341 = -1.0;
double r1486342 = 2.0;
double r1486343 = r1486342 * r1486338;
double r1486344 = r1486341 - r1486343;
double r1486345 = r1486340 + r1486344;
return r1486345;
}
double f(double t) {
double r1486346 = 2e-16;
double r1486347 = t;
double r1486348 = r1486346 * r1486347;
double r1486349 = r1486346 * r1486348;
double r1486350 = r1486349 * r1486347;
return r1486350;
}




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