PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_roots_lambertw_complex (c05bb)
Purpose
nag_roots_lambertw_complex (c05bb) computes the values of Lambert's function .
Syntax
Description
nag_roots_lambertw_complex (c05bb) 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_roots_lambertw_complex (c05bb) 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_roots_lambertw_complex (c05bb) that you are providing
, not
, in
z.
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
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
-
The branch required.
- 2:
– logical scalar
-
Controls whether or not
z is being specified as an offset from
.
- 3:
– complex scalar
-
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
.
Optional Input Parameters
None.
Output Parameters
- 1:
– complex scalar
-
The value
: see also the description of
z.
- 2:
– double scalar
-
The residual
: see also the description of
z.
- 3:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Note: nag_roots_lambertw_complex (c05bb) may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the function:
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
- W
-
For the given offset , is negligibly different from .
is close to .
- W
-
The iterative procedure used internally did not converge in
iterations. Check the value of
resid for the accuracy of
w.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
For a high percentage of
,
nag_roots_lambertw_complex (c05bb) is accurate to the number of decimal digits of precision on the host machine (see
nag_machine_decimal_digits (x02be)). 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.
Further Comments
The following figures show the principal branch of
.
Figure 2:
Figure 3:
Figure 4:
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.
Open in the MATLAB editor:
c05bb_example
function c05bb_example
fprintf('c05bb example results\n\n');
branch = int64(0);
offset = false;
z = [0.5-i; 1+2.3*i; 4.5-0.1*i; 6+6*i];
fprintf('\nBranch = %d\n', branch);
if offset
fprintf('Offset = true\n');
else
fprintf('Offset = false\n');
end
fprintf('\n%12s%16s%18s%9s\n','z','w','resid','ifail');
for j =1:4
[w, resid, ifail] = c05bb(branch, offset, z(j));
fprintf('%10.1f %4.1fi', real(z(j)), imag(z(j)))
fprintf('%10.5f %8.5fi %12.5e %3d\n', real(w), imag(w), resid, ifail);
end
c05bb example results
Branch = 0
Offset = false
z w resid ifail
0.5 -1.0i 0.51651 -0.42205i 5.55112e-17 0
1.0 2.3i 0.87361 0.57698i 1.11022e-16 0
4.5 -0.1i 1.26735 -0.01242i 0.00000e+00 0
6.0 6.0i 1.61492 0.49051i 1.25607e-15 0
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015