NAG Library Routine Document
S14CBF
Note: before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.
1 Purpose
S14CBF returns the value of the logarithm of the beta function, , via the routine name.
2 Specification
REAL (KIND=nag_wp) S14CBF
INTEGER
IFAIL
REAL (KIND=nag_wp)
A, B
3 Description
S14CBF calculates values for
where
is the beta function given by
or equivalently
and
is the gamma function. Note that the beta function is symmetric, so that
.
In order to efficiently obtain accurate results several methods are used depending on the parameters and .
Let and . Then:
for
,
where
-
,
- and
- .
for
,
- for ,
- for ,
for , is reduced to the interval by ;
for
,
- for ,
- for , is reduced to the interval ;
- for ,
4 References
DiDonato A R and Morris A H (1992) Algorithm 708: Significant digit computation of the incomplete beta function ratios ACM Trans. Math. Software 18 360–373
5 Parameters
- 1: A – REAL (KIND=nag_wp)Input
On entry: the argument of the function.
Constraint:
.
- 2: B – REAL (KIND=nag_wp)Input
On entry: the argument of the function.
Constraint:
.
- 3: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
-
On entry, .
Constraint: .
On entry, .
Constraint: .
7 Accuracy
S14CBF should produce full relative accuracy for all input arguments.
None.
9 Example
This example reads values of the arguments and from a file, evaluates the function and prints the results.
9.1 Program Text
Program Text (s14cbfe.f90)
9.2 Program Data
Program Data (s14cbfe.d)
9.3 Program Results
Program Results (s14cbfe.r)