NAG C Library Function Document
nag_lambertW_complex (c05bbc)
1
Purpose
nag_lambertW_complex (c05bbc) computes the values of Lambert's function .
2
Specification
#include <nag.h> |
#include <nagc05.h> |
void |
nag_lambertW_complex (Integer branch,
Nag_Boolean offset,
Complex z,
Complex *w,
double *resid,
NagError *fail) |
|
3
Description
nag_lambertW_complex (c05bbc) calculates an approximate value for 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_complex (c05bbc) allows you to specify the branch of
on which you would like the results to lie by using the argument
branch. Our choice of branch cuts is as in
Corless et al. (1996), and the ranges of the branches of
are summarised in
Figure 1.
Figure 1: Ranges of the branches of
For more information about the closure of each branch, which is not displayed in
Figure 1, see
Corless et al. (1996). The dotted lines in the Figure denote the asymptotic boundaries of the branches, at multiples of
.
The precise method used to approximate
is as described in
Corless et al. (1996). For
close to
greater accuracy comes from evaluating
rather than
: by setting
on entry you inform
nag_lambertW_complex (c05bbc) that you are providing
, not
, in
z.
4
References
Corless R M, Gonnet G H, Hare D E G, Jeffrey D J and Knuth D
E (1996) On the Lambert function Advances in Comp. Math. 3 329–359
5
Arguments
- 1:
– IntegerInput
-
On entry: the branch required.
- 2:
– Nag_BooleanInput
-
On entry: controls whether or not
z is being specified as an offset from
.
- 3:
– ComplexInput
-
On entry: if
,
z is the offset
from
of the intended argument to
; that is,
is computed, where
.
If
,
z is the argument
of the function; that is,
is computed, where
.
- 4:
– Complex *Output
-
On exit: the value
: see also the description of
z.
- 5:
– double *Output
-
On exit: the residual
: see also the description of
z.
- 6:
– NagError *Input/Output
-
The NAG error argument (see
Section 3.7 in How to Use the NAG Library and its Documentation).
6
Error Indicators and Warnings
- 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_BAD_PARAM
-
On entry, argument had an illegal value.
- 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.
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.
- NW_REAL
-
For the given offset , is negligibly different from : and .
is close to . Enter as an offset to for greater accuracy: and .
- NW_TOO_MANY_ITER
-
The iterative procedure used internally did not converge in
iterations. Check the value of
resid for the accuracy of
w.
7
Accuracy
For a high percentage of
,
nag_lambertW_complex (c05bbc) 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 platforms and for a small proportion of
. This depends on the accuracy of the base-
logarithm on your system.
8
Parallelism and Performance
nag_lambertW_complex (c05bbc) is not threaded in any implementation.
The following figures show the principal branch of
.
Figure 2:
Figure 3:
Figure 4:
10
Example
This example reads from a file the value 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 (c05bbce.c)
10.2
Program Data
Program Data (c05bbce.d)
10.3
Program Results
Program Results (c05bbce.r)