Helper function sigma as defined in * "New cardinality estimation algorithms for HyperLogLog sketches" * Otmar Ertl, arXiv:1702.01284 */
| 969 | * "New cardinality estimation algorithms for HyperLogLog sketches" |
| 970 | * Otmar Ertl, arXiv:1702.01284 */ |
| 971 | double hllSigma(double x) { |
| 972 | if (x == 1.) return INFINITY; |
| 973 | double zPrime; |
| 974 | double y = 1; |
| 975 | double z = x; |
| 976 | do { |
| 977 | x *= x; |
| 978 | zPrime = z; |
| 979 | z += x * y; |
| 980 | y += y; |
| 981 | } while(zPrime != z); |
| 982 | return z; |
| 983 | } |
| 984 | |
| 985 | /* Helper function tau as defined in |
| 986 | * "New cardinality estimation algorithms for HyperLogLog sketches" |