Post Reply 
Plus42 Equations, Preview Release
06-16-2022, 04:27 PM (This post was last modified: 06-16-2022 05:42 PM by Ajaja.)
Post: #753
RE: Plus42 Equations, Preview Release
Yes, I gravely underestimated the scale of the recursion. Just tested, the similar keystroke program works only 10-20% faster:
Code:
00 { 33-Byte Prgm }
01▸LBL "FB"
02 FUNC 11
03 RCL ST X
04 1
05 -
06 X>0?
07 GTO 01
08 X<>Y
09 RTN
10▸LBL 01
11 XEQ "FB"
12 LASTX
13 1
14 -
15 XEQ "FB"
16 +
17 END


P.S. With memorization it's MUCH faster Wink
Code:
FIB(N):0*IF(MAT?(M):0:MROWS(L(M:NEWMAT(N:1))))+0*IF(MROWS(M)<N:MROWS(L(M:NEWMAT(N:1))):0)+IF(N≤1:N:IF(M[N:1]=0:L(M[N:1]:FIB(N-2)+FIB(N-1)):M[N:1]))
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Plus42 Equations, Preview Release - Ajaja - 06-16-2022 04:27 PM



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