NAG Library Routine Document
c05baf
(lambertw_real)
1
Purpose
c05baf returns the real values of Lambert's function , via the routine name.
2
Specification
Fortran Interface
Real (Kind=nag_wp) | :: | c05baf | Integer, Intent (In) | :: |
branch | Integer, Intent (Inout) | :: |
ifail | Real (Kind=nag_wp), Intent (In) | :: |
x | Logical, Intent (In) | :: |
offset |
|
C Header Interface
#include nagmk26.h
double |
c05baf_ (
const double *x,
const Integer *branch,
const logical *offset,
Integer *ifail) |
|
3
Description
c05baf calculates an approximate value for the real branches of Lambert's
function (sometimes known as the ‘product log’ or ‘Omega’ function), which is the inverse function of
The function
is many-to-one, and so, except at
,
is multivalued.
c05baf restricts
and its argument
to be real, resulting in a function defined for
and which is double valued on the interval
. This double-valued function is split into two real-valued branches according to the sign of
. We denote by
the branch satisfying
for all real
, and by
the branch satisfying
for all real
. You may select your branch of interest using the argument
branch.
The precise method used to approximate
is described fully in
Barry et al. (1995). For
close to
greater accuracy comes from evaluating
rather than
: by setting
on entry you inform
c05baf that you are providing
, not
, in
x.
4
References
Barry D J, Culligan–Hensley P J, and Barry S J (1995) Real values of the -function ACM Trans. Math. Software 21(2) 161–171
5
Arguments
- 1: – Real (Kind=nag_wp)Input
-
On entry: if
,
x is the offset
from
of the intended argument to
; that is,
is computed, where
.
If
,
x is the argument
of the function; that is,
is computed, where
.
Constraints:
- if , ;
- if , .
- 2: – IntegerInput
-
On entry: the real branch required.
- The branch is selected.
- The branch is selected.
Constraint:
or .
- 3: – LogicalInput
-
On entry: controls whether or not
x is being specified as an offset from
.
- 4: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation 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, because for this routine the values of the output arguments may be useful even if
on exit, 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).
Note: c05baf may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
-
On entry, .
Constraint: or .
On entry, , and .
Constraint: if and then .
On entry, , and .
Constraint: if and then .
On entry, and .
Constraint: if then .
On entry, and .
Constraint: if then .
-
For the given offset , is negligibly different from : .
is close to . Enter as an offset to for greater accuracy: .
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See
Section 3.7 in How to Use the NAG Library and its Documentation for further information.
7
Accuracy
For a high percentage of legal
on input,
c05baf is accurate to the number of decimal digits of precision on the host machine (see
x02bef). An extra digit may be lost on some implementations and for a small proportion of such
. This depends on the accuracy of the base-
logarithm on your system.
8
Parallelism and Performance
c05baf is not threaded in any implementation.
None.
10
Example
This example reads from a file the values of the required branch, whether or not the arguments to are to be considered as offsets to , and the arguments themselves. It then evaluates the function for these sets of input data and prints the results.
10.1
Program Text
Program Text (c05bafe.f90)
10.2
Program Data
Program Data (c05bafe.d)
10.3
Program Results
Program Results (c05bafe.r)