maxima bug



Dear all,

radcan do understand assume and do it correctly.
consider de code

(%i1) reset()$kill(all)$
(%i3) radcan(sqrt(x^2)-x);
(%o3) |x| -x
(%i4) assume(x>0);
(%o4)[x>0]
(%i5) radcan(sqrt(x^2)-x);
(%o5)0
(%i7) reset()$kill(all)$
(%i1) assume(x<0);
(%o1)[x<0]
(%i2) radcan(sqrt(x^2)-x);
(%o2)-2 x

The problems that I have raised in the first
e-mails is that with small r radcan works fine
but with capital R it gives a wrong mathematical result.

As a physicist, a final user of this excellent program,
I think that the best to do in order not
to return a wrong mathematical result is, in the case of
the example bellow is to return,
abs(R-z)

Thank you for your attention
and I congratulate to you to continue
the work of William Schelter

Best regards
Rubens Marinho
Head of Physics Department of
Instituto Tecnol?gico de Aeron?utica












2012/3/14 Stavros Macrakis <macrakis at alum.mit.edu>

> Robert,
>
> Though I agree that, in general, Maxima functions should not ignore
> assumptions, radcan is *by design* oblivious to them. Radcan is supposed
> to return a near-canonical "over a large class of expressions and *a
> given ordering of variables*" (my emphasis), so radcan(EX) should return
> the same value *regardless* of assumptions.     It would be a bug if
> radcan(EX) returned different values dependent on the environment.
>
> Radcan does not follow the numerical-analysis convention that sqrt(EX) is the
> positive square root; rather, it represents *some* consistently-chosen
> square root.
>
> What is more confusing is that radcan(sqrt(x^2)-x) doesn't return 0 --
> because the general simplification sqrt(x^2)->abs(x) interferes. That can
> of course be corrected by setting domain:complex.
>
>               -s
>
> On Wed, Mar 14, 2012 at 11:37, Robert Dodier <robert.dodier at gmail.com>wrote:
>
>> On 3/9/12, Raymond Toy <toy.raymond at gmail.com> wrote:
>>
>> >> reset();kill(all);
>> >> assume(z>r);
>> >> radcan(sqrt(r^2-2*z*r+z^2));
>> >>
>> >> it gives
>> >>
>> >> z-r
>> >>
>> >> works fine
>> >>
>> >> but with capital R
>> >>
>> >> reset();kill(all);
>> >> assume(z>R);
>> >> radcan(sqrt(R^2-2*z*R+z^2));
>> >>
>> >> it gives
>> >>
>> >> R-z
>> >>
>> >> should be
>> >> z-R
>>
>> > I don't think this is a bug.  Radcan does sometimes do things like this
>> and
>> > that is the expected result.  I don't think radcan recognizes assume
>> either.
>>
>> radcan ignores assume -- I think that's a bug. That the result depends on
>> the ordering of the variables is OK only if all possible results are
>> equally valid.
>> That's not the case when there are facts (stated by assume) to take into
>> account.
>>
>> It's true that many functions in Maxima ignore assume. I don't think
>> that's desirable, although I do understand that it's hard to fix.
>>
>> best
>>
>> Robert Dodier
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>
>
>