Programming Exercise (HP-15C, 15C LE - and others)
|
03-21-2014, 01:04 PM
Post: #8
|
|||
|
|||
RE: Programming Exercise (HP-15C, 15C LE - and others)
(03-21-2014 04:57 AM)Gerson W. Barbosa Wrote:(03-21-2014 01:52 AM)Dave Britten Wrote: Basically, I'm banking on SIGMA- being faster than 1, +/-, RCL+ 4, STO 4. I haven't actually tested that hypothesis yet, mind you. Strangely enough, I tried it again with the more straight-forward approach (1, STO- 4, RCL 4), and it runs in pretty much the same amount of time. The 20S is a pretty nice machine with some cool tricks up its sleeve. It's a shame they don't make it anymore, because it's really good for a simple algebraic model. To go even further off the beaten path, here it is again for the 17BII solver: X=\SIGMA(N:10000:1:-1:INV(N)*(-1)^(N+1)) Nice and concise, and it runs in about 8.5 minutes (I was expecting it to be quicker than that, though, with the tight inner loop presumably being handled by SysRPL code). And of course, the RPL version, which runs in 5.5 minutes on my 48SX: \<< 0 10000 1 FOR N N INV -1 N 1 + ^ * + -1 STEP \>> Everything gets so much simpler when you have high-level looping constructs at your disposal. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 11 Guest(s)