01-17-2017, 08:10 AM
For real number input the programme LAMBW returns the value of the Lambert w function to the stack.
For info on the function see
http://mathworld.wolfram.com/LambertW-Function.html
For info on the function see
http://mathworld.wolfram.com/LambertW-Function.html
Code:
::
CK1&Dispatch
BINT1
::
'
ID 0
TRUE
3PICK3PICK
DUP'
%EXP
'
%*
'
%-
BINT6
SYMBN
3PICK
5PICK
DUP
% 500.
%<=
ITE
::
%1+
%LN
DUP
% .0195
%*
%1+
%*
% .665
%*
% .04
%+
;
::
DUP
%4
%-
%LN
SWAP
%LN
%1
OVER
%1/
%-
SWAP
%LN
%*
%-
;
NUMSOLVE
2DROP
SWAP
?PURGE_HERE
SWAP
xDROP
;
;