arb_sin_cos_pi_fmpq, arb_sin_pi_fmpq, arb_cos_pi_fmpq, arb_tan_pi_fmpq
#include <flint/arb.h>Set s to , c to and t to for a rational , with full relative accuracy also near the zeros. The tangent is indeterminate exactly at the poles (the half-integers). The rational values (, , , and ) are exact.
For a word-size denominator at precisions where an algebraic method is faster than evaluating the function of (square roots for small denominators, half-angle steps for with , a Chebyshev iteration for denominators of up to about 12 bits at 30000 bits and more at higher precision), the value is computed as an algebraic number by mp_real_sin_cos_pi_ui_div_ui resp. mp_real_tan_pi_ui_div_ui, or, below 12288 bits and from a precision growing with the number of half-angle steps, for the square roots by arb_sqrt; otherwise symmetries reduce exactly to and the functions of are evaluated there. See Sines and cosines of rational multiples of π.
The FLINT team, “arb_sin_cos_pi_fmpq, arb_sin_pi_fmpq, arb_cos_pi_fmpq, arb_tan_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-11-20).
@misc{flint-doc-arb-arb-sin-cos-pi-fmpq,
author = {{The FLINT team}},
title = {{arb\_sin\_cos\_pi\_fmpq, arb\_sin\_pi\_fmpq, arb\_cos\_pi\_fmpq, arb\_tan\_pi\_fmpq (arb.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/arb/arb_sin_cos_pi_fmpq.html},
note = {Generated 2026-11-20}
}