\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)\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot \left(\sqrt{3.9999999999999997 \cdot 10^{-32}} \cdot {t}^{2}\right)double f(double t) {
double r61313 = 1.0;
double r61314 = t;
double r61315 = 2e-16;
double r61316 = r61314 * r61315;
double r61317 = r61313 + r61316;
double r61318 = r61317 * r61317;
double r61319 = -1.0;
double r61320 = 2.0;
double r61321 = r61320 * r61316;
double r61322 = r61319 - r61321;
double r61323 = r61318 + r61322;
return r61323;
}
double f(double t) {
double r61324 = 3.9999999999999997e-32;
double r61325 = sqrt(r61324);
double r61326 = t;
double r61327 = 2.0;
double r61328 = pow(r61326, r61327);
double r61329 = r61325 * r61328;
double r61330 = r61325 * r61329;
return r61330;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.4 |
Initial program 61.8
Simplified57.6
Taylor expanded around 0 0.4
rmApplied add-sqr-sqrt0.4
Applied associate-*l*0.4
Final simplification0.4
herbie shell --seed 2020089 +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)))))