Post Reply 
(49G) Extended Real Integer Partitions Programme
05-23-2015, 04:38 PM (This post was last modified: 10-21-2017 04:42 PM by Gerald H.)
Post: #1
(49G) Extended Real Integer Partitions Programme
For positive integer extended real input the programme returns the number of integer partitions as an extended real.

eg For entry %% 300 the programme returns %% 9.25308293663826E+00015, the correct value being 9253082936723602.

For entry %% 3.45678E+00005 the result is %% 3.93486234859078E+00648.

Wolfram Alpha returns see below.

Code:
::
  CK1&Dispatch
  # 3F
  ::
    DUP
    %%0<
    caseSIZEERR
    %%INT
    DUP
    %%0=
    casedrop
    %%1
    DUPDUP
    %%+
    SWAP
    %% 4.16666666666667E-2
    %%-
    DUP
    %%SQRT
    DUPUNROT
    %%*
    SWAP
    %% 8.16496580927726E-1
    %%*
    %%PI
    %%*
    2DUPSWAP
    %%/
    %%4
    %%1/
    %%2PI
    DUP
    %%+
    BINT0
    %%0
    DUPDUP
    '
    NULLLAM
    BINT10
    NDUPN
    DOBIND
    BINT0
    BEGIN
    DROP
    %%0
    4GETLAM
    #1+DUP
    4PUTLAM
    DUP
    UNCOERCE%%
    2PUTLAM
    #1+_ONE_DO
    4GETLAM
    INDEX@
    DUP
    UNCOERCE%%
    3PUTLAM
    BEGIN
    DUPUNROT
    #/
    DROP
    #0=UNTIL
    DROP
    #1=
    IT
    ::
      6GETLAM
      4GETLAM
      #1-
      ::
        DUP#0=csDROP
        #1+_ONE_DO
        INDEX@
        UNCOERCE%%
        2GETLAM
        %%/
        DUP
        3GETLAM
        %%*
        DUP
        %%INT
        %%-
        %%.5
        %%-
        SWAP
        %%.5
        %%-
        %%*
        %%+
        LOOP
      ;
      10GETLAM
      3GETLAM
      %%*
      2GETLAM
      %%/
      %%-
      %%PI
      %%*
      %%COSRAD
      %%+
    ;
    LOOP
    8GETLAM
    2GETLAM
    %%/
    %%EXP
    DUP
    %%1/
    2DUP
    %%+
    7GETLAM
    %%*
    2GETLAM
    %%/
    3UNROLL
    %%-
    9GETLAM
    %%/
    %%-
    2GETLAM
    %%SQRT
    %%*
    5GETLAM
    %%/
    DUPROT
    %%*
    1GETLAM
    %%+
    DUP1PUTLAM_
    DUPUNROT
    %%+
    %%.5
    %%+
    %%INT
    SWAP
    %%.5
    %%+
    %%INT
    OVER
    EQUAL
    UNTIL
    ABND
  ;
;


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
Post Reply 




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