with the test program below I get on a x86_64 processor: GNU libc version: 2.18.90 GNU libc release: development x=8.9357301493606989e-01 libc: y0(x)=-3.4749010007703585e-06 mpfr: y0(x)=-3.4749010007607514e-06 ulp difference: -22684.000000 I will keep track of such errors on http://www.loria.fr/~zimmerma/glibc/. Paul Zimmermann #include <stdio.h> #include <math.h> #include <mpfr.h> #include <gnu/libc-version.h> double ulp (double x, double y) { double z = x - y; int ey; y = frexp (y, &ey); y = ldexp (1.0, ey - 53); return z / y; } int main () { double x = 8.9357301493606989e-1; double y, z; mpfr_t t; printf("GNU libc version: %s\n", gnu_get_libc_version ()); printf("GNU libc release: %s\n", gnu_get_libc_release ()); y = y0 (x); mpfr_init2 (t, 53); mpfr_set_d (t, x, MPFR_RNDN); mpfr_y0 (t, t, MPFR_RNDN); z = mpfr_get_d (t, MPFR_RNDN); printf ("x=%.16e\n", x); printf ("libc: y0(x)=%.16e\n", y); /* -3.4749010007703585e-06 */ printf ("mpfr: y0(x)=%.16e\n", z); /* -3.4749010007607514e-06 */ printf ("ulp difference: %f\n", ulp (y, z)); /* -22684.000000 */ return 0; }
cf https://members.loria.fr/PZimmermann/papers/accuracy.pdf for largest known errors found so far. Here are the inputs of the version from February 5, 2021, corresponding to GNU libc 2.33. dbl-64: y0 0x1.c982eb8d417eap-1 (5.93e15 ulps) ldbl-96: y0 0xe.4c175c6a0bf51e8p-4l (1.38e18 ulps) float128: y0 0x6.b99c822052e965e1754eb5ffeb08p+4 (1.69e33 ulps)
The commit that reduces the errors in the binary32 format is 9acda61 (April 1st, 2021). See also #27670 for the other Bessel functions (j0, j1, y1).