lambertW: Lambert W

View source: R/utils.R

lambertWR Documentation

Lambert W

Description

Ben Bolker's port of Lambert W from GNU Scientific Library (GPLV3)

Usage

lambertW(z, b = 0, maxiter = 10, eps = .Machine$double.eps, min.imag = 1e-09)

Arguments

z

input value

b

branch, set to principal by default

maxiter

Halley iteration count

eps

error precision

min.imag

minimum for imaginary solution

Details

Ben Bolker's port of Lambert W from GNU Scientific Library

Value

numeric

Author(s)

Benjamin Bolker (port)

Examples

## Principal branch: W(1) ~ 0.5671
lambertW(1)

## Verify: W(z) * exp(W(z)) == z
w <- lambertW(2)
w * exp(w)

beezdemand documentation built on March 3, 2026, 9:07 a.m.