File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -172,15 +172,20 @@ prop_calc_size_fpr_fpr proxy (FPR fpr) (NumEntries numEntries) =
172172-- | Compare @sizeForBits@ against @falsePositiveRate@ with some tolerance for deviations
173173prop_calc_size_fpr_bits :: BloomFilter bloom => Proxy bloom
174174 -> BitsPerEntry -> NumEntries -> Property
175- prop_calc_size_fpr_bits proxy (BitsPerEntry c ) (NumEntries numEntries) =
176- let policy = policyForBits proxy c
175+ prop_calc_size_fpr_bits proxy (BitsPerEntry bpe ) (NumEntries numEntries) =
176+ let policy = policyForBits proxy bpe
177177 bsize = sizeForPolicy proxy policy numEntries
178178 in falsePositiveRate (fromIntegral (B. sizeBits bsize))
179179 (fromIntegral numEntries)
180180 (fromIntegral (B. sizeHashes bsize))
181181 ~~~ policyFPR proxy policy
182182 where
183- (~~~) = withinTolerance 1e-6
183+ (~~~) = withinTolerance tolerance
184+ tolerance | bpe >= 18 = 1e-7
185+ | bpe >= 13 = 1e-6
186+ | bpe >= 8 = 1e-5
187+ | bpe >= 4 = 1e-4
188+ | otherwise = 1e-3
184189
185190-- reference implementations used for sanity checks
186191
You can’t perform that action at this time.
0 commit comments