static int getBitsPerItemForFpRate ( double fpProb , double loadFactor ) { /* * equation from Cuckoo Filter: Practically Better Than Bloom Bin Fan, * David G. Andersen, Michael Kaminsky , Michael D. Mitzenmacher */ return DoubleMath . roundToInt ( DoubleMath . log2 ( ( 1 / fpProb ) + 3 ) / loadFactor , RoundingMode . UP ) ; }
Calculates how many bits are needed to reach a given false positive rate .