(x: f64)
| 186 | /// Otmar Ertl, arXiv:1702.01284 |
| 187 | #[inline] |
| 188 | fn hll_tau(x: f64) -> f64 { |
| 189 | if x == 0.0 || x == 1.0 { |
| 190 | 0.0 |
| 191 | } else { |
| 192 | let mut y = 1.0; |
| 193 | let mut z = 1.0 - x; |
| 194 | let mut x = x; |
| 195 | loop { |
| 196 | x = x.sqrt(); |
| 197 | let z_prime = z; |
| 198 | y *= 0.5; |
| 199 | z -= (1.0 - x).powi(2) * y; |
| 200 | if z_prime == z { |
| 201 | break; |
| 202 | } |
| 203 | } |
| 204 | z / 3.0 |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | impl<T> AsRef<[u8]> for HyperLogLog<T> |
| 209 | where |
no outgoing calls
no test coverage detected
searching dependent graphs…