\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 r987340 = 1.0;
double r987341 = t;
double r987342 = 2e-16;
double r987343 = r987341 * r987342;
double r987344 = r987340 + r987343;
double r987345 = r987344 * r987344;
double r987346 = -1.0;
double r987347 = 2.0;
double r987348 = r987347 * r987343;
double r987349 = r987346 - r987348;
double r987350 = r987345 + r987349;
return r987350;
}
double f(double t) {
double r987351 = 2e-16;
double r987352 = t;
double r987353 = r987351 * r987352;
double r987354 = r987351 * r987353;
double r987355 = r987354 * r987352;
return r987355;
}




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 2019128
(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)))))