\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 r69926 = 1.0;
double r69927 = t;
double r69928 = 2e-16;
double r69929 = r69927 * r69928;
double r69930 = r69926 + r69929;
double r69931 = r69930 * r69930;
double r69932 = -1.0;
double r69933 = 2.0;
double r69934 = r69933 * r69929;
double r69935 = r69932 - r69934;
double r69936 = r69931 + r69935;
return r69936;
}
double f(double t) {
double r69937 = 3.9999999999999997e-32;
double r69938 = sqrt(r69937);
double r69939 = t;
double r69940 = fabs(r69939);
double r69941 = r69938 * r69940;
double r69942 = 2.0;
double r69943 = pow(r69939, r69942);
double r69944 = sqrt(r69943);
double r69945 = r69941 * r69944;
double r69946 = r69938 * r69945;
return r69946;
}




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.3
rmApplied add-sqr-sqrt0.3
Applied associate-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020064
(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)))))