Post Reply 
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.

I guess it should slower, considering the extra calculations involved. My 21-step HP-12C version takes 2 minutes on my HP-12C+ (not the fastest one around). Using Sigma- to decrease the counter made it 52 seconds slower (and one step longer, but that was a quick modification).
Anyway, that was a nice trick to save a few steps on the HP-20S. Also, 10 minutes appear to be fast enough. Years ago a co-worker offered me an HP-20S in very good shape for a low price - I feel now I should have taken it.

Thank you for the unexpected algebraic program!

Gerson.

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.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Programming Exercise (HP-15C, 15C LE - and others) - Dave Britten - 03-21-2014 01:04 PM



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