_fmpz_poly_cyclotomic, fmpz_poly_cyclotomic
#include <flint/fmpz_poly.h>void fmpz_poly_cyclotomic(fmpz_poly_t poly, ulong n)sourceSet poly to the cyclotomic polynomial , where runs over the primitive -th roots of unity. The non-underscore version writes with squarefree and uses .
The underscore version requires squarefree, the array factors of its num_factors prime factors (with 2 first if is even) and as phi, and writes only the low coefficients; the others follow by symmetry, since is palindromic for . It uses the sparse power series algorithm (Algorithm 4) of [ArnoldMonagan2011], based on , in which multiplications and divisions by cost additions, for operations in total for prime factors. Machine integers are used when no overflow is possible: by Table 6 of [ArnoldMonagan2011], all coefficients of have at most 27 bits for and at most 60 bits for , and they are when has two prime factors. The cases and with odd () are handled directly.
References#
- [ArnoldMonagan2011] Arnold, Andrew and Monagan, Michael : Calculating cyclotomic polynomials, Mathematics of Computation 80:276 (2011) 2359–2379
The FLINT team, “_fmpz_poly_cyclotomic, fmpz_poly_cyclotomic (fmpz_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz_poly/_fmpz_poly_cyclotomic.html (generated 2026-11-02).
@misc{flint-doc-fmpz-poly-fmpz-poly-cyclotomic,
author = {{The FLINT team}},
title = {{\_fmpz\_poly\_cyclotomic, fmpz\_poly\_cyclotomic (fmpz\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz_poly/_fmpz_poly_cyclotomic.html},
note = {Generated 2026-11-02}
}