Subject: Generalized Lambert W function - premature commit
From: David Billinghurst
Date: Tue, 22 May 2012 00:20:22 +1000
On 21/05/2012 10:16 PM, David Billinghurst wrote:
> On 21/05/2012 9:38 PM, Barton Willis wrote:
>> I did some work on merging the specfun generalized lambert code with
>> my code--no particular problems doing that.
>> But I noticed:
>>
>> With GCL (OK, I think)
>>
>> (%i73) generalized_lambert_w(-1,float(-1/%e)-0.0000000001);
>> (%o73) -2.3316436928788765*10^-5*%i-0.99999999981878
>>
>> With either SBCL or 64 bit CCL (not so good?)
>>
>> (%i17) generalized_lambert_w(-1,float(-1/%e)-0.0000000001);
>> lambert-w-k did not converge
>>
>> (%i2) generalized_lambert_w(-1,float(-1/%e)+0.000001); /* only
>> tested with CCL */
>> lambert-w-k did not converge
>>
>> OK:
>>
>> (%i3) generalized_lambert_w(-1,float(-1/%e)+0.0001);
>> (%o3) - 1.023499619082082
>
> Looks like we need a smarter test for convergence that works close to
> the branch point z = -1/%e.
>
I have checked in a fix. It works for gcl under windows. Found another
problem.
fpprec:80$
z:bfloat(-1/%e)-1b-20$
(%i130) w:generalized_lambert_w(-1,z);
Maxima encountered a Lisp error:
Error in SETQ [or a callee]: Zero divisor.
Another night.