regression in tgamma?

Paul Zimmermann Paul.Zimmermann@inria.fr
Wed Dec 16 13:48:55 GMT 2020


       Hi,

the regression I observed also concerns the binary32 code.
Consider the following code:

$ cat /tmp/test_tgamma.c
#include <stdio.h>
#include <math.h>

#ifdef NEWLIB
int errno;
int* __errno () { return &errno; }
#endif

int main()
{
  float x = -0.0f;
  float y = tgammaf (x);
  printf ("x=%a y=%a\n", x, y);
  {
    double x = -0x1.53f198fe3b278p+7, y;
    y = tgamma (x);
    printf ("x=%a y=%a\n", x, y);
  }
}

With commit a0d7982ff486292540078c0121a435013c5ee1ea it gives on x86_64/linux
(Intel(R) Core(TM) i5-4590):

$ gcc -no-pie -DNEWLIB /tmp/test_tgamma.c build/x86_64/newlib/libm/tmp/libm.a
$ ./a.out
x=-0x0p+0 y=inf
x=-0x1.53f198fe3b278p+7 y=0x1.fd6d312572d9cp-1015

and with commit 1f8e5847dff27e504949cd21bfeadb987d36ad19:

$ gcc -no-pie -DNEWLIB /tmp/test_tgamma.c build/x86_64/newlib/libm/tmp/libm.a
$ ./a.out 
x=-0x0p+0 y=0x1p+0
x=-0x1.53f198fe3b278p+7 y=0x1p+0

Paul









More information about the Newlib mailing list