\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(\left(t \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right) \cdot t\right) \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}double f(double t) {
double r9624721 = 1.0;
double r9624722 = t;
double r9624723 = 2e-16;
double r9624724 = r9624722 * r9624723;
double r9624725 = r9624721 + r9624724;
double r9624726 = r9624725 * r9624725;
double r9624727 = -1.0;
double r9624728 = 2.0;
double r9624729 = r9624728 * r9624724;
double r9624730 = r9624727 - r9624729;
double r9624731 = r9624726 + r9624730;
return r9624731;
}
double f(double t) {
double r9624732 = t;
double r9624733 = 3.9999999999999997e-32;
double r9624734 = sqrt(r9624733);
double r9624735 = r9624732 * r9624734;
double r9624736 = r9624735 * r9624732;
double r9624737 = r9624736 * r9624734;
return r9624737;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Simplified50.3
Taylor expanded around inf 0.4
Simplified0.4
rmApplied add-sqr-sqrt0.4
Applied associate-*r*0.4
rmApplied associate-*l*0.3
Final simplification0.3
herbie shell --seed 2019128 +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)))))