\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} = -\infty:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le -1.1371960954834437 \cdot 10^{-94}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le 1.89027997349105774 \cdot 10^{27}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le 5.7188809436523363 \cdot 10^{295}:\\
\;\;\;\;\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 ((x * (y - z)) / y);
}
double code(double x, double y, double z) {
double temp;
if ((((x * (y - z)) / y) <= -inf.0)) {
temp = (x / (y / (y - z)));
} else {
double temp_1;
if ((((x * (y - z)) / y) <= -1.1371960954834437e-94)) {
temp_1 = ((x * (y - z)) / y);
} else {
double temp_2;
if ((((x * (y - z)) / y) <= 1.8902799734910577e+27)) {
temp_2 = (x * ((y - z) / y));
} else {
double temp_3;
if ((((x * (y - z)) / y) <= 5.718880943652336e+295)) {
temp_3 = ((x * (y - z)) / y);
} else {
temp_3 = (x / (y / (y - z)));
}
temp_2 = temp_3;
}
temp_1 = temp_2;
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 3.0 |
| Herbie | 0.2 |
if (/ (* x (- y z)) y) < -inf.0 or 5.718880943652336e+295 < (/ (* x (- y z)) y) Initial program 61.9
rmApplied associate-/l*0.3
if -inf.0 < (/ (* x (- y z)) y) < -1.1371960954834437e-94 or 1.8902799734910577e+27 < (/ (* x (- y z)) y) < 5.718880943652336e+295Initial program 0.2
if -1.1371960954834437e-94 < (/ (* x (- y z)) y) < 1.8902799734910577e+27Initial program 7.3
rmApplied *-un-lft-identity7.3
Applied times-frac0.1
Simplified0.1
Final simplification0.2
herbie shell --seed 2020056 +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))