[GiNaC-list] problem about collect_common_factors

Feng Feng f.feng at outlook.com
Wed Jun 17 10:24:21 CEST 2020


Hi all,

I got a strange problem about collect_common_factors,
the problem can be reproduced by the following example:
------
symbol a("a"),b("b"),c("c");
symtab table;
table["a"] = a;
table["b"] = b;
table["c"] = c;
parser reader(table);
ex res = reader("b*((c+c*(1+4*a+2*b+b^2)-c*(1+2*b+b^2)-(1+4*a)*c))-a*(c+c*(1+4*a+2*b+b^2)-c*(1+2*b+b^2)-(1+4*a)*c)");

cout << res << endl;
cout << collect_common_factors(res) << endl;
------
the collect_common_factors will throw an error: division by zero.
so is this a bug for collect_common_factors?

Best regards!
Feng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ginac.de/pipermail/ginac-list/attachments/20200617/66627ef5/attachment.htm>


More information about the GiNaC-list mailing list