FLINT3.7.0-dev

_mp_real_sin_cos_pi_ui_div_ui_algebraic, _mp_real_tan_pi_ui_div_ui_algebraic, _mp_real_tan_pi_ui_div_ui

Synopsis#include <flint/mp_real.h>
int _mp_real_sin_cos_pi_ui_div_ui_algebraic(ulong q, slong n)source
int _mp_real_tan_pi_ui_div_ui_algebraic(ulong q, slong n)source
ulong _mp_real_tan_pi_ui_div_ui(nn_ptr y, ulong t, ulong q, slong n)source

The first two return whether the tuned dispatch of _mp_real_sin_cos_pi_ui_div_ui resp. that of the tangent evaluates the denominator qq (in lowest terms) at nn limbs by an algebraic method (closed forms, square roots, half angles, the Chebyshev iteration), which is then faster than the kernel on πp/q\pi p/q; the functions of πx\pi x at dyadic xx and the functions of πp/q\pi p/q in arb use them to choose. _mp_real_tan_pi_ui_div_ui sets (y,n+1)(y, n + 1) to tan⁡(πt/q)\tan(\pi t/q) for 0≤4t≤q0 \le 4t \le q at nn fraction limbs and returns the error bound in ulps (UWORD_MAX if none fits).

Cite this page

The FLINT team, “_mp_real_sin_cos_pi_ui_div_ui_algebraic, _mp_real_tan_pi_ui_div_ui_algebraic, _mp_real_tan_pi_ui_div_ui (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_algebraic.html (generated 2026-11-17).