Post Reply 
(35S) Fibonacci Fun for the HP35s and the number phi
01-23-2015, 07:08 AM (This post was last modified: 01-23-2015 07:13 AM by MarkHaysHarris777.)
Post: #6
RE: Fibonacci Fun for the HP35s and the number phi
(01-22-2015 10:56 AM)Didier Lachieze Wrote:  [*]Step F010 is to duplicate register X : REGX is accessed by [YellowShift][Mem][RDN] then select X with the left Arrow and [ENTER]

Well, I finally did get to play with this late today... what an education! I am surprised at this undocumented REGX command. I finally realized that RDN means rolldown! [R|] duh. As it turns out, on the HP35s, the REGX REGY REGZ REGT commands can be accessed from *any* menu followed by a rolldown [R|]. This is huge under some circumstances, because it reduces the amount of storage required on many of my subroutines.

As is usually the case, there is a trade-off. I am not yet sure if its the inclusion of an equation EQN (REGX+REGY) in the loop, or the hidden stack commands themselves, but the new Fibonacci routine (although taking less storage steps) has a significantly longer runtime. The original stored program runs in just over 4 seconds (59th Fib #) while the new stored program with equation embedded runs in just under 7 seconds... a +75% increase in runtime!

That surprised me until I thought about it a bit... there is apparently a significant overhead in the calling mechanism to run an equation rather than using the native stack rolling manipulation; although, with the positive trade-off of having a simplified stored program with less steps in storage; 76 vs 84 bytes (17 vs 25 steps) as in this case study.

Anyway, thanks again for the fun, and the education. Every day I learn something new about HP35s, and every day I love it more than the day before!

Cheers
Smile

Kind regards,
marcus
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Fibonacci Fun for the HP35s and the number phi - MarkHaysHarris777 - 01-23-2015 07:08 AM



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