\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)3.9999999999999997 \cdot 10^{-32} \cdot \left(t \cdot t\right)double f(double t) {
double r2286068 = 1.0;
double r2286069 = t;
double r2286070 = 2e-16;
double r2286071 = r2286069 * r2286070;
double r2286072 = r2286068 + r2286071;
double r2286073 = r2286072 * r2286072;
double r2286074 = -1.0;
double r2286075 = 2.0;
double r2286076 = r2286075 * r2286071;
double r2286077 = r2286074 - r2286076;
double r2286078 = r2286073 + r2286077;
return r2286078;
}
double f(double t) {
double r2286079 = 3.9999999999999997e-32;
double r2286080 = t;
double r2286081 = r2286080 * r2286080;
double r2286082 = r2286079 * r2286081;
return r2286082;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Simplified0.4
rmApplied associate-*r*0.3
Taylor expanded around -inf 0.3
Taylor expanded around inf 0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019143 +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)))))