\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -2.352586947984001 \cdot 10^{-127} \lor \neg \left(z \le -2.01859068287501424 \cdot 10^{-249}\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{1}{y + 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 <= -2.352586947984001e-127) || !(z <= -2.0185906828750142e-249))) {
VAR = ((double) (x / ((double) (z / ((double) (y + z))))));
} else {
VAR = ((double) (((double) (x / z)) / ((double) (1.0 / ((double) (y + z))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 3.0 |
| Herbie | 3.0 |
if z < -2.352586947984001e-127 or -2.0185906828750142e-249 < z Initial program 12.8
rmApplied associate-/l*2.5
if -2.352586947984001e-127 < z < -2.0185906828750142e-249Initial program 9.1
rmApplied associate-/l*9.2
rmApplied div-inv9.3
Applied associate-/r*8.5
Final simplification3.0
herbie shell --seed 2020140
(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))