\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -6.78412653436190541 \cdot 10^{-254} \lor \neg \left(z \le 2.32036261093918049 \cdot 10^{-59}\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y + z\right)\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 (((z <= -6.7841265343619054e-254) || !(z <= 2.3203626109391805e-59))) {
VAR = ((double) (x / ((double) (z / ((double) (y + z))))));
} else {
VAR = ((double) (((double) (x * ((double) (y + z)))) * ((double) (1.0 / z))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 2.9 |
| Herbie | 2.9 |
if z < -6.78412653436190541e-254 or 2.32036261093918049e-59 < z Initial program 13.3
rmApplied associate-/l*1.5
if -6.78412653436190541e-254 < z < 2.32036261093918049e-59Initial program 8.8
rmApplied div-inv9.0
Final simplification2.9
herbie shell --seed 2020149
(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))