\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(\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left(t \cdot t\right)\right)double f(double t) {
double r2061630 = 1.0;
double r2061631 = t;
double r2061632 = 2e-16;
double r2061633 = r2061631 * r2061632;
double r2061634 = r2061630 + r2061633;
double r2061635 = r2061634 * r2061634;
double r2061636 = -1.0;
double r2061637 = 2.0;
double r2061638 = r2061637 * r2061633;
double r2061639 = r2061636 - r2061638;
double r2061640 = r2061635 + r2061639;
return r2061640;
}
double f(double t) {
double r2061641 = 3.9999999999999997e-32;
double r2061642 = sqrt(r2061641);
double r2061643 = t;
double r2061644 = r2061643 * r2061643;
double r2061645 = r2061642 * r2061644;
double r2061646 = r2061642 * r2061645;
return r2061646;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.4 |
Initial program 61.8
Simplified0.4
rmApplied associate-*l*0.3
Taylor expanded around inf 0.3
Simplified0.3
rmApplied add-sqr-sqrt0.3
Applied associate-*r*0.4
Final simplification0.4
herbie shell --seed 2019135 +o rules:numerics
(FPCore (t)
:name "fma_test1"
: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)))))