FLINT3.7.0-dev

_fmpz_poly_num_real_roots_sturm_bounded

Synopsis#include <flint/fmpz_poly.h>
slong _fmpz_poly_num_real_roots_sturm_bounded(const fmpz * pol, slong len, int on_0_1, slong max_size)source

Counts the real roots (all of them if on_0_1 is zero, those in (0, 1) otherwise) with a Sturm sequence computed as a primitive pseudo-remainder sequence, removing the content after each step. Returns -1 as soon as a remainder has length times coefficient bit size larger than max_size; pass WORD_MAX to always finish.

The primitive sequence is much cheaper than the subresultant sequence for polynomials with special structure, such as classical orthogonal polynomials or sparse polynomials whose degrees drop quickly, and usually more expensive for generic polynomials, whose coefficients grow along the sequence; max_size detects the latter case cheaply.

Cite this page

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