From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id E3D8B385E830 for ; Fri, 4 Sep 2020 19:30:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E3D8B385E830 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-kFDAqJ8RO8quMv38nlA_dw-1; Fri, 04 Sep 2020 15:30:43 -0400 X-MC-Unique: kFDAqJ8RO8quMv38nlA_dw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2BDF588EF0D for ; Fri, 4 Sep 2020 19:30:42 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-118-162.rdu2.redhat.com [10.10.118.162]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED6DD5C1D0 for ; Fri, 4 Sep 2020 19:30:41 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 0A228A83A8D; Fri, 4 Sep 2020 21:30:40 +0200 (CEST) Date: Fri, 4 Sep 2020 21:30:40 +0200 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH] libm: Fix 'gamma' and 'gammaf' functions. Clean up other gamma code. [v2] Message-ID: <20200904193040.GX4127@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20200904162527.2145547-1-keithp@keithp.com> MIME-Version: 1.0 In-Reply-To: <20200904162527.2145547-1-keithp@keithp.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 04 Sep 2020 19:30:46 -0000 On Sep 4 09:25, Keith Packard via Newlib wrote: > The current gamma, gamma_r, gammaf and gammaf_r functions return > |gamma(x)| instead of ln(|gamma(x)|) due to a change made back in 2002 > to the __ieee754_gamma_r implementation. This patch fixes that, making > all of these functions map too their lgamma equivalents. > > To fix the underlying bug, the __ieee754_gamma functions have been > changed to return gamma(x), removing the _r variants as those are no > longer necessary. Their names have been changed to __ieee754_tgamma to > avoid potential confusion from users. > > Now that the __ieee754_tgamma functions return the correctly signed > value, the tgamma functions have been modified to use them. > > libm.a now exposes the following gamma functions: > > ln(|gamma(x)|): > > __ieee754_lgamma_r > __ieee754_lgammaf_r > > lgamma > lgamma_r > gamma > gamma_r > > lgammaf > lgammaf_r > gammaf > gammaf_r > > lgammal (on machines where long double is double) > > gamma(x): > > __ieee754_tgamma > __ieee754_tgammaf > tgamma > tgammaf > tgammal (on machines where long double is double) > > Additional aliases for any of the above functions can be added if > necessary; in particular, I'm not sure if we need to include > __ieee754_gamma*_r functions (which would return ln(|(gamma(x)|). > > Signed-off-by: Keith Packard Pushed. Thanks, Corinna