-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add Lambert W function to TMath #8471
Description
Is your feature request related to a problem? Please describe.
I wanted to use the Lambert W function to find a root of a function.
Describe the solution you'd like
Having a TMath::LambertW(Double_t x, Int_t k, Double_t tol=1e-10) and TMath::LambertW(TComplex x, Int_t k, Double_t tol=1e-10).
Describe alternatives you've considered
Of course one can just solve it numerically by finding a root.
Additional context
On the Lambert W function provides some theoretical background.
I'm aware of two implementations of the Lambert W function in code:
https://github.com/fredrik-johansson/mpmath/blob/c11db84b3237bd8fc6721f5a0c5d7c0c98a24dc1/mpmath/functions/functions.py#L327-L490
and
https://github.com/scipy/scipy/blob/master/scipy/special/_lambertw.pxd
which is based on the first one.