\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(\left(t \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}\right) \cdot t\right) \cdot \sqrt{3.9999999999999997 \cdot 10^{-32}}double f(double t) {
double r13667771 = 1.0;
double r13667772 = t;
double r13667773 = 2e-16;
double r13667774 = r13667772 * r13667773;
double r13667775 = r13667771 + r13667774;
double r13667776 = r13667775 * r13667775;
double r13667777 = -1.0;
double r13667778 = 2.0;
double r13667779 = r13667778 * r13667774;
double r13667780 = r13667777 - r13667779;
double r13667781 = r13667776 + r13667780;
return r13667781;
}
double f(double t) {
double r13667782 = t;
double r13667783 = 3.9999999999999997e-32;
double r13667784 = sqrt(r13667783);
double r13667785 = r13667782 * r13667784;
double r13667786 = r13667785 * r13667782;
double r13667787 = r13667786 * r13667784;
return r13667787;
}




Bits error versus t
Results
| Original | 61.8 |
|---|---|
| Target | 50.6 |
| Herbie | 0.3 |
Initial program 61.8
Simplified50.3
Taylor expanded around 0 0.3
Simplified0.3
rmApplied add-sqr-sqrt0.3
Applied associate-*r*0.4
rmApplied associate-*l*0.3
Final simplification0.3
herbie shell --seed 2019125 +o rules:numerics
(FPCore (t)
:name "fma_test1"
: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)))))