Learn R Programming

SimInf (version 11.1.0)

lambertW0: Lambert W0 function

Description

The principal branch of the Lambert W function, which solves \(W e^W = x\). Defined for \(x >= -1/e\), with output in the range \([-1, \infty)\). The value is calculated using the GNU Scientific Library (GSL).

Usage

lambertW0(x)

Value

A numeric vector of the same length as x containing the principal branch of the Lambert W function evaluated at each element.

Arguments

x

A numeric vector of values.

References

GNU Scientific Library <https://www.gnu.org/software/gsl/>

Examples

Run this code
## Should equal 1, as 1 * exp(1) = e.
lambertW0(exp(1))

## Should equal 0, as 0 * exp(0) = 0.
lambertW0(0)

## Should equal -1.
lambertW0(-exp(-1))

Run the code above in your browser using DataLab