\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)t \cdot \left(t \cdot 3.9999999999999997 \cdot 10^{-32}\right)double f(double t) {
double r73065 = 1.0;
double r73066 = t;
double r73067 = 2e-16;
double r73068 = r73066 * r73067;
double r73069 = r73065 + r73068;
double r73070 = r73069 * r73069;
double r73071 = -1.0;
double r73072 = 2.0;
double r73073 = r73072 * r73068;
double r73074 = r73071 - r73073;
double r73075 = r73070 + r73074;
return r73075;
}
double f(double t) {
double r73076 = t;
double r73077 = 3.9999999999999997e-32;
double r73078 = r73076 * r73077;
double r73079 = r73076 * r73078;
return r73079;
}




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.3
rmApplied sqr-pow0.3
Applied associate-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020049 +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)))))