FLINT3.7.0-dev

_gr_poly_sin_cos_series_basecase, gr_poly_sin_cos_series_basecase, _gr_poly_sin_cos_series_tangent, gr_poly_sin_cos_series_tangent, _gr_poly_sin_cos_series_newton, gr_poly_sin_cos_series_newton

Synopsis#include <flint/gr_poly.h>
int _gr_poly_sin_cos_series_basecase(gr_ptr s, gr_ptr c, gr_srcptr h, slong hlen, slong n, int times_pi, gr_ctx_t ctx)source
int gr_poly_sin_cos_series_basecase(gr_poly_t s, gr_poly_t c, const gr_poly_t h, slong n, int times_pi, gr_ctx_t ctx)source
int _gr_poly_sin_cos_series_tangent(gr_ptr s, gr_ptr c, gr_srcptr h, slong hlen, slong n, int times_pi, gr_ctx_t ctx)source
int gr_poly_sin_cos_series_tangent(gr_poly_t s, gr_poly_t c, const gr_poly_t h, slong n, int times_pi, gr_ctx_t ctx)source
int _gr_poly_sin_cos_series_newton(gr_ptr s, gr_ptr c, gr_srcptr h, slong hlen, slong n, slong cutoff, int times_pi, gr_ctx_t ctx)source
int gr_poly_sin_cos_series_newton(gr_poly_t s, gr_poly_t c, const gr_poly_t h, slong n, slong cutoff, int times_pi, gr_ctx_t ctx)source

Compute the sine and cosine of a power series with a specific algorithm; times_pi multiplies the argument by \pi.

The basecase version uses the coupled recurrences from s' = h' c, c' = -h' s, with O(\mathit{hlen} \cdot n) operations. The tangent version computes t = \tan(h_1 / 2) for the nonconstant part h_1 with _gr_poly_tan_series and uses the half-angle formulas \sin h_1 = 2t / (1 + t^2), \cos h_1 = (1 - t^2) / (1 + t^2), with O(M(n)) operations, and then the addition theorems for the constant term h_0. The newton version runs Newton iteration for \exp(i h) with the real and imaginary parts represented formally, so that no complex arithmetic is needed; cutoff is the length computed by the basecase.

Cite this page

The FLINT team, “_gr_poly_sin_cos_series_basecase, gr_poly_sin_cos_series_basecase, _gr_poly_sin_cos_series_tangent, gr_poly_sin_cos_series_tangent, _gr_poly_sin_cos_series_newton, gr_poly_sin_cos_series_newton (gr_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_poly/_gr_poly_sin_cos_series_basecase.html (generated 2026-10-20).