FLINT3.7.0-dev

fmpz_mod_poly_find_distinct_nonzero_roots

Synopsis#include <flint/fmpz_mod_poly.h>
int fmpz_mod_poly_find_distinct_nonzero_roots(fmpz * roots, const fmpz_mod_poly_t P, const fmpz_mod_ctx_t ctx)source

If the nonzero polynomial P has \deg P distinct nonzero roots in \mathbb{F}_p, writes them to roots[0], ..., roots[deg(P) - 1] and returns 1; otherwise returns 0. The modulus must be prime.

The function first splits P by \gcd(P, x^{(p-1)/2} \mp 1), which decides whether P has the required form, and then splits the factors with _fmpz_mod_poly_split_rabin. See Finding roots that are expected to be distinct for the word-size version and Roots of polynomials over finite fields.

Cite this page

The FLINT team, “fmpz_mod_poly_find_distinct_nonzero_roots (fmpz_mod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz_mod_poly/fmpz_mod_poly_find_distinct_nonzero_roots.html (generated 2026-10-20).