05-23-2015, 04:38 PM
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.
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
;
;