fexpr_get_fmpz_mpoly_q
#include <flint/fexpr.h>int fexpr_get_fmpz_mpoly_q(fmpz_mpoly_q_t res, const fexpr_t expr, const fexpr_vec_t vars, const fmpz_mpoly_ctx_t ctx)sourceSets res to expr viewed as a rational function of the subexpressions in vars, which are treated as independent indeterminates, and returns 1. The length of vars must equal the number of variables of ctx; fexpr_arithmetic_nodes gives a suitable vector. Returns 0 if a subexpression is neither an arithmetic operation nor an entry of vars, on overflow (too many terms or too large exponents), or on division by zero.
The conversion is formal: algebraic relations between the entries of vars are ignored, so that Sub(Sqrt(2), Sqrt(2)) gives 0, but Sub(Pow(Sqrt(2), 2), 2) does not, and a denominator that vanishes only because of such relations is not detected.
The FLINT team, “fexpr_get_fmpz_mpoly_q (fexpr.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fexpr/fexpr_get_fmpz_mpoly_q.html (generated 2026-10-20).
@misc{flint-doc-fexpr-fexpr-get-fmpz-mpoly-q,
author = {{The FLINT team}},
title = {{fexpr\_get\_fmpz\_mpoly\_q (fexpr.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fexpr/fexpr_get_fmpz_mpoly_q.html},
note = {Generated 2026-10-20}
}