30 Jun
2005
30 Jun
'05
7:49 a.m.
Hello! collect_common_factors does not work with powers, e.g. (in ginsh)
collect_common_factors((a*x+a*y)^2); (a*x+a*y)^2
I don't like such a behaviour, so I made the patch. With that patch, the above code actually works:
collect_common_factors((a*x+a*y)^2); a^2*(y+x)^2
To guarantee mathematical correctness, this transformation is applied to polynomial expressions only:
collect_common_factors((a*x+a*y)^n); (a*x+a*y)^n
Apart from collect_common_factors hack, this patch somewhat improves worst-case performance of gcd and sr_gcd. Best regards, Alexei -- ROOT: an octopus made by nailing extra legs onto a cat.