x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{y}{z} = -inf.0 \lor \neg \left(\frac{y}{z} \le -8.1676513292150364 \cdot 10^{-166} \lor \neg \left(\frac{y}{z} \le 2.1792075432183381 \cdot 10^{-134}\right)\right):\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\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) || !((((double) (y / z)) <= -8.167651329215036e-166) || !(((double) (y / z)) <= 2.179207543218338e-134)))) {
VAR = ((double) (((double) (x * y)) / z));
} else {
VAR = ((double) (x * ((double) (y / z))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.5 |
|---|---|
| Target | 1.4 |
| Herbie | 2.2 |
if (/ y z) < -inf.0 or -8.167651329215036e-166 < (/ y z) < 2.179207543218338e-134Initial program 19.5
Simplified12.3
rmApplied associate-*r/1.4
if -inf.0 < (/ y z) < -8.167651329215036e-166 or 2.179207543218338e-134 < (/ y z) Initial program 11.6
Simplified2.8
Final simplification2.2
herbie shell --seed 2020124
(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)))