lambertw

lambertw

lambertw(z, k=- 1)[source]

Return \(w\) from the k’th branch of the LambertW function.

\[z = we^w, \qquad w = W_k(z).\]
Parameters
  • z (float, array_like) – Argument. You can assume that z >= -exp(-1) and that z <= 0 if k == -1. Raise ValueError otherwise (unless your code correctly extends \(W(z)\) to the complex plane).

  • k ([0, -1]) – Branch. If k == 0, then return the solution \(w>-1\), otherwise if k == -1, return the solution \(w < -1\)

Notes

Do not use a canned implementation, even if you find one in SciPy. Write your own version.