\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \le -1.7699277626159894 \cdot 10^{303} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \le -8.94979025560652625 \cdot 10^{-52}\right):\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\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.7699277626159894e+303) || !(((double) (((double) (x * ((double) (y - z)))) / y)) <= -8.949790255606526e-52))) {
VAR = ((double) (x * ((double) (((double) (y - z)) / y))));
} else {
VAR = ((double) (((double) (x * ((double) (y - z)))) / y));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.9 |
|---|---|
| Target | 3.4 |
| Herbie | 2.0 |
if (/ (* x (- y z)) y) < -1.7699277626159894e303 or -8.94979025560652625e-52 < (/ (* x (- y z)) y) Initial program 16.9
rmApplied *-un-lft-identity16.9
Applied times-frac2.5
Simplified2.5
if -1.7699277626159894e303 < (/ (* x (- y z)) y) < -8.94979025560652625e-52Initial program 0.3
Final simplification2.0
herbie shell --seed 2020162
(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))