This program calculates and prints square roots of numbers between 1 and 100 to 155 places. The program also calculates the square of the calculated root. The program was originally written by Sven-Arne Wallin and his version appeared in the newsletter of the Swedish club in 1985. [Programbiten 85-2, pages 14-15]
The version presented here has been changed considerably. Modifications include:
To obtain the high precision this program delivers, the following method is used: :lq. :fn id=digit.Because the input is truncated to 8 digits, there is a very small chance that the comparison yields a wrong answer!:efn
The program calculates an estimate of the root, squares it and compares this square with the entered number.:fnref refid=digit. If the calculated square is less than the input, it is increased, if it is greater, it is decreased. In both cases the calculation and the comparison are repeated, and this process continues until the specified precision is obtained.
To make this process a little more efficient, use is made of these two equations: .sk .ce on (a\+\b)&S2.\=\a&S2.\+\2ab\+\b&S2 .sk and .sk (a\-\b)&S2.\=\a&S2.\-\2ab\+\b&S2 .ce off
Using them has the advantage that only part of the square has to be recalculated, thereby saving some time. [But compared to EPR2 the program is still very slow] :elq
The instructions for this version of the program are:
The parts of the root are printed as they are found. For use on a TI-59 without PC-100, you should change step\148 into R/S.
Replacing the NOP at step 148 with R/S, yields inconvenient operation. It is better to enter the short program below from the keyboard after the program has finished. The instructions for it are:
000 76 LBL 011 01 1 022 76 LBL 033 19 19 001 11 A 012 44 SUM 023 12 B 034 91 R/S 002 43 RCL 013 97 97 024 29 CP 035 01 1 003 99 99 014 97 DSZ 025 03 3 036 44 SUM 004 48 EXC 015 98 98 026 01 1 037 97 97 005 98 98 016 00 00 027 42 STO 038 61 GTO 006 42 STO 017 08 08 028 97 97 039 00 00 007 97 97 018 00 0 029 73 RC* 040 29 29 008 73 RC* 019 69 OP 030 97 97 009 97 97 020 68 68 031 67 X=T 010 91 R/S 021 92 RTN 032 00 00 <\pre>Listing of the TI-59[/PC-100] Version
000 92 RTN 060 94 +/- 120 97 DSZ 180 00 0 001 32 X:T 061 44 SUM 121 96 96 181 00 0 002 69 OP 062 94 94 122 00 00 182 00 0 003 17 17 063 44 SUM 123 88 88 183 00 0 004 47 CMS 064 95 95 124 82 HIR 184 76 LBL 005 82 HIR 065 97 DSZ 125 18 18 185 11 A 006 16 16 066 96 96 126 32 X:T 186 50 IxI 007 42 STO 067 00 00 127 43 RCL 187 82 HIR 008 98 98 068 48 48 128 31 31 188 04 04 009 05 5 069 82 HIR 129 22 INV 189 92 RTN 010 42 STO 070 15 15 130 77 XòT 190 53 ( 011 97 97 071 74 SM* 131 01 01 191 69 OP 012 22 INV 072 99 99 132 41 41 192 00 00 013 28 LOG 073 53 ( 133 82 HIR 193 55 ö 014 82 HIR 074 43 RCL 134 16 16 194 05 5 015 06 06 075 99 99 135 94 +/- 195 85 + 016 01 1 076 85 + 136 82 HIR 196 93 . 017 00 0 077 24 CE 137 05 05 197 08 8 018 82 HIR 078 85 + 138 61 GTO 198 54 ) 019 66 66 079 01 1 139 00 00 199 69 OP 020 82 HIR 080 85 + 140 27 27 200 05 05 021 16 16 081 42 STO 141 97 DSZ 201 82 HIR 022 82 HIR 082 96 96 142 97 97 202 06 06 023 05 05 083 03 3 143 00 00 203 53 ( 024 09 9 084 01 1 144 16 16 204 04 4 025 82 HIR 085 54 ) 145 73 RC* 205 22 INV 026 45 45 086 42 STO 146 99 99 206 28 LOG 027 43 RCL 087 95 95 147 99 PRT 207 33 Xý 028 99 99 088 53 ( 148 68 NOP 208 65 x 029 53 ( 089 53 ( 149 01 1 209 32 X:T 030 42 STO 090 73 RC* 150 44 SUM 210 82 HIR 031 94 94 091 95 95 151 99 99 211 14 14 032 85 + 092 55 ö 152 97 DSZ 212 54 ) 033 01 1 093 82 HIR 153 98 98 213 53 ( 034 85 + 094 17 17 154 00 00 214 59 INT 035 42 STO 095 75 - 155 09 09 215 55 ö 036 96 96 096 22 INV 156 00 0 216 32 X:T 037 85 + 097 59 INT 157 81 RST 217 54 ) 038 02 2 098 29 CP 158 00 0 218 99 PRT 039 09 9 099 77 XòT 159 00 0 219 01 1 040 54 ) 100 01 01 160 00 0 220 00 0 041 42 STO 101 04 04 161 00 0 221 32 X:T 042 95 95 102 75 - 162 00 0 222 69 OP 043 82 HIR 103 01 1 163 00 0 223 05 05 044 15 15 104 54 ) 164 00 0 224 82 HIR 045 33 Xý 105 65 x 165 00 0 225 08 08 046 74 SM* 106 32 X:T 166 00 0 226 05 5 047 95 95 107 82 HIR 167 00 0 227 22 INV 048 53 ( 108 17 17 168 00 0 228 28 LOG 049 82 HIR 109 54 ) 169 00 0 229 82 HIR 050 15 15 110 22 INV 170 00 0 230 07 07 051 65 x 111 74 SM* 171 00 0 231 09 9 052 02 2 112 95 95 172 00 0 232 69 OP 053 65 x 113 01 1 173 00 0 233 17 17 054 73 RC* 114 22 INV 174 00 0 234 60 DEG 055 94 94 115 44 SUM 175 00 0 235 04 4 056 54 ) 116 95 95 176 00 0 236 05 5 057 74 SM* 117 32 X:T 177 00 0 237 30 TAN 058 95 95 118 74 SM* 178 00 0 238 33 Xý 059 01 1 119 95 95 179 00 0 239 86 STF <\pre>The TI-58 Version
User Instructions
The user instructions for this version of the program are equal to those of the TI-59 version, except for the fact that this program can only calculate roots to 55 places.
To use the read-out program in cooperation with the TI-58 version, you must make the following changes:
- Change all references to registers 97, 98 and 99 into references to registers 37, 38 and 39.
- Change step 025 into "1".
Listing of the TI-58 Version
000 92 RTN 060 44 SUM 120 36 36 180 00 0 001 04 4 061 34 34 121 00 00 181 00 0 002 69 OP 062 44 SUM 122 87 87 182 00 0 003 17 17 063 35 35 123 82 HIR 183 00 0 004 47 CMS 064 97 DSZ 124 18 18 184 00 0 005 82 HIR 065 36 36 125 32 X:T 185 00 0 006 16 16 066 00 00 126 43 RCL 186 00 0 007 42 STO 067 47 47 127 11 11 187 00 0 008 38 38 068 82 HIR 128 22 INV 188 00 0 009 05 5 069 15 15 129 77 XòT 189 00 0 010 42 STO 070 74 SM* 130 01 01 190 76 LBL 011 37 37 071 39 39 131 40 40 191 11 A 012 22 INV 072 53 ( 132 82 HIR 192 50 IxI 013 28 LOG 073 43 RCL 133 16 16 193 82 HIR 014 82 HIR 074 39 39 134 94 +/- 194 04 04 015 06 06 075 85 + 135 82 HIR 195 92 RTN 016 01 1 076 24 CE 136 05 05 196 53 ( 017 00 0 077 85 + 137 61 GTO 197 69 OP 018 82 HIR 078 01 1 138 00 00 198 00 00 019 66 66 079 85 + 139 27 27 199 55 ö 020 82 HIR 080 42 STO 140 97 DSZ 200 05 5 021 16 16 081 36 36 141 37 37 201 85 + 022 82 HIR 082 01 1 142 00 00 202 93 . 023 05 05 083 01 1 143 16 16 203 08 8 024 09 9 084 54 ) 144 73 RC* 204 54 ) 025 82 HIR 085 42 STO 145 39 39 205 69 OP 026 45 45 086 35 35 146 91 R/S 206 05 05 027 43 RCL 087 53 ( 147 01 1 207 82 HIR 028 39 39 088 53 ( 148 44 SUM 208 06 06 029 53 ( 089 73 RC* 149 39 39 209 53 ( 030 42 STO 090 35 35 150 97 DSZ 210 04 4 031 34 34 091 55 ö 151 38 38 211 22 INV 032 85 + 092 82 HIR 152 00 00 212 28 LOG 033 01 1 093 17 17 153 09 09 213 33 Xý 034 85 + 094 75 - 154 00 0 214 65 x 035 42 STO 095 22 INV 155 81 RST 215 32 X:T 036 36 36 096 59 INT 156 00 0 216 82 HIR 037 85 + 097 29 CP 157 00 0 217 14 14 038 09 9 098 77 XòT 158 00 0 218 54 ) 039 54 ) 099 01 01 159 00 0 219 53 ( 040 42 STO 100 03 03 160 00 0 220 59 INT 041 35 35 101 75 - 161 00 0 221 55 ö 042 82 HIR 102 01 1 162 00 0 222 32 X:T 043 15 15 103 54 ) 163 00 0 223 54 ) 044 33 Xý 104 65 x 164 00 0 224 99 PRT 045 74 SM* 105 32 X:T 165 00 0 225 69 OP 046 35 35 106 82 HIR 166 00 0 226 05 05 047 53 ( 107 17 17 167 00 0 227 82 HIR 048 82 HIR 108 54 ) 168 00 0 228 08 08 049 15 15 109 22 INV 169 00 0 229 05 5 050 65 x 110 74 SM* 170 00 0 230 22 INV 051 02 2 111 35 35 171 00 0 231 28 LOG 052 65 x 112 01 1 172 00 0 232 82 HIR 053 73 RC* 113 22 INV 173 00 0 233 07 07 054 34 34 114 44 SUM 174 00 0 234 60 DEG 055 54 ) 115 35 35 175 00 0 235 04 4 056 74 SM* 116 32 X:T 176 00 0 236 05 5 057 35 35 117 74 SM* 177 00 0 237 30 TAN 058 01 1 118 35 35 178 00 0 238 33 Xý 059 94 +/- 119 97 DSZ 179 00 0 239 86 STF <\pre>Some last notes about the programs