\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.4377386799486208 \cdot 10^{-43} \lor \neg \left(z \le -1.7237487380979473 \cdot 10^{-180}\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + z\right)\\
\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 <= -3.437738679948621e-43) || !(z <= -1.7237487380979473e-180))) {
VAR = ((double) (x / ((double) (z / ((double) (y + z))))));
} else {
VAR = ((double) (((double) (x / z)) * ((double) (y + z))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.1 |
|---|---|
| Target | 3.1 |
| Herbie | 3.0 |
if z < -3.4377386799486208e-43 or -1.7237487380979473e-180 < z Initial program 12.9
rmApplied associate-/l*2.7
if -3.4377386799486208e-43 < z < -1.7237487380979473e-180Initial program 5.7
rmApplied associate-/l*6.0
rmApplied associate-/r/5.1
Final simplification3.0
herbie shell --seed 2020161
(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))