radcan() simplification error.



Costa,

1) No, there is no complete and up-to-date catalog of the simplifications
Maxima performs.  Reading the code will of course show you everything it's
doing, but that's not really practical, as most of the code is about
efficient implementation of mathematically simple things (e.g. 3*x + 4*y +
2*x --> 5*x + 4*y).

2) As I understand it, different GCD algorithm implementations are better in
different cases, e.g. univariate, high-degree dense, high-degree sparse,
homogeneous, etc.  Some of them also appear to have bugs. You might want to
review the archives of this mailing list for discussion of this.

Please note that the gcd and algebraic settings *only* affect the Rational
Function package (rat, radcan, ratsimp, etc.) and *not* the general
simplifier, which does not perform GCDs.

                 -s

On Mon, May 30, 2011 at 14:20, Constantine Frangos <cfrangos at telkomsa.net>wrote:

>
> Dear Stavro,
>
> Thanks for the fast and detailed response. Any assistance with the
> following would be
> appreciated:
>
> (1) Is it possible to print out a list  of the types of simplifications
> performed by the general
> simplifier ?
>
> (2) Up to now I have used the settings: algebraic : true; gcd : 'spmod; and
> then applied
> the Maxima built-in simplification functions to expressions, etc.
> Based on your recent posting regarding 'red and 'spmod, it seems that I
> should be using
> gcd : 'red; OR gcd : 'subres; in order to obtain better simplifications. Is
> this correct ?
>
> Thanks very much.
> Kind regards,
> Constantine Frangos.
>
>
> On Wednesday 25 May 2011 07:55:56 pm you wrote:
> > I haven't looked at your example in detail, but I suspect that your
> question
> > relates to the treatment of things like expr: sqrt(x^2-2*x+1).
>  radcan(expr)
> > => x-1, where you might expect abs(x-1), as returned by
> > scanmap(factor,expr).  This radcan behavior is intentional, on the theory
> > that either branch of the root is correct.
> >
> > Why, then, does radcan(sqrt(x^2)) return abs(x)?  Because the *general
> > simplifier* tries to simplify to the positive root, and so simplifies the
> > expression to abs(x) before radcan even looks at it:
> >
> > (%i2) sqrt(x^2);
> > (%o2) abs(x)
> > (%i3) radcan(%);
> > (%o3) abs(x)
> > (%i4) sqrt(x^2-2*x+1);
> > (%o4) sqrt(x^2-2*x+1)
> > (%i5) radcan(%);
> > (%o5) x-1
> > (%i6) scanmap(factor,%o4);
> > (%o6) abs(x-1)
> > (%i7) radcan(%);
> > (%o7) abs(x-1)
> >
> >              -s
> >
> > On Wed, May 25, 2011 at 17:18, Constantine Frangos <
> cfrangos at telkomsa.net>wrote:
> >
> > >
> > > Dear List,
> > >
> > > Any assistance with the following would be appreciated:
> > >
> > > (1) The function radcan() seems to simplify the following expression
> > > correctly:
> > >
> > > (%i98) radcan(sqrt(a^2)/sqrt(4*%pi^2*(q0-2000)^2));
> > >
> > > (%o98) abs(a)/(2*%pi*abs(q0-2000))
> > > (%i99)
> > >
> > > (2) However, for the following more complicated expression, radcan()
> seems
> > > to simplify the denominator incorrectly:
> > >
> > > (%i99)
> > >
> radcan(sqrt((sin(2*%pi*pmin*(q0-q))-sin(2*%pi*pmax*(q0-q)))^2/(4*%pi^2*(q0-q)^2)+(cos(2*%pi*pmin*(q0-q))-cos(2*%pi*pmax*(q0-q)))^2/(4*%pi^2*(q0-q)^2)));
> > >
> > > rat: replaced 2.0 by 2/1 = 2.0
> > >
> > > rat: replaced 2.0 by 2/1 = 2.0
> > >
> > > rat: replaced 2.0 by 2/1 = 2.0
> > >
> > > rat: replaced 2.0 by 2/1 = 2.0
> > >
> > > rat: replaced 2.0 by 2/1 = 2.0
> > >
> > > rat: replaced 2.0 by 2/1 = 2.0
> > >
> > > rat: replaced 2.0 by 2/1 = 2.0
> > >
> > > rat: replaced 2.0 by 2/1 = 2.0
> > > (%o99) sqrt(sin(2*%pi*pmin*q0-2*%pi*pmin*q)^2
> > >             -2*sin(2*%pi*pmax*q0-2*%pi*pmax*q)
> > >               *sin(2*%pi*pmin*q0-2*%pi*pmin*q)
> > >             +cos(2*%pi*pmin*q0-2*%pi*pmin*q)^2
> > >             -2*cos(2*%pi*pmax*q0-2*%pi*pmax*q)
> > >               *cos(2*%pi*pmin*q0-2*%pi*pmin*q)
> > >             +sin(2*%pi*pmax*q0-2*%pi*pmax*q)^2
> > >             +cos(2*%pi*pmax*q0-2*%pi*pmax*q)^2)
> > >        /(2*%pi*q0-2*%pi*q)
> > > (%i100)
> > >
> > >
> > > (3) On the other hand, radcan() seems to take into account some facts
> > > specified by the
> > > assume() statement in the example below. Do other Maxima built-in
> > > simplification functions
> > > take specified constraints into account ?
> > >
> > > (%i101) assume(q0>=2000);
> > >
> > > (%o101) [q0 >= 2000]
> > > (%i102) radcan(sqrt(a^2)/sqrt(4*%pi^2*(q0-2000)^2));
> > >
> > > (%o102) abs(a)/(2*%pi*q0-4000*%pi)
> > > (%i103)
> > >
> > >
> > > Thanks very much.
> > > Constantine Frangos.
> > >
> > > _______________________________________________
> > > Maxima mailing list
> > > Maxima at math.utexas.edu
> > > http://www.math.utexas.edu/mailman/listinfo/maxima
> > >
> >
>