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_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
- 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.
An unexpected error has been triggered by this function. Please contact
NAG.
See
Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
- 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.
nag_lambertW (c05bac) is not threaded in any implementation.
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.