\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;z \le -2.9947624096786527 \cdot 10^{201}:\\
\;\;\;\;\frac{1}{\frac{y}{x \cdot \left(y - z\right)}}\\
\mathbf{elif}\;z \le 3.5640512405086981 \cdot 10^{131}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(y - z\right)\\
\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 ((z <= -2.9947624096786527e+201)) {
VAR = ((double) (1.0 / ((double) (y / ((double) (x * ((double) (y - z))))))));
} else {
double VAR_1;
if ((z <= 3.564051240508698e+131)) {
VAR_1 = ((double) (x / ((double) (y / ((double) (y - z))))));
} else {
VAR_1 = ((double) (((double) (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.5 |
|---|---|
| Target | 3.2 |
| Herbie | 3.4 |
if z < -2.9947624096786527e201Initial program 16.9
rmApplied clear-num16.9
if -2.9947624096786527e201 < z < 3.5640512405086981e131Initial program 12.0
rmApplied associate-/l*1.3
if 3.5640512405086981e131 < z Initial program 13.9
rmApplied associate-/l*10.1
rmApplied associate-/r/11.5
Final simplification3.4
herbie shell --seed 2020168
(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))