Helper function sigma as defined in * "New cardinality estimation algorithms for HyperLogLog sketches" * Otmar Ertl, arXiv:1702.01284 */
| 977 | * "New cardinality estimation algorithms for HyperLogLog sketches" |
| 978 | * Otmar Ertl, arXiv:1702.01284 */ |
| 979 | double 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" |