\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -4.61934049756080625 \cdot 10^{-65} \lor \neg \left(z \le 9.8505012757387843 \cdot 10^{-137}\right):\\
\;\;\;\;x \cdot \frac{y + z}{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 <= -4.619340497560806e-65) || !(z <= 9.850501275738784e-137))) {
VAR = ((double) (x * ((double) (((double) (y + z)) / 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 | 13.1 |
|---|---|
| Target | 3.0 |
| Herbie | 2.9 |
if z < -4.61934049756080625e-65 or 9.8505012757387843e-137 < z Initial program 14.5
rmApplied *-un-lft-identity14.5
Applied times-frac0.8
Simplified0.8
if -4.61934049756080625e-65 < z < 9.8505012757387843e-137Initial program 9.0
rmApplied div-inv9.1
Final simplification2.9
herbie shell --seed 2020162
(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))