public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* regression in tgamma?
@ 2020-12-15 13:35 Paul Zimmermann
  2020-12-15 17:11 ` Jeff Johnston
  0 siblings, 1 reply; 16+ messages in thread
From: Paul Zimmermann @ 2020-12-15 13:35 UTC (permalink / raw)
  To: newlib

       Hi,

while updating my comparison from Newlib 3.3.0 to Newlib 4.0.0, I found a
regression in tgamma on x86_64/Linux:

$ cat test3.c
#include <stdio.h>
#include <math.h>

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

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

Newlib 3.3.0:
$ gcc -DNEWLIB -no-pie test3.c /localdisk/zimmerma/newlib-3.3.0/libm.a; ./a.out
x=-0x1.53f198fe3b278p+7 y=0x1.fd6d312572d9cp-1015

Newlib 4.0.0:
$ gcc -DNEWLIB -no-pie test3.c /localdisk/zimmerma/newlib-4.0.0/libm.a; ./a.out
x=-0x1.53f198fe3b278p+7 y=0x1p+0

Please can someone confirm?

Best regards,
Paul

^ permalink raw reply	[flat|nested] 16+ messages in thread
* regression in tgamma?
@ 2020-12-16 13:48 Paul Zimmermann
  2020-12-16 20:31 ` Jeff Johnston
  0 siblings, 1 reply; 16+ messages in thread
From: Paul Zimmermann @ 2020-12-16 13:48 UTC (permalink / raw)
  To: newlib

       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








^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-12-18 17:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 13:35 regression in tgamma? Paul Zimmermann
2020-12-15 17:11 ` Jeff Johnston
2020-12-16  6:36   ` Paul Zimmermann
2020-12-16 13:48 Paul Zimmermann
2020-12-16 20:31 ` Jeff Johnston
2020-12-17  7:29   ` Paul Zimmermann
2020-12-17 16:13     ` Keith Packard
2020-12-17 18:27       ` Jeff Johnston
2020-12-17 19:16         ` Keith Packard
2020-12-17 21:28           ` Jeff Johnston
2020-12-18  6:36             ` Paul Zimmermann
2020-12-18  8:42               ` Corinna Vinschen
2020-12-18  8:54                 ` Paul Zimmermann
2020-12-18  9:07                   ` Corinna Vinschen
2020-12-18 17:42                     ` Jeff Johnston
2020-12-18  8:37             ` Paul Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).