\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -5.08146638658676392 \cdot 10^{26}:\\
\;\;\;\;x + \frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{x \cdot y}{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 ((z <= -5.081466386586764e+26)) {
VAR = ((double) (x + ((double) (x / ((double) (z / y))))));
} else {
VAR = ((double) (x + ((double) (((double) (x * y)) / z))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.1 |
| Herbie | 3.3 |
if z < -5.08146638658676392e26Initial program 18.0
Simplified0.1
rmApplied associate-*r/6.3
rmApplied associate-/l*0.1
if -5.08146638658676392e26 < z Initial program 10.4
Simplified4.5
rmApplied associate-*r/4.5
Final simplification3.3
herbie shell --seed 2020185
(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))