1

In physics, i should calculate $W(e^{x})$, and $x$ is over $10^5$.

When I calculate it using Wolfram I get number that is less than $x$, but when I try to program it in C++ or python, I get out of range error.

How can I convert this formula, so I don't need to calculate $e^{x}$?

NoChance
  • 6,695

2 Answers2

2

For large $x$, we can approximate $W(x)$ as being

$$W(x) \sim \log x - \log \log x$$

For our case, we have that

$$W(e^x) \approx x - \log x$$

Ninad Munshi
  • 37,891
1

As @Ninad Munshi answered, for large values of $x$, you can use $$W(t)\approx L_1-L_2+\frac{L_2}{L_1}+\frac{L_2(L_2-2)}{2L_1^2}+\frac{L_2(2L_2^2-9L_2+6)}{6L_1^3}+\cdots$$ where $L_1=\log(t)$ and $L_2=\log(L_1)$.

Make $t=e^x$ and it will work without any problem.