0.17.4 make check failure: t.grftest
Matthias Andree
matthias.andree at gmx.de
Tue Mar 23 01:52:48 CET 2004
On Mon, 22 Mar 2004, Matt Garretson wrote:
> Hiya. I built 0.17.4 from source on my Redhat 9 system and
> "make check" fails on the t.grftest test:
> $ diff outputs/grftest.out grftest.20040322/tests/grftest.out
> 9c9
> < 8 S 1.000000 S 0.00e+00
> ---
> > 8 S 1.000000 S 1.67e-15
>
> Could it be a rounding error of some sort? My GSL is gsl-1.1.1-5,
> if it matters. All previous builds of bogofilter passed this
> test however.
The code that calculates the cumulative distribution function of the
\chi-square-distribution differs between GSL 1.0...1.3 and GSL 1.4+. GSL
1.4+ has native code (gsl_cdf_chisq_Q), GSL 1.0...1.3 only have the PDF
(the density function, gsl_ran_chisq_pdf) that we integrate numerically
with a 15-point Gauß-Kronrod rule (gsl_integration_qag).
I can mask the error by increasing the number of points (corresponding
to intervals) to 41 (slighly slower but more accurate). Given that the
chi^2 function is smooth and has no nasty surprises that might make the
integrator slow, I'll just go for the increased accuracy.
I don't care that much about GSL 1.1, it will gradually go away as
distributors ship newer GSL releases and users install newer
distributions and the alternative, --with-included-gsl, works well and
is shipped in the RPMs that David builds.
I wouldn't be concerned about the test failure in this particular case
though. Whether it's 1.7e-15 or 0 - either is 0.000000 and 0.000000 when
looking at the first six digits and in a range from [0;1].
The patch I've added is this:
Index: src/score.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/src/score.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- src/score.c 9 Mar 2004 04:16:54 -0000 1.11
+++ src/score.c 23 Mar 2004 00:38:13 -0000 1.12
@@ -1,4 +1,4 @@
-/* $Id: score.c,v 1.11 2004/03/09 04:16:54 relson Exp $ */
+/* $Id: score.c,v 1.12 2004/03/23 00:38:13 m-a Exp $ */
/*****************************************************************************
@@ -330,7 +330,7 @@
abort();
}
status = gsl_integration_qag(&chi, 0, x, eps, eps,
- intervals, GSL_INTEG_GAUSS15, w, &p, &abserr);
+ intervals, GSL_INTEG_GAUSS41, w, &p, &abserr);
if (status && status != GSL_EMAXITER) {
fprintf(stderr, "Integration error: %s\n", gsl_strerror(status));
abort();
--
Matthias Andree
Encrypt your mail: my GnuPG key ID is 0x052E7D95
More information about the Bogofilter
mailing list