\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 t\right) \cdot tdouble f(double t) {
double r4216413 = 1.0;
double r4216414 = t;
double r4216415 = 2e-16;
double r4216416 = r4216414 * r4216415;
double r4216417 = r4216413 + r4216416;
double r4216418 = r4216417 * r4216417;
double r4216419 = -1.0;
double r4216420 = 2.0;
double r4216421 = r4216420 * r4216416;
double r4216422 = r4216419 - r4216421;
double r4216423 = r4216418 + r4216422;
return r4216423;
}
double f(double t) {
double r4216424 = 3.9999999999999997e-32;
double r4216425 = t;
double r4216426 = r4216424 * r4216425;
double r4216427 = r4216426 * r4216425;
return r4216427;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Simplified50.6
Taylor expanded around 0 0.3
Simplified0.3
rmApplied add-sqr-sqrt0.6
Taylor expanded around 0 0.4
Taylor expanded around 0 0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019170 +o rules:numerics
(FPCore (t)
:name "fma_test1"
:pre (<= 0.9 t 1.1)
:herbie-target
(fma (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16)) (- -1.0 (* 2.0 (* t 2e-16))))
(+ (* (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16))) (- -1.0 (* 2.0 (* t 2e-16)))))