Post Reply 
Best calculator for recurrence relations
02-25-2020, 08:01 PM
Post: #14
RE: Best calculator for recurrence relations
(02-25-2020 07:15 PM)DavidM Wrote:  This could probably be sped up by doing the computations on the stack instead of with a symbolic expression, but the readability would take a significant hit (IMHO).

This is indeed the case. You end up with lots of PICKs and GETs and the programs are as hard to write as they are to read. They are also a lot faster.

For example, here is a program for a similar sequence:

Code:

%%HP: T(3)A(R)F(.);
@ Returns A070867, a highly chaotic sequence, which is sequence 'F' from S. Wolfram,
@ 'A New Kind of Science', p.129.
@ Expression: A(0) = A(1) = 1; A(n) = A(n-A(n-1)-1) + A(n-A(n-2)-1)
\<< \-> s
  \<< 1 1 3 s
    FOR n OVER n SWAP - n SWAP - 1 + PICK OVER n SWAP - n SWAP - 2 + PICK +
    NEXT s \->LIST
  \>>
\>>
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Best calculator for recurrence relations - John Keith - 02-25-2020 08:01 PM



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