\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(2 \cdot 10^{-16} \cdot \left(2 \cdot 10^{-16} \cdot t\right)\right) \cdot tdouble f(double t) {
double r1947040 = 1.0;
double r1947041 = t;
double r1947042 = 2e-16;
double r1947043 = r1947041 * r1947042;
double r1947044 = r1947040 + r1947043;
double r1947045 = r1947044 * r1947044;
double r1947046 = -1.0;
double r1947047 = 2.0;
double r1947048 = r1947047 * r1947043;
double r1947049 = r1947046 - r1947048;
double r1947050 = r1947045 + r1947049;
return r1947050;
}
double f(double t) {
double r1947051 = 2e-16;
double r1947052 = t;
double r1947053 = r1947051 * r1947052;
double r1947054 = r1947051 * r1947053;
double r1947055 = r1947054 * r1947052;
return r1947055;
}




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
Final simplification0.3
herbie shell --seed 2019142 +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)))))