W {LambertW}R Documentation

Lambert W function and derivative

Description

The Lambert W function W(z), W_1(z) and its first derivative (d1W(z), d1W_1(z)). For both the principal and non-principal branch. (These are wrapper functions for lambert_W0, lambert_Wm1 in the package gsl.)

Usage

W(z)
W_1(z)
d1W(z)
d1W_1(z)

Arguments

z a numeric vector of real values.

Details

The Lambert W function W(z) is implicitly defined as the inverse function of

W(z) exp(W(z)) = z.

For z >=q 0 the solution is unique W(z).

For -1/e <=q z < 0 it has two solutions: the principal (W(z)) and non-principal branch (W_1(z)).

For z < -1/e no solution exists in the reals.

The derivative can be expressed as a function of W(z):

W'(z) = frac{1}{(1 + W(z)) exp(W(z)} = frac{W(z)}{z(1 + W(z))}, quad z neq 0, -1/e.

For details see the references.

Value

Function value or NaN if z < -1/e.

Author(s)

Georg M. Goerg

References

Corless, R. M., G. H. Gonnet, D. E. G. Hare, and D. J. Jeffrey (1993). “On the Lambert W function”. preprint.

See Also

lambert_W0, lambert_Wm1

Examples

W(5) # exists in R
W(-5) # does not exist in R

W(-0.25) # the "reasonable" input event
W_1(-0.25) # the "extreme" input event

[Package LambertW version 0.1.9 Index]