\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \le -1.34319609672474334 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;y \le -5.3503239613714197 \cdot 10^{-267}:\\
\;\;\;\;x - \frac{x \cdot z}{y}\\
\mathbf{elif}\;y \le 3.7743507851606562 \cdot 10^{-214}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;y \le 4.317797565892611 \cdot 10^{-66}:\\
\;\;\;\;x - \frac{x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - 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 ((y <= -1.3431960967247433e-30)) {
VAR = ((double) (x * ((double) (((double) (y - z)) / y))));
} else {
double VAR_1;
if ((y <= -5.35032396137142e-267)) {
VAR_1 = ((double) (x - ((double) (((double) (x * z)) / y))));
} else {
double VAR_2;
if ((y <= 3.774350785160656e-214)) {
VAR_2 = ((double) (x / ((double) (y / ((double) (y - z))))));
} else {
double VAR_3;
if ((y <= 4.3177975658926113e-66)) {
VAR_3 = ((double) (x - ((double) (((double) (x * z)) / y))));
} else {
VAR_3 = ((double) (x * ((double) (((double) (y - z)) / 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.2 |
|---|---|
| Target | 3.4 |
| Herbie | 2.1 |
if y < -1.34319609672474334e-30 or 4.317797565892611e-66 < y Initial program 14.2
rmApplied *-un-lft-identity14.2
Applied times-frac0.3
Simplified0.3
if -1.34319609672474334e-30 < y < -5.3503239613714197e-267 or 3.7743507851606562e-214 < y < 4.317797565892611e-66Initial program 6.7
rmApplied associate-/l*7.2
Taylor expanded around 0 3.0
if -5.3503239613714197e-267 < y < 3.7743507851606562e-214Initial program 14.3
rmApplied associate-/l*14.4
Final simplification2.1
herbie shell --seed 2020161
(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))