\left(1 + t \cdot 1.999999999999999958195573448069207123682 \cdot 10^{-16}\right) \cdot \left(1 + t \cdot 1.999999999999999958195573448069207123682 \cdot 10^{-16}\right) + \left(-1 - 2 \cdot \left(t \cdot 1.999999999999999958195573448069207123682 \cdot 10^{-16}\right)\right)\left(3.999999999999999676487027278085939408227 \cdot 10^{-32} \cdot \left|t\right|\right) \cdot \sqrt{{t}^{2}}double f(double t) {
double r64742 = 1.0;
double r64743 = t;
double r64744 = 2e-16;
double r64745 = r64743 * r64744;
double r64746 = r64742 + r64745;
double r64747 = r64746 * r64746;
double r64748 = -1.0;
double r64749 = 2.0;
double r64750 = r64749 * r64745;
double r64751 = r64748 - r64750;
double r64752 = r64747 + r64751;
return r64752;
}
double f(double t) {
double r64753 = 3.9999999999999997e-32;
double r64754 = t;
double r64755 = fabs(r64754);
double r64756 = r64753 * r64755;
double r64757 = 2.0;
double r64758 = pow(r64754, r64757);
double r64759 = sqrt(r64758);
double r64760 = r64756 * r64759;
return r64760;
}




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