Control: tags 746013 + pending Dear maintainer,
I've prepared an NMU for libmatheval (versioned as 1.1.11+dfsg-1.2) and uploaded it to unstable with a fix for the compiler optimisation effects. This diff extends the previous diff for i386 support. Regards.
diff -Nru libmatheval-1.1.11+dfsg/debian/changelog libmatheval-1.1.11+dfsg/debian/changelog --- libmatheval-1.1.11+dfsg/debian/changelog 2014-10-06 15:38:39.000000000 +0100 +++ libmatheval-1.1.11+dfsg/debian/changelog 2014-10-07 15:16:41.000000000 +0100 @@ -1,3 +1,15 @@ +libmatheval (1.1.11+dfsg-1.2) unstable; urgency=low + + * Non-maintainer upload. + * Add a fix to lib/xmath.c to limit the precision to + within the range compatible with the current compiler + optimisations so that the uncertain process of comparing + floating point numbers can be used in the test suite. + Completes the migration to guile-2.0 (Closes: #746013) + * Update symbols for the patched function + + -- Neil Williams <codeh...@debian.org> Tue, 07 Oct 2014 15:04:50 +0100 + libmatheval (1.1.11+dfsg-1.1) unstable; urgency=low * Non-maintainer upload. diff -Nru libmatheval-1.1.11+dfsg/debian/libmatheval1.symbols libmatheval-1.1.11+dfsg/debian/libmatheval1.symbols --- libmatheval-1.1.11+dfsg/debian/libmatheval1.symbols 2014-05-06 19:29:30.000000000 +0100 +++ libmatheval-1.1.11+dfsg/debian/libmatheval1.symbols 2014-10-07 15:15:38.000000000 +0100 @@ -48,6 +48,7 @@ math_sec@Base 1.1.3 math_sech@Base 1.1.3 math_step@Base 1.1.3 + math_truncate15@Base 1.1.11 node_copy@Base 1.1.3 node_create@Base 1.1.3 node_derivative@Base 1.1.3 diff -Nru libmatheval-1.1.11+dfsg/debian/patches/004-arch-optimisation.patch libmatheval-1.1.11+dfsg/debian/patches/004-arch-optimisation.patch --- libmatheval-1.1.11+dfsg/debian/patches/004-arch-optimisation.patch 1970-01-01 01:00:00.000000000 +0100 +++ libmatheval-1.1.11+dfsg/debian/patches/004-arch-optimisation.patch 2014-10-07 15:04:13.000000000 +0100 @@ -0,0 +1,73 @@ +Description: Compiler optimisation affects on floating point tests. + Truncate the precision of a returned double to 15 places. + This allows for compiler optimisations which may change the + comparison of floating point numbers on particular architectures. + . + libmatheval (1.1.11+dfsg-1.2) unstable; urgency=low + . + * Non-maintainer upload. + * Add a fix to lib/xmath.c to limit the precision to + within the range compatible with the current compiler + optimisations so that the uncertain process of comparing + floating point numbers can be used in the test suite. + Completes the migration to guile-2.0 (Closes: #746013) +Author: Dave Pigott <dave.pig...@linaro.org> +Bug-Debian: https://bugs.debian.org/746013 + +--- + +--- libmatheval-1.1.11+dfsg.orig/lib/xmath.c ++++ libmatheval-1.1.11+dfsg/lib/xmath.c +@@ -19,8 +19,32 @@ + * <http://www.gnu.org/licenses/>. + */ + ++#include <stdio.h> + #include "xmath.h" + ++ ++double ++math_truncate15(double x) ++{ ++ /* ++ * Truncate the precision of a returned double to 15 decimal places ++ * This is hacky, and as at the time of writing, is only required for ++ * the "coth" function, which due to optimisation and floating point ++ * width, gives a different result on i386 to all other platforms ++ * At the moment we're dealing with an explicit 15 significant digits. ++ * This could be generalised to a "give me n digits of precision" type ++ * solution ++ */ ++ double d; ++ char s[128]; ++ ++ sprintf(s, "%.15f", x); ++ sscanf(s, "%lf", &d); ++ ++ return d; ++} ++ ++ + double + math_cot(double x) + { +@@ -81,7 +105,7 @@ math_coth(double x) + /* + * Calculate hyperbolic cotangent value. + */ +- return 1 / tanh(x); ++ return math_truncate15(1 / tanh(x)); + } + + double +--- libmatheval-1.1.11+dfsg.orig/tests/functions.at ++++ libmatheval-1.1.11+dfsg/tests/functions.at +@@ -335,7 +335,7 @@ AT_DATA([function.scm], + (display (evaluator-evaluate-x f 1)) + ]]) + +-AT_CHECK([matheval.sh function.scm], [ignore], [1.3130352854993315], [ignore]) ++AT_CHECK([matheval.sh function.scm], [ignore], [1.313035285499331], [ignore]) + + AT_DATA([function.scm], + [[ diff -Nru libmatheval-1.1.11+dfsg/debian/patches/series libmatheval-1.1.11+dfsg/debian/patches/series --- libmatheval-1.1.11+dfsg/debian/patches/series 2014-10-06 15:47:53.000000000 +0100 +++ libmatheval-1.1.11+dfsg/debian/patches/series 2014-10-07 14:58:25.000000000 +0100 @@ -1,2 +1,3 @@ 002-skip-docs.patch 003-guile2.0.patch +004-arch-optimisation.patch