C++ implementation of the Lambert W(x) function