\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;y \le -4.63176067989680751 \cdot 10^{138}:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\end{array}double code(double x, double y, double z) {
return ((x * (y + z)) / z);
}
double code(double x, double y, double z) {
double VAR;
if ((y <= -4.6317606798968075e+138)) {
VAR = ((x / z) * (y + z));
} else {
VAR = (x / (z / (y + z)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.0 |
| Herbie | 3.0 |
if y < -4.6317606798968075e+138Initial program 12.0
rmApplied associate-/l*11.6
rmApplied associate-/r/11.5
if -4.6317606798968075e+138 < y Initial program 12.5
rmApplied associate-/l*2.1
Final simplification3.0
herbie shell --seed 2020078
(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))