2009/1/5 Martin Rubey <martin.ru...@univie.ac.at>: > > (not sure whether this belongs to sage-support or sage-devel) > > I'm preparing class for tomorrow, and ran across something I do not quite > understand: > > sage: f=ZZ[x].random_element(10) > sage: g=ZZ[x].random_element(10) > sage: timeit('gcd(QQ[x](f),QQ[x](g))') > 125 loops, best of 3: 2.96 ms per loop > sage: timeit('gcd(f,g)') > 625 loops, best of 3: 89.2 µs per loop > > I would have thought that the gcd over the rationals is no more difficult than > over the integers. Am I mistaken? > > (would be wonderful to have a quick answer, even if not 100% polished...) many > many thanks,
This is a known issue. ZZ[x] is handled by Flint and is fast. QQ[x] is handled by pari and is slow(er). We all know how to reduce the latter to the former, but no-one has done it yet. It is trac ticket #4000: see http://trac.sagemath.org/sage_trac/ticket/4000 John Cremona > > Martin > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---