## #392 closed bug (fixed)

# bug in sqrfree

Reported by: | mlee | Owned by: | mlee |
---|---|---|---|

Priority: | minor | Milestone: | 3-1-4 and higher |

Component: | factory | Version: | 3-1-3 |

Keywords: | Cc: |

### Description (last modified by )

ring r=3,(x,y,z),dp;
poly f=(x-y)^{3}*(x+z)*(y-z);
sqrfree(f);
_[1]=-xy+xz-yz+z2

### Change History (6)

### comment:1 Changed 13 years ago by

Description: | modified (diff) |
---|

### comment:3 Changed 13 years ago by

Resolution: | → fixed |
---|---|

Status: | new → closed |

fixed with 14462 (master) and c71a43 (spielwiese)

### comment:4 Changed 13 years ago by

Could somebody also update

Singular-3-1-3-share.tar.gz

in nighlty builds ? (required by the changes made in paraplanecurves.lib due to changed sqrfree)

### comment:5 follow-up: 6 Changed 13 years ago by

Some comments and still a bug:

1.) There is a problem with the the sign:

In the following two examples, it is not wrong but not as expected,

> ring r0 = 0,(x,y),dp; > sqrfree((x-y)*(x+y)); [1]: _[1]=-1 // why this coeff -1 ? _[2]=-x2+y2 [2]: 1,1 > sqrfree((x-y)*(x+y),1); _[1]=-x2+y2 // it should be x2-y2 here > sqrfree((x-y)*(x+y),3); // x2-y2 > ring r=3,(x,y,z),dp; > poly f=(x-y)^3*(x+z)*(y-z); > sqrfree(f); [1]: _[1]=1 _[2]=-xy+xz-yz+z2 _[3]=-x+y [2]: 1,1,3

but in this prime char case a a check

f==sqrfree(f,3)will fail:

> ring r3=3,(x,y,z),dp; > sqrfree((x-y)*(x+y),3); -x2+y2 > _ == (x-y)*(x+y); 0

2.) Are the commands

squarefreeandallsquarefreefrom hnowther.lib now obsolote?I had the impression that sqrfree runs faster, it may to be verified again.

3.) The behaviour of sqrfree with its different with its options is built close to

factorize. But I think to give favour to the version

sqrfree( ,3)as the default behaviour of sqrfree would be the most convenient case for the user.

Certainly, it will make some additional work to revise it again.

### comment:6 Changed 13 years ago by

Replying to anonymous:

In the following two examples, it is not wrong but not as expected,

> ring r0 = 0,(x,y),dp; > sqrfree((x-y)*(x+y)); [1]: _[1]=-1 // why this coeff -1 ? _[2]=-x2+y2 [2]: 1,1

For the squarefree factorization a main variable is chosen, in this case y. Hence the -1

> ring r3=3,(x,y,z),dp; > sqrfree((x-y)*(x+y),3); // BUG here -x2+y2 > _ == (x-y)*(x+y); 0

This is fixed with 572657 in git

2.) Are the commands

squarefreeandallsquarefreefrom hnowther.lib now obsolote?I had the impression that sqrfree runs faster, it may to be verified again.

Yes.

3.) The behaviour of sqrfree with its different with its options is built close to

factorize. But I think to give favour to the version

sqrfree( ,3)as the default behaviour of sqrfree would be the most convenient case for the user.

Certainly, it will make some additional work to revise it again.

(Edit: signed. Ch. Gorzel, forget to login for this comment)

I will leave it like that since the command was to compute the squarefree decomposition of a polynomial and not just the squarefree part.

**Note:**See TracTickets for help on using tickets.