public static BloomFilter createOptimalFilter(int n,double falsePositiveProbability,int tweak,UpdateMode update){
  double ln2=Math.log(2.0);
  int mod=Math.max(1,(int)Math.min((-n * Math.log(falsePositiveProbability) / (ln2 * ln2)) / 8.0,MAX_FILTER_SIZE));
  int hashFunctions=Math.max(1,Math.min((int)(mod * 8.0 / n * ln2),MAX_HASH_FUNCS));
  return new BloomFilter(new byte[mod],hashFunctions,tweak,update);
}

public static BloomFilter createOptimalFilter ( int n , double falsePositiveProbability , int tweak , UpdateMode update ) { double ln2 = Math . log ( 2.0 ) ; int mod = Math . max ( 1 , ( int ) Math . min ( ( - n * Math . log ( falsePositiveProbability ) / ( ln2 * ln2 ) ) / 8.0 , MAX_FILTER_SIZE ) ) ; int hashFunctions = Math . max ( 1 , Math . min ( ( int ) ( mod * 8.0 / n * ln2 ) , MAX_HASH_FUNCS ) ) ; return new BloomFilter ( new byte [ mod ] , hashFunctions , tweak , update ) ; }
create a bloom filter of optimal size and hash functions for
