\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 r491390 = x;
double r491391 = y;
double r491392 = z;
double r491393 = r491391 + r491392;
double r491394 = r491390 * r491393;
double r491395 = r491394 / r491392;
return r491395;
}
double f(double x, double y, double z) {
double r491396 = z;
double r491397 = -4.138619732631135e-196;
bool r491398 = r491396 <= r491397;
double r491399 = 8.41080899877055e-53;
bool r491400 = r491396 <= r491399;
double r491401 = !r491400;
bool r491402 = r491398 || r491401;
double r491403 = x;
double r491404 = y;
double r491405 = r491404 + r491396;
double r491406 = r491396 / r491405;
double r491407 = r491403 / r491406;
double r491408 = r491403 * r491404;
double r491409 = r491408 / r491396;
double r491410 = r491409 + r491403;
double r491411 = r491402 ? r491407 : r491410;
return r491411;
}




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