HP Forums

Full Version: "Running non recursive evaluator"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
I don't know any portable way to check for stack overflow in C. That's the reason for the max recursive eval parameter. Initially, you got a runtime error if the max number of recursive calls was reached, later I implemented a non-recursive evaluator (with dynamic allocation of the space required to make recursive calls), you don't get an error anymore, but it's slower, therefore the warning remains.
By the way, you should not consider the CAS programming language like a traditional programming language designed by CS people for large projects. Like for many other CAS, it's just a scripting language to make easily small programming extensions (say up to about 1000 lines of code on a PC). Large CAS development should be done in C++ on a PC/Mac with libgiac.
After upgrading to the latest software version, running any of my cas programs shows "Running non recursive evaluator" After "enter'' I may get a result, but not always. I have not been able to figure out why this is happening. Does anyone know? Thanks.
Hi Alberto,

In CAS Setting mode Page 2.
Try to set Recursive Function to 100.
(Max is 100 already, So it may not help Peter's problem)
But it solve my problem.

[attachment=4119]
Reference URL's