The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   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
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Scott Hemphill <> writes:

> barefoot gigantor <> 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 Hemphill
"This isn't flying. This is falling, with style." -- Buzz Lightyear

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.