Made a new program for the HP 11C
|
01-08-2014, 06:49 PM
Post: #5
|
|||
|
|||
RE: Made a new program for the HP 11C
(01-08-2014 10:03 AM)vma Wrote: Here is v2 with the following improvements:You may also use storage arithmetics (like 1 STO+ 3) and the dedicated tests that compare X with zero (e.g. X=0? RTN). The max. divisor is sqrt(n), and since the result is exact due to BCD arithmetics, there is no need to add 1. In your previous post you wrote: Quote:...even the optimized algorithm as mentioned above, implemented in VB .net on an Intel Core i7 CPU will take LONGER to calculate than the TI Nspire CAS! There are much better (but more complicated) algorithms around, but still I ask myself how it manages to get the result that fast. I am led to believe that the Nspire just uses a table with the first so many primes...You probably heard of the WP34s project before: a community effort with a homebrew software for a scientific calculator, based on HP30b hardware. The WP34s PRIME? function runs the test you mentioned in less than a second either. For further information take a look at the C code at sourceforge.net (line 1426 ff). For more details regarding the Miller-Rabin primality test, cf. the respective Wikipedia article. So processor speed is one thing, but the really essential part is a carefully chosen algorithm. ;-) |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Made a new program for the HP 11C - vma - 01-07-2014, 09:21 PM
RE: Made a new program for the HP 11C - kakima - 01-07-2014, 10:06 PM
RE: Made a new program for the HP 11C - vma - 01-08-2014, 09:44 AM
RE: Made a new program for the HP 11C - vma - 01-08-2014, 10:03 AM
RE: Made a new program for the HP 11C - Dieter - 01-08-2014 06:49 PM
RE: Made a new program for the HP 11C - vma - 01-08-2014, 09:36 PM
RE: Made a new program for the HP 11C - walter b - 01-08-2014, 10:13 PM
RE: Made a new program for the HP 11C - Thomas Klemm - 01-09-2014, 07:22 AM
RE: Made a new program for the HP 11C - Dave Britten - 01-09-2014, 02:16 AM
|
User(s) browsing this thread: 1 Guest(s)