\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y + z\right)}{z} \le -2.8024718099763744 \cdot 10^{284} \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le -2.72792898397245706 \cdot 10^{55} \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le 1.6295824888591354 \cdot 10^{-81} \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le 2.06201301805685587 \cdot 10^{265}\right)\right)\right):\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\
\end{array}double code(double x, double y, double z) {
return ((x * (y + z)) / z);
}
double code(double x, double y, double z) {
double temp;
if (((((x * (y + z)) / z) <= -2.8024718099763744e+284) || !((((x * (y + z)) / z) <= -2.727928983972457e+55) || !((((x * (y + z)) / z) <= 1.6295824888591354e-81) || !(((x * (y + z)) / z) <= 2.062013018056856e+265))))) {
temp = (x * ((y + z) / z));
} else {
temp = ((x * (y + z)) / z);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 3.2 |
| Herbie | 0.7 |
if (/ (* x (+ y z)) z) < -2.8024718099763744e+284 or -2.727928983972457e+55 < (/ (* x (+ y z)) z) < 1.6295824888591354e-81 or 2.062013018056856e+265 < (/ (* x (+ y z)) z) Initial program 21.3
rmApplied *-un-lft-identity21.3
Applied times-frac1.0
Simplified1.0
if -2.8024718099763744e+284 < (/ (* x (+ y z)) z) < -2.727928983972457e+55 or 1.6295824888591354e-81 < (/ (* x (+ y z)) z) < 2.062013018056856e+265Initial program 0.3
Final simplification0.7
herbie shell --seed 2020060
(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))