Closed Mat-Ge closed 5 months ago
Oh dear, well the unary minus really is a pain to deal with. I'll take a look.
I've looked into this. I don't think this is a "bug" in factorlist
really. If you want to decide if f1
is a factor of ex
then it's best to compare remainder(ex,f1)
with zero than to look for f1
within factorlist(ex)
. That wasn't obvious to me this morning, but I think that's a better approach overall.
If a factor of the argument ex is a difference, then the line «ex:ev(factor(ex), simp)» in the function definition can be problematic due to the symbols used. For example, according to factorlist(), the expression a-b contains the factor b-a, but not the factor a-b. Thus, the factors of a^2-b^2 are not (a+b) and (a-b) but (a+b) and (b-a), etc.