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/14469] Inaccurate j0f function on x86_32 and x86_64


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

--- Comment #3 from Liubov Dmitrieva <liubov.dmitrieva at gmail dot com> 2012-08-16 08:06:33 UTC ---
>> please give testcases that use hex floats

New test case for J0f Bessel function. 

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

extern float j0f(float);
extern double j0(double);

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

    a=0x1.79543ep3;    //argument

    fesetround(FE_TONEAREST);

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

64 bit result:
inputs: a = 0x1.79543ep+3
actual    = -0x1.e3b3acp-23
expected  = -0x1.e3a8a3p-23
error     = 1412.411834 ulp

32 bit result:
inputs: a = 0x1.79543ep+3
actual    = -0x1.e3d050p-23
expected  = -0x1.e3a8a3p-23
error     = 5078.411826 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]