This does indeed look like a bug. I can't think of any reason off the top of my head for the quotients to be different except that one of them is wrong.
I'm currently working on the next FLINT release and will be sure to address this problem. There will probably be two FLINT releases relatively soon after one another due to the large amount of code. The releases might be a week or two apart and I don't want to hold up the code that will be in the first release (which includes some critical bug fixes) on account of the code that will be in the second release (which includes lots of contributed code). Thanks for the report! Bill. On 22 Sep, 03:18, Sebastian Pancratz <s...@pancratz.org> wrote: > Dear all, > > Yesterday I ran into a problem when using the FLINT pseudo division > methods in SAGE. Below I am copying part of an email I sent to Bill > Hart already. > > Sebastian > > [Bug report] > While working on re-implementing QQ[] in SAGE, I came across the > following inconsistency. From the FLINT 1.4.0 manual, I think the > methods fmpz_poly_pseudo_divrem and fmpz_poly_pseudo_div should return > the same quotient. But using the "div" method I get > > A = x^4-4*x^2+2*x+2 > B = x-2560 > Q = x^3+2560*x^2+6553596*x+3892303874 > m = 0 > > whereas the "divrem" yields > > A = x^4-4*x^2+2*x+2 > B = x-2560 > Q = x^3+2560*x^2+6553596*x+16777205762 > m = 0 > > The second answer is the correct one. Temporarily, I have now changed > the relevant Cython code to > > cdef fmpz_poly_t rem > fmpz_poly_init(rem) > fmpz_poly_pseudo_divrem(q.num, rem, &m, a.num, b.num) > fmpz_poly_clear(rem) > # fmpz_poly_pseudo_div(q.num, &m, a.num, b.num) > > and it seems to work fine, as far as many random comparisons between > the output of "f // g" with new QQ[] and with the old QQ[] suggest. > Here is another example, for which the output doesn't agree: > > f = -10*x^6 + x^5 + 2*x^4 - x^3 + 2*x^2 - x - 1 > g = 75*x^4 - 1/2*x^3 - x^2 + 37/3*x - 1/124 > > In case this helps, I am working with SAGE 4.1.2.alpha0 under Ubuntu > 8.10. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---