\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 r97815 = 1.0;
double r97816 = t;
double r97817 = 2e-16;
double r97818 = r97816 * r97817;
double r97819 = r97815 + r97818;
double r97820 = r97819 * r97819;
double r97821 = -1.0;
double r97822 = 2.0;
double r97823 = r97822 * r97818;
double r97824 = r97821 - r97823;
double r97825 = r97820 + r97824;
return r97825;
}
double f(double t) {
double r97826 = 3.9999999999999997e-32;
double r97827 = sqrt(r97826);
double r97828 = t;
double r97829 = 2.0;
double r97830 = pow(r97828, r97829);
double r97831 = r97827 * r97830;
double r97832 = r97827 * r97831;
return r97832;
}




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