\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \le -9.8715650386691714 \cdot 10^{295}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{y}\right)\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le -4.0721490506970673 \cdot 10^{86}:\\
\;\;\;\;\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) (x * ((double) (y - z)))) / y);
}
double code(double x, double y, double z) {
double VAR;
if (((((double) (x * ((double) (y - z)))) / y) <= -9.871565038669171e+295)) {
VAR = ((double) (x * ((double) (1.0 - (z / y)))));
} else {
double VAR_1;
if (((((double) (x * ((double) (y - z)))) / y) <= -4.0721490506970673e+86)) {
VAR_1 = (((double) (x * ((double) (y - z)))) / y);
} else {
VAR_1 = (x / (y / ((double) (y - z))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.8 |
|---|---|
| Target | 3.1 |
| Herbie | 1.9 |
if (/ (* x (- y z)) y) < -9.8715650386691714e295Initial program 59.7
rmApplied *-un-lft-identity59.7
Applied times-frac0.9
Simplified0.9
Simplified0.9
if -9.8715650386691714e295 < (/ (* x (- y z)) y) < -4.0721490506970673e86Initial program 0.2
if -4.0721490506970673e86 < (/ (* x (- y z)) y) Initial program 10.2
rmApplied associate-/l*2.2
Final simplification1.9
herbie shell --seed 2020182
(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))