MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: best approximation to the LambertW(x) or exp(LambertW(x)) for large x say x > 2500

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117188] Re: best approximation to the LambertW(x) or exp(LambertW(x)) for large x say x > 2500
  • From: Scott Hemphill <hemphill at hemphills.net>
  • Date: Thu, 10 Mar 2011 16:04:34 -0500 (EST)
  • References: <il7qab$du5$1@smc.vnet.net> <ilabs7$1rc$1@smc.vnet.net>
  • Reply-to: hemphill at alumni.caltech.edu

Scott Hemphill <hemphill at hemphills.net> writes:

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


  • Prev by Date: Re: Finding Clusters
  • Next by Date: Re: Notebook interface and Wolfram-Alpha button [solved]
  • Previous by thread: Re: best approximation to the LambertW(x) or exp(LambertW(x)) for large x say x > 2500
  • Next by thread: Reproducible crash in Mathematica 8