\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} = -\infty:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le -5.74240735694960229 \cdot 10^{-106}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le 1.0101904628573289 \cdot 10^{139}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le 3.14880917404541375 \cdot 10^{307}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(y - z\right)\\
\end{array}double f(double x, double y, double z) {
double r823919 = x;
double r823920 = y;
double r823921 = z;
double r823922 = r823920 - r823921;
double r823923 = r823919 * r823922;
double r823924 = r823923 / r823920;
return r823924;
}
double f(double x, double y, double z) {
double r823925 = x;
double r823926 = y;
double r823927 = z;
double r823928 = r823926 - r823927;
double r823929 = r823925 * r823928;
double r823930 = r823929 / r823926;
double r823931 = -inf.0;
bool r823932 = r823930 <= r823931;
double r823933 = r823926 / r823928;
double r823934 = r823925 / r823933;
double r823935 = -5.742407356949602e-106;
bool r823936 = r823930 <= r823935;
double r823937 = 1.0101904628573289e+139;
bool r823938 = r823930 <= r823937;
double r823939 = 3.1488091740454137e+307;
bool r823940 = r823930 <= r823939;
double r823941 = r823925 / r823926;
double r823942 = r823941 * r823928;
double r823943 = r823940 ? r823930 : r823942;
double r823944 = r823938 ? r823934 : r823943;
double r823945 = r823936 ? r823930 : r823944;
double r823946 = r823932 ? r823934 : r823945;
return r823946;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.7 |
|---|---|
| Target | 3.4 |
| Herbie | 0.4 |
if (/ (* x (- y z)) y) < -inf.0 or -5.742407356949602e-106 < (/ (* x (- y z)) y) < 1.0101904628573289e+139Initial program 14.1
rmApplied associate-/l*0.6
if -inf.0 < (/ (* x (- y z)) y) < -5.742407356949602e-106 or 1.0101904628573289e+139 < (/ (* x (- y z)) y) < 3.1488091740454137e+307Initial program 0.3
if 3.1488091740454137e+307 < (/ (* x (- y z)) y) Initial program 63.7
rmApplied associate-/l*0.3
rmApplied associate-/r/0.2
Final simplification0.4
herbie shell --seed 2020060 +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))