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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.7 |
|---|---|
| Target | 2.8 |
| Herbie | 3.6 |
if z < -2.7390615932918903e-281Initial program 12.5
rmApplied *-un-lft-identity12.5
Applied times-frac2.6
Simplified2.6
Taylor expanded around 0 2.6
if -2.7390615932918903e-281 < z Initial program 12.9
Taylor expanded around 0 5.2
rmApplied *-commutative5.2
Applied associate-/l*4.5
Final simplification3.6
herbie shell --seed 2020113
(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))