Menu

#2486 trigrat loops forever, depending on how you call it

open
nobody
7
2012-11-07
2012-11-07
No

The following works:

e : 2*x/(sqrt(y)+x) - (x^2/((sqrt(y)+x)^2));
trigrat(e);
trigrat(xthru(e));

Both of the following lines will make the second "trigrat" call take forever (100% CPU utilization, will never return):

( trigrat(e), trigrat(xthru(e)) );
[ trigrat(e), trigrat(xthru(e)) ];

So: evaluating both lines separately works, but evaluating them together or inside a function will cause the "bug".

If you switch the expressions, it works fine:

( trigrat(e), trigrat(xthru(e)) ); /* loops forever */
( trigrat(xthru(e)), trigrat(e) ); /* works */

Discussion

  • David Scherfgen

    David Scherfgen - 2012-11-07

    trigrat bug demo

     
  • David Scherfgen

    David Scherfgen - 2012-11-07

    Maxima version: "5.28.0"
    Maxima build date: "2012-09-03 11:36:16"
    Host type: "x86_64-unknown-linux-gnu"
    Lisp implementation type: "CLISP"
    Lisp implementation version: "2.42 (2007-10-16) (built 3403443236) (memory 3555653780)"

     
  • David Scherfgen

    David Scherfgen - 2012-11-07
    • priority: 5 --> 7
     
  • David Scherfgen

    David Scherfgen - 2012-11-07

    Stavros Macrakis posted another, simpler, example on the mailing list:

    f: 1/(y+sqrt(y))$
    [trigrat(f), trigrat(f)]

    It doesn't loop forever, but the first result is different from the second!

     

Log in to post a comment.