_mp_real_sin_cos_pi_ui_div_ui, _mp_real_sin_cos_pi_ui_div_ui_tune
#include <flint/mp_real.h>void _mp_real_sin_cos_pi_ui_div_ui(nn_ptr ys, nn_ptr yc, ulong * err, ulong p, ulong q, slong n)sourcevoid _mp_real_sin_cos_pi_ui_div_ui_tune(nn_ptr ys, nn_ptr yc, ulong * err, ulong p, ulong q, slong n, int alg, int r)sourceSet and (either may be NULL) to and for and . err is at most 4 for the closed forms and the Chebyshev iteration and the kernel's bound plus 2 (at most , ) when the sine and cosine kernel is used.
After reduction of the fraction, gives exact values, quadratic irrationals from _mp_real_rsqrt_ui_newton, and closed forms with square roots from about 12 limbs (24 for ). For denominators up to a precision-dependent bit length (none below 48 limbs, 12 bits at 512 limbs, 48 bits at 65536 limbs, any beyond) the value is refined as a root of a Chebyshev polynomial by a high-order iteration costing ; otherwise the kernel of mp_real_sin_cos_bits is applied to . The _tune version takes the algorithm (alg = 0 tuned, 1 kernel, 2 Chebyshev iteration, 3 closed forms) and the order of the iteration (r = 0 for the default 12, at most 16). See Sines of rational multiples of π.
The FLINT team, “_mp_real_sin_cos_pi_ui_div_ui, _mp_real_sin_cos_pi_ui_div_ui_tune (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/_mp_real_sin_cos_pi_ui_div_ui.html (generated 2026-11-02).
@misc{flint-doc-mp-real-mp-real-sin-cos-pi-ui-div-ui,
author = {{The FLINT team}},
title = {{\_mp\_real\_sin\_cos\_pi\_ui\_div\_ui, \_mp\_real\_sin\_cos\_pi\_ui\_div\_ui\_tune (mp\_real.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mp_real/_mp_real_sin_cos_pi_ui_div_ui.html},
note = {Generated 2026-11-02}
}