\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \le -3.5302740687576495 \cdot 10^{307} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \le -1.6831734572194845 \cdot 10^{59} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \le 9.0428667222306372 \cdot 10^{60} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \le 7.4856792036076336 \cdot 10^{286}\right)\right)\right):\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{x \cdot \left(y - z\right)}}\\
\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 (((((x * (y - z)) / y) <= -3.5302740687576495e+307) || !((((x * (y - z)) / y) <= -1.6831734572194845e+59) || !((((x * (y - z)) / y) <= 9.042866722230637e+60) || !(((x * (y - z)) / y) <= 7.485679203607634e+286))))) {
VAR = (x / (y / (y - z)));
} else {
VAR = (1.0 / (y / (x * (y - z))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 11.8 |
|---|---|
| Target | 3.0 |
| Herbie | 0.4 |
if (/ (* x (- y z)) y) < -3.5302740687576495e+307 or -1.6831734572194845e+59 < (/ (* x (- y z)) y) < 9.042866722230637e+60 or 7.485679203607634e+286 < (/ (* x (- y z)) y) Initial program 17.5
rmApplied associate-/l*0.5
if -3.5302740687576495e+307 < (/ (* x (- y z)) y) < -1.6831734572194845e+59 or 9.042866722230637e+60 < (/ (* x (- y z)) y) < 7.485679203607634e+286Initial program 0.2
rmApplied clear-num0.3
Final simplification0.4
herbie shell --seed 2020079 +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))