(08-18-2022 04:26 PM)prino Wrote: Here are four extended precision programs, sorry for the "formatting", it's IBM's DCF/Script, but I'm sure you can make sense of it, it's a bit html-like, and at some stage I'll put it in the as yet unpublished calculator pages of my website.
Code:
.if SYSPAGE = ODD .pa
.pn pref D-
.pn 1
:h1.Appendix D: A few programs for the TI-57
:p.This appendix gives a short description of a few extended precision
programs for the TI-57 [The old LED-display version!]
:p.The programs included in this appendix are:
:dl tsize=9
:dt.EPF57-I
:dd.Extended Precision Factorials I
.br
This program can calculate factorials up to 34!
:dt.EPF57-II
:dd.Extended Precision Factorials II
.br
This program can calculate factorials up to 52!
:dt.EPe57-I
:dd.Extended Precision e I
.br
This program calculates e to 32 places.
:dt.EPe57-II
:dd.Extended Precision e II
.br
This program calculates e to 48 places.
:edl
.sk;.pa
:h2.Extended Precision Factorials I
:h3.About the program
:p.This program can calculate factorials up to 34!, using more or less
the same method as in the TI-58/59/66 versions. The main difference is
the fact that this program cannot avoid multiplications with zero!
:p.The execution time of the program for 34! is about 2'45".
:h4.User Instructions
:p.The instructions for this program are:
:ol
:li.Enter the program.
:li.Initialise the program by pressing :hp1.RST\INV\CT:ehp1..
:li.Enter the number you want to "factorialize".
:li.Start the program by pressing :hp1.R/S:ehp1..
:li.When the program has finished, you can find the result in R5\[MSD]
through R1\[LSD].
:eol
:h4.Listing of EPF57-I
.fo off
00 66 X=T 17 -49 IINT 34 25 1/X
01 01 1 18 38 2 EXC 2 35 86 1 LBL 1
02 32 0 STO 0 19 61 2 SBR 2 36 39 1 PRD 1
03 08 8 20 34 3 SUM 3 37 39 2 PRD 2
04 84 +/- 21 33 3 RCL 3 38 39 3 PRD 3
05 -18 ILOG 22 -49 IINT 39 39 4 PRD 4
06 32 1 STO 1 23 38 3 EXC 3 40 39 5 PRD 5
07 32 6 STO 6 24 61 2 SBR 2 41 00 0
08 86 0 LBL 0 25 34 4 SUM 4 42 -61 ISBR
09 33 0 RCL 0 26 33 4 RCL 4 43 86 2 LBL 2
10 61 1 SBR 1 27 -49 IINT 44 49 INT
11 33 1 RCL 1 28 38 4 EXC 4 45 42 EE
12 -49 IINT 29 61 2 SBR 2 46 08 8
13 38 1 EXC 1 30 34 5 SUM 5 47 84 +/-
14 61 2 SBR 2 31 56 DSZ 48 -42 IEE
15 34 2 SUM 2 32 51 0 GTO 0 49 -61 ISBR
16 33 2 RCL 2 33 33 6 RCL 6
.fo on
:p.It should be noted that :hp1.all:ehp1. arithmetic in this program is
done by means of the registers!!
.pa
:h2.Extended Precision Factorials II
:h3.About the program
:p.This program can calculate factorials up to 52!, using more or less
the same method as in the TI-58/59/66 versions. Just as
:hp1.EPF57-I:ehp1.,
this program cannot avoid multiplications with zero!
:p.The extended range, compared to :hp1.EPF57-I:ehp1., is obtained by
using a rotating stack with wrap-around. A disadvantage of this method
is a severe increase in execution time!
:p.The execution time of the program for 52! is about 8'20".
:h4.User Instructions
:p.The instructions for this program are:
:ol
:li.Enter the program.
:li.Initialise the program by pressing :hp1.RST\INV\CT:ehp1..
:li.Enter the number you want to "factorialize".
:li.Start the program by pressing :hp1.R/S:ehp1..
:li.When the program has finished, you can find the result in all 7
registers, but the format may need some clarification:
:ul
:li.Your entry is less than or equal to 44:
:p.The result can be found in R1 [LSD] through R7 [MSD].
:li.Your entry is between 45 and 49 (inclusive):
:p.The result can be found in R1 [Most MSD] and R7 [Next MSD] through
R2\[LSD], that is, the most significant digits overlay the trailing
zeroes in R1. [Factorials of numbers between 45 and 49 have ten
trailing zeroes]
:li.Your entry is 50, 51 or 52:
:p.These three numbers have 12 trailing zeroes, so the MSD extend into
the last four digits of R2!
:eul
:eol
.pa
:p.Some examples, leading zeroes are indicated by a .:
.sk;.fo off
48! 50! 52!
R7: 15592536 .1713378 43878571
R6: .7267086 .4361260 66063685
R5: 22890473 81660647 64037669
R4: 73375083 68844377 75289505
R3: 52148635 64156896 44088327
R2: 46777600 .5120003 78248065
R1: 124139 .4140932 81751709
.fo on
:p.The above indicates that the actual values of 48!, 50! and 52! are:
:ul
.fo off
:li.48! = 1241391559 ..... 8635467776 E+10.
:li.50! = 3041409320 ..... 1568960512 E+12.
:li.52! = 8065817517 ..... 0883277824 E+12.
.fo on
:eul
:h4.Listing of EPF57-II
.fo off
00 66 X=T 17 49 INT 34 32 0 STO 0
01 01 1 18 42 EE 35 56 DSZ
02 32 0 STO 0 19 08 8 36 51 0 GTO 0
03 08 8 20 84 +/- 37 08 8
04 84 +/- 21 -42 IEE 38 -18 ILOG
05 -18 ILOG 22 38 1 EXC 1 39 86 2 LBL 2
06 32 1 STO 1 23 38 7 EXC 7 40 39 1 PRD 1
07 86 0 LBL 0 24 38 6 EXC 6 41 39 2 PRD 2
08 43 ( 25 38 5 EXC 5 42 39 3 PRD 3
09 07 7 26 38 4 EXC 4 43 39 4 PRD 4
10 38 0 EXC 0 27 38 3 EXC 3 44 39 5 PRD 5
11 75 + 28 38 2 EXC 2 45 39 6 PRD 6
12 61 2 SBR 2 29 34 1 SUM 1 46 39 7 PRD 7
13 86 1 LBL 1 30 56 DSZ 47 00 0
14 33 1 RCL 1 31 51 1 GTO 1 48 -61 ISBR
15 -49 IINT 32 00 0
16 38 1 EXC 1 33 44 )
.fo on;.pa
:h2.Extended Precision e I
:h3.About the program
:p.This program calculates "e" to 32 places, using the same method as
used in the TI-58/59/66 versions.
:p.The execution time of the program is about 3"20', which translates
to about 6" per digit.
:h4.User Instructions
:p.The instructions for this program are:
:ol
:li.Enter the program.
:li.Start the program by pressing :hp1.SBR\0:ehp1..
:li.When the program has finished, you can find the result in R2\[MSD]
through R5\[LSD].
:eol
:h4.Listing of EPe57-I
.fo off;.tr $ 4E
00 43 ( 17 32 5 STO 5 34 86 2 LBL 2
01 00 0 18 44 ) 35 55 &ML
02 61 2 SBR 2 19 86 1 LBL 1 36 33 0 RCL 0
03 33 2 RCL 2 20 07 7 37 44 )
04 61 3 SBR 3 21 -18 ILOG 38 43 (
05 32 2 STO 2 22 34 2 SUM 2 39 -42 IEE
06 61 2 SBR 2 23 56 DSZ 40 42 EE
07 33 3 RCL 3 24 71 RST 41 08 8
08 61 3 SBR 3 25 -39 2 IPRD 2 42 75 $
09 32 3 STO 3 26 15 CLR 43 -61 ISBR
10 61 2 SBR 2 27 -61 ISBR 44 86 3 LBL 3
11 33 4 RCL 4 28 86 0 LBL 0 45 65 -
12 61 3 SBR 3 29 -19 ICT 46 32 1 STO 1
13 32 4 STO 4 30 03 3 47 89 |x
14 61 2 SBR 2 31 00 0 48 49 INT
15 33 5 RCL 5 32 32 0 STO 0 49 -61 ISBR
16 61 3 SBR 3 33 51 1 GTO 1
.fo on;.tr;.pa
:h2.Extended Precision e II
:h3.About the program
:p.This program calculates "e" to 48 places, using the same method as
used in the TI-58/59/66 versions. The extended capability, compared to
the program on the previous page, is obtained by using a rotating stack,
which allows repeated calculations to be performed on one single
register. The disadvantage is once again a much longer execution time!
[7'40", or almost 10" per digit]
:h4.User Instructions
:p.The instructions for this program are:
:ol
:li.Enter the program.
:li.Start the program by pressing :hp1.SBR\0:ehp1..
:li.When the program has finished, you can find the result in R1\[MSD]
through R6\[LSD].
:eol
:h4.Listing of EPe57-II
.fo off
00 06 6 17 65 - 34 86 2 LBL 2
01 38 0 EXC 0 18 89 |x 35 32 0 STO 0
02 22 X:T 19 49 INT 36 07 7
03 43 ( 20 55 x 37 -18 ILOG
04 00 0 21 38 6 EXC 6 38 34 1 SUM 1
05 55 x 22 38 5 EXC 5 39 56 DSZ
06 86 1 LBL 1 23 38 4 EXC 4 40 71 RST
07 33 0 RCL 0 24 38 3 EXC 3 41 -39 1 IPRD 1
08 22 X:T 25 38 2 EXC 2 42 15 CLR
09 32 0 STO 0 26 38 1 EXC 1 43 -61 ISBR
10 44 ) 27 33 0 RCL 0 44 86 0 LBL 0
11 -42 IEE 28 22 X:T 45 -19 ICT
12 42 EE 29 32 0 STO 0 46 04 4
13 08 8 30 56 DSZ 47 00 0
14 34 1 SUM 1 31 51 1 GTO 1 48 51 2 GTO 2
15 43 ( 32 44 )
16 33 1 RCL 1 33 22 X:T
.fo on
Finally, just a question, is this emulator based on the actual TI-57 microcode?
Quite a feat with only 50 steps and no indirect register!
Attached a screenshot from running the 4th program (48 digits of e) on RCL-57. (Takes ~1 second in Turbo Mode).
(And yes, RCL-57 is based on the actual TI-57 microcode).