\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -1483102598056.9634 \lor \neg \left(x \le 4.575777435395605 \cdot 10^{-20}\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 <= -1483102598056.9634) || !(x <= 4.575777435395605e-20))) {
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.4 |
|---|---|
| Target | 3.0 |
| Herbie | 1.4 |
if x < -1483102598056.9634 or 4.575777435395605e-20 < x Initial program 22.5
rmApplied associate-/l*0.1
if -1483102598056.9634 < x < 4.575777435395605e-20Initial program 4.6
Taylor expanded around 0 2.5
Final simplification1.4
herbie shell --seed 2020174
(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))