\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(3.9999999999999997 \cdot 10^{-32} \cdot \left|t\right|\right) \cdot \sqrt{{t}^{2}}double f(double t) {
double r69541 = 1.0;
double r69542 = t;
double r69543 = 2e-16;
double r69544 = r69542 * r69543;
double r69545 = r69541 + r69544;
double r69546 = r69545 * r69545;
double r69547 = -1.0;
double r69548 = 2.0;
double r69549 = r69548 * r69544;
double r69550 = r69547 - r69549;
double r69551 = r69546 + r69550;
return r69551;
}
double f(double t) {
double r69552 = 3.9999999999999997e-32;
double r69553 = t;
double r69554 = fabs(r69553);
double r69555 = r69552 * r69554;
double r69556 = 2.0;
double r69557 = pow(r69553, r69556);
double r69558 = sqrt(r69557);
double r69559 = r69555 * r69558;
return r69559;
}




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 2020035 +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)))))