x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -1.245947516265854964311200045000519905686 \cdot 10^{-233}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;\frac{y}{z} \le 6.872941476643587911784112841004328702772 \cdot 10^{-272}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double f(double x, double y, double z, double t) {
double r23678818 = x;
double r23678819 = y;
double r23678820 = z;
double r23678821 = r23678819 / r23678820;
double r23678822 = t;
double r23678823 = r23678821 * r23678822;
double r23678824 = r23678823 / r23678822;
double r23678825 = r23678818 * r23678824;
return r23678825;
}
double f(double x, double y, double z, double __attribute__((unused)) t) {
double r23678826 = y;
double r23678827 = z;
double r23678828 = r23678826 / r23678827;
double r23678829 = -1.245947516265855e-233;
bool r23678830 = r23678828 <= r23678829;
double r23678831 = x;
double r23678832 = r23678828 * r23678831;
double r23678833 = 6.872941476643588e-272;
bool r23678834 = r23678828 <= r23678833;
double r23678835 = r23678831 * r23678826;
double r23678836 = r23678835 / r23678827;
double r23678837 = r23678827 / r23678826;
double r23678838 = r23678831 / r23678837;
double r23678839 = r23678834 ? r23678836 : r23678838;
double r23678840 = r23678830 ? r23678832 : r23678839;
return r23678840;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.7 |
|---|---|
| Target | 1.4 |
| Herbie | 3.3 |
if (/ y z) < -1.245947516265855e-233Initial program 13.3
Simplified7.8
rmApplied *-un-lft-identity7.8
Applied times-frac4.3
Simplified4.3
if -1.245947516265855e-233 < (/ y z) < 6.872941476643588e-272Initial program 18.6
Simplified0.4
rmApplied add-cube-cbrt0.8
Applied times-frac3.1
rmApplied frac-times0.8
Simplified0.4
if 6.872941476643588e-272 < (/ y z) Initial program 14.0
Simplified8.0
rmApplied associate-/l*3.8
Final simplification3.3
herbie shell --seed 2019171 +o rules:numerics
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"
: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)))