I have to simplify such expressions: (1 + 2*a)/(b*(1 + c)) - 1/c
, simplifying this expression i need to get something like this: (2*a*c - b*c - b + c) / (b*c*(c + 1))
. I tried to use fmpz_mpoly_q from flint/calcium library and SparseMultivariateRationalPolynomial from Bpas library but I've encountered a problem: it seems not possible to quickly convert (1 + 2*a)/(b*(1 + c)) - 1/c
to class entity and then get simplified expression because both of classes expects to get denominator and numerator of this expression.
Is there really no way out of this problem, except to write a some kind of parser that will return denominator and numerator?