On Dec 10, 12:39 pm, "ma...@mendelu.cz" <ma...@mendelu.cz> wrote:
> On 10 pro, 11:02, Harald Schilly <harald.schi...@gmail.com> wrote:
>
> > > (%i3) ratsimp(a), algebraic=true;
>
> > Ok, is it wise to do this by default if called from sage?
>
> Not sure (could it break something in integration for example?) but
> without this we have bug described 
> athttp://groups.google.cz/group/sage-devel/browse_thread/thread/1220492...


I don't think there is a bug there. It's just that one form is harder
to compute numerically because of rounding errors.

(%i2) A1:ratsimp(A), algebraic=true$
(%i3) A2:ratsimp(A)$

(%i4) float(A1);
(%o4) 139.406088405362

(%i5) float(A2);
(%o5) 32.0

But they are the same:

(%i6) ratsimp(A1-A2);
(%o6) 0

If you compute A2 in higher precision, you will get a better result:

(%i7) fpprec:256;
(%o7) 256
(%i8) bfloat(A2);
(%o8) 1.3940608840536196048491518637[198 digits]
6294485890103091502824365657b2


Removing radicals from the denominator is not always "simplification":

(%i9) 1/(2^(1/2)+2^(1/3)+2^(1/4));
(%o9) 1/(sqrt(2)+2^(1/3)+2^(1/4))

(%i10) ratsimp(%), algebraic=true;
(%o10) -(11*2^(13/4)+sqrt(2)*(2^(1/3)*(37*2^(11/4)-59*2^(5/4)-19*sqrt
(2)+96)+2^(2/3)*(23*2^(11/4)+89*2^(5/4)-47*sqrt(2)+27)+11*2^(11/4)-5*2^
(9/4)+115*sqrt(2)-444)+2^(1/3)*(-19*2^(9/4)-25*2^(3/4)+3*sqrt
(2)+148)+57*2^(3/2)-299*2^(3/4)+2^(2/3)*(-101*2^(3/4)-159*sqrt(2)+91*2^
(1/4)-280)-142)/(2046)

HTH, Andrej

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

Reply via email to