public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Andoni Arregi <andoni.arregui@gtd-gmbh.de>
To: newlib@sourceware.org
Subject: Re: [PATCH 1/2] Improve lgammaf range for very small cases
Date: Fri, 11 Feb 2022 12:19:33 +0100	[thread overview]
Message-ID: <d0a93f7b4920a8ee4d0c87f9b6470862031b8d71.camel@gtd-gmbh.de> (raw)
In-Reply-To: <YgUn/f7micaqjfiR@calimero.vinschen.de>

Hi Corina,

after my mistake from Tuesday and the checks by Paul Zimmermann
only the last patch I submitted for lgmammaf should be pushed as
Paul could confirm that the fix is correct. Forget about the
following patch series please:

[PATCH 0/2] Fix lgammaf and lgamma for small ranges and in [2, 3[ 

Regards

On Thu, 2022-02-10 at 15:58 +0100, Corinna Vinschen wrote:
> Hi Andoni,
> 
> On Feb  9 17:28, Andoni Arregi wrote:
> > The original cut for small arguments at |x|<2**-70 (copied from the
> > double version) produces that when computing nadj we get a subnormal
> > number for t*x and thus, the division of pi/subnormal will be INF and
> > the logarithm of it too, which is wrong as a result for lgammaf in this
> > range.
> > The proposed new limit seems to be safe and has been tested to
> > produce accurate results.
> > (Courtesy of Andreas Jung, ESA)
> > ---
> >  newlib/libm/math/erf_lgamma.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/newlib/libm/math/erf_lgamma.c
> > b/newlib/libm/math/erf_lgamma.c
> 
> This is broken.  It should be on one line, so apparently your
> mailer broke it via autowrapping lines.
> 
> > index f88f63092..84d02159b 100644
> > --- a/newlib/libm/math/erf_lgamma.c
> > +++ b/newlib/libm/math/erf_lgamma.c
> > @@ -168,7 +168,7 @@ static float zero=  0.0000000000e+00;
> >                *signgamp = -1;
> >            return one/(x-x);
> >         }
> > -       if(ix<0x1c800000) {     /* |x|<2**-70, return -log(|x|) */
> > +       if(ix<0x30800000) {     /* |x|<2**-30, return -log(|x|) */
> >            if(hx<0) {
> >                *signgamp = -1;
> >                return -__ieee754_logf(-x);
> > -- 
> > 2.35.1
> 
> But even if I fix this manually, your patch doesn't apply, neither with
> `git am', nor with `patch -p1'.  I have to admit that I don't understand
> why...
> 
> Another question, would you mind to send patch series with a cover letter,
> please?
> 
> 
> Thanks,
> Corinna
> 

-- 
Andoni Arregi
Geschäftsführer
 
GTD GmbH
Ravensburger Str. 32a, 88677 Markdorf
T: +49 7544 96440 22 | M: +49 151 65620499 | F: +49 7544 96440 29
http://www.gtd-gmbh.de andoni.arregi@gtd-gmbh.de


  parent reply	other threads:[~2022-02-11 11:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-05  6:38 regression in Newlib 4.2.0 (lgammaf) Paul Zimmermann
2022-02-09 16:28 ` [PATCH 1/2] Improve lgammaf range for very small cases Andoni Arregi
2022-02-10 14:58   ` Corinna Vinschen
2022-02-10 16:07     ` [PATCH 0/2] Fix lgammaf and lgamma for small ranges and in [2, 3[ Andoni Arregi
2022-02-10 16:10     ` [PATCH 1/2] Improve lgammaf range for very small cases Andoni Arregi
2022-02-10 16:21       ` Paul Zimmermann
2022-02-10 16:12     ` [PATCH 2/2] Add a missing default case in lgamma Andoni Arregi
2022-02-10 17:29       ` Paul Zimmermann
2022-02-11 11:14         ` Andoni Arregi
2022-02-10 16:16     ` [PATCH 1/2] Improve lgammaf range for very small cases Andoni Arregi
2022-02-11 11:19     ` Andoni Arregi [this message]
2022-02-09 16:30 ` [PATCH 2/2] Add a missing default case in lgamma Andoni Arregi
2022-02-09 16:49 ` regression in Newlib 4.2.0 (lgammaf) Andoni Arregi
2022-02-11 11:16 ` [PATCH] Improve lgammaf range for very small cases Andoni Arregi
2022-02-14 13:46   ` Corinna Vinschen

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=d0a93f7b4920a8ee4d0c87f9b6470862031b8d71.camel@gtd-gmbh.de \
    --to=andoni.arregui@gtd-gmbh.de \
    --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).