#525 ratweight expt coredump/FIX

closed
nobody
None
5
2004-11-23
2004-02-25
No

ratweights(x,1,y,1);
rat((1+x+y)^10000),ratwtlvl:3;

coredumps (too deep recursion)

The fix is simple, and improves the algorithm to boot:

In rat3b.lisp:

(defun wtpexpt (x n)
(cond ((= n 0) 1)
((= n 1) x)
((evenp n)
(let ((xn2 (wtpexpt x (/ n 2))))
(wtptimes xn2 xn2 0)))
(t (wtptimes x (wtpexpt x (1- n)) 0))))

Now even rat((1+x+y)^(10^30)),ratwtlvl:5; works.

Maxima 5.9.0 GCL 2.5.0 mingw32 W2k Athlon

Discussion

  • Raymond Toy

    Raymond Toy - 2004-11-23

    Logged In: YES
    user_id=28849

    Assuming you meant wtpexpt in ratout.lisp, this all works
    nicely.

    Suggested fix applied.

     
  • Raymond Toy

    Raymond Toy - 2004-11-23
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks