FLINT3.7.0-dev

_mp_real_series_rs_tan, _mp_real_series_rs_tan_ok

Synopsis#include <flint/mp_real.h>
void _mp_real_series_rs_tan(nn_ptr res, nn_srcptr x, slong n, flint_bitcnt_t r)source
int _mp_real_series_rs_tan_ok(slong n, flint_bitcnt_t r)source

Set (res,n)(\mathit{res}, n) to tan⁡x\tan x for 0≤x<2−r0 \le x < 2^{-r}, r≥32r \ge 32, within 3 ulps, for n≤80n \le 80 and beyond as long as _mp_real_series_rs_tan_ok returns nonzero. res may alias xx.

The coefficients ck=Tk+2/(2k+3)!c_k = T_{k+2}/(2k+3)! of tan⁡t=t+t3∑kckt2k\tan t = t + t^3\sum_k c_k t^{2k} (TmT_m the tangent numbers) are not ratios of small integers, but the leading ones share small denominators: chunk jj holds the terms whose common denominator QjQ_j fits j+1j + 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 QjQ_j times the partial sum; crossing into chunk j−1j - 1 costs one division by Qj/Qj−1Q_j/Q_{j-1}. The tail is the tapered Horner scheme of _mp_real_series_tapered.

Cite this page

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-11-02).