[apophenia] 01/01: RC #793998 - tests/distribution_tests - fix

Jerome Benoit calculus-guest at moszumanska.debian.org
Sun Aug 30 03:01:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

calculus-guest pushed a commit to branch master
in repository apophenia.

commit cd2f5874fc6ad7a19f8ff064e824dfd91ae278f4
Author: Jerome Benoit <calculus at rezozer.net>
Date:   Sun Aug 30 04:58:33 2015 +0200

    RC #793998 - tests/distribution_tests - fix
---
 debian/changelog                                   |  4 ++-
 debian/patches/series                              |  1 +
 ...tream-bug-793998-tests_distribution_tests.patch | 33 ++++++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index b279cff..f79089e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,9 @@ apophenia (0.999e+ds-3) UNRELEASED; urgency=medium
 
   * RC bug fix release (Closes: #793998):
     - eg/test_updating FAILURE on some architectures: intricate type conversion
-      in apop_mcmc.c, unfold.
+      in apop_mcmc.c, unfold;
+    - tests/distribution_tests FAILURE on some 32bit architectures: double
+      comparison issue, fix via a numerical approach (based on GSL_DBL_EPSILN).
 
  -- Jerome Benoit <calculus at rezozer.net>  Sat, 29 Aug 2015 01:56:36 +0000
 
diff --git a/debian/patches/series b/debian/patches/series
index 4c1d111..cd675a5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
 upstream-bug-793998-eg_test_updating.patch
+upstream-bug-793998-tests_distribution_tests.patch
 debianization.patch
 debianization-help2man.patch
 debianization-documentation.patch
diff --git a/debian/patches/upstream-bug-793998-tests_distribution_tests.patch b/debian/patches/upstream-bug-793998-tests_distribution_tests.patch
new file mode 100644
index 0000000..625fe94
--- /dev/null
+++ b/debian/patches/upstream-bug-793998-tests_distribution_tests.patch
@@ -0,0 +1,33 @@
+Description: upstream -- RC bug fix 793998 -- tests/distribution_tests
+ Fix a machine precision issue by relying on a more numerical approach,
+ given that the employed numerical library is GSL.
+ It appears that on i386 architecture (at least) the last digits are chopped:
+ 1-(*out) = 0x1p-63 verifies the test !(*out >= 1) inside the beta_rng function,
+ but inside the calling function (1-(*out)) is 0x0p+0 , that is *out is 1 .
+ (Note that GSL_DBL_EPSILON has the value 0x1p-52 .) The patch was designed with
+ 'gcc (Debian 5.2.1-15) 5.2.1 20150808' on a i386 Debian porter (sid).
+ A more architecture oriented approach might exist, but anyway the numerical
+ approach is satisfactory given that advanced numerical computations are done
+ via GSL which relies on GSL_DBL_EPSILON.
+Origin: debian
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2015-08-30
+
+--- a/model/apop_beta.c
++++ b/model/apop_beta.c
+@@ -88,11 +88,13 @@
+ }
+ 
+ static int beta_rng(double *out, gsl_rng *r, apop_model* eps){
++    double ans = GSL_NAN;
+     Nullcheck_mp(eps, 1)
+     Get_ab(eps)
+     do {
+-    *out = gsl_ran_beta(r, ab.alpha, ab.beta);
+-    } while (*out <= 0 || *out >= 1);
++    ans = gsl_ran_beta(r, ab.alpha, ab.beta);
++    } while (!((0.0 < ans) && (GSL_DBL_EPSILON <= 1.0 - ans)));
++    *out = ans;
+     return 0;
+ }
+ 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/apophenia.git



More information about the debian-science-commits mailing list