Skip to content

Commit 4bb490d

Browse files
committed
fix tests
1 parent 38e583e commit 4bb490d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/Tests.dfy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ module Tests {
3131
{
3232
var empiricalMean := empiricalSum / n as real;
3333
var diff := RealArith.Abs(empiricalMean - trueMean);
34-
var threshold := 3.0 * 3.0 * trueVariance;
35-
if diff * diff > threshold {
34+
var threshold := 4.0 * 4.0 * trueVariance / n as real;
35+
if diff * diff >= threshold {
3636
print "Test failed: ", description, "\n";
3737
print "True mean: ", trueMean, "\n";
3838
print "Empirical mean: ", empiricalMean, "\n";
3939
print "Difference between empirical and true mean: ", diff, "\n";
4040
print "squared difference: ", diff * diff, "\n";
41-
print "sigma squared: ", trueVariance, "\n";
41+
print "sigma squared: ", trueVariance / n as real, "\n";
4242
}
4343
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.";
4444
}

0 commit comments

Comments
 (0)