Wrong polynomial factoring

48 views
Skip to first unread message

Roberto Avanzi

unread,
May 6, 2019, 10:29:37 AM5/6/19
to sage-devel
Hello

I haven't been able to find this very same bug in the trac or in the sage-level group, even though some related ones have been reported

L = (u + t)/(u - t)
factor( L.substitute(t=sqrt(u)))

yields

(u + 1)/(u - 1)

which is wrong (the example is small enough to be verifiable by hand).
Mathematica, OTOH

l[t_] := (u + t)/(u - t);
Factor[l[Sqrt[u]]]

returns the correct result

(1 + Sqrt[u])/(-1 + Sqrt[u])

If this is a previously unknown bug, I would like to submit it (or if anybody wants to submit it and inform me, they're welcome!)

 best
  Roberto

Eric Gourgoulhon

unread,
May 6, 2019, 11:40:23 AM5/6/19
to sage-devel
Indeed,  the factor function of Sage is terribly buggy at the moment, see
The issue you report seems to have been triggered by https://trac.sagemath.org/ticket/23835 (merged in Sage 8.4.beta3) as well, since we have a correct result in Sage 8.3:

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.3, Release Date: 2018-08-03                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
sage: var('t u')
(t, u)
sage: L = (u + t)/(u - t)
sage: factor( L.substitute(t=sqrt(u)))
(u + sqrt(u))/(u - sqrt(u))

but not in Sage 8.4 and later.

Eric.
Reply all
Reply to author
Forward
0 new messages