Post Reply 
Yet another Fibonacci mini-challenge (HP-42S/Free42)
12-06-2018, 12:31 PM
Post: #13
RE: Yet another Fibonacci mini-challenge (HP-42S/Free42)
(12-06-2018 11:30 AM)Thomas Okken Wrote:  NOT +/-


Anyway, now I see why this cleverness causes this implementation to fail for n > 50: that's where the BASE functions' 36-bit arithmetic goes out of range. You do need to use IP if you want to avoid that limitation.

Actually it starts to fail when n = 53 (Invalid Data). It gets F(52) right, but F(51) is off by one unity.

Code:

00 { 22-Byte Prgm }
01▸LBL "FIB"
02 0.5
03 ASINH
04 ×
05 E↑X-1
06 5
07 SQRT
08 ÷
09 NOT
10 +/-
11 END

When lines 09 and 10 are deleted the byte-count drops to 19, which has driven me to think they add up to three bytes. The least byte-count, 17, is reached when line 01 is changed to LBL F, or 15 when it is deleted. But what’s the point? MEM shows me the available memory is 1818968064 bytes :-)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Yet another Fibonacci mini-challenge (HP-42S/Free42) - Gerson W. Barbosa - 12-06-2018 12:31 PM



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