Re: Lambert's W on the HP-33s Message #6 Posted by Egan Ford on 12 Feb 2008, 12:57 a.m., in response to message #5 by Gerson W. Barbosa
Hello Gerson,
I couldn't resist. Some super fast missing special functions for the 50g: http://sense.net/~egan/hpgcc/misc/special.zip
Unzip that to the root of your 50g SD card. The following files will be extracted:
SPECIAL.LIB
SPECIAL/LAMBERTW
SPECIAL/LOGGAMMA
Put the SD card back in your 50g and type:
:3:SPECIAL.LIB
RCL
2
STO
ON-C
This library adds two missing special functions to the 50g. LogGamma and LambertW. Both take real or complex arguments. There is a 2nd LambertW (LAMBERTWB) that takes two arguments. The first is the branch (integer) and the 2nd is the argument.
LogGamma tests:
z LogGamma(z) 50g loggamma(z) 50g ln(gamma(z))
1 0 0 0
100 359.134205370 359.13420537 359.13420537
1000 5905.22042321 5905.22042321 1151.2925465
5555.4444 42343.2 42343.1698379 1151.2925465
12+34i -11.7232+102.052i (-11.7232,102.0521) (-11.7232,1.5212)
Bold answers are wrong. ln(gamma()) is not loggamma().
LambertW tests:
b z function result
5 LAMBERTW 1.32672
0 5 LAMBERTWB 1.32672
-1 5 LAMBERTWB (0.05663,-4.72438)
3 5 LAMBERTWB (-1.23846,17.20691)
-5 LAMBERTW (0.84484,1.97501)
123.4+5.6i LAMBERTW (3.54958,0.03538)
-898-44.5i LAMBERTW (5.06143,-2.61517)
And
2 LN LAMBERTW e^x = 1.55961046946
Neither is well tested for stability. A spot check of many values looked ok. I plan to clean up when HPGCC3 releases. For now you are stuck with the HPGCC2 version.
Edited: 12 Feb 2008, 2:01 a.m.
|