guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: gsl: Fix poly test on i686.


From: Mark H. Weaver
Subject: 01/01: gnu: gsl: Fix poly test on i686.
Date: Sat, 20 Jun 2015 05:40:26 +0000

mhw pushed a commit to branch core-updates
in repository guix.

commit 180a93c72a69e6e322da1226c4d439a321279490
Author: Mark H Weaver <address@hidden>
Date:   Sat Jun 20 01:38:56 2015 -0400

    gnu: gsl: Fix poly test on i686.
    
    * gnu/packages/patches/gsl-poly-test-fix-pt1.patch,
      gnu/packages/patches/gsl-poly-test-fix-pt2.patch: New files.
    * gnu-system.am (dist_patch_DATA): Add them.
    * gnu/packages/maths.scm (gsl)[source]: Add patches.
---
 gnu-system.am                                    |    2 +
 gnu/packages/maths.scm                           |    4 +-
 gnu/packages/patches/gsl-poly-test-fix-pt1.patch |   84 ++++++++++++++++++++++
 gnu/packages/patches/gsl-poly-test-fix-pt2.patch |   27 +++++++
 4 files changed, 116 insertions(+), 1 deletions(-)

diff --git a/gnu-system.am b/gnu-system.am
index 82a8677..81cfd7b 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -450,6 +450,8 @@ dist_patch_DATA =                                           
\
   gnu/packages/patches/grep-CVE-2015-1345.patch                        \
   gnu/packages/patches/grub-gets-undeclared.patch              \
   gnu/packages/patches/grub-freetype.patch                     \
+  gnu/packages/patches/gsl-poly-test-fix-pt1.patch             \
+  gnu/packages/patches/gsl-poly-test-fix-pt2.patch             \
   gnu/packages/patches/guile-1.8-cpp-4.5.patch                 \
   gnu/packages/patches/guile-arm-fixes.patch                   \
   gnu/packages/patches/guile-default-utf8.patch                        \
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 6fbe6fd..421baf5 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -154,7 +154,9 @@ semiconductors.")
                           version ".tar.gz"))
       (sha256
        (base32
-        "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k"))))
+        "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k"))
+      (patches (map search-patch '("gsl-poly-test-fix-pt1.patch"
+                                   "gsl-poly-test-fix-pt2.patch")))))
     (build-system gnu-build-system)
     (arguments
      `(#:parallel-tests? #f
diff --git a/gnu/packages/patches/gsl-poly-test-fix-pt1.patch 
b/gnu/packages/patches/gsl-poly-test-fix-pt1.patch
new file mode 100644
index 0000000..3d1ed42
--- /dev/null
+++ b/gnu/packages/patches/gsl-poly-test-fix-pt1.patch
@@ -0,0 +1,84 @@
+From 9cc12d0377dd634b1b97954d076b715f982853b7 Mon Sep 17 00:00:00 2001
+From: Patrick Alken <address@hidden>
+Date: Fri, 4 Apr 2014 13:36:16 -0600
+Subject: [PATCH] bug fix in sorting of complex numbers (bug #39055)
+
+---
+ poly/test.c | 49 ++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 30 insertions(+), 19 deletions(-)
+
+diff --git a/poly/test.c b/poly/test.c
+index 9c147f6..d090802 100644
+--- a/poly/test.c
++++ b/poly/test.c
+@@ -25,11 +25,21 @@
+ #include <gsl/gsl_poly.h>
+ #include <gsl/gsl_heapsort.h>
+ 
++/* sort by Re(z) then by Im(z) */
+ static int
+ cmp_cplx(const double *a, const double *b)
+ {
+-      double t = (a[0] * a[0] + a[1] * a[1]) - (b[0] * b[0] + b[1] * b[1]);
+-      return t < 0.0 ? -1 : t > 0.0 ? 1 : 0;
++  double r = a[0] - b[0];
++
++  if (r == 0.0)
++    {
++      double t = a[1] - b[1];
++          return t < 0.0 ? -1 : t > 0.0 ? 1 : 0;
++    }
++  else if (r < 0.0)
++    return -1;
++  else
++    return 1;
+ }
+ 
+ int
+@@ -534,25 +544,26 @@ main (void)
+        Problem reported by Munagala Ramanath (bug #39055)
+     */
+ 
+-    double a[16] = { 32, -48, -8, 28, -8, 16, -16, 12, -16, 6, 10, -17, 10, 
2, -4, 1 };
++    double a[16] = { 32, -48, -8, 28, -8, 16, -16, 12,
++                    -16, 6, 10, -17, 10, 2, -4, 1 };
+     double z[16*2];
+ 
+-    double expected[16*20] = {
+-         1.0000000000000000,  0.00000000000000000,
+-         1.0000000000000000,  0.00000000000000000,
+-        -1.0000000000000000,  0.00000000000000000,
+-       -0.65893856175240950,  0.83459757287426684,
+-       -0.65893856175240950, -0.83459757287426684,
+-      -0.070891117403341281,  -1.1359249087587791,
+-      -0.070891117403341281,   1.1359249087587791,
+-         1.1142366961812986, -0.48083981203389980,
+-         1.1142366961812986,  0.48083981203389980,
+-        -1.3066982484920768,  0.00000000000000000,
+-        0.57284747839410854,   1.1987808988289705,
+-        0.57284747839410854,  -1.1987808988289705,
+-        -1.6078107423472359,  0.00000000000000000,
+-         2.0000000000000000,  0.00000000000000000,
+-         2.0000000000000000,  0.00000000000000000 };
++    double expected[16*2] = {
++     -1.6078107423472359,    0.00000000000000000,
++     -1.3066982484920768,    0.00000000000000000,
++     -1.0000000000000000,    0.00000000000000000,
++     -0.65893856175240950,  -0.83459757287426684,
++     -0.65893856175240950,   0.83459757287426684,
++     -0.070891117403341281, -1.1359249087587791,
++     -0.070891117403341281,  1.1359249087587791,
++      0.57284747839410854,  -1.1987808988289705,
++      0.57284747839410854,   1.1987808988289705,
++      1.0000000000000000,    0.00000000000000000,
++      1.0000000000000000,    0.00000000000000000,
++      1.1142366961812986,   -0.48083981203389980,
++      1.1142366961812986,    0.48083981203389980,
++      2.0000000000000000,    0.00000000000000000,
++      2.0000000000000000,    0.00000000000000000 };
+ 
+     int i;
+ 
+-- 
+2.4.3
+
diff --git a/gnu/packages/patches/gsl-poly-test-fix-pt2.patch 
b/gnu/packages/patches/gsl-poly-test-fix-pt2.patch
new file mode 100644
index 0000000..0e6fcf1
--- /dev/null
+++ b/gnu/packages/patches/gsl-poly-test-fix-pt2.patch
@@ -0,0 +1,27 @@
+From 0466df8660a7b6ddf2e082a1ec38bc6ea25a3c5c Mon Sep 17 00:00:00 2001
+From: Patrick Alken <address@hidden>
+Date: Mon, 7 Apr 2014 10:59:58 -0600
+Subject: [PATCH] change error test for 15th degree polynomial (bug #39055)
+
+---
+ poly/test.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/poly/test.c b/poly/test.c
+index d090802..f6a7e3f 100644
+--- a/poly/test.c
++++ b/poly/test.c
+@@ -579,8 +579,8 @@ main (void)
+ 
+     for (i = 0; i<15; i++)
+       {
+-        gsl_test_abs (z[2*i], expected[2*i], 1e-7, "z%d.real, 15th-order 
polynomial", i);
+-        gsl_test_abs (z[2*i+1], expected[2*i+1], 1e-7, "z%d.imag, 15th-order 
polynomial", i);
++        gsl_test_rel (z[2*i], expected[2*i], 1e-7, "z%d.real, 15th-order 
polynomial", i);
++        gsl_test_rel (z[2*i+1], expected[2*i+1], 1e-7, "z%d.imag, 15th-order 
polynomial", i);
+       }
+   }
+ 
+-- 
+2.4.3
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]