This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [libgfortran,patch] Add fallback functions tgamma, lgamma, tgammaf and lgammaf
- From: "François-Xavier Coudert" <fxcoudert at gmail dot com>
- To: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>
- Cc: "gcc-patches list" <gcc-patches at gcc dot gnu dot org>, "Thomas Koenig" <tkoenig at alice-dsl dot net>
- Date: Fri, 16 Nov 2007 18:09:31 +0000
- Subject: Re: [libgfortran,patch] Add fallback functions tgamma, lgamma, tgammaf and lgammaf
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=TlPrgPdMenkx/ngeeZ2pT96K+aQV0tiigqOWcsaipo0=; b=OA9I2IYEyHpQUmJM0L0IxucWWrXtfC6HSQtylSPWdWr1E1tR5c32JGkRCISirgk+2be0oas+MCTrVXz5VjrbVDK2bB/jUUyYLqNLv6czPlZEAk4QXnVMvCUsyF2TWNyRRRnBczIUK+rVtsyl3ZUpmKzY6OtVdidRQW3D7zSPIes=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=IGSjCuaqEc9U/2qjKD0pbbHWzom97T3r1T5cwPLO0GxjAKSakmYm40LdclTPms6atAxvaV5H8hyJny+1DacIBWesOr0i5CRbT+4Ozsy6fXJCp9R6Vax9pR1MphRacbL+clVGk2+rWoc7TMquVO0hgNNzs/+iEivSq/zL2hhcq2E=
- References: <1EB2452F-22DC-497A-822E-8BE1E9A78615@gmail.com>
ping; I tend to think that for patches that have a potential to
trigger problems on non-mainstream targets, the earlier they get
committed, the better.
On Nov 11, 2007 5:14 PM, FX Coudert <fxcoudert@gmail.com> wrote:
> Attached patch adds fallback implementations of gamma-related C99
> functions that are missing on some targets. gamma and lgamma follow
> the formulas used in the Fortran netlib implementation, with extra
> care taken of exceptionnal values (when an argument or the result is
> either an infinity or a NaN) and handling of negative arguments for
> lgamma (which the netlib version ignores altogether).
>
> Results of these implementation have be checked against glibc results
> on x86_64-linux, and only small differences in the last significant
> digits are observed (enough for a fallback implementation; it is also
> noteworthy that glibc results are always exact, especially for
> lgamma). There is one case where a difference exist: for very large
> negative arguments, this implementation returns +Inf while glibc
> returns NaN; I don't think it's worth putting extra effort into this
> case.
>
> Regtested on x86_64-linux by pretending (tweaking config.h) that it
> didn't have any of these function in libm. OK to commit?
>
> FX
>
> PS: Thomas, as you were interested in these, if you later feel like
> refining this implementation, please feel free to do so!
>
>
>
> :ADDPATCH libgfortran: