\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.551442779203872 \cdot 10^{-29}:\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\mathbf{elif}\;z \le 1.4526164130838052 \cdot 10^{-279}:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\end{array}double f(double x, double y, double z) {
double r451132 = x;
double r451133 = y;
double r451134 = z;
double r451135 = r451133 + r451134;
double r451136 = r451132 * r451135;
double r451137 = r451136 / r451134;
return r451137;
}
double f(double x, double y, double z) {
double r451138 = z;
double r451139 = -3.551442779203872e-29;
bool r451140 = r451138 <= r451139;
double r451141 = x;
double r451142 = y;
double r451143 = r451142 + r451138;
double r451144 = r451143 / r451138;
double r451145 = r451141 * r451144;
double r451146 = 1.4526164130838052e-279;
bool r451147 = r451138 <= r451146;
double r451148 = r451141 / r451138;
double r451149 = r451148 * r451143;
double r451150 = r451138 / r451143;
double r451151 = r451141 / r451150;
double r451152 = r451147 ? r451149 : r451151;
double r451153 = r451140 ? r451145 : r451152;
return r451153;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 3.0 |
| Herbie | 3.1 |
if z < -3.551442779203872e-29Initial program 16.9
rmApplied *-un-lft-identity16.9
Applied times-frac0.2
Simplified0.2
if -3.551442779203872e-29 < z < 1.4526164130838052e-279Initial program 8.0
rmApplied associate-/l*8.6
rmApplied associate-/r/8.9
if 1.4526164130838052e-279 < z Initial program 11.8
rmApplied associate-/l*2.5
Final simplification3.1
herbie shell --seed 2020018
(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))