On 9/4/07, Robert Miller <[EMAIL PROTECTED]> wrote: > > > Thanks, that was fast! If I may ask, what was the problem? Must've > > > been something not particularly exciting... > > > > Robert Miller implemented root finding for RDF polynomials right > > before SAGE-2.8.3, and he messed up. Basically SAGE represents > > polynomials as list with one "endian-ness", and numpy uses > > the other. So I just reverse the list before passing it into numpy. > > Actually, I just moved already-broken code: > http://www.sagemath.org/hg/sage-main/diff/7085de591817/sage/rings/polynomial/polynomial_element.pyx > (at the bottom...). What I implemented was factoring of RDF > polynomials. > > > > Double precision is more than sufficient for my purposes--even floats > > > (!) are fine, I just need fast and reasonably accurate. > > Using numpy, reasonably accurate means up to only a few places, not > the full double precision. This leads to badness when you try to > factor anything. If it finds that 1.0000112451357 is a root of > (x-1)^3, you will likely get a quadratic irreducible as a factor...
It's not full double precision, but it's not terrible. Basically, when you substitute the root back in your get 0 to about precision 1e-16: sage: x = polygen(RDF); f = (x-1)^3 sage: [f(a) for a in f.roots()] [4.4408920985e-16, 6.66133814775e-16 + 1.01643953671e-20*I, 6.66133814775e-16 - 1.01643953671e-20*I] > > What polynomials are you evaluating? If they are double precision, > > I wonder if making a special GSL-based polynomial class will help > > a lot? > > The root finding is much much more accurate, and no doubt faster too. > I really hope this is true. Have you tested it? William --~--~---------~--~----~------------~-------~--~----~ 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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---