PoslavskySV / rings

Rings: efficient JVM library for polynomial rings
https://rings.readthedocs.io
72 stars 10 forks source link

Bug in factorization of polynomial over Z #76

Closed Rivo75 closed 11 months ago

Rivo75 commented 11 months ago

Hi,

I believe I found a bug in factorization of a polynomial over Z. I looked into it a bit and i believe I traced the bug to the function SquareFreeFactorizationYunZeroCharacteristics. Calling this function on 2y^3-3x*y^2+x^3 yields (-2y-x)(-y+x)^2 instead of (2y+x)(y-x)^2 (which differ by a factor of -1). I also checked SquareFreeFactorizationMusserZeroCharacteristics, which does yield (2y+x)(y-x)^2, so for now i just switched the method used in our project.

PoslavskySV commented 11 months ago

Hi! Thanks for reporting. I've just pushed the fix.