version 0.4.1
Ikarus::util Namespace Reference

Functions

template<typename ST = double>
ST lambertW0 (ST z, int maxIterations=20, ST eps=std::numeric_limits< ST >::epsilon())
 Implementation of the principal branch of the Lambert-W function (branch 0 in the domain \( [- \dfrac{1}{e}, \inf) \) ), that is defined as the inverse function of \( f: x \mapsto xe^x \). It is defined for inputs of \( [- \dfrac{1}{e}, \inf) \). More...
 

Function Documentation

◆ lambertW0()

template<typename ST = double>
ST Ikarus::util::lambertW0 ( ST  z,
int  maxIterations = 20,
ST  eps = std::numeric_limits<ST>::epsilon() 
)

The implementation uses Halley's iterative method and is inspired by https://github.com/JuliaMath/LambertW.jl/blob/master/src/LambertW.jl (licensed under MIT "Expat" License).

Template Parameters
STthe ScalarType (defaults to double).
Parameters
zthe input value.
maxIterationsoptionally define a maximmum of iteration.
epsoptionally define the epsilon of the iteration process (detuls to machine epsilon).
Returns
ST the output value.