[VA] SRC #012b - Then and Now: Root
|
11-13-2022, 11:44 PM
(This post was last modified: 11-13-2022 11:55 PM by PeterP.)
Post: #20
|
|||
|
|||
RE: [VA] SRC #012b - Then and Now: Root
Ok, here are the listings typed up, please excuse any typos:
It is called with XEQ “VA2” and stops after about 23 seconds with the result in X. The elements a[n] to a[n-x] are in the registers sss.eee, with sss > eee. This control number is stored in R00 The calculated elements b[n] from the squaring are in registers bbb.fff with bbb > fff. This control number is stored in R01 Once all b[n] are calculated, the new boundaries are calculated (1/2 of bbb-fff. And bbb-fff is half of sss-eee) The b[n]’s become the new a[n]s, and the control numbers are created accordingly, R02 accumulates the values for each b[n-i] as the summation over all j = 1….i takes place. R03 holds the current j R04 holds the current i R06 holds the number of elements to calculate LBL 00 is the loop summing over the elements j = 1….i LBL 01 is the loop over all i LBL 03 is the loop over the successive b[n], b’[n], b’’[n], etc LBL 05 is the final min abs root value calculation after the last b’’…[n] series calculation which has only 3 elements. ———————————————- REM - Fill Primes in descending order into registers. Called with a control word of sss.eee LBL “PL” 50 SETCSPD RDN STO M 2 STO IND M DSE M VIEW X 3 VIEW X STO IND M DSE M LBL 00 INCX INCX PRIME? GTO 01 LASTx GTO 00 LBL 01 View X STO IND M DSE M GTO 00 END ————————- REM….. Main PRogram LBL “VA2” 109.009 STO 00 XEQ “PL” RCL 00 159.110 STO 01 X<>Y - INT STO 06 LBL 03 1 STO 04 RCL Ind 00 X^2 STO IND 01 LBL 01 RCL 04 STO 03 CLX STO 02 LBL 00 RCL 03 RCL 04 - RCL 00 + RCL IND X STO 05 RCL 03 CHS RCL 04 - RCL 00 + RCL IND X ST* 05 2 -1 RCL 04 RCL 03 - Y^x * RCL 05 * ST+02 DSE 03 GTO 00 RCL 00 RCL 04 - RCL IND X X^2 -1 RCL 04 Y^X * RCL 02 + RCL 01 RCL 04 - X<>Y STO IND Y RCL 04 INCX STO 04 Enter RCL 06 X>Y? GTO 01 RCL 06 2 / INT STO 06 2 X>Y? GTO 05 RDN RCL 00 INT X<>Y - 1000 / RCL 00 INT + X<>01 X<>00 GTO 03 LBL 05 -2 RCL 01 RCL IND X RDN + RCL IND X R^ / RCL IND 01 LOG 2 LOG / 2 * 1/x Y^X 1/x Beep CLD END Cheers, PeterP |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)