x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \leq -3.563046468116238 \cdot 10^{+267}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \leq -1.1287556868815893 \cdot 10^{-194}:\\
\;\;\;\;\frac{\frac{y}{z} \cdot t}{t} \cdot x\\
\mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \leq 1.4821969375237 \cdot 10^{-323}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \leq 9.664313956054862 \cdot 10^{+112}:\\
\;\;\;\;\frac{\frac{y}{z} \cdot t}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x * (((double) ((y / z) * t)) / t)));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) ((y / z) * t)) / t) <= -3.563046468116238e+267)) {
VAR = (((double) (y * x)) / z);
} else {
double VAR_1;
if (((((double) ((y / z) * t)) / t) <= -1.1287556868815893e-194)) {
VAR_1 = ((double) ((((double) ((y / z) * t)) / t) * x));
} else {
double VAR_2;
if (((((double) ((y / z) * t)) / t) <= 1.4821969375237e-323)) {
VAR_2 = ((double) (y * (x / z)));
} else {
double VAR_3;
if (((((double) ((y / z) * t)) / t) <= 9.664313956054862e+112)) {
VAR_3 = ((double) ((((double) ((y / z) * t)) / t) * x));
} else {
VAR_3 = ((double) (((double) (y * x)) * (1.0 / z)));
}
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




Bits error versus t
Results
| Original | 14.6 |
|---|---|
| Target | 1.6 |
| Herbie | 1.6 |
if (/ (* (/ y z) t) t) < -3.5630464681162382e267Initial program 58.2
Simplified25.1
rmApplied associate-*r/3.4
if -3.5630464681162382e267 < (/ (* (/ y z) t) t) < -1.1287556868815893e-194 or 1.4822e-323 < (/ (* (/ y z) t) t) < 9.66431395605486189e112Initial program 0.8
if -1.1287556868815893e-194 < (/ (* (/ y z) t) t) < 1.4822e-323Initial program 23.5
Simplified9.5
rmApplied add-cube-cbrt9.8
Applied associate-*l*9.8
Simplified5.8
Taylor expanded around 0 1.6
Simplified1.6
if 9.66431395605486189e112 < (/ (* (/ y z) t) t) Initial program 32.2
Simplified13.3
rmApplied div-inv13.4
Applied associate-*r*3.7
Final simplification1.6
herbie shell --seed 2020199
(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)))