issue with tgammaf

Paul Zimmermann Paul.Zimmermann@inria.fr
Wed Sep 16 08:33:36 GMT 2020


thank you Keith. For your information I have updated my comparison with
Newlib 3.3.0:

https://members.loria.fr/PZimmermann/papers/accuracy.pdf

The differences with the previous (unknown) version of Newlib I used are
that j1 is less accurate (largest error goes from 2.66e6 ulps to 1.68e7 ulps),
and y1 is more accurate (largest error goes from 4.65e8 ulps to 6.18e6 ulps).
(However, those huge errors simply tell us that j1f is completely off, in the
first case for x=0x6.cfd78p+100 j1f returns 0 instead of -0x1p-52.)

I am still unable to compile a program using lgammaf:

$ cat f.c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <errno.h>

#ifdef NEWLIB
/* without this, newlib says: undefined reference to `__errno' */
int errno;
int* __errno () { return &errno; }
#endif

int
main (int argc, char *argv[])
{
  float x = 0x1p-149f;
  float y = lgammaf (x);
  printf ("x=%.9e y=%.9e\n", x, y);
  return 0;
}

$ gcc -DNEWLIB -no-pie f.c /localdisk/zimmerma/newlib-3.3.0/libm.a
/usr/bin/ld: /localdisk/zimmerma/newlib-3.3.0/libm.a(lib_a-wf_lgamma.o): in function `lgammaf':
wf_lgamma.c:(.text+0x7): undefined reference to `_impure_ptr'
collect2: error: ld returned 1 exit status

If someone manages to compile this program on x86_64/Linux, please tell me!

Paul


More information about the Newlib mailing list