From 4bb490d2d33bcfb676c2dd79348dabd7d7de20d8 Mon Sep 17 00:00:00 2001 From: stefan-aws Date: Wed, 20 Mar 2024 14:47:18 +0000 Subject: [PATCH] fix tests --- tests/Tests.dfy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Tests.dfy b/tests/Tests.dfy index cfd6a0b0..a8b42e70 100644 --- a/tests/Tests.dfy +++ b/tests/Tests.dfy @@ -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."; }