FLINT3.7.0-dev

acb_lambertw

Synopsis#include <flint/acb.h>
void acb_lambertw(acb_t res, const acb_t z, const fmpz_t k, int flags, slong prec)source

Sets res to the branch W_k(z) of the Lambert W function, the solution of w e^w = z; k = 0 is the principal branch. The branch cuts are those of [CGHJK1996]. The algorithm is described in [Joh2017b] and on The Lambert W function.

With flags equal to ACB_LAMBERTW_LEFT, the function computes W_{\mathrm{left}|k}(z), which is W_k(z) in the upper half plane and W_{k+1}(z) in the lower half plane, connected continuously to the left of the branch points; the branch cut on (-\infty, 0) is rotated counterclockwise to (0, +\infty). (For k = -1 and k = 0 there is also a branch cut on (-1/e, 0), continuous from below instead of from above to keep counterclockwise continuity.)

With ACB_LAMBERTW_MIDDLE, it computes W_{\mathrm{middle}}(z), which is W_{-1}(z) in the upper half plane and W_1(z) in the lower half plane, connected continuously through (-1/e, 0), with branch cuts on (-\infty, -1/e) and (0, +\infty). It extends the real analytic function W_{-1}(x) on (-1/e, 0) to a complex analytic function, whereas the standard W_{-1}(z) has a branch cut on that segment.

Guides#

References#

  • [CGHJK1996] R. M. Corless, G. H. Gonnet, D. E. Hare, D. J. Jeffrey and D. E. Knuth, "On the Lambert W function", Advances in Computational Mathematics, 5(1) (1996), 329-359
  • [Joh2017b] F. Johansson, "Computing the Lambert W function in arbitrary-precision complex interval arithmetic", preprint (2017), https://arxiv.org/abs/1705.03266
Cite this page

The FLINT team, “acb_lambertw (acb.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/acb/acb_lambertw.html (generated 2026-10-20).