Post Reply 
Made a new program for the HP 11C
01-08-2014, 09:44 AM
Post: #3
RE: Made a new program for the HP 11C
Hi,

Thanks for the reply and no offense taken!

Actually, I do know how to optimize the prime testing algorithm (it's actually part of a VB .net course I lecture), but I got just too excited that it did work at all, as it is, i.e. without most optimizations!

I will try to make a v2 with the following improvements:

1) Search only to SQRT(number)+1
2) Search only odd numbers, creating a first condition for even numbers
3) Try to use the Index register

The beauty of programing a device like the HP 11C is that one needs to simplify the code to the max. This encourages to develop the algorithm/code BEFORE starting to actually program the device. Modern programming enviroments are by now so user friendly, that students have a hard time to accept that they need to create the algorithm (i.e. flowchart) before starting to do the program on the computer, which leads too often to failure.

Anyway: 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...

BTW: I am NOT a math teacher - I work with CAD/CAM systems.

Regards,
Vitor

HP: HP 11C, HP 40, HP 48GX, HP 95LX, HP 200LX
CASIO: FX-5000F, FX-880P, FX-9860 Slim, ClassPad 330
TI: TI-74, TI Voyage 200, TI Nspire CAS
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


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 - vma - 01-08-2014 09:44 AM



User(s) browsing this thread: 1 Guest(s)