Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: best approximation to the LambertW(x) or exp(LambertW(x)) for large x say x > 2500
Replies: 4   Last Post: Mar 10, 2011 4:04 PM

 Messages: [ Previous | Next ]
 Scott Hemphill Posts: 196 Registered: 12/13/04
Re: best approximation to the LambertW(x) or exp(LambertW(x)) for large x say x > 2500
Posted: Mar 10, 2011 4:04 PM

Scott Hemphill <hemphill@hemphills.net> writes:

> barefoot gigantor <barefoot1980@gmail.com> writes:
>

>> what is the best available approximation ( say up to 10 digits ) for
>> LambertW(x) or exp(LambertW(x)) for x > 2000
>>
>> thank you for your help

>
> It isn't immediately obvious to me what "best" means. You are solving
> for x in the equation y == x * E^x. A simple solution would be to start
> with x = Log[y], then iterate x = Log[y] - Log[x] enough times that you
> have as many correct digits as you need. The convergence is a little
> slow, though, so you could use Newton's Method instead. You could still
> start with x = Log[y], but then iterate x = (Log[y]-Log[x]+1) * x/(x+1).

To follow up, I just want to point out that for y > 2000, you only need
three iterations to get the desired accuracy. It is asymptotic, so if x
is large enough you need fewer iterations. The worst case is for y ==
2000, where three iterations gives you a relative error of approximately
2*10^-13. To sum up:

x = Log[y];
x = (Log[y]-Log[x]+1) * x/(x+1);
x = (Log[y]-Log[x]+1) * x/(x+1);
x = (Log[y]-Log[x]+1) * x/(x+1);

gives you the value of LambertW[y] to the required accuracy for all y >
2000. (Actually, it does better than that. It gives a relative error
of better than 10^-10 down to about y==32.)

Scott
--
Scott Hemphill hemphill@alumni.caltech.edu
"This isn't flying. This is falling, with style." -- Buzz Lightyear

Date Subject Author
3/9/11 barefoot gigantor
3/10/11 Peter Pein
3/10/11 Scott Hemphill
3/10/11 Scott Hemphill
3/10/11 DrMajorBob