\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -8.3314135878818525418922407335108977686 \cdot 10^{-18}:\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\mathbf{elif}\;z \le 2.717641103527439173532310107215917032371 \cdot 10^{-184}:\\
\;\;\;\;\left(x \cdot \left(y + z\right)\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\end{array}double f(double x, double y, double z) {
double r301157 = x;
double r301158 = y;
double r301159 = z;
double r301160 = r301158 + r301159;
double r301161 = r301157 * r301160;
double r301162 = r301161 / r301159;
return r301162;
}
double f(double x, double y, double z) {
double r301163 = z;
double r301164 = -8.331413587881853e-18;
bool r301165 = r301163 <= r301164;
double r301166 = x;
double r301167 = y;
double r301168 = r301167 + r301163;
double r301169 = r301168 / r301163;
double r301170 = r301166 * r301169;
double r301171 = 2.717641103527439e-184;
bool r301172 = r301163 <= r301171;
double r301173 = r301166 * r301168;
double r301174 = 1.0;
double r301175 = r301174 / r301163;
double r301176 = r301173 * r301175;
double r301177 = r301163 / r301168;
double r301178 = r301166 / r301177;
double r301179 = r301172 ? r301176 : r301178;
double r301180 = r301165 ? r301170 : r301179;
return r301180;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.3 |
|---|---|
| Target | 3.2 |
| Herbie | 2.9 |
if z < -8.331413587881853e-18Initial program 16.2
rmApplied *-un-lft-identity16.2
Applied times-frac0.1
Simplified0.1
if -8.331413587881853e-18 < z < 2.717641103527439e-184Initial program 7.6
rmApplied *-un-lft-identity7.6
Applied times-frac9.7
Simplified9.7
rmApplied div-inv9.8
Applied associate-*r*7.8
if 2.717641103527439e-184 < z Initial program 12.7
rmApplied associate-/l*1.7
Final simplification2.9
herbie shell --seed 2019325
(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))