public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Paul Zimmermann <Paul.Zimmermann@inria.fr>
To: "Keith Packard" <keithp@keithp.com>
Cc: newlib@sourceware.org
Subject: Re: issue with tgammaf
Date: Wed, 16 Sep 2020 10:33:36 +0200	[thread overview]
Message-ID: <mw7dsuxgrj.fsf@tomate.loria.fr> (raw)
In-Reply-To: <87een3eyq4.fsf@keithp.com>

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

  reply	other threads:[~2020-09-16  8:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15  8:21 Paul Zimmermann
2020-09-15 17:28 ` Keith Packard
2020-09-16  8:33   ` Paul Zimmermann [this message]
2020-09-16 15:13     ` Keith Packard
2020-09-17  7:18       ` Paul Zimmermann
2020-09-17 16:11         ` Keith Packard
2021-01-13  5:46           ` Paul Zimmermann
2021-01-13  6:38             ` Keith Packard
2021-01-13  7:52               ` Paul Zimmermann
2020-09-18 21:21   ` Jeff Johnston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mw7dsuxgrj.fsf@tomate.loria.fr \
    --to=paul.zimmermann@inria.fr \
    --cc=keithp@keithp.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).