Bill Hart wrote: > > > On 4 Nov, 03:39, Jason Grout <[EMAIL PROTECTED]> wrote: >> Bill Hart wrote: >>> sage: R.<x>=RDF['t'] >>> sage: s=1.0e1*t^3+1.0e-100*t^2+1.01234e-100*t+1.0e1 >>> sage: u=1.0e1*t^3-1.0e1*t^2+1.0e1*t-1.0e1 >>> sage: s*u >>> 100.0*t^6 - 100.0*t^5 + 100.0*t^4 - 100.0*t^2 + 100.0*t - 100.0 >>> What happened to the t^3 term? >> Isn't it zero in RDF? > > No. RDF has the possibility to have exponents down to -1023.
I just *knew* I was getting into it over my head and that you knew the precision issues at stake. Sorry for giving you the naive answer; I should have realized that of all people, you would know exactly the capabilities of machine precision arithmetic! So I take it your question was really: Shouldn't Sage realize that the naive computation of the coefficient of t^3 is seen as zero, while it is very possible to do the computation in such a way that you (correctly) don't get zero? Shouldn't Sage be smart about the precision issues here? To which I answer: Yes, sure, of course! It would make for a very interesting demo to show other systems incorrectly returning 0 for the coefficient, while Sage is just a bit smarter about the arithmetic issues and doesn't return 0. Mma returns the term as "0. t^3" Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---