x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{y}{z} = -inf.0:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{elif}\;\frac{y}{z} \le -2.8571398257620769 \cdot 10^{-249}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;\frac{y}{z} \le 0.0 \lor \neg \left(\frac{y}{z} \le 3.2488727725831697 \cdot 10^{222}\right):\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x * ((double) (((double) (((double) (y / z)) * t)) / t))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((double) (y / z)) <= -inf.0)) {
VAR = ((double) (((double) (y * x)) / z));
} else {
double VAR_1;
if ((((double) (y / z)) <= -2.857139825762077e-249)) {
VAR_1 = ((double) (x / ((double) (z / y))));
} else {
double VAR_2;
if (((((double) (y / z)) <= 0.0) || !(((double) (y / z)) <= 3.24887277258317e+222))) {
VAR_2 = ((double) (((double) (y * x)) / z));
} else {
VAR_2 = ((double) (((double) (y / z)) * x));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.8 |
|---|---|
| Target | 1.5 |
| Herbie | 0.4 |
if (/ y z) < -inf.0 or -2.8571398257620769e-249 < (/ y z) < 0.0 or 3.2488727725831697e222 < (/ y z) Initial program 28.4
Simplified23.6
rmApplied associate-*r/0.3
if -inf.0 < (/ y z) < -2.8571398257620769e-249Initial program 10.7
Simplified0.2
rmApplied associate-*r/8.3
rmApplied associate-/l*0.2
if 0.0 < (/ y z) < 3.2488727725831697e222Initial program 9.9
Simplified0.5
Final simplification0.4
herbie shell --seed 2020184
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"
:precision binary64
:herbie-target
(if (< (/ (* (/ y z) t) t) -1.20672205123045e+245) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) -5.907522236933906e-275) (* x (/ y z)) (if (< (/ (* (/ y z) t) t) 5.658954423153415e-65) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) 2.0087180502407133e+217) (* x (/ y z)) (/ (* y x) z)))))
(* x (/ (* (/ y z) t) t)))