_mp_real_series_rs_tan, _mp_real_series_rs_tan_ok
#include <flint/mp_real.h>void _mp_real_series_rs_tan(nn_ptr res, nn_srcptr x, slong n, flint_bitcnt_t r)sourceint _mp_real_series_rs_tan_ok(slong n, flint_bitcnt_t r)sourceSet (\mathit{res}, n) to \tan x for 0 \le x < 2^{-r}, r \ge 32, within 3 ulps, for n \le 80 and beyond as long as _mp_real_series_rs_tan_ok returns nonzero. res may alias x.
The coefficients c_k = T_{k+2}/(2k+3)! of \tan t = t + t^3\sum_k c_k t^{2k} (T_m the tangent numbers) are not ratios of small integers, but the leading ones share small denominators: chunk j holds the terms whose common denominator Q_j fits j + 1 limbs (12 terms in one limb, then 5 to 7 more per limb on 64-bit machines), with integer numerators in static tables. One tapered rectangular splitting runs over the chunks, carrying Q_j times the partial sum; crossing into chunk j - 1 costs one division by Q_j/Q_{j-1}. The tail is the tapered Horner scheme of _mp_real_series_tapered.
The FLINT team, “_mp_real_series_rs_tan, _mp_real_series_rs_tan_ok (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/_mp_real_series_rs_tan.html (generated 2026-10-20).
@misc{flint-doc-mp-real-mp-real-series-rs-tan,
author = {{The FLINT team}},
title = {{\_mp\_real\_series\_rs\_tan, \_mp\_real\_series\_rs\_tan\_ok (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_series_rs_tan.html},
note = {Generated 2026-10-20}
}