LogLog and HyperLogLog algorithms for counting of large cardinalities
Here it is the updated version of the algorithm based on the newer paper: var pow_2_32 = 0xFFFFFFFF + 1; function HyperLogLog(std_error) { function log2(x) { return Math.log(x) / Math.LN2; } function rank(hash, max) { var r = 1; while ((hash & 1) == 0 && r <= max) { ++r; hash >>>= 1; } … Read more