\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;z \le -2.11290955006504583 \cdot 10^{-28}:\\
\;\;\;\;x - \frac{z}{\frac{y}{x}}\\
\mathbf{elif}\;z \le 1.1301515707540782 \cdot 10^{111}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;z \le 2.52593401718285492 \cdot 10^{184}:\\
\;\;\;\;\frac{1}{\frac{y}{x \cdot \left(y - z\right)}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z}{\frac{y}{x}}\\
\end{array}double code(double x, double y, double z) {
return ((x * (y - z)) / y);
}
double code(double x, double y, double z) {
double VAR;
if ((z <= -2.112909550065046e-28)) {
VAR = (x - (z / (y / x)));
} else {
double VAR_1;
if ((z <= 1.1301515707540782e+111)) {
VAR_1 = (x / (y / (y - z)));
} else {
double VAR_2;
if ((z <= 2.525934017182855e+184)) {
VAR_2 = (1.0 / (y / (x * (y - z))));
} else {
VAR_2 = (x - (z / (y / x)));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 2.8 |
| Herbie | 2.3 |
if z < -2.112909550065046e-28 or 2.525934017182855e+184 < z Initial program 11.6
rmApplied *-commutative11.6
Applied associate-/l*11.2
rmApplied div-sub11.2
Simplified5.0
if -2.112909550065046e-28 < z < 1.1301515707540782e+111Initial program 13.1
rmApplied associate-/l*0.4
if 1.1301515707540782e+111 < z < 2.525934017182855e+184Initial program 11.4
rmApplied clear-num11.5
Final simplification2.3
herbie shell --seed 2020078
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))