\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)\left(3.999999999999999676487027278085939408227 \cdot 10^{-32} \cdot \left|t\right|\right) \cdot \sqrt{{t}^{2}}double f(double t) {
double r45921 = 1.0;
double r45922 = t;
double r45923 = 2e-16;
double r45924 = r45922 * r45923;
double r45925 = r45921 + r45924;
double r45926 = r45925 * r45925;
double r45927 = -1.0;
double r45928 = 2.0;
double r45929 = r45928 * r45924;
double r45930 = r45927 - r45929;
double r45931 = r45926 + r45930;
return r45931;
}
double f(double t) {
double r45932 = 3.9999999999999997e-32;
double r45933 = t;
double r45934 = fabs(r45933);
double r45935 = r45932 * r45934;
double r45936 = 2.0;
double r45937 = pow(r45933, r45936);
double r45938 = sqrt(r45937);
double r45939 = r45935 * r45938;
return r45939;
}




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-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019209
(FPCore (t)
:name "fma_test1"
:precision binary64
:pre (<= 0.900000000000000022 t 1.1000000000000001)
: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)))))