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
-~----------~----~----~----~------~----~------~--~---

Reply via email to