rectform rescue of principal value



On Nov. 4, Stavros Macrakis  wrote:
------------------


> 1) rectform/polarform are as naive (or more)
       as the rest of Maxima about principal values.

-------------------------------------------
A failure of both rectform and polarform to agree
with principal value conventions is PV (-8)^(1/3) )
  defined in terms of the p.v.log.
-----

 Maxima 5.22.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
"2010-11-05"

(%i1) pv_nth_root(zz,nn) := expand (exp (%i*carg(zz)/nn) * abs (zz)^(1/nn))$

(%i2) rectform ( (-8)^(1/3) );
(%o2) -2

(%i3) polarform ( (-8)^(1/3) );
(%o3) 2*%e^(%i*%pi)
(%i4) ev(%);
(%o4) -2

(%i5) z : 8*exp(%i*%pi);

(%o5) -8

(%i6) [abs(z),carg(z)];
(%o6) [8,%pi]

(%i7) 8^(1/3);
(%o7) 2

(%i8) pv_nth_root(z,3);
(%o8) sqrt(3)*%i+1

----------------------------------

> 2) Taking log of the rectform of something messy will
>            give something even messier.
>          The log of the polarform is >  much more sensible.
>
>   3) Of course, if there are bugs in polarform, that doesn't help....
>
>   4) In general, both will be big messes, partly because
>          Maxima is trying to be careful by using atan2,
>        but Maxima doesn't know how to simplify atan2 very
>        much.
------------------------------------------

Thanks for the heads up.

Ted Woollett