🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.fortran
Article #6562

Re: Fastest code for Gamma function

#6562
From: Andrej Panjkov
Date: Mon, 08 May 2000 00:00
40 lines
2950 bytes
Leonard Howell wrote:
> 
> Hi all --
> 
> I need to compute the gamma probability density function  g(x;a,b)=C(a,b)
> x**(a-1) exp(-x/b) on the order of 10**10 calls (on many different
> occasions) and thus would like to use the FASTEST algorithm available.  It
> must also be double precision with 14 or 15 decimal places of accuracy.
> Advice/coded FORTRAN solutions greatly appreciated.  Other language
> solutions also welcome, if the speed and accuracy is achieved.
> 
> Thanks, Leonard
Some older refs, which may be useful as starting points for citation
searches:

DiDonato AR and Morris, AH, Computation of the incomplete gamma function
ratios and their inverses, ACM Trans MathSoftware 12 1986 pp 377 - 393

Kuki, H, Complex Gamma Function with Error Control, Comm ACM 15 (1972) pp
262-267

Spira R, Calculation of the Gamma Function by Stirling's formula, Math Comp
25 (1971) pp 317 - 322

I got these from the venerable NSWC Library of Mtahematical Subroutines
manual.

-- 
!--------------------------------------------------------------------------!
! Dr Andrej Panjkov, Analyst/Programmer                                    !
! Numerical Modelling Project, Coal Mine Engineering Group                 !
! CSIRO Division of Exploration and Mining                                 !
! Queensland Centre for Advanced Technologies        Tel:  +61 7 3212 4693 !
! PO Box 883, Kenmore (Brisbane),                    Fax:  +61 7 3212 4455 !
! Queensland, Australia, 4069                     Mobile:     0417 551 435 !
!--------------------------------------------------------------------------!
! Andrej.Panjkov@dem.csiro.au                          A.Panjkov@uq.net.au !
!--------------------------------------------------------------------------!
! This email is formatted for 76 character displays, using fixed fonts.    !
!--------------------------------------------------------------------------!
Technical Details
Message-ID: <39160647.C17FEC12@dem.csiro.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <fGNQ4.51301$WF.2761743@bgtnsc04-news.ops.worldnet.att.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d632,8bad7910b3fe0dc6
X-Google-Attributes: gid10d632,public
X-Google-Thread: 104500,8bad7910b3fe0dc6
X-Google-Attributes: gid104500,public
X-Google-Thread: 1094ba,8bad7910b3fe0dc6
X-Google-Attributes: gid1094ba,public
From: Andrej Panjkov <Andrej.Panjkov@dem.csiro.au>
Subject: Re: Fastest code for Gamma function
Date: 2000/05/08
Message-ID: <39160647.C17FEC12@dem.csiro.au>
X-Deja-AN: 620462638
Content-Transfer-Encoding: 7bit
References: <fGNQ4.51301$WF.2761743@bgtnsc04-news.ops.worldnet.att.net>
To: Leonard Howell <leowood@worldnet.att.net>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@news.cat.csiro.au
X-Trace: news.cat.csiro.au 957744712 25875 140.253.20.55 (8 May 2000 00:11:52 GMT)
Organization: CSIRO Division of Exploration and Mining
Mime-Version: 1.0
NNTP-Posting-Date: 8 May 2000 00:11:52 GMT
Newsgroups: comp.lang.fortran,computer42.statistik,sci.stat.math