\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} = -inf.0:\\
\;\;\;\;x - x \cdot \frac{z}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le -3.685233061790574 \cdot 10^{-275}:\\
\;\;\;\;x - \left(x \cdot z\right) \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \left(x \cdot \frac{z}{\sqrt[3]{y} \cdot \sqrt[3]{y}}\right) \cdot \frac{1}{\sqrt[3]{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)) {
VAR = ((double) (x - ((double) (x * ((double) (z / y))))));
} else {
double VAR_1;
if ((((double) (((double) (x * ((double) (y - z)))) / y)) <= -3.685233061790574e-275)) {
VAR_1 = ((double) (x - ((double) (((double) (x * z)) * ((double) (1.0 / y))))));
} else {
VAR_1 = ((double) (x - ((double) (((double) (x * ((double) (z / ((double) (((double) cbrt(y)) * ((double) cbrt(y)))))))) * ((double) (1.0 / ((double) cbrt(y))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 3.1 |
| Herbie | 1.7 |
if (/ (* x (- y z)) y) < -inf.0Initial program 64.0
Simplified0.1
if -inf.0 < (/ (* x (- y z)) y) < -3.685233061790574e-275Initial program 0.4
Simplified4.3
rmApplied div-inv4.4
Applied associate-*r*0.3
if -3.685233061790574e-275 < (/ (* x (- y z)) y) Initial program 14.1
Simplified2.9
rmApplied div-inv3.0
Applied associate-*r*5.3
rmApplied add-cube-cbrt5.6
Applied *-un-lft-identity5.6
Applied times-frac5.6
Applied associate-*r*5.6
Simplified2.9
Final simplification1.7
herbie shell --seed 2020179
(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))