\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)\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left(\left(t \cdot t\right) \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right)double f(double t) {
double r2135624 = 1.0;
double r2135625 = t;
double r2135626 = 2e-16;
double r2135627 = r2135625 * r2135626;
double r2135628 = r2135624 + r2135627;
double r2135629 = r2135628 * r2135628;
double r2135630 = -1.0;
double r2135631 = 2.0;
double r2135632 = r2135631 * r2135627;
double r2135633 = r2135630 - r2135632;
double r2135634 = r2135629 + r2135633;
return r2135634;
}
double f(double t) {
double r2135635 = 3.9999999999999997e-32;
double r2135636 = sqrt(r2135635);
double r2135637 = t;
double r2135638 = r2135637 * r2135637;
double r2135639 = r2135638 * r2135636;
double r2135640 = r2135636 * r2135639;
return r2135640;
}




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