dialtr / libcount

C/C++ Implementation of the HyperLogLog++ cardinality estimation algorithm.
Apache License 2.0
26 stars 10 forks source link

EMP_alpha() should use number of registers and not precision value in calculation. #13

Closed dialtr closed 8 years ago

dialtr commented 8 years ago

Per the original paper, the alpha calculation:

αm := 0.7213/(1 + 1.079/m) for m ≥ 128

Should use number of registers (m) in the denominator, not the precision value. (The number of registers is 2 raised to the p.) The erroneous code used p instead of 1 << p.