HP Forums

Full Version: (50G) Lambert w function for reals
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
  ;
;
Reference URL's