This program can calculate natural logarithms up to 1188 digits. It also prints the results, using the same method as used with EPP1. The program was written by myself and up to now it has not been published.
To obtain the high precision this program delivers, the following method is used: :lq.
The program starts with the following series, which can be found in
"Mathematical Tables and Formulas" by Robert D. Carmichael and Edwin R. Smith:
.sk
.ce
Ln(y+1) =
Part 1 in this series is: .sk .ce Ln(y) :fn id=pn.In the rest of this chapter I will use P(n) to refer to a Part 2, that has to be calculated for a specific\n. [n\=\y\+\1]:efn
Part 2:fnref refid=pn. is: .sk .ce 2 &ML [1/(2y+1) + 1/(3&ML.(2y+1)&S3.) + 1/(5&ML.(2y+1)&S5.) + ...] :fn id=ar.The only real difference between the two series is the fact that the terms in the series for Arctan(X) have alternating signs.:efn
If we take a closer look at Part 2 of the above series, we see that it is very similar to the series for Arctan(X) used to calculate &PI..:fnref refid=ar. Because of this close relationship, it was very easy to adapt the program used in the "EPP1" chapter for calculating &PI.. :elq
The most important modifications with respect to the program in that chapter are:
The instructions for this version of the program are:
Optional, and to be repeated for every factor of the number:
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 record bank\3 to save the result for later. Don't record it with\-3, but change the display temporarily into\3. After you have recorded bank 3, you can repeat steps 10\and 11 three more times with A3[/B3], digits 469-828, A2[/B2], digits 109-468 and finally A1[/B1], digits 1-108.
000 92 RTN 060 67 X=T 120 64 PD* 180 08 8 001 01 1 061 00 00 121 99 99 181 69 OP 002 00 0 062 71 71 122 65 x 182 68 68 003 69 OP 063 82 HIR 123 82 HIR 183 22 INV 004 17 17 064 17 17 124 15 15 184 77 XòT 005 47 CMS 065 34 ûX 125 74 SM* 185 01 01 006 82 HIR 066 82 HIR 126 99 99 186 74 74 007 18 18 067 07 07 127 82 HIR 187 60 DEG 008 42 STO 068 22 INV 128 17 17 188 53 ( 009 99 99 069 86 STF 129 54 ) 189 32 X:T 010 02 2 070 04 04 130 97 DSZ 190 55 ö 011 53 ( 071 02 2 131 99 99 191 01 1 012 52 EE 072 82 HIR 132 00 00 192 02 2 013 06 6 073 56 56 133 78 78 193 75 - 014 75 - 074 82 HIR 134 87 IFF 194 93 . 015 53 ( 075 18 18 135 04 04 195 09 9 016 22 INV 076 48 EXC 136 00 00 196 02 2 017 52 EE 077 99 99 137 06 06 197 94 +/- 018 55 ö 078 53 ( 138 01 1 198 82 HIR 019 82 HIR 079 53 ( 139 52 EE 199 08 08 020 16 16 080 52 EE 140 06 6 200 54 ) 021 54 ) 081 06 6 141 22 INV 201 59 INT 022 59 INT 082 85 + 142 49 PRD 202 53 ( 023 65 x 083 73 RC* 143 00 00 203 82 HIR 024 74 SM* 084 99 99 144 69 OP 204 38 38 025 99 99 085 75 - 145 20 20 205 65 x 026 82 HIR 086 53 ( 146 82 HIR 206 01 1 027 16 16 087 24 CE 147 18 18 207 02 2 028 54 ) 088 55 ö 148 59 INT 208 55 ö 029 53 ( 089 82 HIR 149 22 INV 209 53 ( 030 52 EE 090 17 17 150 28 LOG 210 01 1 031 06 6 091 54 ) 151 52 EE 211 75 - 032 75 - 092 59 INT 152 22 INV 212 32 X:T 033 53 ( 093 82 HIR 153 57 ENG 213 82 HIR 034 22 INV 094 05 05 154 49 PRD 214 17 17 035 52 EE 095 65 x 155 00 00 215 65 x 036 55 ö 096 82 HIR 156 00 0 216 02 2 037 82 HIR 097 17 17 157 81 RST 217 54 ) 038 16 16 098 85 + 158 00 0 218 33 Xý 039 54 ) 099 73 RC* 159 00 0 219 82 HIR 040 59 INT 100 99 99 160 00 0 220 07 07 041 65 x 101 22 INV 161 00 0 221 28 LOG 042 52 EE 102 59 INT 162 00 0 222 54 ) 043 06 6 103 54 ) 163 00 0 223 53 ( 044 94 +/- 104 55 ö 164 00 0 224 59 INT 045 74 SM* 105 01 1 165 00 0 225 65 x 046 99 99 106 52 EE 166 00 0 226 02 2 047 82 HIR 107 06 6 167 00 0 227 85 + 048 16 16 108 94 +/- 168 00 0 228 01 1 049 54 ) 109 72 ST* 169 00 0 229 54 ) 050 22 INV 110 99 99 170 76 LBL 230 82 HIR 051 52 EE 111 75 - 171 11 A 231 06 06 052 97 DSZ 112 53 ( 172 82 HIR 232 09 9 053 99 99 113 22 INV 173 07 07 233 69 OP 054 00 00 114 52 EE 174 92 RTN 234 17 17 055 11 11 115 55 ö 175 50 IxI 235 04 4 056 82 HIR 116 82 HIR 176 32 X:T 236 05 5 057 16 16 117 17 17 177 01 1 237 30 TAN 058 66 PAU 118 54 ) 178 01 1 238 33 Xý 059 22 INV 119 59 INT 179 08 8 239 86 STF <\pre>Listing of the TI-59/PC-100 Version [Sum & Print Part]
000 29 CP 060 87 IFF 120 54 ) 180 15 15 001 92 RTN 061 05 05 121 82 HIR 181 42 STO 002 76 LBL 062 01 01 122 56 56 182 05 05 003 12 B 063 30 30 123 86 STF 183 54 ) 004 37 P/R 064 02 2 124 40 IND 184 59 INT 005 67 X=T 065 42 STO 125 01 01 185 65 x 006 00 00 066 07 07 126 87 IFF 186 48 EXC 007 09 09 067 53 ( 127 00 00 187 05 05 008 22 INV 068 73 RC* 128 00 00 188 54 ) 009 86 STF 069 08 08 129 01 01 189 74 SM* 010 04 04 070 55 ö 130 73 RC* 190 03 03 011 09 9 071 28 LOG 131 03 03 191 69 OP 012 69 OP 072 59 INT 132 53 ( 192 23 23 013 17 17 073 82 HIR 133 22 INV 193 97 DSZ 014 47 CMS 074 06 06 134 59 INT 194 02 02 015 03 3 075 22 INV 135 65 x 195 01 01 016 00 0 076 28 LOG 136 82 HIR 196 30 30 017 10 E' 077 52 EE 137 18 18 197 22 INV 018 97 DSZ 078 54 ) 138 85 + 198 57 ENG 019 01 01 079 72 ST* 139 73 RC* 199 69 OP 020 00 00 080 08 08 140 04 04 200 33 33 021 15 15 081 01 1 141 22 INV 201 53 ( 022 82 HIR 082 52 EE 142 59 INT 202 73 RC* 023 16 16 083 06 6 143 65 x 203 03 03 024 10 E' 084 82 HIR 144 82 HIR 204 75 - 025 43 RCL 085 05 05 145 17 17 205 59 INT 026 05 05 086 64 PD* 146 85 + 206 99 PRT 027 99 PRT 087 08 08 147 43 RCL 207 54 ) 028 00 0 088 22 INV 148 05 05 208 52 EE 029 81 RST 089 74 SM* 149 55 ö 209 06 6 030 76 LBL 090 08 08 150 82 HIR 210 22 INV 031 10 E' 091 03 3 151 15 15 211 57 ENG 032 42 STO 092 00 0 152 75 - 212 99 PRT 033 02 02 093 44 SUM 153 59 INT 213 97 DSZ 034 42 STO 094 08 08 154 42 STO 214 06 06 035 06 06 095 53 ( 155 05 05 215 01 01 036 03 3 096 87 IFF 156 54 ) 216 99 99 037 00 0 097 04 04 157 63 EX* 217 69 OP 038 42 STO 098 01 01 158 03 03 218 05 05 039 03 03 099 04 04 159 53 ( 219 87 IFF 040 42 STO 100 97 DSZ 160 59 INT 220 05 05 041 08 08 101 07 07 161 65 x 221 00 00 042 06 6 102 00 00 162 82 HIR 222 01 01 043 00 0 103 68 68 163 18 18 223 82 HIR 044 42 STO 104 65 x 164 85 + 224 15 15 045 04 04 105 32 X:T 165 73 RC* 225 44 SUM 046 87 IFF 106 53 ( 166 04 04 226 30 30 047 00 00 107 82 HIR 167 59 INT 227 22 INV 048 01 01 108 16 16 168 65 x 228 49 PRD 049 30 30 109 55 ö 169 82 HIR 229 30 30 050 03 3 110 22 INV 170 17 17 230 32 X:T 051 94 +/- 111 28 LOG 171 85 + 231 49 PRD 052 91 R/S 112 52 EE 172 43 RCL 232 30 30 053 87 IFF 113 32 X:T 173 05 05 233 86 STF 054 04 04 114 54 ) 174 75 - 234 05 05 055 00 00 115 59 INT 175 53 ( 235 92 RTN 056 60 60 116 42 STO 176 69 OP 057 02 2 117 01 01 177 24 24 058 94 +/- 118 75 - 178 55 ö 059 91 R/S 119 01 1 179 82 HIR <\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 see the next six digits.
Listing of the TI-59 Version
To obtain the TI-59 version you only have to change steps 027, 206 and 212 of the Sum & Print part of the program into R/S.
Some last notes about the program
- P (2) 85 hour P(29) 23.2 hour P(67) 19.1 hour
- P (3) 58 P(31) 22.8 P(71) 18.9
- P (5) 42.5 P(37) 21.8 P(73) 18.7
- P (7) 36.5 P(41) 21.3 P(79) 18.5
- P(11) 30.8 P(43) 21.0 P(83) 18.3
- P(13) 29.0 P(47) 20.6 P(89) 18.1
- P(17) 26.8 P(53) 20.1 P(97) 17.8
- P(19) 25.9 P(59) 19.7
- P(23) 24.6 P(61) 19.5
The above times are based on the number of iterations compared to the number of iterations and the time needed to calculate Ln(2), so they can only be considered as (rough) guidelines.
- Ln(89) = Ln(88) + P(89)
- Ln(88) = Ln(11) + Ln(8) Ln(8) = 3 &ML Ln(2)
- Ln(11) = Ln(10) + P(11)
- Ln(10) = Ln (5) + Ln(2)
- Ln (5) = Ln (4) + P (5) Ln(4) = 2 &ML Ln(2)
- Ln (2) = P(2)
From the above we see that Ln(89) = 6 &ML P (2) + 1 &ML P (5) + 1 &ML P(11) + 1 &ML P(89),
so the actual run time for an 1188 digit Ln(89) is about 177 hours. [85 + 42.5 + 30.8 + 18.1 + the time for the summations]
After these first 23 steps, you have four cards containing P(89),
P(11), P(5) and P(2), so now you can continue with the Sum\&\Print
program.
.fo off
.sk
24. Enter 6 Press Op 17
.sk
25. Enter the Sum & Print program.
.sk
.fo on
.of 4
26. Change steps 206 and 212 into NOP, unless you're interested in a lot
of useless print-out.
.of
.sk
.fo off
27. Enter 1 Press X:T
28. Enter 1 Press C
29. Enter bank 4A. Press R/S
30. Enter bank 4B. Press R/S
31. Record bank 3. [4E] Press +/- WRT +/-
.sk
32. Enter bank 3A. Press R/S
33. Enter bank 3B. Press R/S
34. Record bank 3. [3E] Press +/- WRT
.sk
35. Enter 1 Press X:T
36. Enter 1 Press C
37. Enter bank 4C. Press R/S
38. Enter bank 4E. Press R/S
39. Record bank 3. [4F] Press +/- WRT +/-
.sk
40. Enter bank 3C. Press R/S
41. Enter bank 3E. Press R/S
42. Record bank 3. [3F] Press +/- WRT
.sk
43. Change steps 206 and 212 into PRT.
.sk
44. Enter 1 Press X:T
45. Enter 6 Press C
46. Enter bank 4D. Press R/S
47. Enter bank 4F. Press R/S
48. Optional:
Record bank 3. [4G] Press +/- WRT +/-
.sk
49. Enter bank 3D. Press R/S
50. Enter bank 3F. Press R/S
51. Optional:
Record bank 3. [3G] Press +/- WRT
.sk
.fo on
.of 4
52. Add the two numbers printed after the completion of steps 34 and 42 to the
number that is printed after the completion of step 50, to obtain the integer
part of Ln(89). [The program has no provisions to store the integer parts of
logarithms]
.of
I hope that the above example makes it clear how to use the program.