\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y + z\right)}{z} = -inf.0 \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le -4405354812.0436611 \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le 1.554719158539295 \cdot 10^{41} \lor \neg \left(\frac{x \cdot \left(y + z\right)}{z} \le 4.81708140039638585 \cdot 10^{302}\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 ((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) || !((((double) (((double) (x * ((double) (y + z)))) / z)) <= -4405354812.043661) || !((((double) (((double) (x * ((double) (y + z)))) / z)) <= 1.554719158539295e+41) || !(((double) (((double) (x * ((double) (y + z)))) / z)) <= 4.817081400396386e+302))))) {
VAR = ((double) (x * ((double) (((double) (y + z)) / z))));
} else {
VAR = ((double) (((double) (x * ((double) (y + z)))) / z));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.2 |
|---|---|
| Target | 3.0 |
| Herbie | 0.2 |
if (/ (* x (+ y z)) z) < -inf.0 or -4405354812.043661 < (/ (* x (+ y z)) z) < 1.554719158539295e+41 or 4.817081400396386e+302 < (/ (* x (+ y z)) z) Initial program 19.6
rmApplied *-un-lft-identity19.6
Applied times-frac0.2
Simplified0.2
if -inf.0 < (/ (* x (+ y z)) z) < -4405354812.043661 or 1.554719158539295e+41 < (/ (* x (+ y z)) z) < 4.817081400396386e+302Initial program 0.2
Final simplification0.2
herbie shell --seed 2020148
(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))