NAG FL Interface
s22bbf (hyperg_confl_real_scaled)
1
Purpose
s22bbf returns a value for the confluent hypergeometric function , with real parameters and and real argument . The solution is returned in the scaled form . This function is sometimes also known as Kummer's function .
2
Specification
Fortran Interface
Integer, Intent (Inout) |
:: |
ifail |
Integer, Intent (Out) |
:: |
scm |
Real (Kind=nag_wp), Intent (In) |
:: |
ani, adr, bni, bdr, x |
Real (Kind=nag_wp), Intent (Out) |
:: |
frm |
|
C Header Interface
#include <nag.h>
void |
s22bbf_ (const double *ani, const double *adr, const double *bni, const double *bdr, const double *x, double *frm, Integer *scm, Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
s22bbf_ (const double &ani, const double &adr, const double &bni, const double &bdr, const double &x, double &frm, Integer &scm, Integer &ifail) |
}
|
The routine may be called by the names s22bbf or nagf_specfun_hyperg_confl_real_scaled.
3
Description
s22bbf returns a value for the confluent hypergeometric function , with real parameters and and real argument , in the scaled form , where is the real scaled component and is the integer power of two scaling. This function is unbounded or not uniquely defined for equal to zero or a negative integer.
The confluent hypergeometric function is defined by the confluent series,
where
is the rising factorial of
.
is a solution to the second order ODE (Kummer's Equation):
Given the parameters and argument , this routine determines a set of safe values and selects an appropriate algorithm to accurately evaluate the functions . The result is then used to construct the solution to the original problem using, where necessary, recurrence relations and/or continuation.
For improved precision in the final result, this routine accepts and split into an integral and a decimal fractional component. Specifically , where and is integral. is similarly deconstructed.
Additionally, an artificial bound, is placed on the magnitudes of , and to minimize the occurrence of overflow in internal calculations. , where . It should, however, not be assumed that this routine will produce an accurate result for all values of , and satisfying this criterion.
Please consult the
NIST Digital Library of Mathematical Functions for a detailed discussion of the confluent hypergeometric function including special cases, transformations, relations and asymptotic approximations.
4
References
Pearson J (2009) Computation of hypergeometric functions MSc Dissertation, Mathematical Institute, University of Oxford
5
Arguments
-
1:
– Real (Kind=nag_wp)
Input
-
On entry: , the nearest integer to , satisfying .
-
2:
– Real (Kind=nag_wp)
Input
-
On entry: , the signed decimal remainder satisfying and .
Constraint:
.
Note: if
,
will be used, where
is the
machine precision as returned by
x02ajf.
-
3:
– Real (Kind=nag_wp)
Input
-
On entry: , the nearest integer to , satisfying .
Constraints:
- ;
- ;
- if , .
-
4:
– Real (Kind=nag_wp)
Input
-
On entry: , the signed decimal remainder satisfying and .
Constraint:
.
Note: if
,
will be used, where
is the
machine precision as returned by
x02ajf.
-
5:
– Real (Kind=nag_wp)
Input
-
On entry: the argument of the function.
Constraint:
.
-
6:
– Real (Kind=nag_wp)
Output
-
On exit:
, the scaled real component of the solution satisfying
.
Note: if overflow occurs upon completion, as indicated by , the value of returned may still be correct. If overflow occurs in a subcalculation, as indicated by , this should not be assumed.
-
7:
– Integer
Output
-
On exit:
, the scaling power of two, satisfying
.
Note: if overflow occurs upon completion, as indicated by
, then
, where
is the largest representable integer (see
x02bbf). If overflow occurs during a subcalculation, as indicated by
,
may or may not be greater than
. In either case,
will have been returned.
-
8:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended.
When the value or 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:
-
Underflow occurred during the evaluation of .
The returned value may be inaccurate.
-
On completion, overflow occurred in the evaluation of .
-
All approximations have completed, and the final residual estimate indicates some precision may have been lost.
Relative residual .
-
All approximations have completed, and the final residual estimate indicates no accuracy can be guaranteed.
Relative residual .
-
Overflow occurred in a subcalculation of .
The answer may be completely incorrect.
-
On entry, .
Constraint: .
-
ani is non-integral.
On entry,
.
Constraint:
.
-
On entry, .
Constraint: .
-
On entry, .
Constraint: .
-
On entry, .
is undefined when is zero or a negative integer.
-
bni is non-integral.
On entry,
.
Constraint:
.
-
On entry, .
Constraint: .
-
On entry, .
Constraint: .
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See
Section 9 in the Introduction to the NAG Library FL Interface for further information.
7
Accuracy
In general, if
, the value of
may be assumed accurate, with the possible loss of one or two decimal places. Assuming the result does not under or overflow, an error estimate
is made internally using equation
(1). If the magnitude of
is sufficiently large a
nonzero
ifail
will be returned. Specifically,
|
|
|
|
|
|
A further estimate of the residual can be constructed using equation
(1), and the differential identity,
This estimate is however, dependent upon the error involved in approximating and .
8
Parallelism and Performance
s22bbf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
s22bbf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The values of and are implementation dependent. In most cases, if , and will be returned, and if is finite, the fractional component will be bound by , with chosen accordingly.
The values returned in
frm (
) and
scm (
) may be used to explicitly evaluate
, and may also be used to evaluate products and ratios of multiple values of
as follows,
10
Example
This example evaluates the confluent hypergeometric function at two points in scaled form using s22bbf, and subsequently calculates their product and ratio without having to explicitly construct .
10.1
Program Text
10.2
Program Data
None.
10.3
Program Results