You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/Tests.dfy
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,14 @@ module Tests {
31
31
{
32
32
var empiricalMean := empiricalSum / n asreal;
33
33
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 asreal;
35
+
if diff * diff >= threshold {
36
36
print "Test failed: ", description, "\n";
37
37
print "True mean: ", trueMean, "\n";
38
38
print "Empirical mean: ", empiricalMean, "\n";
39
39
print "Difference between empirical and true mean: ", diff, "\n";
40
40
print "squared difference: ", diff * diff, "\n";
41
-
print "sigma squared: ", trueVariance, "\n";
41
+
print "sigma squared: ", trueVariance/ n asreal, "\n";
42
42
}
43
43
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.";
0 commit comments