_gr_poly_interpolate, gr_poly_interpolate, _gr_poly_interpolate_exact, gr_poly_interpolate_exact, _gr_poly_interpolate_newton, gr_poly_interpolate_newton, _gr_poly_interpolate_exact_newton, gr_poly_interpolate_exact_newton
#include <flint/gr_poly.h>int _gr_poly_interpolate_exact(gr_ptr res, gr_srcptr xs, gr_srcptr ys, slong len, gr_ctx_t ctx)sourceint gr_poly_interpolate_exact(gr_poly_t poly, const gr_vec_t xs, const gr_vec_t ys, gr_ctx_t ctx)sourceint _gr_poly_interpolate_newton(gr_ptr res, gr_srcptr xs, gr_srcptr ys, slong len, gr_ctx_t ctx)sourceint gr_poly_interpolate_newton(gr_poly_t poly, const gr_vec_t xs, const gr_vec_t ys, gr_ctx_t ctx)sourceint _gr_poly_interpolate_exact_newton(gr_ptr res, gr_srcptr xs, gr_srcptr ys, slong len, gr_ctx_t ctx)sourceint gr_poly_interpolate_exact_newton(gr_poly_t poly, const gr_vec_t xs, const gr_vec_t ys, gr_ctx_t ctx)sourceSet res to the interpolating polynomial f of length at most len with f(x_i) = y_i, for pairwise distinct points x_i. The default versions currently call the newton versions, which compute divided differences in the Newton basis and convert to the monomial basis, with O(\mathit{len}^2) operations.
The ring is presumed to be an integral domain; over other rings the functions may succeed without the result interpolating. They return GR_DOMAIN or GR_UNABLE if xs and ys have different lengths (checked by the non-underscore versions only), if the points are not distinct, or if f has coefficients in the fraction field of R but not in R (as for the points 0, 2 and values 0, 1 over \mathbb{Z}). The exact versions assume that the points are distinct and that f has coefficients in R, use exact divisions, and may return an arbitrary polynomial otherwise.
The FLINT team, “_gr_poly_interpolate, gr_poly_interpolate, _gr_poly_interpolate_exact, gr_poly_interpolate_exact, _gr_poly_interpolate_newton, gr_poly_interpolate_newton, _gr_poly_interpolate_exact_newton, gr_poly_interpolate_exact_newton (gr_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_poly/_gr_poly_interpolate.html (generated 2026-10-20).
@misc{flint-doc-gr-poly-gr-poly-interpolate,
author = {{The FLINT team}},
title = {{\_gr\_poly\_interpolate, gr\_poly\_interpolate, \_gr\_poly\_interpolate\_exact, gr\_poly\_interpolate\_exact, \_gr\_poly\_interpolate\_newton, gr\_poly\_interpolate\_newton, \_gr\_poly\_interpolate\_exact\_newton, gr\_poly\_interpolate\_exact\_newton (gr\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr_poly/_gr_poly_interpolate.html},
note = {Generated 2026-10-20}
}