Post Reply 
Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant
02-20-2017, 12:40 AM
Post: #41
RE: Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant
(02-19-2017 10:25 PM)BartDB Wrote:  Taking into account Joe's comment on accuracy by summing from 1/F (n) first, my attempt on the 50g:

Code:
 
« 0. 1. 1. 4. PICK
  START DUP INV 4. ROLLD
  DUP ROT + NEXT
  DROP2 0. 1. ROT
  START + NEXT »

62.5 bytes

.


Nice use of the infinite stack! Well, that's what it is for, anyway.

Too bad ΣLIST doesn't work with one-element lists (any reason berhind this feature?), otherwise you could have saved 1.5 bytes:

Code:

« 0. 1. 1. 4. PICK
  START DUP INV 4. ROLLD DUP ROT +
  NEXT DROP2 →LIST REVLIST ΣLIST
»

60 bytes, but fails for n = 1 ( ΣLIST Error: Invalid Dimension ).

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-20-2017 12:40 AM



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