\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \leq -\infty:\\
\;\;\;\;x - z \cdot \frac{x}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \leq -6.659376642994718 \cdot 10^{-98}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \leq -0:\\
\;\;\;\;x - {\left(\sqrt[3]{x}\right)}^{2} \cdot \left(\sqrt[3]{x} \cdot \frac{z}{y}\right)\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \leq 1.1993304859552876 \cdot 10^{+303}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{x}{y}\\
\end{array}double code(double x, double y, double z) {
return (((double) (x * ((double) (y - z)))) / y);
}
double code(double x, double y, double z) {
double VAR;
if (((((double) (x * ((double) (y - z)))) / y) <= ((double) -(((double) INFINITY))))) {
VAR = ((double) (x - ((double) (z * (x / y)))));
} else {
double VAR_1;
if (((((double) (x * ((double) (y - z)))) / y) <= -6.659376642994718e-98)) {
VAR_1 = (((double) (x * ((double) (y - z)))) / y);
} else {
double VAR_2;
if (((((double) (x * ((double) (y - z)))) / y) <= -0.0)) {
VAR_2 = ((double) (x - ((double) (((double) pow(((double) cbrt(x)), 2.0)) * ((double) (((double) cbrt(x)) * (z / y)))))));
} else {
double VAR_3;
if (((((double) (x * ((double) (y - z)))) / y) <= 1.1993304859552876e+303)) {
VAR_3 = (((double) (x * ((double) (y - z)))) / y);
} else {
VAR_3 = ((double) (x - ((double) (z * (x / y)))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.0 |
|---|---|
| Target | 3.1 |
| Herbie | 0.5 |
if (/ (* x (- y z)) y) < -inf.0 or 1.19933048595528755e303 < (/ (* x (- y z)) y) Initial program 62.4
Simplified0.4
rmApplied add-cube-cbrt0.6
Applied associate-*l*0.6
Simplified0.6
Taylor expanded around 0 18.7
Simplified0.8
if -inf.0 < (/ (* x (- y z)) y) < -6.65937664299471807e-98 or -0.0 < (/ (* x (- y z)) y) < 1.19933048595528755e303Initial program 0.4
if -6.65937664299471807e-98 < (/ (* x (- y z)) y) < -0.0Initial program 17.8
Simplified0.1
rmApplied add-cube-cbrt0.4
Applied associate-*l*0.4
Simplified0.4
rmApplied pow10.4
Applied pow10.4
Applied pow-prod-up0.4
Simplified0.4
Final simplification0.5
herbie shell --seed 2020196
(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))