\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \leq -1.2799990873646843 \cdot 10^{-221} \lor \neg \left(y \leq 3.5017718189801225 \cdot 10^{-168}\right):\\
\;\;\;\;x - x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{z}{\sqrt[3]{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 (((y <= -1.2799990873646843e-221) || !(y <= 3.5017718189801225e-168))) {
VAR = ((double) (x - ((double) (x * (z / y)))));
} else {
VAR = ((double) (x - ((double) ((x / ((double) (((double) cbrt(y)) * ((double) cbrt(y))))) * (z / ((double) cbrt(y)))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 13.1 |
|---|---|
| Target | 3.3 |
| Herbie | 2.7 |
if y < -1.2799990873646843e-221 or 3.50177181898012248e-168 < y Initial program 13.2
Simplified1.6
if -1.2799990873646843e-221 < y < 3.50177181898012248e-168Initial program 12.3
Simplified12.2
rmApplied add-cube-cbrt12.9
Applied *-un-lft-identity12.9
Applied times-frac12.9
Applied associate-*r*9.3
Simplified9.3
Final simplification2.7
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))