\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} = -inf.0 \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \le -4.44296295761780195 \cdot 10^{51}\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)) <= -inf.0) || !(((double) (((double) (x * ((double) (y - z)))) / y)) <= -4.442962957617802e+51))) {
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.6 |
|---|---|
| Target | 2.9 |
| Herbie | 1.8 |
if (/ (* x (- y z)) y) < -inf.0 or -4.44296295761780195e51 < (/ (* x (- y z)) y) Initial program 15.2
rmApplied *-un-lft-identity15.2
Applied times-frac2.1
Simplified2.1
if -inf.0 < (/ (* x (- y z)) y) < -4.44296295761780195e51Initial program 0.2
Final simplification1.8
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))