On Aug. 30, Dieter Kaiser wrote:
--------------------------------------
thank you very much for the link.
Unfortunately, the shown behavior of Macsyma 422.0 for Sparc which has
been used in the link is not the present behavior of Maxima. It is
worse.
sqrt(1/z) is always simplified to 1/sqrt(z). We can declare z to be
complex or use a symbol assumed to be real and negative. Even to set
radexpand to false does not help:
(%i2) declare(z,complex)$
(%i3) assume(y<0)$
(%i4) sqrt(1/z);
(%o4) 1/sqrt(z)
(%i6) sqrt(1/y);
(%o6) 1/sqrt(y)
(%i7) radexpand:false$
(%i8) sqrt(1/z);
(%o8) 1/sqrt(z)
(%i10) sqrt(1/y);
(%o10) 1/sqrt(y)
I have already improved the code to get a correct simplification. The
testsuite and the share_testsuite have no serious problems.
At the moment I am working on a testfile for the sqrt function, to check
the improved code and a lot of other things too. When I have finished
this work I will present the results on the mailing list.
-------------------------------------------
Hi Dieter,
I am finally looking at this behavior again as I rewrite
Ch. 4, Solving Equations.
In both windows ver 5.22.1 and 5.21.1 I get the behavior:
--------------------------------------------------------------
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-10-29
(%i1) display2d:false$
(%i2) assume(z < 0);
(%o2) [z < 0]
(%i3) expr : sqrt(1/z) + 1/sqrt(z);
(%o3) 1/sqrt(z)+sqrt(1/z)
(%i4) ratsimp(%);
(%o4) (sqrt(1/z)*sqrt(z)+1)/sqrt(z)
(%i5) sqrt(1/z);
(%o5) sqrt(1/z)
(%i6) ratsimp(%);
(%o6) sqrt(1/z)
-------------------------------------
As Michael Wester's complex domain test of Macsyma
shows, the simplification of sqrt(1/z)
should be - 1/sqrt(z) when z is real and negative.
So his test of Macsyma shows that with the
statement assume(z < 0) in place, the observed
Macsyma behavior (principal branches) is
sqrt(1/z) + 1/sqrt(z) ==> 0
(automatically simplified).
Is there a way to have Maxima do this
simplification automatically?
Ted
-----------------------------------------------
my original note to you:
On Sun, 30 Aug 2009 Dieter Kaiser wrote:
.....
This might be a problem of the simplifier, which does not handle the sqrt
function carefully.
-------------------------
Dieter, I'm sure you are hyperaware of everything below,
but some mailing list readers might benefit from knowing that
the bug report you have referred to
BUG ID: 1010768 - sqrt(1/z) - 1/sqrt(z) => 0
has a link to the text file:
http://www.math.unm.edu/~wester/demos/ComplexDomain/Macsyma.problems
by Michael Wester of the Mathematics Department at the University of New
Mexico,
Albuquerque, reviewing the use of Macsyma with complex expressions, and
this
review might be useful for some readers.
This file is dated 1999 and uses Macsyma 422.0 for Sparc (Solaris 2.x)
computers.
Lines 128 - 175 appear to show careful and correct treatment of
expr : sqrt(1/z) - 1/sqrt(z);
which is not simplified unless various further information about z is
furnished. declare (z, complex) does not cause simplification, but
remove(z, complex)$ and assume(z > 0)$ causes
ratsimp(expr) --> 0.
forget(z > 0)$ and assume(z < 0)$ causes sqrt(1/z) + 1/sqrt(z);
to be automatically simplified to 0.
Using the principal branch definitions for both w1 = (z)^(1/2)
and w2 = (1/z)^(1/2) , sqrt(1/z) = 1 / sqrt(z) unless
z is real and negative (theta = pi radians), in which case
sqrt(1/z) = - 1 / sqrt(z).
I would welcome an improvement in simplification
of square roots of complex expressions, avoiding tedious
hand work.
Ted Woollett