/// <summary> /// Gets the number of indexing bits required to produce a given standard error /// </summary> /// <param name="stdError"> /// Standard error, which determines accuracy and memory consumption. For large cardinalities, the observed error is usually less than /// 3 * <paramref name="stdError" />. /// </param> /// <returns></returns> private static int GetAccuracyInBits(double stdError) { double sqrtm = 1.04 / stdError; var b = (int)Math.Ceiling(CardinalityEstimator.Log2(sqrtm * sqrtm)); return(b); }