Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-aws committed Mar 20, 2024
1 parent 38e583e commit 4bb490d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/Tests.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ module Tests {
{
var empiricalMean := empiricalSum / n as real;
var diff := RealArith.Abs(empiricalMean - trueMean);
var threshold := 3.0 * 3.0 * trueVariance;
if diff * diff > threshold {
var threshold := 4.0 * 4.0 * trueVariance / n as real;
if diff * diff >= threshold {
print "Test failed: ", description, "\n";
print "True mean: ", trueMean, "\n";
print "Empirical mean: ", empiricalMean, "\n";
print "Difference between empirical and true mean: ", diff, "\n";
print "squared difference: ", diff * diff, "\n";
print "sigma squared: ", trueVariance, "\n";
print "sigma squared: ", trueVariance / n as real, "\n";
}
expect diff * diff <= threshold, "Empirical mean should be within 3 sigma of true mean. This individual test may fail with probability of about 6.3e-5.";
}
Expand Down

0 comments on commit 4bb490d

Please sign in to comment.