home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!usc!howland.reston.ans.net!bogus.sura.net!darwin.sura.net!paladin.american.edu!auvm!V9.HANSCOM.AF.MIL!SIGNORINOC
- Message-ID: <STAT-L%93010609444945@VM1.MCGILL.CA>
- Newsgroups: bit.listserv.stat-l
- Date: Wed, 6 Jan 1993 09:20:00 EST
- Sender: STATISTICAL CONSULTING <STAT-L@MCGILL1.BITNET>
- From: "SI00::SIGNORINOC" <SIGNORINOC%SI00.decnet@V9.HANSCOM.AF.MIL>
- Subject: Re: calculators and computers: precision
- Lines: 73
-
- E L E C T R O N I C M A I L
- (DDN Host Address: V3.HANSCOM.AF.MIL)
-
- Date: 06-Jan-1993 09:19
- From: Lt Curtis S. Signorino
- Username: SIGNORINOC
- Dept: ESC/XRPM
- Tel No: 617-377-7483 (DSN 478)
-
- TO: _WINS% ( _DDN[STAT-L@VM1.MCGILL.CA] )
-
-
- Subject: Re: calculators and computers: precision
-
-
-
-
- -----------------------------A T T A C H M E N T------------------------
-
- E L E C T R O N I C M A I L
- (DDN Host Address: V3.HANSCOM.AF.MIL)
-
- Date: 06-Jan-1993 09:17
- From: Lt Curtis S. Signorino
- SIGNORINOC
- Dept: ESC/XRPM
- Tel No: 617-377-7483 (DSN 478)
-
- TO: VMSMail User WINS%"<DANIEL%UHU (
- WINS%"<DANIEL%UHUNIX.BITNET@VM1.MCGILL.CA>"@SI09@MRGATE )
-
-
- Subject: Re: calculators and computers: precision
-
- Someone brought up the difficulty of computing large factorials.
- Many times the need to compute large factorials or large gamma
- function values is for an expression containing a ratio of
- factorials or gamma function values. While the individual
- factorials or gamma function values will cause an overflow, the
- resulting ratio is quite manageable. The trick, then, is to
- compute the ratio without having to compute the original numerator
- or denominator. Using the relationships
-
- X = exp( ln(X) )
-
- and
-
- ln(X1/X2) = ln(X1) - ln(X2),
-
- the factorial and gamma ratios can be computed as
-
- X1!
- -- = exp( lnfact(X1) - lnfact(X2) )
- X2!
-
- and
-
- Gamma(X1)
- --------- = exp( lngamma(X1) - lngamma(X2) )
- Gamma(X2)
-
- where lnfact() and lngamma() are numerical methods-based
- functions (using something like Sterling's formula for lngamma[]).
- These functions can be found in a number of numerical methods
- books. I believe _Numerical_Recipes_ has both.
-
- I've found the precision of the above methods to be
- acceptable for my research. For those who are familiar with the
- above, have you had any problems with poor precision due to the
- numerical methods?
-
- curt signorino
- signorinoc@v3.hanscom.af.mil
-