Opened 9 years ago

Closed 8 years ago

# multivariate factorization errors

Reported by: Owned by: Burcin Erocal tbd major sage-duplicate/invalid/wontfix factorization singular factory Jori Mäntysalo N/A

### Description

Reported by Manuel Kauers.

On Sage 5.10.beta4:

```sage: R.<x1,x2,x3> = QQ['x1,x2,x3']
sage: f = (x1+x2+x3)*(2*x1-x2+x3+2)*(4*x1+x2+x3+2)*(8*x1-x2+x3+4)
sage: f.factor()
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-3-429743410e57> in <module>()
----> 1 f.factor()

/home/burcin/sage/sage-5.10.beta2/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_libsingular.so in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.factor (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:25997)()

RuntimeError: Floating point exception
sage: g = (x1+x2+x3)*(2*x1-x2+x3+2)*(4*x1+x2+x3+2)
sage: g.factor()
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-5-689da5069cee> in <module>()
----> 1 g.factor()

/home/burcin/sage/sage-5.10.beta2/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_libsingular.so in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.factor (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:25997)()

RuntimeError: Floating point exception
```

These examples work with Singular 3.1.6 (should be updated in #14333):

```                     SINGULAR                                 /
A Computer Algebra System for Polynomial Computations       /   version 3-1-6
0<
by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann     \   Dec 2012
FB Mathematik der Universitaet, D-67653 Kaiserslautern        \
> ring R = 0,(x1,x2,x3),dp;
> poly f = (x1+x2+x3)*(2*x1-x2+x3+2)*(4*x1+x2+x3+2)*(8*x1-x2+x3+4);
> factorize(f);
:
_=1
_=2*x1-x2+x3+2
_=x1+x2+x3
_=8*x1-x2+x3+4
_=4*x1+x2+x3+2
:
1,1,1,1,1
> poly g = (x1+x2+x3)*(2*x1-x2+x3+2)*(4*x1+x2+x3+2);
> factorize(g);
:
_=1
_=4*x1+x2+x3+2
_=2*x1-x2+x3+2
_=x1+x2+x3
:
1,1,1,1
```

### comment:1 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11 → sage-5.12

### comment:2 Changed 9 years ago by Frédéric Chapoton

on 5.12.beta2, one gets:

```sage: R.<x1,x2,x3> = QQ['x1,x2,x3']
sage: f = (x1+x2+x3)*(2*x1-x2+x3+2)*(4*x1+x2+x3+2)*(8*x1-x2+x3+4)
sage: f.factor()
(x1 + x2 + x3) * (64*x1^3 - 24*x1^2*x2 - 6*x1*x2^2 + x2^3 + 56*x1^2*x3 - 8*x1*x2*x3 - x2^2*x3 + 14*x1*x3^2 - x2*x3^2 + x3^3 + 128*x1^2 - 20*x1*x2 - 4*x2^2 + 68*x1*x3 - 4*x2*x3 + 8*x3^2 + 80*x1 - 4*x2 + 20*x3 + 16)
sage: factor(f)
---------------------------------------------------------------------------
Traceback (most recent call last):
...
RuntimeError: Floating point exception

```

so it either fails or returns a partial factorisation..

### comment:3 Changed 9 years ago by Frédéric Chapoton

But

```sage: factor(f,proof=True)
(x1 + x2 + x3) * (8*x1 - x2 + x3 + 4) * (8*x1^2 - 2*x1*x2 - x2^2 + 6*x1*x3 + x3^2 + 12*x1 + 4*x3 + 4)
```

works a little better.

Last edited 9 years ago by Frédéric Chapoton (previous) (diff)

### comment:4 Changed 9 years ago by Burcin Erocal

Cc: Jori Mäntysalo added

Perhaps we should add Jori's randomized testing code as a long doctest:

### comment:5 Changed 9 years ago by Jori Mäntysalo

Why not. But I think that product of three polynomial in four variables do not find all errors; see trac #14333.

### comment:6 Changed 9 years ago by For batch modifications

Milestone: sage-6.1 → sage-6.2

### comment:7 Changed 8 years ago by For batch modifications

Milestone: sage-6.2 → sage-6.3

### comment:8 Changed 8 years ago by Volker Braun

Milestone: sage-6.3 → sage-duplicate/invalid/wontfix new → needs_review

Fixed at least in sage-6.3.beta3 (by the earlier Singular update)

### comment:9 Changed 8 years ago by Ralf Stephan

Status: needs_review → positive_review

Confirm the Sage errors no longer happen.

### comment:10 Changed 8 years ago by Volker Braun

Resolution: → fixed positive_review → closed
Note: See TracTickets for help on using tickets.