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

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

             Bug #: 14471
           Summary: Inaccurate y0f 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 y0f(float);
extern double y0(double);

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

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

    i32(a)=0x4155c70d;    //argument

    fesetround(FE_TONEAREST);

    r1 = y0f(a);  //actual result
    r2 = y0(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;
}

Result:

(core 2 for example):


-bash-4.2$ gcc main_y0f.c -lm -odo -m32
-bash-4.2$ ./do
inputs: a = (0x4155c70d)        1.336110e+01
actual    = (0xb4801c51)        -2.3862460807322e-07
expected  = (0xb47ff7c8)        -2.3838867946324e-07
error     = 9353 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] 9+ messages in thread

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-15 14:14 [Bug math/14471] New: Inaccurate y0f function on x86_32 liubov.dmitrieva at gmail dot com
2012-08-15 14:34 ` [Bug math/14471] " liubov.dmitrieva at gmail dot com
2012-08-15 14:40 ` [Bug math/14471] Inaccurate y0f function on x86_32 and x86_64 liubov.dmitrieva at gmail dot com
2012-08-16  8:16 ` liubov.dmitrieva at gmail dot com
2014-02-04 14:06 ` zimmerma+gcc at loria dot fr
2014-02-06 18:31 ` [Bug math/14471] Inaccurate y0f function jsm28 at gcc dot gnu.org
2014-06-17 18:38 ` fweimer at redhat dot com
2020-08-06 10:46 ` zimmerma+gcc at loria dot fr
2021-04-02  4:25 ` 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).