\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 -1.2616248203952432 \cdot 10^{-95}\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)) <= -1.2616248203952432e-95))) {
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.4 |
|---|---|
| Target | 2.8 |
| Herbie | 1.7 |
if (/ (* x (+ y z)) z) < -inf.0 or -1.2616248203952432e-95 < (/ (* x (+ y z)) z) Initial program 17.4
rmApplied *-un-lft-identity17.4
Applied times-frac2.2
Simplified2.2
if -inf.0 < (/ (* x (+ y z)) z) < -1.2616248203952432e-95Initial program 0.3
Final simplification1.7
herbie shell --seed 2020162
(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))