\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 r44123 = 1.0;
double r44124 = t;
double r44125 = 2e-16;
double r44126 = r44124 * r44125;
double r44127 = r44123 + r44126;
double r44128 = r44127 * r44127;
double r44129 = -1.0;
double r44130 = 2.0;
double r44131 = r44130 * r44126;
double r44132 = r44129 - r44131;
double r44133 = r44128 + r44132;
return r44133;
}
double f(double t) {
double r44134 = 3.9999999999999997e-32;
double r44135 = t;
double r44136 = fabs(r44135);
double r44137 = r44134 * r44136;
double r44138 = 2.0;
double r44139 = pow(r44135, r44138);
double r44140 = sqrt(r44139);
double r44141 = r44137 * r44140;
return r44141;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Taylor expanded around 0 0.4
rmApplied add-sqr-sqrt0.4
Applied associate-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019322
(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)))))