public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/14470] New: Inaccurate j1f function on x86_32
@ 2012-08-15 14:10 liubov.dmitrieva at gmail dot com
  2012-08-15 14:39 ` [Bug math/14470] Inaccurate j1f function on x86_32 and x86_64 liubov.dmitrieva at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: liubov.dmitrieva at gmail dot com @ 2012-08-15 14:10 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14470

             Bug #: 14470
           Summary: Inaccurate j1f function on x86_32
           Product: glibc
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: unassigned@sourceware.org
        ReportedBy: liubov.dmitrieva@gmail.com
    Classification: Unclassified


Test case:

// gcc main.c -std=c99 -lm -m32

#include <stdio.h>
#include <fenv.h>
#include <stdlib.h>  // abs function for int argument

extern float j1f(float);
extern double j1(double);

#define i32(a)    (((int*)&(a))[0])

int main() {
    float a,r1,r2;

    i32(a)=0x4122c68a;    //argument

    fesetround(FE_TONEAREST);

    r1 = j1f(a);  //actual result
    r2 = j1(a);   //actual result 2

    printf("inputs: a = (0x%08x)\t%e\n", i32(a), a);
    printf("actual    = (0x%08x)\t%.13e\n", i32(r1), r1);
    printf("expected  = (0x%08x)\t%.13e\n", i32(r2), r2);
    printf("error     = %d ulp\n", abs(i32(r1) - i32(r2)));

    return 0;
}

Results:

inputs: a = (0x4122c68a)        1.017347e+01
actual    = (0xb55e2ad3)        -8.2763762065952e-07
expected  = (0xb55e40c6)        -8.2795702383009e-07
error     = 5619 ulp

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/14470] Inaccurate j1f function on x86_32 and x86_64
  2012-08-15 14:10 [Bug math/14470] New: Inaccurate j1f function on x86_32 liubov.dmitrieva at gmail dot com
@ 2012-08-15 14:39 ` liubov.dmitrieva at gmail dot com
  2012-08-16  8:12 ` liubov.dmitrieva at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: liubov.dmitrieva at gmail dot com @ 2012-08-15 14:39 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14470

Liubov Dmitrieva <liubov.dmitrieva at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Inaccurate j1f function on  |Inaccurate j1f function on
                   |x86_32                      |x86_32 and x86_64

--- Comment #1 from Liubov Dmitrieva <liubov.dmitrieva at gmail dot com> 2012-08-15 14:38:56 UTC ---
In bug description result 5619 ulps was the result for x86_64 and for 32 bit
mode
result is:

-bash-4.2$ gcc main_j1f.c   -lm -odo -m32
-bash-4.2$ ./do
inputs: a = (0x4122c68a)        1.017347e+01
actual    = (0xb55e4d6d)        -8.2814113966378e-07
expected  = (0xb55e40c6)        -8.2795702383009e-07
error     = 3239 ulp

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/14470] Inaccurate j1f function on x86_32 and x86_64
  2012-08-15 14:10 [Bug math/14470] New: Inaccurate j1f function on x86_32 liubov.dmitrieva at gmail dot com
  2012-08-15 14:39 ` [Bug math/14470] Inaccurate j1f function on x86_32 and x86_64 liubov.dmitrieva at gmail dot com
@ 2012-08-16  8:12 ` liubov.dmitrieva at gmail dot com
  2014-02-06 18:31 ` [Bug math/14470] Inaccurate j1f function jsm28 at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: liubov.dmitrieva at gmail dot com @ 2012-08-16  8:12 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14470

--- Comment #2 from Liubov Dmitrieva <liubov.dmitrieva at gmail dot com> 2012-08-16 08:11:45 UTC ---
represent the test argument using a hex float value, test case update:

#include <stdio.h>
#include <math.h>
#include <fenv.h>

extern float j1f(float);
extern double j1(double);

int main() {
    float a,r1;
    double r2;

    a=0x1.458d14p3;    //argument

    fesetround(FE_TONEAREST);

    r1 = j1f(a);  //actual result
    r2 = j1(a);   //actual result 2

    printf("inputs: a = %.6a\n", a);
    printf("actual    = %.6a\n", r1);
    printf("expected  = %.6a\n", r2);
    printf("error     = %f ulp\n", fabs(r1 - r2) * exp2(23.0-logbf(r1)));
    return 0;
}

Result x86:
inputs: a = 0x1.458d14p+3
actual    = -0x1.bc9adap-21
expected  = -0x1.bc818dp-21
error     = 3238.561446 ulp

Result x86_64:
inputs: a = 0x1.458d14p+3
actual    = -0x1.bc55a6p-21
expected  = -0x1.bc818dp-21
error     = 5619.438563 ulp

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/14470] Inaccurate j1f function
  2012-08-15 14:10 [Bug math/14470] New: Inaccurate j1f function on x86_32 liubov.dmitrieva at gmail dot com
  2012-08-15 14:39 ` [Bug math/14470] Inaccurate j1f function on x86_32 and x86_64 liubov.dmitrieva at gmail dot com
  2012-08-16  8:12 ` liubov.dmitrieva at gmail dot com
@ 2014-02-06 18:31 ` jsm28 at gcc dot gnu.org
  2014-06-17 18:39 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-02-06 18:31 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=14470

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Inaccurate j1f function on  |Inaccurate j1f function
                   |x86_32 and x86_64           |

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/14470] Inaccurate j1f function
  2012-08-15 14:10 [Bug math/14470] New: Inaccurate j1f function on x86_32 liubov.dmitrieva at gmail dot com
                   ` (2 preceding siblings ...)
  2014-02-06 18:31 ` [Bug math/14470] Inaccurate j1f function jsm28 at gcc dot gnu.org
@ 2014-06-17 18:39 ` fweimer at redhat dot com
  2020-08-06 10:45 ` zimmerma+gcc at loria dot fr
  2021-04-02  4:24 ` zimmerma+gcc at loria dot fr
  5 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2014-06-17 18:39 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=14470

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/14470] Inaccurate j1f function
  2012-08-15 14:10 [Bug math/14470] New: Inaccurate j1f function on x86_32 liubov.dmitrieva at gmail dot com
                   ` (3 preceding siblings ...)
  2014-06-17 18:39 ` fweimer at redhat dot com
@ 2020-08-06 10:45 ` zimmerma+gcc at loria dot fr
  2021-04-02  4:24 ` zimmerma+gcc at loria dot fr
  5 siblings, 0 replies; 7+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2020-08-06 10:45 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=14470

--- Comment #4 from Paul Zimmermann <zimmerma+gcc at loria dot fr> ---
with glibc-2.32, the maximum error on x86_64 is now 2246675 ulps (for
x=1.892188179e+38)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/14470] Inaccurate j1f function
  2012-08-15 14:10 [Bug math/14470] New: Inaccurate j1f function on x86_32 liubov.dmitrieva at gmail dot com
                   ` (4 preceding siblings ...)
  2020-08-06 10:45 ` zimmerma+gcc at loria dot fr
@ 2021-04-02  4:24 ` zimmerma+gcc at loria dot fr
  5 siblings, 0 replies; 7+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2021-04-02  4:24 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=14470

Paul Zimmermann <zimmerma+gcc at loria dot fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |2.34

--- Comment #5 from Paul Zimmermann <zimmerma+gcc at loria dot fr> ---
fixed by commit 9acda61

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-02  4:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-15 14:10 [Bug math/14470] New: Inaccurate j1f function on x86_32 liubov.dmitrieva at gmail dot com
2012-08-15 14:39 ` [Bug math/14470] Inaccurate j1f function on x86_32 and x86_64 liubov.dmitrieva at gmail dot com
2012-08-16  8:12 ` liubov.dmitrieva at gmail dot com
2014-02-06 18:31 ` [Bug math/14470] Inaccurate j1f function jsm28 at gcc dot gnu.org
2014-06-17 18:39 ` fweimer at redhat dot com
2020-08-06 10:45 ` zimmerma+gcc at loria dot fr
2021-04-02  4:24 ` zimmerma+gcc at loria dot fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).