regression in tgamma?

Paul Zimmermann <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
       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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.