x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -1.42110258613913981 \cdot 10^{-87} \lor \neg \left(\frac{y}{z} \le 1.1014995100088346 \cdot 10^{-297} \lor \neg \left(\frac{y}{z} \le 1.84201517993839439 \cdot 10^{192}\right)\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}double code(double x, double y, double z, double t) {
return (x * (((y / z) * t) / t));
}
double code(double x, double y, double z, double t) {
double temp;
if ((((y / z) <= -1.4211025861391398e-87) || !(((y / z) <= 1.1014995100088346e-297) || !((y / z) <= 1.8420151799383944e+192)))) {
temp = (x * (y / z));
} else {
temp = ((x * y) / z);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.5 |
|---|---|
| Target | 1.6 |
| Herbie | 2.2 |
if (/ y z) < -1.4211025861391398e-87 or 1.1014995100088346e-297 < (/ y z) < 1.8420151799383944e+192Initial program 11.1
Simplified2.5
if -1.4211025861391398e-87 < (/ y z) < 1.1014995100088346e-297 or 1.8420151799383944e+192 < (/ y z) Initial program 20.6
Simplified12.1
rmApplied add-cube-cbrt12.6
Applied *-un-lft-identity12.6
Applied times-frac12.6
Applied associate-*r*3.6
Simplified3.6
rmApplied *-un-lft-identity3.6
Applied associate-*l*3.6
Simplified1.8
Final simplification2.2
herbie shell --seed 2020049 +o rules:numerics
(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)))