The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
"Running non recursive evaluator"
06-14-2014, 06:03 PM
Post: #1
"Running non recursive evaluator"
This occurs whenever recursion depth goes beyond the "Recursive Function" parameter in the CAS Setting. The maximum limit for this parameter seems to be 100. That is not very deep for recursive algorithms, especially since the Prime does not seem to do tail recursion optimization. Here is a simple example:
Code:
(x,a)->BEGIN
  IF x=0 THEN RETURN(a); ELSE RETURN(f(x-1,x*a)); END;
END
Calling f(99,1) works but if I call this as f(100,1) then I get the warning message "Running non recursive evaluator", which requires a click to exit (and seems to be much slower). Is there a way to do deeper recursion? Ideally, the limit should be much higher or even unbounded (with run-time error for stack overflow), but I would be content to have tail recursion!

PS, the typo "Rescursive Evaluation" in CAS Settings is still there in the new firmware.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
"Running non recursive evaluator" - Peter Van Roy - 06-14-2014 06:03 PM



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