FLINT3.7.0-dev

arb_sin_cos_pi_fmpq, arb_sin_pi_fmpq, arb_cos_pi_fmpq

Synopsis#include <flint/arb.h>
void arb_sin_cos_pi_fmpq(arb_t s, arb_t c, const fmpq_t x, slong prec)source
void arb_sin_pi_fmpq(arb_t s, const fmpq_t x, slong prec)source
void arb_cos_pi_fmpq(arb_t c, const fmpq_t x, slong prec)source

Set s to \sin(\pi x) and c to \cos(\pi x) for a rational x in lowest terms.

Symmetries first reduce x to [0, 1/4]. Then either \pi x is approximated and the usual functions are called, or, for small denominators, the value is computed as an algebraic number (a root of a Chebyshev-type polynomial), whichever is estimated to be faster. Since the reduced argument is in the first octant, the first method gives full relative accuracy even near the zeros.

Cite this page

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