\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y + z\right)}{z} \le -6.2559509423991317 \cdot 10^{293} \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le -5.13924030840783878 \cdot 10^{59} \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le 1.4460188900352925 \cdot 10^{-198} \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le 2.35854138642000028 \cdot 10^{266}\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 VAR;
if (((((x * (y + z)) / z) <= -6.255950942399132e+293) || !((((x * (y + z)) / z) <= -5.139240308407839e+59) || !((((x * (y + z)) / z) <= 1.4460188900352925e-198) || !(((x * (y + z)) / z) <= 2.3585413864200003e+266))))) {
VAR = (x * ((y + z) / z));
} else {
VAR = ((x * (y + z)) / z);
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 2.7 |
| Herbie | 0.8 |
if (/ (* x (+ y z)) z) < -6.255950942399132e+293 or -5.139240308407839e+59 < (/ (* x (+ y z)) z) < 1.4460188900352925e-198 or 2.3585413864200003e+266 < (/ (* x (+ y z)) z) Initial program 23.8
rmApplied *-un-lft-identity23.8
Applied times-frac1.2
Simplified1.2
if -6.255950942399132e+293 < (/ (* x (+ y z)) z) < -5.139240308407839e+59 or 1.4460188900352925e-198 < (/ (* x (+ y z)) z) < 2.3585413864200003e+266Initial program 0.3
Final simplification0.8
herbie shell --seed 2020092
(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))