\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 r63389 = 1.0;
double r63390 = t;
double r63391 = 2e-16;
double r63392 = r63390 * r63391;
double r63393 = r63389 + r63392;
double r63394 = r63393 * r63393;
double r63395 = -1.0;
double r63396 = 2.0;
double r63397 = r63396 * r63392;
double r63398 = r63395 - r63397;
double r63399 = r63394 + r63398;
return r63399;
}
double f(double t) {
double r63400 = 3.9999999999999997e-32;
double r63401 = t;
double r63402 = fabs(r63401);
double r63403 = r63400 * r63402;
double r63404 = 2.0;
double r63405 = pow(r63401, r63404);
double r63406 = sqrt(r63405);
double r63407 = r63403 * r63406;
return r63407;
}




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