@@ -1178,10 +1178,26 @@ Power series special functions
11781178 int _gr_poly_cos_pi_series(gr_ptr c, gr_srcptr h, slong hlen, slong n, gr_ctx_t ctx)
11791179 int gr_poly_cos_pi_series(gr_poly_t c, const gr_poly_t h, slong n, gr_ctx_t ctx)
11801180
1181- Compute `s = \sin(h) `, `c = \cos(h) ` as power series truncated to length `m `,
1181+ Compute `s = \sin(h) `, `c = \cos(h) ` as power series truncated to length `n `,
11821182 or `s = \sin(\pi h) `, `c = \cos(\pi h) ` for the ``pi `` variants.
11831183 The underscore methods allow aliasing.
11841184
1185+ .. function :: int _gr_poly_tan_series(gr_ptr f, gr_srcptr h, slong hlen, slong n, gr_ctx_t ctx)
1186+ int gr_poly_tan_series(gr_poly_t f, const gr_poly_t h, slong n, gr_ctx_t ctx)
1187+ int _gr_poly_tanh_series(gr_ptr f, gr_srcptr h, slong hlen, slong n, gr_ctx_t ctx)
1188+ int gr_poly_tanh_series(gr_poly_t f, const gr_poly_t h, slong n, gr_ctx_t ctx)
1189+ int _gr_poly_cot_series(gr_ptr f, gr_srcptr h, slong hlen, slong n, gr_ctx_t ctx)
1190+ int gr_poly_cot_series(gr_poly_t f, const gr_poly_t h, slong n, gr_ctx_t ctx)
1191+ int _gr_poly_coth_series(gr_ptr f, gr_srcptr h, slong hlen, slong n, gr_ctx_t ctx)
1192+ int gr_poly_coth_series(gr_poly_t f, const gr_poly_t h, slong n, gr_ctx_t ctx)
1193+ int _gr_poly_tan_pi_series(gr_ptr f, gr_srcptr h, slong hlen, slong n, gr_ctx_t ctx)
1194+ int gr_poly_tan_pi_series(gr_poly_t f, const gr_poly_t h, slong n, gr_ctx_t ctx)
1195+ int _gr_poly_cot_pi_series(gr_ptr f, gr_srcptr h, slong hlen, slong n, gr_ctx_t ctx)
1196+ int gr_poly_cot_pi_series(gr_poly_t f, const gr_poly_t h, slong n, gr_ctx_t ctx)
1197+
1198+ Compute the respective trigonometric and hyperbolic functions of power series
1199+ truncated to length `n `. The underscore methods allow aliasing.
1200+
11851201.. function :: 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)
11861202 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)
11871203 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)
@@ -1207,15 +1223,42 @@ Power series special functions
12071223
12081224 The *newton * version uses Newton iteration for `\exp(ih) `. The complex
12091225 parts are represented formally; complex arithmetic is not required.
1210- The *cutoff * parameter specifies the cutoff for using the basecase
1211- algorithm.
1212-
1213- .. function :: int _gr_poly_tan_series_basecase(gr_ptr f, gr_srcptr h, slong hlen, slong n, gr_ctx_t ctx)
1214- int gr_poly_tan_series_basecase(gr_poly_t f, const gr_poly_t h, slong n, gr_ctx_t ctx)
1215- int _gr_poly_tan_series_newton(gr_ptr f, gr_srcptr h, slong hlen, slong n, slong cutoff, gr_ctx_t ctx)
1216- int gr_poly_tan_series_newton(gr_poly_t f, const gr_poly_t h, slong n, slong cutoff, gr_ctx_t ctx)
1217- int _gr_poly_tan_series(gr_ptr f, gr_srcptr h, slong hlen, slong n, gr_ctx_t ctx)
1218- int gr_poly_tan_series(gr_poly_t f, const gr_poly_t h, slong n, gr_ctx_t ctx)
1226+ The *cutoff * parameter specifies the initial length to compute with the
1227+ basecase algorithm.
1228+
1229+ .. function :: int _gr_poly_tan_series_basecase(gr_ptr f, gr_srcptr h, slong hlen, slong n, int func, gr_ctx_t ctx)
1230+ int gr_poly_tan_series_basecase(gr_poly_t f, const gr_poly_t h, slong n, int func, gr_ctx_t ctx)
1231+ int _gr_poly_tan_series_newton(gr_ptr f, gr_srcptr h, slong hlen, slong n, slong cutoff, int func, gr_ctx_t ctx)
1232+ 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)
1233+ int _gr_poly_tan_series_sine_cosine(gr_ptr f, gr_srcptr h, slong hlen, slong n, int func, gr_ctx_t ctx)
1234+ int gr_poly_tan_series_sine_cosine(gr_poly_t res, const gr_poly_t h, slong len, int func, gr_ctx_t ctx)
1235+ int _gr_poly_tan_series_exponential(gr_ptr f, gr_srcptr h, slong hlen, slong n, int func, gr_ctx_t ctx)
1236+ int gr_poly_tan_series_exponential(gr_poly_t res, const gr_poly_t h, slong len, int func, gr_ctx_t ctx)
1237+
1238+ Various algorithms to compute tangent-like functions of power series.
1239+ The *func * parameter specifies the function as follows:
1240+
1241+ * 0 - tan
1242+ * 1 - tanh
1243+ * 2 - cot
1244+ * 3 - coth
1245+ * 4 - tan_pi
1246+ * 5 - tanh_pi (not currently implemented)
1247+ * 6 - cot_pi
1248+ * 7 - coth_pi (not currently implemented)
1249+
1250+ The *basecase * algorithm uses an `O(n^2) ` recurrence for the coefficients.
1251+ The *newton * algorithm uses Newton iteration to invert the integral
1252+ defining the corresponding inverse function; the *cutoff * parameter
1253+ specifies the initial length to compute with the basecase algorithm.
1254+ The *sine_cosine * algorithm computes the function as a quotient of
1255+ a sine and cosine; for the hyperbolic functions this algorithm requires that
1256+ the ring contains the imaginary unit.
1257+ The *exponential * algorithm computes the function as a quotient of
1258+ `\pm 1 ` plus an exponential, where the sign of the exponent is chosen
1259+ (if possible) so that the exponential is small. For the trigonometric
1260+ functions this algorithm requires that the ring contains the imaginary unit.
1261+
12191262
12201263Modular arithmetic and composition
12211264--------------------------------------------------------------------------------
0 commit comments