\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.25214836899743172 \cdot 10^{-266}:\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\mathbf{elif}\;z \le 1.2662689376772197 \cdot 10^{-111}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + 1\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 <= -1.2521483689974317e-266)) {
VAR = ((double) (x / ((double) (z / ((double) (y + z))))));
} else {
double VAR_1;
if ((z <= 1.2662689376772197e-111)) {
VAR_1 = ((double) (((double) (((double) (x * y)) / z)) + x));
} else {
VAR_1 = ((double) (x * ((double) (((double) (y / z)) + 1.0))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 3.1 |
| Herbie | 2.4 |
if z < -1.25214836899743172e-266Initial program 13.1
rmApplied associate-/l*2.4
if -1.25214836899743172e-266 < z < 1.2662689376772197e-111Initial program 9.5
Taylor expanded around 0 6.3
if 1.2662689376772197e-111 < z Initial program 13.1
rmApplied *-un-lft-identity13.1
Applied times-frac0.9
Simplified0.9
Taylor expanded around 0 0.9
Final simplification2.4
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))