Post Reply 
Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant
02-17-2017, 02:23 PM (This post was last modified: 02-17-2017 02:28 PM by Gerson W. Barbosa.)
Post: #14
RE: Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant
(02-17-2017 07:29 AM)Paul Dale Wrote:  How's this:

Code:
    STO 00
    CLR STK
    ISG X
    LBL 00
        STO+ Y
        1/x
        STO+ Z
        1/x
        x<>y
        DSE 00
            GTO 00
    RCL Z

Twelve steps, eighteen bytes. This doesn't use any functions they don't have, although the accuracy won't be so great.

In thirteen steps, twenty bytes and no register:

Code:

    0
    ENTER
    ENTER
    ISG X
    LBL 00
        STO+ Y
        1/x
        STO+ Z
        1/x
        x<>y
        DSE T
            GTO 00
    RCL Z


Pauli

One more step, considering the initial LBL. 25 and 27 bytes on the HP-42S, respectively. 55 iterations in 9.0 s and 8.1 s, respectively.

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant - Gerson W. Barbosa - 02-17-2017 02:23 PM



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