\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -3.55850091344555163 \cdot 10^{110} \lor \neg \left(x \le 25947.6304069558137\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{x \cdot y}{z}\\
\end{array}double code(double x, double y, double z) {
return (((double) (x * ((double) (y + z)))) / z);
}
double code(double x, double y, double z) {
double VAR;
if (((x <= -3.5585009134455516e+110) || !(x <= 25947.630406955814))) {
VAR = (x / (z / ((double) (y + z))));
} else {
VAR = ((double) (x + (((double) (x * y)) / z)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 13.1 |
|---|---|
| Target | 3.3 |
| Herbie | 1.9 |
if x < -3.55850091344555163e110 or 25947.6304069558137 < x Initial program 27.5
rmApplied associate-/l*0.1
if -3.55850091344555163e110 < x < 25947.6304069558137Initial program 5.7
Taylor expanded around 0 2.8
Final simplification1.9
herbie shell --seed 2020182
(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))