MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / hllSigma

Function hllSigma

src/hyperloglog.cpp:979–991  ·  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

977 * "New cardinality estimation algorithms for HyperLogLog sketches"
978 * Otmar Ertl, arXiv:1702.01284 */
979double hllSigma(double x) {
980 if (x == 1.) return INFINITY;
981 double zPrime;
982 double y = 1;
983 double z = x;
984 do {
985 x *= x;
986 zPrime = z;
987 z += x * y;
988 y += y;
989 } while(zPrime != z);
990 return z;
991}
992
993/* Helper function tau as defined in
994 * "New cardinality estimation algorithms for HyperLogLog sketches"

Callers 1

hllCountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected