Bug#153022: [powerpc libm] exp() in directed rounding modes gives wrong results

2013-03-06 Thread Vincent Lefevre
On 2013-03-05 17:36:20 -0800, Jonathan Nieder wrote:
> Does "apt-get source libc6/unstable" work?  If it doesn't, then
> 
>   dget http://http.debian.net/debian/pool/main/e/eglibc/eglibc_2.13-38.dsc
> 
> should do the trick.

Yes, "apt-get source libc6/unstable" works. The problem is mentioned
here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=438999#10

I could build the test version and I tested all the glibc math
functions. I didn't find any error.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


--
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130306150056.gu5...@xvii.vinc17.org



Bug#153022: [powerpc libm] exp() in directed rounding modes gives wrong results

2013-03-05 Thread Jonathan Nieder
Vincent Lefevre wrote:
> On 2013-03-03 23:49:26 -0800, Jonathan Nieder wrote:

>> Better debdiff attached.
>
> OK, but I don't know how to download the eglibc source: both
> "apt-get source eglibc/unstable" and "apt-get source -t unstable eglibc"
> download the experimental version.

Does "apt-get source libc6/unstable" work?  If it doesn't, then

  dget http://http.debian.net/debian/pool/main/e/eglibc/eglibc_2.13-38.dsc

should do the trick.

Thanks,
Jonathan


-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130306013619.gb3...@google.com



Bug#153022: [powerpc libm] exp() in directed rounding modes gives wrong results

2013-03-05 Thread Vincent Lefevre
On 2013-03-03 23:49:26 -0800, Jonathan Nieder wrote:
> Jonathan Nieder wrote:
> 
> > debdiff attached.
> 
> Better debdiff attached.

OK, but I don't know how to download the eglibc source: both
"apt-get source eglibc/unstable" and "apt-get source -t unstable eglibc"
download the experimental version. This is the first time I see
something like that.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


--
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130305145045.ga2...@xvii.vinc17.org



Bug#153022: [powerpc libm] exp() in directed rounding modes gives wrong results

2013-03-03 Thread Jonathan Nieder
tags 153022 + upstream patch moreinfo
quit

On 2013-03-03 16:33:45 -0800, Jonathan Nieder wrote:

> If someone prepares a backport of the fix for 2.13.y, would you
> like to test it?

debdiff attached.  Completely untested.
diff -u eglibc-2.13/debian/changelog eglibc-2.13/debian/changelog
--- eglibc-2.13/debian/changelog
+++ eglibc-2.13/debian/changelog
@@ -1,3 +1,11 @@
+eglibc (2.13-38+test) local; urgency=low
+
+  * patches/any/cvs-exp-rounding-mode.diff: __ieee754_exp: save and
+restore rounding mode and use round-to-nearest for all computations.
+Closes: #153022
+
+ -- Jonathan Nieder   Sun, 03 Mar 2013 23:04:24 -0800
+
 eglibc (2.13-38) unstable; urgency=low
 
   [ Adam Conrad ]
diff -u eglibc-2.13/debian/patches/series eglibc-2.13/debian/patches/series
--- eglibc-2.13/debian/patches/series
+++ eglibc-2.13/debian/patches/series
@@ -376,0 +377 @@
+any/cvs-exp-rounding-mode.diff
only in patch2:
unchanged:
--- eglibc-2.13.orig/debian/patches/any/cvs-exp-rounding-mode.diff
+++ eglibc-2.13/debian/patches/any/cvs-exp-rounding-mode.diff
@@ -0,0 +1,400 @@
+2012-03-02  Joseph Myers  
+
+   [BZ #3976]
+   * sysdeps/ieee754/dbl-64/e_exp.c: Include .
+   (__ieee754_exp): Save and restore rounding mode and use
+   round-to-nearest for all computations.
+   * math/libm-test.inc (exp_test_tonearest): New function.
+   (exp_test_towardzero): Likewise.
+   (exp_test_downward): Likewise.
+   (exp_test_upward): Likewise.
+   (main): Call the new functions.
+   * sysdeps/i386/fpu/libm-test-ulps: Update.
+   * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+---
+ ChangeLog |  14 +
+ math/libm-test.inc| 112 ++
+ sysdeps/i386/fpu/libm-test-ulps   |  67 +++
+ sysdeps/ieee754/dbl-64/e_exp.c|  38 -
+ sysdeps/x86_64/fpu/libm-test-ulps |  51 +
+ 5 files changed, 268 insertions(+), 14 deletions(-)
+
+diff --git a/math/libm-test.inc b/math/libm-test.inc
+index c6ed7a39..02f51f2e 100644
+--- a/math/libm-test.inc
 b/math/libm-test.inc
+@@ -2527,6 +2527,114 @@ exp_test (void)
+ 
+ 
+ static void
++exp_test_tonearest (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(exp) (0);
++  if (errno == ENOSYS)
++/* Function not implemented.  */
++return;
++
++  START (exp_tonearest);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TONEAREST))
++{
++  TEST_f_f (exp, 1, M_El);
++  TEST_f_f (exp, 2, M_E2l);
++  TEST_f_f (exp, 3, M_E3l);
++}
++
++  fesetround (save_round_mode);
++
++  END (exp_tonearest);
++}
++
++
++static void
++exp_test_towardzero (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(exp) (0);
++  if (errno == ENOSYS)
++/* Function not implemented.  */
++return;
++
++  START (exp_towardzero);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TOWARDZERO))
++{
++  TEST_f_f (exp, 1, M_El);
++  TEST_f_f (exp, 2, M_E2l);
++  TEST_f_f (exp, 3, M_E3l);
++}
++
++  fesetround (save_round_mode);
++
++  END (exp_towardzero);
++}
++
++
++static void
++exp_test_downward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(exp) (0);
++  if (errno == ENOSYS)
++/* Function not implemented.  */
++return;
++
++  START (exp_downward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_DOWNWARD))
++{
++  TEST_f_f (exp, 1, M_El);
++  TEST_f_f (exp, 2, M_E2l);
++  TEST_f_f (exp, 3, M_E3l);
++}
++
++  fesetround (save_round_mode);
++
++  END (exp_downward);
++}
++
++
++static void
++exp_test_upward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(exp) (0);
++  if (errno == ENOSYS)
++/* Function not implemented.  */
++return;
++
++  START (exp_upward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_UPWARD))
++{
++  TEST_f_f (exp, 1, M_El);
++  TEST_f_f (exp, 2, M_E2l);
++  TEST_f_f (exp, 3, M_E3l);
++}
++
++  fesetround (save_round_mode);
++
++  END (exp_upward);
++}
++
++
++static void
+ exp10_test (void)
+ {
+   errno = 0;
+@@ -6255,6 +6363,10 @@ main (int argc, char **argv)
+ 
+   /* Exponential and logarithmic functions:  */
+   exp_test ();
++  exp_test_tonearest ();
++  exp_test_towardzero ();
++  exp_test_downward ();
++  exp_test_upward ();
+   exp10_test ();
+   exp2_test ();
+   expm1_test ();
+diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
+index 4b1a9e73..74dbb600 100644
+--- a/sysdeps/i386/fpu/libm-test-ulps
 b/sysdeps/i386/fpu/libm-test-ulps
+@@ -453,6 +453,51 @@ Test "exp10 (3) == 1000":
+ ildouble: 8
+ ldouble: 8
+ 
++# exp_downward
++Test "exp_downward (1) == e":
++ildouble: 1
++ldouble: 1
++Test "exp_downward (2) == e^2":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "exp_downward (3) == e^3":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1

Bug#153022: [powerpc libm] exp() in directed rounding modes gives wrong results

2013-03-03 Thread Vincent Lefevre
On 2013-03-03 16:33:45 -0800, Jonathan Nieder wrote:
> If someone prepares a backport of the fix for 2.13.y, would you
> like to test it?

Yes, if this doesn't introduce dependency problems on unstable.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


--
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130304015525.gh5...@xvii.vinc17.org