GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
albeta.f
Go to the documentation of this file.
1*DECK ALBETA
2 FUNCTION albeta (A, B)
3C***BEGIN PROLOGUE ALBETA
4C***PURPOSE Compute the natural logarithm of the complete Beta
5C function.
6C***LIBRARY SLATEC (FNLIB)
7C***CATEGORY C7B
8C***TYPE SINGLE PRECISION (ALBETA-S, DLBETA-D, CLBETA-C)
9C***KEYWORDS FNLIB, LOGARITHM OF THE COMPLETE BETA FUNCTION,
10C SPECIAL FUNCTIONS
11C***AUTHOR Fullerton, W., (LANL)
12C***DESCRIPTION
13C
14C ALBETA computes the natural log of the complete beta function.
15C
16C Input Parameters:
17C A real and positive
18C B real and positive
19C
20C***REFERENCES (NONE)
21C***ROUTINES CALLED ALNGAM, ALNREL, GAMMA, R9LGMC, XERMSG
22C***REVISION HISTORY (YYMMDD)
23C 770701 DATE WRITTEN
24C 890531 Changed all specific intrinsics to generic. (WRB)
25C 890531 REVISION DATE from Version 3.2
26C 891214 Prologue converted to Version 4.0 format. (BAB)
27C 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
28C 900326 Removed duplicate information from DESCRIPTION section.
29C (WRB)
30C 900727 Added EXTERNAL statement. (WRB)
31C***END PROLOGUE ALBETA
32 EXTERNAL gamma
33 SAVE sq2pil
34 DATA sq2pil / 0.9189385332 0467274 e0 /
35C***FIRST EXECUTABLE STATEMENT ALBETA
36 p = min(a, b)
37 q = max(a, b)
38C
39 IF (p .LE. 0.0) CALL xermsg ('SLATEC', 'ALBETA',
40 + 'BOTH ARGUMENTS MUST BE GT ZERO', 1, 2)
41 IF (p.GE.10.0) GO TO 30
42 IF (q.GE.10.0) GO TO 20
43C
44C P AND Q ARE SMALL.
45C
46 albeta = log(gamma(p) * (gamma(q)/gamma(p+q)) )
47 RETURN
48C
49C P IS SMALL, BUT Q IS BIG.
50C
51 20 corr = r9lgmc(q) - r9lgmc(p+q)
52 albeta = alngam(p) + corr + p - p*log(p+q) +
53 1 (q-0.5)*alnrel(-p/(p+q))
54 RETURN
55C
56C P AND Q ARE BIG.
57C
58 30 corr = r9lgmc(p) + r9lgmc(q) - r9lgmc(p+q)
59 albeta = -0.5*log(q) + sq2pil + corr + (p-0.5)*log(p/(p+q))
60 1 + q*alnrel(-p/(p+q))
61 RETURN
62C
63 END
function albeta(a, b)
Definition albeta.f:3
function alngam(x)
Definition alngam.f:3
function alnrel(x)
Definition alnrel.f:3
charNDArray max(char d, const charNDArray &m)
Definition chNDArray.cc:230
charNDArray min(char d, const charNDArray &m)
Definition chNDArray.cc:207
function gamma(x)
Definition gamma.f:3
function r9lgmc(x)
Definition r9lgmc.f:3
subroutine xermsg(librar, subrou, messg, nerr, level)
Definition xermsg.f:3