\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y + z\right)}{z} \le 1.69309411293973363 \cdot 10^{-270}:\\
\;\;\;\;x + \frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{y}{\sqrt[3]{z}}\\
\mathbf{elif}\;\frac{x \cdot \left(y + z\right)}{z} \le 1.82587901953215762 \cdot 10^{299}:\\
\;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \frac{y}{z}\\
\end{array}double code(double x, double y, double z) {
return (((double) (x * ((double) (y + z)))) / z);
}
double code(double x, double y, double z) {
double VAR;
if (((((double) (x * ((double) (y + z)))) / z) <= 1.6930941129397336e-270)) {
VAR = ((double) (x + ((double) ((x / ((double) (((double) cbrt(z)) * ((double) cbrt(z))))) * (y / ((double) cbrt(z)))))));
} else {
double VAR_1;
if (((((double) (x * ((double) (y + z)))) / z) <= 1.8258790195321576e+299)) {
VAR_1 = (((double) (x * ((double) (y + z)))) / z);
} else {
VAR_1 = ((double) (x + ((double) (x * (y / z)))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 13.1 |
|---|---|
| Target | 3.3 |
| Herbie | 2.2 |
if (/ (* x (+ y z)) z) < 1.69309411293973363e-270Initial program 14.6
Simplified3.2
rmApplied add-cube-cbrt3.6
Applied *-un-lft-identity3.6
Applied times-frac3.6
Applied associate-*r*3.6
Simplified3.6
if 1.69309411293973363e-270 < (/ (* x (+ y z)) z) < 1.82587901953215762e299Initial program 0.4
if 1.82587901953215762e299 < (/ (* x (+ y z)) z) Initial program 60.6
Simplified0.8
Final simplification2.2
herbie shell --seed 2020182
(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))