Extended Precision pi I

About the program

This program can calculate &PI up to 1188 digits and prints the result. The program was originally written by Jovan Puzovic and his version appeared in TI\PPC\Notes, in 1983. [TI\PPC\Notes V8N1P21-22]

The version presented here has been changed considerably. Modifications include:

Method Used

:fn id=four.Actually, the program calculates four times this term.:efn

To obtain the high precision this program delivers, the following method is used: :lq.

The program starts with the following well known equation: .sk .ce &PI = 16 &ML arctan (1/5) - 4 &ML arctan (1/239)

The calculation proceeds in three stages:

To calculate both terms, use is made of the series expansion for the arctan function, that is: .sk .ce Arctan (1/X) = 1/X - 1/(3&ML.X&S3.) + 1/(5&ML.X&S5.) - .....

The above series expansion is first reversed and the factored, .sk .ce ...... + (1/5)] / X&S2 - (1/3)] / X&S2 + 1] / X = Arctan (1/X)

so that the process becomes very simple, two divisions followed by an addition. :elq

The above equation is implemented in the program in steps 011-055, the addition of the (1/N) term, and steps 085-141, the division by\X&S2 (or just\X in the last loop).

The TI-59/PC-100 Version

User Instructions

The instructions for this version of the program are:

  1. Enter the Calculate Part of the program.
  2. Enter the number of digits you want and press A. After a short time the calculator will stop with a flashing\1 in the display. [The number you enter will be rounded up to the next multiple of\12 and if you enter a number\>\1188, it will return to the display flashing, to indicate an error].
  3. Now press 7 EE to start the program in Fast Mode.
    When the calculation of 4\&ML.\arctan(1/5) is completed the display will show a zero.
  4. Record banks 1, 2, 3 and 4 on magnetic cards. Mark these four banks\A1 through A4.
  5. Reset the partitioning to 479.59 [6 OP 17]
  6. Re-enter the Calculate Part.
  7. Once again enter the number of digits you want and press B. It is an absolute must that the number of digits you enter is the same as in step 2! You will again see a flashing\1 in the display, so .....
  8. Press 7 EE to start the program in Fast Mode.
    When the calculation of 4\&ML.\arctan(1/239) is completed the display will show a zero.
  9. Record banks 1, 2, 3 and 4 on magnetic cards. Mark these four banks B1 through B4.
  10. Reset the partitioning to 479.59. [6 OP 17]
  11. Enter the Sum & Print Part of the program.
  12. Enter the number of digits you want for the third time and press C.
  13. When the display shows a -3, enter bank A4 and press R/S.
  14. When the display shows a -2, enter bank B4 and press R/S. .sk After a little while the printer will start printing. The digits obtained are not the first ones, but are digits 829-1188. After the printing has finished the display will once again show a\-3. You can now repeat steps 13\and 14 three more times with A3/B3, digits 469-828, A2/B2, digits 109-468 and finally A1/B1, digits 1-108.
:note.The user instructions above assume that you enter 1188 as the number of digits wanted! If you want to calculate a smaller number of digits, you should refer to the "Some last notes about the program" section at the end of this chapter.

Listing of the TI-59/PC-100 Version [Calculate Part]

000  92 RTN         060  75  -          120  53  (          180  03  3
001  01  1          061  22 INV         121  22 INV         181  09  9
002  32 X:T         062  67 X=T         122  52 EE          182  33 Xý
003  69 OP          063  00  00         123  55  ö          183  82 HIR
004  17  17         064  73  73         124  82 HIR         184  07  07
005  47 CMS         065  82 HIR         125  17  17         185  01  1
006  82 HIR         066  17  17         126  54  )          186  01  1
007  18  18         067  34 ûX          127  59 INT         187  08  8
008  42 STO         068  82 HIR         128  64 PD*         188  09  9
009  99  99         069  07  07         129  99  99         189  32 X:T
010  04  4          070  22 INV         130  65  x          190  50 IxI
011  53  (          071  86 STF         131  82 HIR         191  59 INT
012  52 EE          072  04  04         132  15  15         192  77 XòT
013  06  6          073  69 OP          133  74 SM*         193  01  01
014  75  -          074  10  10         134  99  99         194  65  65
015  53  (          075  65  x          135  82 HIR         195  53  (
016  22 INV         076  02  2          136  17  17         196  60 DEG
017  52 EE          077  54  )          137  54  )          197  55  ö
018  55  ö          078  94 +/-         138  97 DSZ         198  01  1
019  82 HIR         079  82 HIR         139  99  99         199  02  2
020  16  16         080  06  06         140  00  00         200  75  -
021  54  )          081  82 HIR         141  85  85         201  93  .
022  59 INT         082  18  18         142  87 IFF         202  09  9
023  74 SM*         083  48 EXC         143  04  04         203  02  2
024  99  99         084  99  99         144  00  00         204  94 +/-
025  65  x          085  53  (          145  06  06         205  82 HIR
026  82 HIR         086  53  (          146  00  0          206  08  08
027  16  16         087  52 EE          147  81 RST         207  54  )
028  54  )          088  06  6          148  00  0          208  59 INT
029  53  (          089  85  +          149  00  0          209  53  (
030  52 EE          090  73 RC*         150  00  0          210  82 HIR
031  06  6          091  99  99         151  00  0          211  38  38
032  75  -          092  59 INT         152  00  0          212  65  x
033  53  (          093  75  -          153  00  0          213  06  6
034  22 INV         094  53  (          154  00  0          214  55  ö
035  52 EE          095  24 CE          155  00  0          215  82 HIR
036  55  ö          096  55  ö          156  00  0          216  17  17
037  82 HIR         097  82 HIR         157  00  0          217  28 LOG
038  16  16         098  17  17         158  00  0          218  85  +
039  54  )          099  54  )          159  00  0          219  01  1
040  59 INT         100  59 INT         160  00  0          220  54  )
041  65  x          101  82 HIR         161  00  0          221  53  (
042  52 EE          102  05  05         162  00  0          222  59 INT
043  06  6          103  65  x          163  00  0          223  65  x
044  94 +/-         104  82 HIR         164  00  0          224  04  4
045  74 SM*         105  17  17         165  29 CP          225  85  +
046  99  99         106  85  +          166  69 OP          226  01  1
047  82 HIR         107  73 RC*         167  68  68         227  54  )
048  16  16         108  99  99         168  92 RTN         228  82 HIR
049  54  )          109  22 INV         169  76 LBL         229  06  06
050  22 INV         110  59 INT         170  11  A          230  22 INV
051  52 EE          111  54  )          171  32 X:T         231  58 FIX
052  97 DSZ         112  55  ö          172  05  5          232  09  9
053  99  99         113  01  1          173  61 GTO         233  69 OP
054  00  00         114  52 EE          174  01  01         234  17  17
055  11  11         115  06  6          175  82  82         235  04  4
056  53  (          116  94 +/-         176  76 LBL         236  05  5
057  82 HIR         117  72 ST*         177  12  B          237  30 TAN
058  16  16         118  99  99         178  32 X:T         238  33 Xý
059  66 PAU         119  75  -          179  02  2          239  86 STF
<\pre>

Listing of the TI-59/PC-100 Version [Sum & Print Part]

000  29 CP          060  55  ö          120  54  )          180  52 EE
001  92 RTN         061  01  1          121  63 EX*         181  06  6
002  76 LBL         062  02  2          122  03  03         182  22 INV
003  13  C          063  75  -          123  53  (          183  57 ENG
004  82 HIR         064  93  .          124  59 INT         184  99 PRT
005  08  08         065  00  0          125  65  x          185  97 DSZ
006  09  9          066  08  8          126  04  4          186  06  06
007  69 OP          067  54  )          127  75  -          187  01  01
008  17  17         068  59 INT         128  73 RC*         188  71  71
009  47 CMS         069  37 P/R         129  04  04         189  69 OP
010  03  3          070  53  (          130  59 INT         190  05  05
011  00  0          071  03  3          131  85  +          191  92 RTN
012  10 E'          072  00  0          132  43 RCL
013  97 DSZ         073  65  x          133  05  05
014  01  01         074  53  (          134  75  -
015  00  00         075  82 HIR         135  77 XòT
016  10  10         076  18  18         136  01  01
017  82 HIR         077  55  ö          137  39  39
018  18  18         078  03  3          138  02  2
019  10 E'          079  00  0          139  00  0
020  43 RCL         080  54  )          140  94 +/-
021  05  05         081  59 INT         141  42 STO
022  99 PRT         082  42 STO         142  05  05
023  00  0          083  01  01         143  65  x
024  81 RST         084  75  -          144  82 HIR
025  76 LBL         085  01  1          145  17  17
026  10 E'          086  54  )          146  75  -
027  42 STO         087  82 HIR         147  53  (
028  02  02         088  58  58         148  69 OP
029  42 STO         089  86 STF         149  24  24
030  06  06         090  40 IND         150  55  ö
031  03  3          091  01  01         151  82 HIR
032  00  0          092  86 STF         152  17  17
033  42 STO         093  04  04         153  54  )
034  03  03         094  87 IFF         154  59 INT
035  06  6          095  00  00         155  44 SUM
036  00  0          096  00  00         156  05  05
037  42 STO         097  01  01         157  65  x
038  04  04         098  73 RC*         158  82 HIR
039  87 IFF         099  03  03         159  17  17
040  00  00         100  53  (          160  54  )
041  00  00         101  22 INV         161  74 SM*
042  98  98         102  59 INT         162  03  03
043  03  3          103  65  x          163  69 OP
044  94 +/-         104  04  4          164  23  23
045  91 R/S         105  75  -          165  97 DSZ
046  02  2          106  73 RC*         166  02  02
047  94 +/-         107  04  04         167  00  00
048  91 R/S         108  22 INV         168  98  98
049  87 IFF         109  59 INT         169  22 INV
050  04  04         110  85  +          170  57 ENG
051  00  00         111  43 RCL         171  69 OP
052  98  98         112  05  05         172  33  33
053  01  1          113  55  ö          173  53  (
054  52 EE          114  82 HIR         174  73 RC*
055  06  6          115  17  17         175  03  03
056  32 X:T         116  75  -          176  75  -
057  53  (          117  59 INT         177  59 INT
058  82 HIR         118  42 STO         178  99 PRT
059  18  18         119  05  05         179  54  )
<\pre>

The TI-59 Version

User Instructions

The user instructions for this version of the program are exactly the same, except for the fact that the calculator will stop with every group of six digits in the display and that you have to press R/S to get the next.

Listing of the TI-59 Version

To obtain the TI-59 version you only have to change steps 178 and 184 of the Sum & Print Part into\R/S.

Some last notes about the program