\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 r85251 = 1.0;
double r85252 = t;
double r85253 = 2e-16;
double r85254 = r85252 * r85253;
double r85255 = r85251 + r85254;
double r85256 = r85255 * r85255;
double r85257 = -1.0;
double r85258 = 2.0;
double r85259 = r85258 * r85254;
double r85260 = r85257 - r85259;
double r85261 = r85256 + r85260;
return r85261;
}
double f(double t) {
double r85262 = 3.9999999999999997e-32;
double r85263 = t;
double r85264 = fabs(r85263);
double r85265 = r85262 * r85264;
double r85266 = 2.0;
double r85267 = pow(r85263, r85266);
double r85268 = sqrt(r85267);
double r85269 = r85265 * r85268;
return r85269;
}




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 2019353
(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)))))