\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -4.1386197326311352 \cdot 10^{-196} \lor \neg \left(z \le 8.41080899877055 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r533112 = x;
double r533113 = y;
double r533114 = z;
double r533115 = r533113 + r533114;
double r533116 = r533112 * r533115;
double r533117 = r533116 / r533114;
return r533117;
}
double f(double x, double y, double z) {
double r533118 = z;
double r533119 = -4.138619732631135e-196;
bool r533120 = r533118 <= r533119;
double r533121 = 8.41080899877055e-53;
bool r533122 = r533118 <= r533121;
double r533123 = !r533122;
bool r533124 = r533120 || r533123;
double r533125 = x;
double r533126 = y;
double r533127 = r533126 + r533118;
double r533128 = r533118 / r533127;
double r533129 = r533125 / r533128;
double r533130 = r533125 * r533126;
double r533131 = r533130 / r533118;
double r533132 = r533131 + r533125;
double r533133 = r533124 ? r533129 : r533132;
return r533133;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 2.9 |
| Herbie | 2.2 |
if z < -4.138619732631135e-196 or 8.41080899877055e-53 < z Initial program 13.6
rmApplied associate-/l*1.2
if -4.138619732631135e-196 < z < 8.41080899877055e-53Initial program 9.2
rmApplied *-un-lft-identity9.2
Applied times-frac9.4
Simplified9.4
Taylor expanded around 0 5.7
Final simplification2.2
herbie shell --seed 2020036
(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))