Speed of HP-15C LE - and it's capabilities
|
05-13-2014, 08:20 PM
(This post was last modified: 05-13-2014 08:39 PM by Jeff_Kearns.)
Post: #1
|
|||
|
|||
Speed of HP-15C LE - and it's capabilities
I am always amazed at the incredible ingenuity of current and former forum contributors in solving puzzles and mini-challenges, and the various programming techniques used. I would like to tackle the various problems in the Project Euler website one day to see if the HP-15C can handle them all.
I finally got around to entering Valentin Albillo's 160 line program to solve Karl Schneider's A modest arithmetical challenge, posted in April 2007. A worthwhile thread to re-read. The puzzle involved finding integers from 1 through 9, used exactly once to form three quotients of single-digit integer numerators and two-digit integer denominators, such that the sum of these three terms equals unity. There is only one solution. The program takes 'a mere' 48 minutes on a physical HP-15C. According to Valentin, a 750x emulator would run this program in less than 4 seconds. So I tried it on the HP-15C LE just now. ... Time: ~20 seconds!!! That is more like 144 times as fast as regular 15C. I am very happy with this calculator, in spite of its bugs, and I regret selling my spare unit last year for a measly $150 (but at least it was sold to a friend who felt he got a good deal) considering what they are going for now, and especially since my 10 year old son is eyeing mine! Jeff K |
|||
05-13-2014, 08:41 PM
Post: #2
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
If I'm not mistaken, you confirmed that the LE is just 100 time faster than the original 15C which is indeed what I found with a much simpler way. I just implemented a loop with a +1 increment and ran and stopped both 15C and 15C LE at the same time. I found that the LE counter was 100 time higher than the 15C counter which I think is pretty representative of the clock speed (not sure if the LE has multiple frequencies depending on the calculation load like the Prime?).
I would be curious to do the same test on the 34s. I already tried a few tests and was very confused by the results. In some occasion the 34s was superior to the LE in some other cases it was the contrary demonstrating a very different approach of apparently similar questions. Also the 15C LE is emulated while the 34s is natively compiled. If you would like to share your 15C source code I could probably adapt it to the 34s and would be curious to see how it compares. |
|||
05-13-2014, 08:47 PM
(This post was last modified: 05-13-2014 09:13 PM by Jeff_Kearns.)
Post: #3
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
The HP-15C source code is at the link provided in the original post. It would be nice to see the 34s code also.
(05-13-2014 08:41 PM)Tugdual Wrote: If I'm not mistaken, you confirmed that the LE is just 100 time faster than the original 15C ... You may be correct, however according to Valentin's timing of 48 minutes for this particular routine, it is 144x as fast. That wasn't really my point though; I avoided entering the routine at the time because I had no intention of waiting three quarters of an hour to risk discovering I had make a mistake entering the code. It is more fun now than ever. Jeff |
|||
05-14-2014, 01:16 AM
(This post was last modified: 05-14-2014 01:34 AM by Gerson W. Barbosa.)
Post: #4
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
(05-13-2014 08:20 PM)Jeff_Kearns Wrote: I am always amazed at the incredible ingenuity of current and former forum contributors in solving puzzles and mini-challenges, and the various programming techniques used. I would like to tackle the various problems in the Project Euler website one day to see if the HP-15C can handle them all. My (few) solutions to Valentin's challenges typically used to take about 10 times more than his original ones, but then I surpassed myself: my HP-15C program later in that thread takes 200+ minutes... on the HP-15C LE! :-) http://www.hpmuseum.org/cgi-sys/cgiwrap/...ead=210415 Regards, Gerson. |
|||
05-14-2014, 01:37 AM
Post: #5
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
The 15C program is message #13 in the link mentioned.
The only problematic bits looks to be the STO RAN# & RCL RAN# which the 34S doesn't support. Pauli |
|||
05-14-2014, 02:12 AM
Post: #6
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
(05-13-2014 08:20 PM)Jeff_Kearns Wrote: I am always amazed at the incredible ingenuity of current and former forum contributors in solving puzzles and mini-challenges, and the various programming techniques used. I would like to tackle the various problems in the Project Euler website one day to see if the HP-15C can handle them all. I'm pretty sure that the 15C wouldn't be able to handle them ALL, as I recall doing at least a few problems that required a pretty substantial* input data set, or some kind of string manipulation. However, I'd also wager that a very large percentage could be tackled with a non-alphanumeric programmable, as most of them center around finding an algorithm that performs much better than the obvious brute force approach. (*Substantial for a 15C, at least, unless you want to devise a way to stream-process 10+ KB of manually keyed data. A 41C with enough extra hardware could probably get a lot closer to the "all" mark, and I'm pretty confident the palmtops would have little trouble if you can handle entering that much code on the tiny keyboard.) |
|||
05-14-2014, 02:41 AM
Post: #7
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities | |||
05-14-2014, 03:25 AM
Post: #8
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
(05-13-2014 08:20 PM)Jeff_Kearns Wrote: I would like to tackle the various problems in the Project Euler website one day to see if the HP-15C can handle them all. I'm afraid that you will run soon into problems due to the limited memory. Consider problem 11: How do you want to store 800 digits with only 64 registers? And then, how much is left for the program? Cheers Thomas |
|||
05-14-2014, 04:58 AM
Post: #9
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
(05-13-2014 08:47 PM)Jeff_Kearns Wrote: You may be correct, however according to Valentin's timing of 48 minutes for this particular routine, it is 144x as fast. That wasn't really my point though; I avoided entering the routine at the time because I had no intention of waiting three quarters of an hour to risk discovering I had make a mistake entering the code. It is more fun now than ever. In the very long calculation if Pi to 306 digits detailed here, I found the original 15c took 43 hours while the 15cLE took 16.1 minutes. That's a 160x speedup. -katie |
|||
05-14-2014, 04:11 PM
Post: #10
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
Check my YouTube presentation on the HP-15C LE timings at HHC 2011. Here is the link to that presentation.
|
|||
05-14-2014, 07:27 PM
Post: #11
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
(05-14-2014 04:11 PM)Namir Wrote: Check my YouTube presentation on the HP-15C LE timings at HHC 2011. Here is the link to that presentation. Or your article in HP Solve Newsletter "Limited Edition HP 15c Execution Times", Issue 25, October 2011, page 36: http://h20331.www2.hp.com/hpsub/download...r_2011.pdf |
|||
05-18-2014, 08:49 AM
(This post was last modified: 05-18-2014 08:53 AM by Tugdual.)
Post: #12
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
(05-13-2014 08:20 PM)Jeff_Kearns Wrote: I finally got around to entering Valentin Albillo's 160 line program to solve Karl Schneider's A modest arithmetical challenge, posted in April 2007. A worthwhile thread to re-read. For some reasons this little problem kept my attention and sorry if I'm a bit off topic now. I suspected there were more solutions than those listed and checked that with a quick and dirty C++ app. Here are my findings. There are 3 patterns of digits to consider: P1: d/dd + d/dd + d/dd P2: dd/dd + d/dd + d/d P3: dd/ddd + d/d + d/d P3 doesn't seem to produce results. Code: P2 - 1 : 12/48 + 7/36 + 5/9 And some C++ snippets for those interested in gory details (using Qt cuz it is so simple but STL on its own would totally do here). Code: #include <QDebug> |
|||
05-18-2014, 09:25 AM
Post: #13
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
(05-18-2014 08:49 AM)Tugdual Wrote: There are 3 patterns of digits to consider: Quote:form three quotients of single-digit integer numerators and two-digit integer denominators All your solutions to the P1 pattern are essentially the same: Quote: Cheers Thomas |
|||
05-18-2014, 09:53 AM
Post: #14
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities | |||
05-23-2014, 12:37 PM
(This post was last modified: 05-23-2014 01:50 PM by Tugdual.)
Post: #15
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
I completed a version of code for the 34s. I started from scratch so don't even try to compare to the 15C version. I doubt my code is optimal, considering its size and the much higher capabilities of the 34s compared to the 15C. Anyway, here is what it looks like.
I tested it on the 34s emulator and the result is pretty quick. On the real 34s it seems to take much more time; I haven't seen the 1st result after 40mn and I think I'm going to stop to avoid draining the battery. Edit: took around 1h to find a result. Usage: Call A to run. When it stops you'll read: FOUND 219,867,435 which means (read right to left) 5/34+7/68+9/12 Press R/S to search for the next solution Code: 001 LBL A |
|||
05-25-2014, 08:36 AM
(This post was last modified: 05-25-2014 08:39 AM by Tugdual.)
Post: #16
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
Tested the same problem with the Hp Prime.
Ease of development: much much easier than 34s or 15C, no question about that. Using lists and a few other convenient functions took me less than 1h while on the 34s it took me days of painful debugging. Also when you read the source code, there is a chance that you understand something while the 34s and 15c are quite challenging. Speed: Prime is the big big winner. 1'51s to find the result! Amazing. You cannot even compare with old gen calculators. Comments: here again the Prime demonstrates how powerful it is. Still I would use a 34s or 15c on a daily base. Definitely a matter of concept. The Prime seems to be lost somewhere in between a small computer and a calculator, demonstrating a lot of power and programming ease but not convenient for daily calculations. Code: next_permutation(); |
|||
05-25-2014, 01:37 PM
Post: #17
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
(05-25-2014 08:36 AM)Tugdual Wrote: Tested the same problem with the Hp Prime. Can you confirm the speed? 1 minute and 51 seconds on the Prime compared to 20 seconds on the 15C-LE is not so impressive. Jeff K |
|||
05-25-2014, 04:54 PM
Post: #18
|
|||
|
|||
RE: Speed of HP-15C LE - and it's capabilities
(05-25-2014 01:37 PM)Jeff_Kearns Wrote:I didn't transpose the 15C algorithm, I transposed the C++ STL next_permutation algorithm. I would rather compare this to the former 34s result, 48mn.(05-25-2014 08:36 AM)Tugdual Wrote: Tested the same problem with the Hp Prime. Not sure how the 15C algorithm works, isnt' it brute force? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)