From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gtd-gmbh.de (mail.gtd.eu [46.24.46.35]) by sourceware.org (Postfix) with ESMTPS id BE7F7385800E for ; Fri, 11 Feb 2022 11:22:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BE7F7385800E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gtd-gmbh.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=gtd-gmbh.de X-MDAV-Result: clean X-MDAV-Processed: gtd-gmbh.de, Fri, 11 Feb 2022 12:19:36 +0100 Received: by gtd-gmbh.de (MDaemon PRO v21.0.3) with ESMTPSA id md5001016223429.msg; Fri, 11 Feb 2022 12:19:35 +0100 X-Spam-Processed: gtd-gmbh.de, Fri, 11 Feb 2022 12:19:35 +0100 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 109.90.104.197 X-MDArrival-Date: Fri, 11 Feb 2022 12:19:35 +0100 X-Authenticated-Sender: andoni.arregui@gtd-gmbh.de X-Return-Path: prvs=10417d22d5=andoni.arregui@gtd-gmbh.de X-Envelope-From: andoni.arregui@gtd-gmbh.de X-MDaemon-Deliver-To: newlib@sourceware.org Message-ID: Subject: Re: [PATCH 1/2] Improve lgammaf range for very small cases From: Andoni Arregi Reply-To: andoni.arregui@gtd-gmbh.de To: newlib@sourceware.org Date: Fri, 11 Feb 2022 12:19:33 +0100 In-Reply-To: References: <99cdb95d3263da03844fa0343c22d9e4ab87375e.camel@gtd-gmbh.de> Organization: GTD GmbH Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MDCFSigsAdded: gtd-gmbh.de X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2022 11:22:34 -0000 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