\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 r2622382 = 1.0;
double r2622383 = t;
double r2622384 = 2e-16;
double r2622385 = r2622383 * r2622384;
double r2622386 = r2622382 + r2622385;
double r2622387 = r2622386 * r2622386;
double r2622388 = -1.0;
double r2622389 = 2.0;
double r2622390 = r2622389 * r2622385;
double r2622391 = r2622388 - r2622390;
double r2622392 = r2622387 + r2622391;
return r2622392;
}
double f(double t) {
double r2622393 = 2e-16;
double r2622394 = t;
double r2622395 = r2622393 * r2622394;
double r2622396 = r2622393 * r2622395;
double r2622397 = r2622396 * r2622394;
return r2622397;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.5 |
| Herbie | 0.3 |
Initial program 61.8
Simplified0.4
rmApplied associate-*r*0.3
Final simplification0.3
herbie shell --seed 2019144 +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)))))