Thanks for the very quick answers :)

> > I don't know much about the symbolic part of Sage, but I think that
> > punch line is that the evaluation of a symbolic expression to a
> > boolean returns False if it is not guaranteed to be True. In your
> > case, I could imagine that the symbolic sqrt(...) does not choose one
> > particular root (could be positive or negative), and so
> > 1/3*sqrt(2/5)==2/3*sqrt(1/10) is indeed not necessarily true.

I thought that the symbolic sqrt root by default was the positive one
(which is the one I'm interested in, anyway), and it looks as if the
"not enough simplification"
 (as Jason pointed out) may be why I get the wrong answer, since
"simplify(1/3*sqrt(2/5))==simplify(2/3*sqrt(1/10))" does return
True...

> I think the symbolic square root does pick a particular root:
>
> sage: sqrt(3).n()
> 1.73205080756888

Ahh...

>
> > But you can transform both sides of the equation into algebraic
> > numbers, and they do compare equal (since the positive square root is
> > picked):
> >    sage: QQbar(1/3*sqrt(2/5))==QQbar(2/3*sqrt(1/10))
> >    True
> >    sage: QQbar(1/3*sqrt(2/5))
> >    0.2108185106778920?
>
> Transforming to QQbar is a good idea, if your expression can be handled
> by QQbar (for example, if your expression had a pi in it, it probably
> wouldn't work).

I had already considered coercing my expressions into QQbar, but it
made the code slower and I thought I could get away with the "symbolic
calculus" (clearly that's not the case, thouh I  was hoping someone
had another solution...).

Thanks again,

Maite.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to