\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 r2660296 = 1.0;
double r2660297 = t;
double r2660298 = 2e-16;
double r2660299 = r2660297 * r2660298;
double r2660300 = r2660296 + r2660299;
double r2660301 = r2660300 * r2660300;
double r2660302 = -1.0;
double r2660303 = 2.0;
double r2660304 = r2660303 * r2660299;
double r2660305 = r2660302 - r2660304;
double r2660306 = r2660301 + r2660305;
return r2660306;
}
double f(double t) {
double r2660307 = 3.9999999999999997e-32;
double r2660308 = sqrt(r2660307);
double r2660309 = t;
double r2660310 = r2660309 * r2660309;
double r2660311 = r2660308 * r2660310;
double r2660312 = r2660308 * r2660311;
return r2660312;
}




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 0 0.3
Simplified0.3
rmApplied add-sqr-sqrt0.3
Applied associate-*r*0.4
Final simplification0.4
herbie shell --seed 2019149
(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)))))