nag_lambertW (c05bac) 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. nag_lambertW (c05bac) 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 nag_lambertW (c05bac) that you are providing
, not
, in
x.
- NE_INT
-
On entry, .
Constraint: or .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
- NE_REAL
-
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 .
- NW_REAL
-
For the given offset , is negligibly different from : .
is close to . Enter as an offset to for greater accuracy: .
For a high percentage of legal
on input, nag_lambertW (c05bac) is accurate to the number of decimal digits of precision on the host machine (see
nag_decimal_digits (X02BEC)). 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.
Not applicable.
None.
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.