MCPcopy Create free account
hub / github.com/apache/datafusion / hll_tau

Function hll_tau

datafusion/functions-aggregate/src/hyperloglog.rs:188–206  ·  view source on GitHub ↗
(x: f64)

Source from the content-addressed store, hash-verified

186/// Otmar Ertl, arXiv:1702.01284
187#[inline]
188fn 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
208impl<T> AsRef<[u8]> for HyperLogLog<T>
209where

Callers 1

countMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…