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