ca_get_fexpr
#include <flint/ca.h>Sets res to a symbolic expression for x. Rational numbers and special values give simple expressions. Other numbers give an expression Where(f(a_1, ..., a_n), Def(a_1, e_1), ..., Def(a_n, e_n)) that defines symbols a_1, a_2, ... for the extension numbers involved (recursively) and expresses x as a rational function of them.
With flags = 0, algebraic extension numbers are written as Sqrt(n)-type formulas when they are Gaussian rationals or quadratic, and otherwise as PolynomialRootNearest(coeffs, approx) with a decimal approximation; this is readable but cannot always be parsed back unambiguously. With flags = CA_FEXPR_SERIALIZATION, algebraic numbers are written exactly with AlgebraicNumberSerialized (see qqbar_get_fexpr_repr), so that ca_set_fexpr recovers the same number.
Guides#
The FLINT team, “ca_get_fexpr (ca.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ca/ca_get_fexpr.html (generated 2026-10-20).
@misc{flint-doc-ca-ca-get-fexpr,
author = {{The FLINT team}},
title = {{ca\_get\_fexpr (ca.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/ca/ca_get_fexpr.html},
note = {Generated 2026-10-20}
}