FLINT3.7.0-dev

_gr_poly_tan_series_basecase, gr_poly_tan_series_basecase, _gr_poly_tan_series_newton, gr_poly_tan_series_newton, _gr_poly_tan_series_sine_cosine, gr_poly_tan_series_sine_cosine, _gr_poly_tan_series_exponential, gr_poly_tan_series_exponential

Synopsis#include <flint/gr_poly.h>
int _gr_poly_tan_series_basecase(gr_ptr f, gr_srcptr h, slong hlen, slong n, int func, gr_ctx_t ctx)source
int gr_poly_tan_series_basecase(gr_poly_t f, const gr_poly_t h, slong n, int func, gr_ctx_t ctx)source
int _gr_poly_tan_series_newton(gr_ptr f, gr_srcptr h, slong hlen, slong n, slong cutoff, int func, gr_ctx_t ctx)source
int gr_poly_tan_series_newton(gr_poly_t f, const gr_poly_t h, slong n, slong cutoff, int func, gr_ctx_t ctx)source
int _gr_poly_tan_series_sine_cosine(gr_ptr f, gr_srcptr h, slong hlen, slong n, int func, gr_ctx_t ctx)source
int gr_poly_tan_series_sine_cosine(gr_poly_t res, const gr_poly_t h, slong len, int func, gr_ctx_t ctx)source
int _gr_poly_tan_series_exponential(gr_ptr f, gr_srcptr h, slong hlen, slong n, int func, gr_ctx_t ctx)source
int gr_poly_tan_series_exponential(gr_poly_t res, const gr_poly_t h, slong len, int func, gr_ctx_t ctx)source

Compute a tangent-like function of a power series with a specific algorithm. The parameter func selects the function: 0 for \tan, 1 for \tanh, 2 for \cot, 3 for \coth, 4 for \tan(\pi \cdot), 6 for \cot(\pi \cdot) (5 and 7, the hyperbolic functions times \pi, are not implemented).

The basecase algorithm uses an O(n^2) recurrence for the coefficients (from f' = h'(1 \pm f^2)). The newton algorithm inverts the integral defining the inverse function by Newton iteration, with the basecase below cutoff. The sine_cosine algorithm divides a sine by a cosine; for the hyperbolic functions it needs the imaginary unit in the ring. The exponential algorithm writes the function as a quotient of \pm 1 plus an exponential, choosing the sign of the exponent (if possible) so that the exponential is small; for the trigonometric functions it needs the imaginary unit.

Cite this page

The FLINT team, “_gr_poly_tan_series_basecase, gr_poly_tan_series_basecase, _gr_poly_tan_series_newton, gr_poly_tan_series_newton, _gr_poly_tan_series_sine_cosine, gr_poly_tan_series_sine_cosine, _gr_poly_tan_series_exponential, gr_poly_tan_series_exponential (gr_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_poly/_gr_poly_tan_series_basecase.html (generated 2026-10-20).