\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.9851351852842985 \cdot 10^{-54} \lor \neg \left(z \le 4.35859024137570151 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{x \cdot 1}{\frac{z}{y + z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y + z}{\frac{z}{x}}\\
\end{array}double code(double x, double y, double z) {
return ((x * (y + z)) / z);
}
double code(double x, double y, double z) {
double temp;
if (((z <= -1.9851351852842985e-54) || !(z <= 4.3585902413757015e-87))) {
temp = ((x * 1.0) / (z / (y + z)));
} else {
temp = ((y + z) / (z / x));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.1 |
| Herbie | 3.0 |
if z < -1.9851351852842985e-54 or 4.3585902413757015e-87 < z Initial program 14.0
rmApplied *-un-lft-identity14.0
Applied associate-*r*14.0
Applied associate-/l*0.3
if -1.9851351852842985e-54 < z < 4.3585902413757015e-87Initial program 8.8
rmApplied *-commutative8.8
Applied associate-/l*8.7
Final simplification3.0
herbie shell --seed 2020066 +o rules:numerics
(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))