MCPcopy Create free account
hub / github.com/apache/kvrocks / HllSigma

Function HllSigma

src/types/hyperloglog.cc:194–206  ·  view source on GitHub ↗

Helper function sigma as defined in * "New cardinality estimation algorithms for HyperLogLog sketches" * Otmar Ertl, arXiv:1702.01284 */

Source from the content-addressed store, hash-verified

192 * "New cardinality estimation algorithms for HyperLogLog sketches"
193 * Otmar Ertl, arXiv:1702.01284 */
194double HllSigma(double x) {
195 if (x == 1.) return INFINITY;
196 double z_prime = NAN;
197 double y = 1;
198 double z = x;
199 do {
200 x *= x;
201 z_prime = z;
202 z += x * y;
203 y += y;
204 } while (z_prime != z);
205 return z;
206}
207
208/* Helper function tau as defined in
209 * "New cardinality estimation algorithms for HyperLogLog sketches"

Callers 1

HllDenseEstimateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected