\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \le -7.618280645693821 \cdot 10^{-23}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;y \le 6.320240572056151 \cdot 10^{-185}:\\
\;\;\;\;\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 VAR;
if ((y <= -7.618280645693821e-23)) {
VAR = (x * ((y - z) / y));
} else {
double VAR_1;
if ((y <= 6.320240572056151e-185)) {
VAR_1 = ((x * (y - z)) / y);
} else {
VAR_1 = (x / (y / (y - z)));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 11.6 |
|---|---|
| Target | 3.1 |
| Herbie | 2.6 |
if y < -7.618280645693821e-23Initial program 15.2
rmApplied *-un-lft-identity15.2
Applied times-frac0.1
Simplified0.1
if -7.618280645693821e-23 < y < 6.320240572056151e-185Initial program 7.2
if 6.320240572056151e-185 < y Initial program 11.9
rmApplied associate-/l*1.4
Final simplification2.6
herbie shell --seed 2020105 +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))