Menu ▾ ▴

#5701 rectform gives a Lisp error or 0 for negative powers of zeros like log(%i)-%i*%pi/2

None
closed
nobody
rectform (29)
5
5 hours ago
6 hours ago
No

By Claude:

log(%i) - %i*%pi/2 is 0, although it does not simplify to 0. rectform of its reciprocal gives a Lisp error, while its square gives the error that 0 to a negative power should give:

(%i1) display2d : false$
(%i2) rectform(log(%i) - %i*%pi/2);
(%o2) 0
(%i3) rectform(1/(log(%i) - %i*%pi/2));
Maxima encountered a Lisp error:

 arithmetic error DIVISION-BY-ZERO signalled
Operation was (/ 1 0).
(%i4) rectform(1/(log(%i) - %i*%pi/2)^2);
expt: undefined: 0 to a negative exponent.

realpart, imagpart, cabs, carg, polarform and sign of 1/(log(%i) - %i*%pi/2) give the same Lisp error, and so do rectform(sech(log(%i))), rectform(csch(2*log(%i))) and rectform(coth(2*log(%i))), which are at poles of sech, csch and coth.

For powers below -maxposex, which is -1000 by default, rectform returns 0 instead, although 0 to a negative power is undefined:

(%i5) rectform((log(%i) - %i*%pi/2)^(-1000));
expt: undefined: 0 to a negative exponent.
(%i6) rectform((log(%i) - %i*%pi/2)^(-1001));
(%o6) 0
(%i7) cabs((log(%i) - %i*%pi/2)^(-1001));
(%o7) 0

realpart, imagpart, carg and polarform return 0 for it as well, and sign returns zero.

Discussion

  • David Scherfgen

    David Scherfgen - 5 hours ago
     
  • David Scherfgen

    David Scherfgen - 5 hours ago

    Fixed by commit [cbf3e0].

     

    Related

    Commit: [cbf3e0]

  • David Scherfgen

    David Scherfgen - 5 hours ago
    • status: open --> closed
     

Log in to post a comment.