[HP35s] Program for prime number (Wheel Sieve and Miller-Rabin)
|
02-15-2019, 08:47 AM
(This post was last modified: 02-15-2019 09:06 AM by fred_76.)
Post: #19
|
|||
|
|||
RE: [HP35s] Program for prime number (brut force)
(02-14-2019 08:50 PM)Thomas Klemm Wrote: Here's a program for the HP-42S using this idea: Version 8 I entered the program in the HP35s, it was straightforward. The measured run times are still slower than V3 : Run time 6 digits 999 983 = 13.4 s 7 digits 9 999 991 = 40,4 s The difference between the two algorithms at each cycle are :
The 7 multiplications in V8 take longer to calculate than the additional 7 tests and stack operations in V3. (02-14-2019 09:17 PM)Thomas Klemm Wrote: You can also try numbered registers instead of variables. I could imagine that they are faster. But I could be completely wrong. There is no "numbered" registers in the HP35S to my knowledge, just alpha registers and indirect registers. I measured the time taken (1000 loops) to calculate the execution time of indirect vs direct registers. The unit op exec time is then :
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 11 Guest(s)