Post Reply 
Programming Exercise (HP-15C, 15C LE - and others)
03-21-2014, 03:53 PM
Post: #9
RE: Programming Exercise (HP-15C, 15C LE - and others)
(03-21-2014 01:04 PM)Dave Britten Wrote:  
(03-21-2014 04:57 AM)Gerson W. Barbosa Wrote:  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.
Dave/Gerson,
I ran Daves 20S code on my 20S and came up with the same result but it took 13 minutes. Does execution time depend on battery value?

I also "ported" Daves 20S program to my 34S:
LBL 'SRS'
CLRREGS
1
STO 00
EEX
4
STO 04
LBL '00'
ENTER
RCL 00
+/-
STO 00
*
1/x
STO+ 01
1
1/X
RCL+ 04
STO 04
X=0?
GTO '01'
GTO '00'
LBL '01'
RCL 01
END

On the WP34S it ran in 27 seconds.
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) - Shawn Gibson - 03-21-2014 03:53 PM



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