\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.5447905988096068 \cdot 10^{-136}:\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\mathbf{elif}\;z \le 1.5164738101784048 \cdot 10^{-21}:\\
\;\;\;\;\left(x \cdot \left(y + z\right)\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\end{array}double f(double x, double y, double z) {
double r450636 = x;
double r450637 = y;
double r450638 = z;
double r450639 = r450637 + r450638;
double r450640 = r450636 * r450639;
double r450641 = r450640 / r450638;
return r450641;
}
double f(double x, double y, double z) {
double r450642 = z;
double r450643 = -1.5447905988096068e-136;
bool r450644 = r450642 <= r450643;
double r450645 = x;
double r450646 = y;
double r450647 = r450646 + r450642;
double r450648 = r450642 / r450647;
double r450649 = r450645 / r450648;
double r450650 = 1.5164738101784048e-21;
bool r450651 = r450642 <= r450650;
double r450652 = r450645 * r450647;
double r450653 = 1.0;
double r450654 = r450653 / r450642;
double r450655 = r450652 * r450654;
double r450656 = r450647 / r450642;
double r450657 = r450645 * r450656;
double r450658 = r450651 ? r450655 : r450657;
double r450659 = r450644 ? r450649 : r450658;
return r450659;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.0 |
| Herbie | 2.9 |
if z < -1.5447905988096068e-136Initial program 13.1
rmApplied associate-/l*0.7
if -1.5447905988096068e-136 < z < 1.5164738101784048e-21Initial program 8.3
rmApplied div-inv8.4
if 1.5164738101784048e-21 < z Initial program 15.6
rmApplied *-un-lft-identity15.6
Applied times-frac0.1
Simplified0.1
Final simplification2.9
herbie shell --seed 2020043
(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))