\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 r43331 = 1.0;
double r43332 = t;
double r43333 = 2e-16;
double r43334 = r43332 * r43333;
double r43335 = r43331 + r43334;
double r43336 = r43335 * r43335;
double r43337 = -1.0;
double r43338 = 2.0;
double r43339 = r43338 * r43334;
double r43340 = r43337 - r43339;
double r43341 = r43336 + r43340;
return r43341;
}
double f(double t) {
double r43342 = 3.9999999999999997e-32;
double r43343 = t;
double r43344 = fabs(r43343);
double r43345 = r43342 * r43344;
double r43346 = 2.0;
double r43347 = pow(r43343, r43346);
double r43348 = sqrt(r43347);
double r43349 = r43345 * r43348;
return r43349;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Taylor expanded around 0 0.3
rmApplied add-sqr-sqrt0.3
Applied associate-*r*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019195
(FPCore (t)
:name "fma_test1"
:pre (<= 0.9 t 1.1)
:herbie-target
(fma (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16)) (- -1.0 (* 2.0 (* t 2e-16))))
(+ (* (+ 1.0 (* t 2e-16)) (+ 1.0 (* t 2e-16))) (- -1.0 (* 2.0 (* t 2e-16)))))