Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
21529: fix bug in factoring of general symbolic expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Sep 18, 2016
1 parent 0ae5fd8 commit 2ea5c31
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/sage/symbolic/expression.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10100,6 +10100,14 @@ cdef class Expression(CommutativeRingElement):
x^3*y^17 + x*y^19 + y^20)*(x^10 - x^9*y + x^8*y^2 - x^7*y^3 +
x^6*y^4 - x^5*y^5 + x^4*y^6 - x^3*y^7 + x^2*y^8 - x*y^9 +
y^10)*(x^6 - x^3*y^3 + y^6)*(x^2 - x*y + y^2)*(x + y)
TESTS:
Check that :trac:`21529` is fixed::
sage: f(x) = function('f')(x)
sage: (f(x).diff(x)^2-1).factor()
(diff(f(x), x) + 1)*(diff(f(x), x) - 1)
"""
from sage.calculus.calculus import symbolic_expression_from_maxima_string, symbolic_expression_from_string
if len(dontfactor) > 0:
Expand All @@ -10114,7 +10122,7 @@ cdef class Expression(CommutativeRingElement):
f = self.polynomial(QQ)
w = repr(f.factor())
return symbolic_expression_from_string(w)
except TypeError:
except (TypeError, NotImplementedError):
pass
return self.parent()(self._maxima_().factor())

Expand Down

0 comments on commit 2ea5c31

Please sign in to comment.