\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 {t}^{\left(\frac{2}{2}\right)}double f(double t) {
double r123964 = 1.0;
double r123965 = t;
double r123966 = 2e-16;
double r123967 = r123965 * r123966;
double r123968 = r123964 + r123967;
double r123969 = r123968 * r123968;
double r123970 = -1.0;
double r123971 = 2.0;
double r123972 = r123971 * r123967;
double r123973 = r123970 - r123972;
double r123974 = r123969 + r123973;
return r123974;
}
double f(double t) {
double r123975 = t;
double r123976 = 3.9999999999999997e-32;
double r123977 = r123975 * r123976;
double r123978 = 2.0;
double r123979 = r123978 / r123978;
double r123980 = pow(r123975, r123979);
double r123981 = r123977 * r123980;
return r123981;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Simplified50.6
Taylor expanded around 0 0.3
rmApplied sqr-pow0.3
Applied associate-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020045 +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)))))