Post Reply 
lambertw, all branches
01-23-2024, 11:00 PM (This post was last modified: 01-24-2024 03:23 PM by Gil.)
Post: #43
RE: lambertw, all branches
Again, W(k=-1,a=+PI/2 )
seems impossible to give — at least with my HP50G program —the nice answer (0-i×PI),
returning "tiny real - i×PI"

And also W(k=-1, a=-4×PI/2 )
HP output is "tiny - i×2PI"

And also W(k=-2,a=i×6PI/2)
HP output is "tiny - i×3PI"

LambertW (k=-3,0+10*i*pi/2)
HP output is "tiny - i×5PI"

LambertW (k=-1000,i*3998 *pi/2)
Output Wolfram Alpha
i ×
6280.04371452599668368682412317572626551014162935083653612891424=

Output HP:
:W-1000('i*3998*(pi/2)'=(0.,6280.04371455)): (3.6616915941E-12,-6280.04371452)

And LambertW (-5, -20*i*pi/2)
=-i*10*pi/2 =-i*20*pi/2 = a


Pattern
W(k=n, n<0, a=i×(-n×4-2)) = a —> complex with no real part
W(k=n, n>0, a=i×(n×4)) = a —> complex with no real part

All the results are quite OK, though unsatisfactory, as already said.

Rule of thumb:

IF {imaginary (result) = integer≠0 × PI
and abs (real (result) < 1E-10}
THEN result = i × imaginary (result)
END

And more generally
With W0(-pi/2)=0+i×Pi/2
With W-1(-pi/2)=0-i×Pi/2
IF {imaginary (result) = integer≠0 × PI/2
and abs (real (result) < 1E-10}
THEN result = i × imaginary (result)
END


Is that deduction or assumption correct?

Of course, because of the roundings and the fact that we never have the real value of pi, we might never — or rather will never — have a real integer multiple of pi/2.

Final program steps/test
M0=abs(Imaginary part of the final result) /(pi/2)
M1= round (M0, 0) —> to get the nearest integer to M0
M2= real part of the final result
IF {abs (M0-M1)<0.0001 and abs (M2) < 1E-11}
THEN
M0 is considered as a multiple of (pi/2)
& real part of the result, found to be "tiny",
is to be set to exactly = zero:
M2=0
final result = M2+i×(Imaginary part of the final result)
(ELSE
The found result is OK and is not to be "tampered":
final result = final result)
END

Check a=real, multiple of pi/2, with no imaginary part
Tests with Wolfram
Conclusion
W(k, k<0 or k>0, a= real =(-4k-1)×pi/2=-i×a (and zero for the real part)

Overall conclusion
Too many tests about the input on k & a=±i × multiple of pi/2.
Easier to test the final result and correct the real part of that final result (tiny into exactly zero), as described above in Final program steps/test, if necessary or wished, ie if & only if when both conditions abs (M0-M1)<0.0001 and abs (M2) < 1e-11 are fulfilled.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
lambertw, all branches - Albert Chan - 04-07-2023, 01:24 PM
RE: lambertw, all branches - Albert Chan - 04-07-2023, 02:47 PM
RE: lambertw, all branches - Albert Chan - 04-19-2023, 01:30 AM
RE: lambertw, all branches - pier4r - 04-07-2023, 06:04 PM
RE: lambertw, all branches - Albert Chan - 04-07-2023, 07:54 PM
RE: lambertw, all branches - Albert Chan - 04-08-2023, 03:21 PM
RE: lambertw, all branches - Albert Chan - 04-08-2023, 05:54 PM
RE: lambertw, all branches - Albert Chan - 04-07-2023, 08:40 PM
RE: lambertw, all branches - Albert Chan - 04-09-2023, 03:59 AM
RE: lambertw, all branches - Albert Chan - 04-09-2023, 04:36 PM
RE: lambertw, all branches - Albert Chan - 04-10-2023, 04:44 PM
RE: lambertw, all branches - Albert Chan - 04-10-2023, 06:47 PM
RE: lambertw, all branches - Albert Chan - 04-13-2023, 03:03 PM
RE: lambertw, all branches - floppy - 04-13-2023, 04:14 PM
RE: lambertw, all branches - Albert Chan - 04-23-2023, 02:49 PM
RE: lambertw, all branches - Albert Chan - 04-23-2023, 04:40 PM
RE: lambertw, all branches - Albert Chan - 01-19-2024, 04:14 PM
RE: lambertw, all branches - Albert Chan - 01-20-2024, 04:48 PM
RE: lambertw, all branches - Gil - 01-20-2024, 10:52 PM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 01:14 AM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 01:54 AM
RE: lambertw, all branches - Gil - 01-21-2024, 01:53 PM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 04:19 PM
RE: lambertw, all branches - Gil - 01-21-2024, 04:35 PM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 06:03 PM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 07:01 PM
RE: lambertw, all branches - Gil - 01-21-2024, 07:30 PM
RE: lambertw, all branches - Gil - 01-21-2024, 08:39 PM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 10:06 PM
RE: lambertw, all branches - Gil - 01-21-2024, 09:51 PM
RE: lambertw, all branches - Gil - 01-21-2024, 10:56 PM
RE: lambertw, all branches - Albert Chan - 01-22-2024, 01:34 AM
RE: lambertw, all branches - Gil - 01-21-2024, 11:15 PM
RE: lambertw, all branches - Gil - 01-22-2024, 06:09 PM
RE: lambertw, all branches - Albert Chan - 01-22-2024, 07:29 PM
RE: lambertw, all branches - Gil - 01-22-2024, 11:33 PM
RE: lambertw, all branches - Albert Chan - 01-23-2024, 02:32 AM
RE: lambertw, all branches - Gil - 01-23-2024, 02:35 PM
RE: lambertw, all branches - Albert Chan - 01-23-2024, 03:54 PM
RE: lambertw, all branches - Gil - 01-23-2024, 04:57 PM
RE: lambertw, all branches - Albert Chan - 01-23-2024, 06:17 PM
RE: lambertw, all branches - Gil - 01-23-2024, 06:44 PM
RE: lambertw, all branches - Gil - 01-23-2024 11:00 PM
RE: lambertw, all branches - Gil - 01-24-2024, 03:18 PM
RE: lambertw, all branches - Albert Chan - 01-24-2024, 08:53 PM
RE: lambertw, all branches - Gil - 01-25-2024, 12:37 AM
RE: lambertw, all branches - Gil - 01-25-2024, 01:10 AM
RE: lambertw, all branches - Gil - 01-25-2024, 03:04 AM
RE: lambertw, all branches - Albert Chan - 01-25-2024, 07:02 AM
RE: lambertw, all branches - Gil - 01-25-2024, 10:09 AM
RE: lambertw, all branches - Albert Chan - 01-25-2024, 04:13 PM
RE: lambertw, all branches - Gil - 01-25-2024, 05:14 PM
RE: lambertw, all branches - Albert Chan - 01-25-2024, 05:57 PM
RE: lambertw, all branches - Gil - 01-25-2024, 06:19 PM
RE: lambertw, all branches - Albert Chan - 01-28-2024, 11:18 PM
RE: lambertw, all branches - Albert Chan - 02-01-2024, 02:17 AM
RE: lambertw, all branches - Albert Chan - 02-01-2024, 04:16 PM
RE: lambertw, all branches - Albert Chan - 02-02-2024, 11:49 AM



User(s) browsing this thread: