\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y + z\right)}{z} = -inf.0:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + z\right)\\
\mathbf{elif}\;\frac{x \cdot \left(y + z\right)}{z} \le -7.49079041143360216 \cdot 10^{121}:\\
\;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\
\mathbf{elif}\;\frac{x \cdot \left(y + z\right)}{z} \le 3.7398528169995593 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\mathbf{elif}\;\frac{x \cdot \left(y + z\right)}{z} \le 1.7843898618341535 \cdot 10^{296}:\\
\;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (x * ((double) (y + z)))) / z));
}
double code(double x, double y, double z) {
double VAR;
if ((((double) (((double) (x * ((double) (y + z)))) / z)) <= -inf.0)) {
VAR = ((double) (((double) (x / z)) * ((double) (y + z))));
} else {
double VAR_1;
if ((((double) (((double) (x * ((double) (y + z)))) / z)) <= -7.490790411433602e+121)) {
VAR_1 = ((double) (((double) (x * ((double) (y + z)))) / z));
} else {
double VAR_2;
if ((((double) (((double) (x * ((double) (y + z)))) / z)) <= 3.7398528169995593e-25)) {
VAR_2 = ((double) (x * ((double) (((double) (y + z)) / z))));
} else {
double VAR_3;
if ((((double) (((double) (x * ((double) (y + z)))) / z)) <= 1.7843898618341535e+296)) {
VAR_3 = ((double) (((double) (x * ((double) (y + z)))) / z));
} else {
VAR_3 = ((double) (x * ((double) (((double) (y + z)) / z))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.7 |
|---|---|
| Target | 3.2 |
| Herbie | 0.6 |
if (/ (* x (+ y z)) z) < -inf.0Initial program 64.0
rmApplied associate-/l*0.1
rmApplied associate-/r/0.2
if -inf.0 < (/ (* x (+ y z)) z) < -7.490790411433602e+121 or 3.7398528169995593e-25 < (/ (* x (+ y z)) z) < 1.7843898618341535e+296Initial program 0.2
if -7.490790411433602e+121 < (/ (* x (+ y z)) z) < 3.7398528169995593e-25 or 1.7843898618341535e+296 < (/ (* x (+ y z)) z) Initial program 13.3
rmApplied *-un-lft-identity13.3
Applied times-frac0.9
Simplified0.9
Final simplification0.6
herbie shell --seed 2020130
(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))