\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(\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left|t\right|\right) \cdot \sqrt{{t}^{2}}\right)double f(double t) {
double r70873 = 1.0;
double r70874 = t;
double r70875 = 2e-16;
double r70876 = r70874 * r70875;
double r70877 = r70873 + r70876;
double r70878 = r70877 * r70877;
double r70879 = -1.0;
double r70880 = 2.0;
double r70881 = r70880 * r70876;
double r70882 = r70879 - r70881;
double r70883 = r70878 + r70882;
return r70883;
}
double f(double t) {
double r70884 = 3.9999999999999997e-32;
double r70885 = sqrt(r70884);
double r70886 = t;
double r70887 = fabs(r70886);
double r70888 = r70885 * r70887;
double r70889 = 2.0;
double r70890 = pow(r70886, r70889);
double r70891 = sqrt(r70890);
double r70892 = r70888 * r70891;
double r70893 = r70885 * r70892;
return r70893;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Taylor expanded around 0 0.3
rmApplied add-sqr-sqrt0.3
Applied associate-*l*0.4
rmApplied add-sqr-sqrt0.4
Applied associate-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020047
(FPCore (t)
:name "fma_test1"
:precision binary64
: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)))))