\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)\left(\left(t \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right) \cdot t\right) \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}double f(double t) {
double r16180829 = 1.0;
double r16180830 = t;
double r16180831 = 2e-16;
double r16180832 = r16180830 * r16180831;
double r16180833 = r16180829 + r16180832;
double r16180834 = r16180833 * r16180833;
double r16180835 = -1.0;
double r16180836 = 2.0;
double r16180837 = r16180836 * r16180832;
double r16180838 = r16180835 - r16180837;
double r16180839 = r16180834 + r16180838;
return r16180839;
}
double f(double t) {
double r16180840 = t;
double r16180841 = 3.9999999999999997e-32;
double r16180842 = sqrt(r16180841);
double r16180843 = r16180840 * r16180842;
double r16180844 = r16180843 * r16180840;
double r16180845 = r16180844 * r16180842;
return r16180845;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Simplified61.8
Taylor expanded around 0 0.4
Simplified0.4
rmApplied add-sqr-sqrt0.4
Applied associate-*r*0.4
rmApplied associate-*l*0.3
Final simplification0.3
herbie shell --seed 2019128
(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)))))