On Nov 4, 2009, at 11:25 AM, Michael Orlitzky wrote: > Robert Bradshaw wrote: >> >> I'd also like to point out that we don't just want to fall back and >> do >> everything over the rationals (even though any finite decimal >> expansion is rational) as things get much slower due to coefficient >> explosion. For example > > Who cares about speed when the answer is wrong?
Lots of people, if you can precisely put a finger on how wrong an answer is. In fact, I'm working on a problem right now where I only care about the first couple of digits of my answer being right. The rest may be "wrong" but I don't care because I know by how much. The reason SVD was even brought up in the last email is it tells you "how wrong" the answer might be if working over the reals, and in this case it told you the answer could be "very wrong." > If I don't have to produce the correct answer, I can solve any problem > instantly. The current implementation over the reals might as well be, > > def echelon_form(self): > return matrix([ [1,0,0], [0,1,0], [0,0,1] ]) > > and it doesn't get much faster than that. Some would argue that's correct for floating point matrices, as every square matrix over the reals is infinitely close to an invertible matrix. >> Note also that 0.3 and 3/10 have different behaviors in Sage, >> sometimes you want one, sometimes you want the other. > > Retarded. Just because you don't understand floating point numbers doesn't mean we shouldn't support them. In fact, far more people (by a factor of 10 at least, I'd guess even a factor of 100) care about floating point arithmetic than working exactly over the rationals. >> Note that 0.3 can't even be represented exactly as a (binary) >> floating >> point number. > > And that's why. > > Correctness should be the default. If using n(3/10) is going to be a > couple of milliseconds faster, let the guy who cares about that type a > few 'n's. Or he can write 0.3. Note the decimal point. You can write 3/10. This is a common convention: sage: mathematica('0.3^1000') 1.3220708194807853*^-523 sage: maxima('0.3^1000') 0.0 sage: maxima('0.3^100') 5.153775207320102e-53 sage: maple('0.3^1000;') .1322070819e-522 sage: matlab('0.3^1000') 0 sage: matlab('0.3^100') 5.1538e-53 > I shouldn't have to solve my problem by hand before feeding it > to SAGE just to get the correct answer. No, you shouldn't. You should either learn about or avoid floating point numbers. - Robert --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---