\left(1 + t \cdot 1.999999999999999958195573448069207123682 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 1.999999999999999958195573448069207123682 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 1.999999999999999958195573448069207123682 \cdot 10^{-16}\right)\right)\sqrt{3.999999999999999676487027278085939408227 \cdot 10^{-32}} \cdot \left(\left(\sqrt{3.999999999999999676487027278085939408227 \cdot 10^{-32}} \cdot \left|t\right|\right) \cdot \sqrt{{t}^{2}}\right)double f(double t) {
double r74789 = 1.0;
double r74790 = t;
double r74791 = 2e-16;
double r74792 = r74790 * r74791;
double r74793 = r74789 + r74792;
double r74794 = r74793 * r74793;
double r74795 = -1.0;
double r74796 = 2.0;
double r74797 = r74796 * r74792;
double r74798 = r74795 - r74797;
double r74799 = r74794 + r74798;
return r74799;
}
double f(double t) {
double r74800 = 3.9999999999999997e-32;
double r74801 = sqrt(r74800);
double r74802 = t;
double r74803 = fabs(r74802);
double r74804 = r74801 * r74803;
double r74805 = 2.0;
double r74806 = pow(r74802, r74805);
double r74807 = sqrt(r74806);
double r74808 = r74804 * r74807;
double r74809 = r74801 * r74808;
return r74809;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Simplified57.6
Taylor expanded around 0 0.3
rmApplied add-sqr-sqrt0.3
Applied associate-*l*0.3
rmApplied add-sqr-sqrt0.3
Applied associate-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020002 +o rules:numerics
(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)))))