\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.800990442123997124517400333412962942968 \cdot 10^{-14} \lor \neg \left(z \le 8.110081971156096547419795603121779523406 \cdot 10^{77}\right):\\
\;\;\;\;x \cdot \frac{y}{z} + x\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r577742 = x;
double r577743 = y;
double r577744 = z;
double r577745 = r577743 + r577744;
double r577746 = r577742 * r577745;
double r577747 = r577746 / r577744;
return r577747;
}
double f(double x, double y, double z) {
double r577748 = z;
double r577749 = -1.800990442123997e-14;
bool r577750 = r577748 <= r577749;
double r577751 = 8.110081971156097e+77;
bool r577752 = r577748 <= r577751;
double r577753 = !r577752;
bool r577754 = r577750 || r577753;
double r577755 = x;
double r577756 = y;
double r577757 = r577756 / r577748;
double r577758 = r577755 * r577757;
double r577759 = r577758 + r577755;
double r577760 = r577755 * r577756;
double r577761 = 1.0;
double r577762 = r577761 / r577748;
double r577763 = r577760 * r577762;
double r577764 = r577763 + r577755;
double r577765 = r577754 ? r577759 : r577764;
return r577765;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 3.0 |
| Herbie | 1.7 |
if z < -1.800990442123997e-14 or 8.110081971156097e+77 < z Initial program 18.2
Taylor expanded around 0 5.8
rmApplied *-un-lft-identity5.8
Applied times-frac0.1
Simplified0.1
if -1.800990442123997e-14 < z < 8.110081971156097e+77Initial program 6.6
Taylor expanded around 0 3.4
rmApplied div-inv3.4
Final simplification1.7
herbie shell --seed 2019362
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))