\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 r84243 = 1.0;
double r84244 = t;
double r84245 = 2e-16;
double r84246 = r84244 * r84245;
double r84247 = r84243 + r84246;
double r84248 = r84247 * r84247;
double r84249 = -1.0;
double r84250 = 2.0;
double r84251 = r84250 * r84246;
double r84252 = r84249 - r84251;
double r84253 = r84248 + r84252;
return r84253;
}
double f(double t) {
double r84254 = 3.9999999999999997e-32;
double r84255 = sqrt(r84254);
double r84256 = t;
double r84257 = 2.0;
double r84258 = pow(r84256, r84257);
double r84259 = r84255 * r84258;
double r84260 = r84255 * r84259;
return r84260;
}




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-*l*0.3
Final simplification0.3
herbie shell --seed 2020056 +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)))))