This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/14470] Inaccurate j1f function on x86_32 and x86_64


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]