\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \le 2.337823436972603 \cdot 10^{-24} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \le 8.81099014379826153 \cdot 10^{295}\right):\\
\;\;\;\;\frac{1}{\frac{\frac{y}{y - z}}{x}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x \cdot z}{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)) <= 2.337823436972603e-24) || !(((double) (((double) (x * ((double) (y - z)))) / y)) <= 8.810990143798262e+295))) {
VAR = ((double) (1.0 / ((double) (((double) (y / ((double) (y - z)))) / x))));
} else {
VAR = ((double) (x - ((double) (((double) (x * z)) / y))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 3.0 |
| Herbie | 1.7 |
if (/ (* x (- y z)) y) < 2.337823436972603e-24 or 8.81099014379826153e295 < (/ (* x (- y z)) y) Initial program 16.4
rmApplied associate-/l*2.0
rmApplied clear-num2.2
if 2.337823436972603e-24 < (/ (* x (- y z)) y) < 8.81099014379826153e295Initial program 0.2
rmApplied associate-/l*5.5
Taylor expanded around 0 0.2
Final simplification1.7
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))