int bessel(acb_ptr out, const acb_t inp, void * params, long order, long prec) { acb_ptr t; acb_t z; ulong n; t = _acb_vec_init(order); acb_init(z); acb_set(t, inp); if (order > 1) acb_one(t + 1); n = 10; arb_set_si(acb_realref(z), 20); arb_set_si(acb_imagref(z), 10); /* z sin(t) */ _acb_poly_sin_series(out, t, FLINT_MIN(2, order), order, prec); _acb_vec_scalar_mul(out, out, order, z, prec); /* t n */ _acb_vec_scalar_mul_ui(t, t, FLINT_MIN(2, order), n, prec); _acb_poly_sub(out, t, FLINT_MIN(2, order), out, order, prec); _acb_poly_cos_series(out, out, order, order, prec); _acb_vec_clear(t, order); acb_clear(z); return 0; }
int sinx(acb_ptr out, const acb_t inp, void * params, long order, long prec) { int xlen = FLINT_MIN(2, order); acb_set(out, inp); if (xlen > 1) acb_one(out + 1); _acb_poly_sin_series(out, out, xlen, order, prec); return 0; }
int elliptic(acb_ptr out, const acb_t inp, void * params, long order, long prec) { acb_ptr t; t = _acb_vec_init(order); acb_set(t, inp); if (order > 1) acb_one(t + 1); _acb_poly_sin_series(t, t, FLINT_MIN(2, order), order, prec); _acb_poly_mullow(out, t, order, t, order, order, prec); _acb_vec_scalar_mul_2exp_si(t, out, order, -1); acb_sub_ui(t, t, 1, prec); _acb_vec_neg(t, t, order); _acb_poly_rsqrt_series(out, t, order, order, prec); _acb_vec_clear(t, order); return 0; }
void acb_poly_sin_series(acb_poly_t g, const acb_poly_t h, slong n, slong prec) { slong hlen = h->length; if (hlen == 0 || n == 0) { acb_poly_zero(g); return; } if (hlen == 1) n = 1; acb_poly_fit_length(g, n); _acb_poly_sin_series(g->coeffs, h->coeffs, hlen, n, prec); _acb_poly_set_length(g, n); _acb_poly_normalise(g); }