\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \le -1.59894608005550967 \cdot 10^{49}:\\
\;\;\;\;\frac{x}{y} \cdot \left(y - z\right)\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le 1.73770528439198434 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le 3.4257421418327737 \cdot 10^{275}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (x * ((double) (y - z)))) / y));
}
double code(double x, double y, double z) {
double VAR;
if ((((double) (((double) (x * ((double) (y - z)))) / y)) <= -1.5989460800555097e+49)) {
VAR = ((double) (((double) (x / y)) * ((double) (y - z))));
} else {
double VAR_1;
if ((((double) (((double) (x * ((double) (y - z)))) / y)) <= 1.7377052843919843e-46)) {
VAR_1 = ((double) (x / ((double) (y / ((double) (y - z))))));
} else {
double VAR_2;
if ((((double) (((double) (x * ((double) (y - z)))) / y)) <= 3.4257421418327737e+275)) {
VAR_2 = ((double) (((double) (x * ((double) (y - z)))) / y));
} else {
VAR_2 = ((double) (x / ((double) (y / ((double) (y - z))))));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 13.0 |
|---|---|
| Target | 3.1 |
| Herbie | 2.0 |
if (/ (* x (- y z)) y) < -1.5989460800555097e+49Initial program 20.1
rmApplied associate-/l*5.7
rmApplied associate-/r/6.4
if -1.5989460800555097e+49 < (/ (* x (- y z)) y) < 1.7377052843919843e-46 or 3.4257421418327737e+275 < (/ (* x (- y z)) y) Initial program 15.1
rmApplied associate-/l*0.7
if 1.7377052843919843e-46 < (/ (* x (- y z)) y) < 3.4257421418327737e+275Initial program 0.3
Final simplification2.0
herbie shell --seed 2020123 +o rules:numerics
(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))