_fmpq_poly_interpolate_barycentric, fmpq_poly_interpolate_barycentric, _fmpq_poly_interpolate_multi_mod, fmpq_poly_interpolate_multi_mod, _fmpq_poly_interpolate_fmpq_vec, fmpq_poly_interpolate_fmpz_vec, fmpq_poly_interpolate_fmpz_fmpq_vec, fmpq_poly_interpolate_fmpq_vec
#include <flint/fmpq_poly.h>void _fmpq_poly_interpolate_barycentric(fmpz * poly, fmpz_t den, const fmpq * xs, const fmpq * ys, slong n)sourcevoid fmpq_poly_interpolate_barycentric(fmpq_poly_t poly, const fmpq * xs, const fmpq * ys, slong n)sourcevoid _fmpq_poly_interpolate_multi_mod(fmpz * poly, fmpz_t den, const fmpq * xs, const fmpq * ys, slong n)sourcevoid fmpq_poly_interpolate_multi_mod(fmpq_poly_t poly, const fmpq * xs, const fmpq * ys, slong n)sourceint _fmpq_poly_interpolate_fmpq_vec(fmpz * poly, fmpz_t den, const fmpq * xs, const fmpq * ys, slong n)sourceint fmpq_poly_interpolate_fmpz_vec(fmpq_poly_t poly, const fmpz * xs, const fmpz * ys, slong n)sourceint fmpq_poly_interpolate_fmpz_fmpq_vec(fmpq_poly_t poly, const fmpz * xs, const fmpq * ys, slong n)sourceint fmpq_poly_interpolate_fmpq_vec(fmpq_poly_t poly, const fmpq * xs, const fmpq * ys, slong n)sourceSets poly (or poly / den) to the unique interpolating polynomial of degree at most n - 1 satisfying f(x_i) = y_i for every pair x_i, y_i in xs and ys.
The barycentric uses a naive implementation of Lagrange interpolation in its barycentric form, clearing denominators to avoid working with fractions. It assumes that the evaluation points x_i are distinct.
The multi_mod algorithm performs interpolation modulo one or more prime numbers, combines the results using the Chinese Remainder Theorem (CRT) with adaptive termination, and recovers the rational coefficients by rational reconstruction. This function is particularly efficient when the interpolated polynomial is expected to have small-bitsize coefficients. It assumes that the evaluation points x_i are distinct.
The default implementation first checks that the x_i are distinct and, if so, automatically chooses between the barycentric, multi_mod and fast algorithms. It returns 1 if the x_i are distinct, otherwise 0.
The FLINT team, “_fmpq_poly_interpolate_barycentric, fmpq_poly_interpolate_barycentric, _fmpq_poly_interpolate_multi_mod, fmpq_poly_interpolate_multi_mod, _fmpq_poly_interpolate_fmpq_vec, fmpq_poly_interpolate_fmpz_vec, fmpq_poly_interpolate_fmpz_fmpq_vec, fmpq_poly_interpolate_fmpq_vec (fmpq_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpq_poly/_fmpq_poly_interpolate_barycentric.html (generated 2026-10-20).
@misc{flint-doc-fmpq-poly-fmpq-poly-interpolate-barycentric,
author = {{The FLINT team}},
title = {{\_fmpq\_poly\_interpolate\_barycentric, fmpq\_poly\_interpolate\_barycentric, \_fmpq\_poly\_interpolate\_multi\_mod, fmpq\_poly\_interpolate\_multi\_mod, \_fmpq\_poly\_interpolate\_fmpq\_vec, fmpq\_poly\_interpolate\_fmpz\_vec, fmpq\_poly\_interpolate\_fmpz\_fmpq\_vec, fmpq\_poly\_interpolate\_fmpq\_vec (fmpq\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpq_poly/_fmpq_poly_interpolate_barycentric.html},
note = {Generated 2026-10-20}
}