\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -8.2634454007052858 \cdot 10^{-187} \lor \neg \left(z \le 2.04808374197606253 \cdot 10^{-113}\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 <= -8.263445400705286e-187) || !(z <= 2.0480837419760625e-113))) {
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.8 |
|---|---|
| Target | 3.1 |
| Herbie | 2.9 |
if z < -8.263445400705286e-187 or 2.0480837419760625e-113 < z Initial program 13.4
rmApplied associate-/l*1.1
if -8.263445400705286e-187 < z < 2.0480837419760625e-113Initial program 10.3
rmApplied div-inv10.3
Final simplification2.9
herbie shell --seed 2020126
(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))