FLINT3.7.0-dev

_fmpz_poly_interpolate, fmpz_poly_interpolate, _fmpz_poly_interpolate_newton, fmpz_poly_interpolate_newton, _fmpz_poly_interpolate_multi_mod, fmpz_poly_interpolate_multi_mod

Synopsis#include <flint/fmpz_poly.h>
int _fmpz_poly_interpolate(fmpz * poly, const fmpz * xs, const fmpz * ys, slong n)source
int fmpz_poly_interpolate(fmpz_poly_t poly, const fmpz * xs, const fmpz * ys, slong n)source
int _fmpz_poly_interpolate_newton(fmpz * poly, const fmpz * xs, const fmpz * ys, slong n)source
int fmpz_poly_interpolate_newton(fmpz_poly_t poly, const fmpz * xs, const fmpz * ys, slong n)source
int _fmpz_poly_interpolate_multi_mod(fmpz * poly, const fmpz * xs, const fmpz * ys, slong n)source
int fmpz_poly_interpolate_multi_mod(fmpz_poly_t poly, const fmpz * xs, const fmpz * ys, slong n)source

Set poly to the polynomial f of degree less than n with f(x_i) = y_i for 0 \le i < n and return 1, if the x_i are distinct and f has integer coefficients; otherwise return 0. The newton version computes divided differences, failing at the first inexact division, and converts from the Newton basis; the multi_mod version interpolates modulo word-size primes (with a fast algorithm for many points) and combines the results by the Chinese remainder theorem until they stabilise and are checked. The default uses Newton interpolation for n \le 25 and chooses by size otherwise. The underscore versions write n coefficients.

Cite this page

The FLINT team, “_fmpz_poly_interpolate, fmpz_poly_interpolate, _fmpz_poly_interpolate_newton, fmpz_poly_interpolate_newton, _fmpz_poly_interpolate_multi_mod, fmpz_poly_interpolate_multi_mod (fmpz_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz_poly/_fmpz_poly_interpolate.html (generated 2026-10-20).