lambertW

 

Description

Calculate the real values of Lambert’s W function W(x)

Syntax

double lambertW(const double dP, int branch, int offset, int* nFail = NULL)

Parameters

dP
[input] input argument
branch
[input] the real branch required, should be 0 or -1.
offset
[input] controls whether or not dP is being specified as an offset from -exp(-1), should be 0 or 1.
nFail
[output] on successful exit, it returns the NAG error code NE_NOERROR; if an error or warning has been detected, then it returns the specific error or warning code.

Return

Returns the real values of Lambert’s W function W(x)

Examples

EX1

void lambertW_ex1()
{
        double x[]= {0.25, 0.5, 0.75};
        int branch = 0;
        for(int ii = 0; ii<3; ii++)
      printf("%f %d %d: %f\n", x[ii], branch, ii%2, lambertW(x[ii], branch, ii%2));
}

Remark

See Also

chi2cdf

header to Include

origin.h

Reference