x \cdot \log \left(\frac{x}{y}\right)\begin{array}{l}
\mathbf{if}\;y \le 8.742822810316433167447774358180572573041 \cdot 10^{-311}:\\
\;\;\;\;x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right) + \log \left(\frac{\sqrt[3]{x}}{{\left(-1 \cdot y\right)}^{\frac{1}{3}} \cdot \sqrt[3]{-1}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{{\left(\frac{1}{y}\right)}^{\frac{-1}{3}}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right)\\
\end{array}double f(double x, double y) {
double r585891 = x;
double r585892 = y;
double r585893 = r585891 / r585892;
double r585894 = log(r585893);
double r585895 = r585891 * r585894;
return r585895;
}
double f(double x, double y) {
double r585896 = y;
double r585897 = 8.7428228103164e-311;
bool r585898 = r585896 <= r585897;
double r585899 = x;
double r585900 = 2.0;
double r585901 = cbrt(r585899);
double r585902 = cbrt(r585896);
double r585903 = r585901 / r585902;
double r585904 = log(r585903);
double r585905 = r585900 * r585904;
double r585906 = -1.0;
double r585907 = r585906 * r585896;
double r585908 = 0.3333333333333333;
double r585909 = pow(r585907, r585908);
double r585910 = cbrt(r585906);
double r585911 = r585909 * r585910;
double r585912 = r585901 / r585911;
double r585913 = log(r585912);
double r585914 = r585905 + r585913;
double r585915 = r585899 * r585914;
double r585916 = 1.0;
double r585917 = r585916 / r585896;
double r585918 = -0.3333333333333333;
double r585919 = pow(r585917, r585918);
double r585920 = r585901 / r585919;
double r585921 = log(r585920);
double r585922 = r585900 * r585921;
double r585923 = r585922 + r585904;
double r585924 = r585899 * r585923;
double r585925 = r585898 ? r585915 : r585924;
return r585925;
}




Bits error versus x




Bits error versus y
Results
| Original | 16.1 |
|---|---|
| Target | 8.4 |
| Herbie | 0.5 |
if y < 8.7428228103164e-311Initial program 15.7
rmApplied add-cube-cbrt15.7
Applied add-cube-cbrt15.7
Applied times-frac15.7
Applied log-prod3.9
Simplified0.4
Taylor expanded around -inf 0.5
if 8.7428228103164e-311 < y Initial program 16.4
rmApplied add-cube-cbrt16.4
Applied add-cube-cbrt16.4
Applied times-frac16.4
Applied log-prod4.5
Simplified0.4
Taylor expanded around inf 0.6
Final simplification0.5
herbie shell --seed 1978988140
(FPCore (x y)
:name "Data.HyperLogLog.Type:size from hyperloglog-0.3.4, B"
:precision binary64
:herbie-target
(if (< y 1.29731490526178e-303) (* x (log (/ x y))) (/ x (/ 1 (- (log x) (log y)))))
(* x (log (/ x y))))