Better way to compute this Lambert W function?

119 Views Asked by At

I have an expression of this form:

$$W_0\left(\dfrac{\exp(\frac{a}{d})}{d \cdot \exp(\frac{b}{d})}\right)$$

However a lot of online implementations that use the Newton approximation will experience data type overflow since the process involves taking $e^{\text{big number}}$ since these are already exp terms.

Is there a way to simplify this in any way, shape, or form?

1

There are 1 best solutions below

1
On BEST ANSWER

It seems you should have a direct implementation of $l(x)=W(e^{x})$. I do not know of any such implementation so I guess, you should write it yourself. Just use your favorite solver (Newton or whatever) to solve the defining equation $$ \ln y +y = x$$ with $l(x)=y$. A proper starting value is $y_0=x$.

Given an implementation of the function $l$, you obtain your result as $$ l\left( \frac{a-b}{d} - \ln d\right).$$