problems with find_root



Hi,

I'm having some difficulties with find_root, and I wonder if 
anyone can help. I've already searched the mailing list 
archives, and I've found some pertinent posts which led me 
to quote the expression given to find_root, but this doesn't 
seem to help.

Here is the problem. In the following call, delta and mphi 
have numerical values (and so do all other function 
arguments that appear in the code below, although I am not 
giving these values here).

ahatp(delta,1e-6,0.005,mphi)

Maxima encountered a Lisp error:
Binding stack exhausted.

PROCEED WITH CAUTION.
Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
   INFO: Binding stack guard page unprotected
   Binding stack guard page temporarily disabled: proceed 
with caution
   INFO: Binding stack guard page reprotected


Now the complete code is below.  Thanks for any help.


						Kostas


===================================================================

ahatp(delta,epsilon,theta,min_phi) := block([a0],
   a0 : alpha0(theta),
   find_root('(N1th2(alpha,delta,epsilon,theta,min_phi) -
      1/(2*theta_0p(alpha,delta,theta,min_phi))), 'alpha, 0, a0)
);


theta_0p(alpha,delta,theta,min_phi) :=
   min(theta_inf(delta), alpha*theta/m, min_phi);

psi(alpha,theta) := 0.5*theta^2 -
   if alpha > 0 then alpha*theta*log(m/(alpha*theta)) else 0;

alpha0(theta) := find_root(psi(alpha,theta), alpha, theta^2, 1);

C1p(alpha,theta) := (0.5*(m+mu_s)-1) / psi(alpha,theta);
C2p(alpha,epsilon,theta) :=
   (m*log(1.2) + 1.0023*mu_s + log(2/epsilon+2.0) - 
0.5*mu_s*log(float(mu_s)))
  / psi(alpha,theta);


/* The N_1 of Th. 2 */
N1th2(alpha,delta,epsilon,theta,min_phi) := block([c1,c2],
   c1 : C1p(alpha,theta),
   c2 : C2p(alpha,epsilon,theta),
   if c1 < 0 then
     error("this shouldn't happen!!"),
   if c2 > 0 and c1+c2 >= 21 then
     1.5*c1*log(c1+c2) + c2
   elseif c2 <= 0 then
     1.5*c1*log(c1)+c2
   else
     error("with C2 > 0, must have C1+C2 >= 21!")
);