You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The closest in symengine is to use the is_zero property for the difference of the expressions. It is currently quite weak and will not be able to handle this expression.
I think in the end the only feasible way of comparing two polynomials for equality is to first expand them so the underlying function would need to do this. Doing it without expanding is a hard problem in general (see https://en.wikipedia.org/wiki/Polynomial_identity_testing).
Activity
rikardn commentedon Oct 9, 2024
The closest in symengine is to use the
is_zeroproperty for the difference of the expressions. It is currently quite weak and will not be able to handle this expression.I think in the end the only feasible way of comparing two polynomials for equality is to first expand them so the underlying function would need to do this. Doing it without expanding is a hard problem in general (see https://en.wikipedia.org/wiki/Polynomial_identity_testing).
The implementation is here https://github.com/symengine/symengine/blob/master/symengine/test_visitors.cpp if you'd like to take a look. Perhaps adding an
is_equalfunction would be also be of value.