\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(t \cdot 3.9999999999999997 \cdot 10^{-32}\right) \cdot tdouble f(double t) {
double r74158 = 1.0;
double r74159 = t;
double r74160 = 2e-16;
double r74161 = r74159 * r74160;
double r74162 = r74158 + r74161;
double r74163 = r74162 * r74162;
double r74164 = -1.0;
double r74165 = 2.0;
double r74166 = r74165 * r74161;
double r74167 = r74164 - r74166;
double r74168 = r74163 + r74167;
return r74168;
}
double f(double t) {
double r74169 = t;
double r74170 = 3.9999999999999997e-32;
double r74171 = r74169 * r74170;
double r74172 = r74171 * r74169;
return r74172;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Simplified57.6
Taylor expanded around 0 0.4
rmApplied unpow20.4
Applied associate-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020065 +o rules:numerics
(FPCore (t)
:name "fma_test1"
:precision binary64
: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)))))