From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 8D8CF3858C60 for ; Thu, 10 Feb 2022 14:58:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D8CF3858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644505089; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=G40/9Gnpxpa5wk6tSbnNY6ztMw/BWswRJu0tVrtk3So=; b=NKAJM+wB2RsQJLaOviSSrkNDdGq3kgZ72AVEFw54z1qY5zw3s3wuWKd+soVBMiTNgjENBv U5siCapxoEkwsd1W8D4fb6Kl+tF/qKiOZhaIOrE23yQ9PGRqEt9TjWUdzKvEKDJTxjNB5c hYBqqa7laNx6oato1KVxDJb+V7HyfQ0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-477-KKrAJoVxMJ-o0MZjDHbGaw-1; Thu, 10 Feb 2022 09:58:07 -0500 X-MC-Unique: KKrAJoVxMJ-o0MZjDHbGaw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E350F1B18BC5 for ; Thu, 10 Feb 2022 14:58:06 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.36.112.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9CF9C2B4DD for ; Thu, 10 Feb 2022 14:58:06 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 2D050A80F4D; Thu, 10 Feb 2022 15:58:05 +0100 (CET) Date: Thu, 10 Feb 2022 15:58:05 +0100 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH 1/2] Improve lgammaf range for very small cases Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <99cdb95d3263da03844fa0343c22d9e4ab87375e.camel@gtd-gmbh.de> MIME-Version: 1.0 In-Reply-To: <99cdb95d3263da03844fa0343c22d9e4ab87375e.camel@gtd-gmbh.de> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vinschen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, 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: Thu, 10 Feb 2022 14:58:14 -0000 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