pub const fn linear_counting_threshold(precision: usize) -> f32
Expand description

Returns an empirically determined threshold to decide on the use of linear counting.

Arguments

  • precision: The precision of the HyperLogLog algorithm.

References

This data is made available by the authors of the paper in this Google Docs document.

Examples


assert_eq!(linear_counting_threshold(4), 10.0);
assert_eq!(linear_counting_threshold(5), 20.0);
assert_eq!(linear_counting_threshold(6), 40.0);
assert_eq!(linear_counting_threshold(7), 80.0);