\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 -6.61839896682325078 \cdot 10^{-230}\right):\\
\;\;\;\;x + x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(x \cdot y\right) \cdot \frac{1}{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)) <= -6.618398966823251e-230))) {
VAR = ((double) (x + ((double) (x * ((double) (y / z))))));
} else {
VAR = ((double) (x + ((double) (((double) (x * y)) * ((double) (1.0 / z))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.1 |
| Herbie | 1.9 |
if (/ (* x (+ y z)) z) < -inf.0 or -6.61839896682325078e-230 < (/ (* x (+ y z)) z) Initial program 19.1
Simplified2.8
if -inf.0 < (/ (* x (+ y z)) z) < -6.61839896682325078e-230Initial program 0.4
Simplified4.3
rmApplied div-inv4.3
Applied associate-*r*0.3
Final simplification1.9
herbie shell --seed 2020184
(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))