FA-73009 / Probabilistic sketches / Member archive
HyperLogLog cardinality estimate: large-range correction threshold unreachable · case 04
Very large cardinalities are underestimated because hash collisions are never corrected.
Case contract
Input {regs} with 16, 32, 64 or 128 registers. alpha is 0.673, 0.697, 0.709 for m = 16, 32, 64 and 0.7213/(1 + 1.079/m) otherwise. Raw E = alpha m^2 / sum 2^-r. If E <= 2.5m and V (zero registers) > 0, use linear counting m ln(m/V); otherwise if E > 2^32/30 apply the large-range correction -2^32 ln(1 - E/2^32). Return [round(E), V].
Why this case matters
Distinct-count dashboards and query planners rely on the bias corrections of the HyperLogLog estimator at both small and large cardinalities.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| large range correction | [385401732, 0] | [403802870, 0] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗