\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.12733665982382516 \cdot 10^{-302} \lor \neg \left(x \le 1.768585661751164 \cdot 10^{49}\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\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 (((x <= -1.1273366598238252e-302) || !(x <= 1.768585661751164e+49))) {
VAR = ((double) (x / ((double) (z / ((double) (y + z))))));
} else {
VAR = ((double) (((double) (((double) (x * y)) / z)) + x));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.8 |
|---|---|
| Target | 2.8 |
| Herbie | 2.2 |
if x < -1.12733665982382516e-302 or 1.768585661751164e49 < x Initial program 16.5
rmApplied associate-/l*2.0
if -1.12733665982382516e-302 < x < 1.768585661751164e49Initial program 5.0
Taylor expanded around 0 2.6
Final simplification2.2
herbie shell --seed 2020163
(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))