[libcxx-commits] [libcxx] [libc++] Adjust some of the [rand.dist] critical values that are too strict (PR #88669)

Matt Stephanson via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 15 14:49:11 PDT 2024


MattStephanson wrote:

> Is in not better to have smaller values on this?

Not exactly. The statistics of a sample (mean, variance, etc.) are themselves random variables with some distribution. So except in degenerate cases, there's always some chance that a correct generator will give an out-of-tolerance result. There's also a tradeoff because if you want a smaller tolerance, you need more samples to justify rejecting the null hypothesis that the sample comes from the desired distribution. Even these larger tolerances that I'm proposing only approximate a 90% confidence interval, so if the underlying U[0,1) engine was truly random, you would still expect these tests to fail 10% of the time _even if the distribution generator was completely correct_.



https://github.com/llvm/llvm-project/pull/88669


More information about the libcxx-commits mailing list