Post Reply 
(50G) Lambert w function for reals
01-17-2017, 08:10 AM (This post was last modified: 06-15-2017 01:40 PM by Gene.)
Post: #1
(50G) Lambert w function for reals
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
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
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)