GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
dlbeta.f
Go to the documentation of this file.
1*DECK DLBETA
2 DOUBLE PRECISION FUNCTION dlbeta (A, B)
3C***BEGIN PROLOGUE DLBETA
4C***PURPOSE Compute the natural logarithm of the complete Beta
5C function.
6C***LIBRARY SLATEC (FNLIB)
7C***CATEGORY C7B
8C***TYPE DOUBLE 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 DLBETA(A,B) calculates the double precision natural logarithm of
15C the complete beta function for double precision arguments
16C A and B.
17C
18C***REFERENCES (NONE)
19C***ROUTINES CALLED D9LGMC, DGAMMA, DLNGAM, DLNREL, XERMSG
20C***REVISION HISTORY (YYMMDD)
21C 770701 DATE WRITTEN
22C 890531 Changed all specific intrinsics to generic. (WRB)
23C 890531 REVISION DATE from Version 3.2
24C 891214 Prologue converted to Version 4.0 format. (BAB)
25C 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
26C 900727 Added EXTERNAL statement. (WRB)
27C***END PROLOGUE DLBETA
28 DOUBLE PRECISION a, b, p, q, corr, sq2pil, d9lgmc, dgamma, dlngam,
29 1 dlnrel
30 EXTERNAL dgamma
31 SAVE sq2pil
32 DATA sq2pil / 0.9189385332 0467274178 0329736405 62 d0 /
33C***FIRST EXECUTABLE STATEMENT DLBETA
34 p = min(a, b)
35 q = max(a, b)
36C
37 IF (p .LE. 0.d0) CALL xermsg ('SLATEC', 'DLBETA',
38 + 'BOTH ARGUMENTS MUST BE GT ZERO', 1, 2)
39C
40 IF (p.GE.10.d0) GO TO 30
41 IF (q.GE.10.d0) GO TO 20
42C
43C P AND Q ARE SMALL.
44C
45 dlbeta = log(dgamma(p) * (dgamma(q)/dgamma(p+q)) )
46 RETURN
47C
48C P IS SMALL, BUT Q IS BIG.
49C
50 20 corr = d9lgmc(q) - d9lgmc(p+q)
51 dlbeta = dlngam(p) + corr + p - p*log(p+q)
52 1 + (q-0.5d0)*dlnrel(-p/(p+q))
53 RETURN
54C
55C P AND Q ARE BIG.
56C
57 30 corr = d9lgmc(p) + d9lgmc(q) - d9lgmc(p+q)
58 dlbeta = -0.5d0*log(q) + sq2pil + corr + (p-0.5d0)*log(p/(p+q))
59 1 + q*dlnrel(-p/(p+q))
60 RETURN
61C
62 END
charNDArray max(char d, const charNDArray &m)
Definition chNDArray.cc:230
charNDArray min(char d, const charNDArray &m)
Definition chNDArray.cc:207
double precision function d9lgmc(x)
Definition d9lgmc.f:3
double precision function dgamma(x)
Definition dgamma.f:3
double precision function dlbeta(a, b)
Definition dlbeta.f:3
double precision function dlngam(x)
Definition dlngam.f:3
double precision function dlnrel(x)
Definition dlnrel.f:3
subroutine xermsg(librar, subrou, messg, nerr, level)
Definition xermsg.f:3