1 /*
2     Copyright (C) 2014 Fredrik Johansson
3 
4     This file is part of Arb.
5 
6     Arb is free software: you can redistribute it and/or modify it under
7     the terms of the GNU Lesser General Public License (LGPL) as published
8     by the Free Software Foundation; either version 2.1 of the License, or
9     (at your option) any later version.  See <http://www.gnu.org/licenses/>.
10 */
11 
12 #ifndef ACB_HYPGEOM_H
13 #define ACB_HYPGEOM_H
14 
15 #include "acb.h"
16 #include "acb_poly.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 void acb_hypgeom_rising_ui_forward(acb_t res, const acb_t x, ulong n, slong prec);
23 void acb_hypgeom_rising_ui_rs(acb_t res, const acb_t x, ulong n, ulong m, slong prec);
24 void acb_hypgeom_rising_ui_bs(acb_t res, const acb_t x, ulong n, slong prec);
25 void acb_hypgeom_rising_ui_rec(acb_t res, const acb_t x, ulong n, slong prec);
26 void acb_hypgeom_rising_ui(acb_t y, const acb_t x, ulong n, slong prec);
27 void acb_hypgeom_rising(acb_t y, const acb_t x, const acb_t n, slong prec);
28 
29 void acb_hypgeom_rising_ui_jet_powsum(acb_ptr res, const acb_t x, ulong n, slong len, slong prec);
30 void acb_hypgeom_rising_ui_jet_rs(acb_ptr res, const acb_t x, ulong n, ulong m, slong len, slong prec);
31 void acb_hypgeom_rising_ui_jet_bs(acb_ptr res, const acb_t x, ulong n, slong len, slong prec);
32 void acb_hypgeom_rising_ui_jet(acb_ptr res, const acb_t x, ulong n, slong len, slong prec);
33 
34 void acb_hypgeom_log_rising_ui_jet(acb_ptr res, const acb_t z, ulong r, slong len, slong prec);
35 void acb_hypgeom_log_rising_ui(acb_ptr res, const acb_t z, ulong r, slong prec);
36 
37 void acb_hypgeom_gamma_stirling_sum_horner(acb_t s, const acb_t z, slong N, slong prec);
38 void acb_hypgeom_gamma_stirling_sum_improved(acb_t s, const acb_t z, slong N, slong K, slong prec);
39 void acb_hypgeom_gamma_stirling(acb_t res, const acb_t x, int reciprocal, slong prec);
40 int acb_hypgeom_gamma_taylor(acb_t res, const acb_t x, int reciprocal, slong prec);
41 void acb_hypgeom_gamma(acb_t y, const acb_t x, slong prec);
42 void acb_hypgeom_rgamma(acb_t y, const acb_t x, slong prec);
43 
44 void acb_hypgeom_lgamma(acb_t y, const acb_t x, slong prec);
45 
46 void acb_hypgeom_pfq_bound_factor(mag_t C,
47     acb_srcptr a, slong p, acb_srcptr b, slong q, const acb_t z, ulong n);
48 
49 slong acb_hypgeom_pfq_choose_n(acb_srcptr a, slong p,
50                          acb_srcptr b, slong q, const acb_t z, slong prec);
51 
52 void acb_hypgeom_pfq_sum_forward(acb_t s, acb_t t, acb_srcptr a, slong p, acb_srcptr b, slong q,
53     const acb_t z, slong n, slong prec);
54 
55 void acb_hypgeom_pfq_sum_rs(acb_t s, acb_t t, acb_srcptr a, slong p, acb_srcptr b, slong q,
56     const acb_t z, slong n, slong prec);
57 
58 void acb_hypgeom_pfq_sum_bs(acb_t s, acb_t t, acb_srcptr a, slong p, acb_srcptr b, slong q,
59     const acb_t z, slong n, slong prec);
60 
61 void acb_hypgeom_pfq_sum_fme(acb_t s, acb_t t, acb_srcptr a, slong p, acb_srcptr b, slong q,
62     const acb_t z, slong n, slong prec);
63 
64 void acb_hypgeom_pfq_sum(acb_t s, acb_t t, acb_srcptr a, slong p, acb_srcptr b, slong q,
65     const acb_t z, slong n, slong prec);
66 
67 void acb_hypgeom_pfq_sum_bs_invz(acb_t s, acb_t t,
68     acb_srcptr a, slong p, acb_srcptr b, slong q, const acb_t z, slong n, slong prec);
69 
70 void acb_hypgeom_pfq_sum_invz(acb_t s, acb_t t, acb_srcptr a, slong p,
71     acb_srcptr b, slong q, const acb_t z, const acb_t zinv, slong n, slong prec);
72 
73 void acb_hypgeom_pfq_direct(acb_t res, acb_srcptr a, slong p, acb_srcptr b, slong q,
74     const acb_t z, slong n, slong prec);
75 
76 slong acb_hypgeom_pfq_series_choose_n(const acb_poly_struct * a, slong p,
77                                 const acb_poly_struct * b, slong q,
78                                 const acb_poly_t z, slong len, slong prec);
79 
80 void
81 acb_hypgeom_pfq_series_sum_forward(acb_poly_t s, acb_poly_t t,
82     const acb_poly_struct * a, slong p,
83     const acb_poly_struct * b, slong q,
84     const acb_poly_t z, int regularized,
85     slong n, slong len, slong prec);
86 
87 void
88 acb_hypgeom_pfq_series_sum_bs(acb_poly_t s, acb_poly_t t,
89     const acb_poly_struct * a, slong p,
90     const acb_poly_struct * b, slong q,
91     const acb_poly_t z, int regularized,
92     slong n, slong len, slong prec);
93 
94 void
95 acb_hypgeom_pfq_series_sum_rs(acb_poly_t s, acb_poly_t t,
96     const acb_poly_struct * a, slong p,
97     const acb_poly_struct * b, slong q,
98     const acb_poly_t z, int regularized,
99     slong n, slong len, slong prec);
100 
101 void
102 acb_hypgeom_pfq_series_sum(acb_poly_t s, acb_poly_t t,
103     const acb_poly_struct * a, slong p,
104     const acb_poly_struct * b, slong q,
105     const acb_poly_t z, int regularized,
106     slong n, slong len, slong prec);
107 
108 void acb_hypgeom_pfq_series_direct(acb_poly_t res,
109     const acb_poly_struct * a, slong p,
110     const acb_poly_struct * b, slong q,
111     const acb_poly_t z, int regularized,
112     slong n, slong len, slong prec);
113 
114 void acb_hypgeom_pfq(acb_t res, acb_srcptr a, slong p, acb_srcptr b, slong q,
115     const acb_t z, int regularized, slong prec);
116 
117 void acb_hypgeom_u_asymp(acb_t res, const acb_t a, const acb_t b,
118     const acb_t z, slong n, slong prec);
119 
120 void acb_hypgeom_u_1f1_series(acb_poly_t res,
121     const acb_poly_t a, const acb_poly_t b, const acb_poly_t z,
122     slong len, slong prec);
123 
124 void acb_hypgeom_u_1f1(acb_t res, const acb_t a, const acb_t b, const acb_t z, slong prec);
125 void acb_hypgeom_u(acb_t res, const acb_t a, const acb_t b, const acb_t z, slong prec);
126 
127 int acb_hypgeom_u_use_asymp(const acb_t z, slong prec);
128 
129 void acb_hypgeom_m_asymp(acb_t res, const acb_t a, const acb_t b, const acb_t z, int regularized, slong prec);
130 void acb_hypgeom_m_1f1(acb_t res, const acb_t a, const acb_t b, const acb_t z, int regularized, slong prec);
131 void acb_hypgeom_m(acb_t res, const acb_t a, const acb_t b, const acb_t z, int regularized, slong prec);
132 void acb_hypgeom_1f1(acb_t res, const acb_t a, const acb_t b, const acb_t z, int regularized, slong prec);
133 
134 void acb_hypgeom_bessel_j_0f1(acb_t res, const acb_t nu, const acb_t z, slong prec);
135 void acb_hypgeom_bessel_j_asymp(acb_t res, const acb_t nu, const acb_t z, slong prec);
136 void acb_hypgeom_bessel_j(acb_t res, const acb_t nu, const acb_t z, slong prec);
137 
138 void acb_hypgeom_bessel_i_0f1(acb_t res, const acb_t nu, const acb_t z, int scaled, slong prec);
139 void acb_hypgeom_bessel_i_asymp(acb_t res, const acb_t nu, const acb_t z, int scaled, slong prec);
140 void acb_hypgeom_bessel_i(acb_t res, const acb_t nu, const acb_t z, slong prec);
141 void acb_hypgeom_bessel_i_scaled(acb_t res, const acb_t nu, const acb_t z, slong prec);
142 
143 void acb_hypgeom_bessel_k_0f1(acb_t res, const acb_t nu, const acb_t z, int scaled, slong prec);
144 void acb_hypgeom_bessel_k_0f1_series(acb_poly_t res, const acb_poly_t n, const acb_poly_t z, int scaled, slong len, slong prec);
145 void acb_hypgeom_bessel_k_asymp(acb_t res, const acb_t nu, const acb_t z, int scaled, slong prec);
146 void acb_hypgeom_bessel_k(acb_t res, const acb_t nu, const acb_t z, slong prec);
147 void acb_hypgeom_bessel_k_scaled(acb_t res, const acb_t nu, const acb_t z, slong prec);
148 
149 void acb_hypgeom_bessel_y(acb_t res, const acb_t nu, const acb_t z, slong prec);
150 void acb_hypgeom_bessel_jy(acb_t res1, acb_t res2, const acb_t nu, const acb_t z, slong prec);
151 
152 void acb_hypgeom_0f1_asymp(acb_t res, const acb_t a, const acb_t z, int regularized, slong prec);
153 void acb_hypgeom_0f1_direct(acb_t res, const acb_t a, const acb_t z, int regularized, slong prec);
154 void acb_hypgeom_0f1(acb_t res, const acb_t a, const acb_t z, int regularized, slong prec);
155 
156 void acb_hypgeom_airy_bound(mag_t ai, mag_t aip, mag_t bi, mag_t bip, const acb_t z);
157 void acb_hypgeom_airy_asymp(acb_t ai, acb_t aip, acb_t bi, acb_t bip, const acb_t z, slong n, slong prec);
158 void acb_hypgeom_airy_direct(acb_t ai, acb_t aip, acb_t bi, acb_t bip, const acb_t z, slong n, slong prec);
159 void acb_hypgeom_airy(acb_t ai, acb_t aip, acb_t bi, acb_t bip, const acb_t z, slong prec);
160 void acb_hypgeom_airy_jet(acb_ptr ai, acb_ptr bi, const acb_t z, slong len, slong prec);
161 void _acb_hypgeom_airy_series(acb_ptr ai, acb_ptr ai_prime, acb_ptr bi, acb_ptr bi_prime, acb_srcptr z, slong zlen, slong len, slong prec);
162 void acb_hypgeom_airy_series(acb_poly_t ai, acb_poly_t ai_prime, acb_poly_t bi, acb_poly_t bi_prime, const acb_poly_t z, slong len, slong prec);
163 
164 void acb_hypgeom_coulomb(acb_t F, acb_t G, acb_t Hpos, acb_t Hneg, const acb_t l, const acb_t eta, const acb_t z, slong prec);
165 void acb_hypgeom_coulomb_jet(acb_ptr F, acb_ptr G, acb_ptr Hpos, acb_ptr Hneg, const acb_t l, const acb_t eta, const acb_t z, slong len, slong prec);
166 void _acb_hypgeom_coulomb_series(acb_ptr F, acb_ptr G, acb_ptr Hpos, acb_ptr Hneg, const acb_t l, const acb_t eta, acb_srcptr z, slong zlen, slong len, slong prec);
167 void acb_hypgeom_coulomb_series(acb_poly_t F, acb_poly_t G, acb_poly_t Hpos, acb_poly_t Hneg, const acb_t l, const acb_t eta, const acb_poly_t z, slong len, slong prec);
168 
169 void acb_hypgeom_gamma_upper_asymp(acb_t res, const acb_t s, const acb_t z, int modified, slong prec);
170 void acb_hypgeom_gamma_upper_1f1a(acb_t res, const acb_t s, const acb_t z, int modified, slong prec);
171 void acb_hypgeom_gamma_upper_1f1b(acb_t res, const acb_t s, const acb_t z, int modified, slong prec);
172 void acb_hypgeom_gamma_upper_singular(acb_t res, slong s, const acb_t z, int modified, slong prec);
173 void acb_hypgeom_gamma_upper(acb_t res, const acb_t s, const acb_t z, int modified, slong prec);
174 
175 void _acb_hypgeom_gamma_upper_series(acb_ptr g, const acb_t s, acb_srcptr h, slong hlen, int regularized, slong n, slong prec);
176 void acb_hypgeom_gamma_upper_series(acb_poly_t g, const acb_t s, const acb_poly_t h, int regularized, slong n, slong prec);
177 
178 void acb_hypgeom_gamma_lower(acb_t res, const acb_t s, const acb_t z, int modified, slong prec);
179 
180 void _acb_hypgeom_gamma_lower_series(acb_ptr g, const acb_t s, acb_srcptr h, slong hlen, int regularized, slong n, slong prec);
181 void acb_hypgeom_gamma_lower_series(acb_poly_t g, const acb_t s, const acb_poly_t h, int regularized, slong n, slong prec);
182 
183 void acb_hypgeom_beta_lower(acb_t res, const acb_t a, const acb_t b, const acb_t z, int regularized, slong prec);
184 void _acb_hypgeom_beta_lower_series(acb_ptr res, const acb_t a, const acb_t b, acb_srcptr z, slong zlen, int regularized, slong len, slong prec);
185 void acb_hypgeom_beta_lower_series(acb_poly_t res, const acb_t a, const acb_t b, const acb_poly_t z, int regularized, slong len, slong prec);
186 
187 void acb_hypgeom_expint(acb_t res, const acb_t s, const acb_t z, slong prec);
188 
189 void acb_hypgeom_erf_propagated_error(mag_t re, mag_t im, const acb_t z);
190 void acb_hypgeom_erf_1f1a(acb_t res, const acb_t z, slong prec);
191 void acb_hypgeom_erf_1f1b(acb_t res, const acb_t z, slong prec);
192 void acb_hypgeom_erf_asymp(acb_t res, const acb_t z, int complementary, slong prec, slong prec2);
193 void acb_hypgeom_erf(acb_t res, const acb_t z, slong prec);
194 void _acb_hypgeom_erf_series(acb_ptr g, acb_srcptr h, slong hlen, slong len, slong prec);
195 void acb_hypgeom_erf_series(acb_poly_t g, const acb_poly_t h, slong len, slong prec);
196 
197 void acb_hypgeom_erfc(acb_t res, const acb_t z, slong prec);
198 void _acb_hypgeom_erfc_series(acb_ptr g, acb_srcptr h, slong hlen, slong len, slong prec);
199 void acb_hypgeom_erfc_series(acb_poly_t g, const acb_poly_t h, slong len, slong prec);
200 
201 void acb_hypgeom_erfi(acb_t res, const acb_t z, slong prec);
202 void _acb_hypgeom_erfi_series(acb_ptr g, acb_srcptr h, slong hlen, slong len, slong prec);
203 void acb_hypgeom_erfi_series(acb_poly_t g, const acb_poly_t h, slong len, slong prec);
204 
205 void acb_hypgeom_fresnel(acb_t res1, acb_t res2, const acb_t z, int normalized, slong prec);
206 void _acb_hypgeom_fresnel_series(acb_ptr s, acb_ptr c, acb_srcptr h, slong hlen, int normalized, slong len, slong prec);
207 void acb_hypgeom_fresnel_series(acb_poly_t s, acb_poly_t c, const acb_poly_t h, int normalized, slong len, slong prec);
208 
209 void acb_hypgeom_ei_asymp(acb_t res, const acb_t z, slong prec);
210 void acb_hypgeom_ei_2f2(acb_t res, const acb_t z, slong prec);
211 void acb_hypgeom_ei(acb_t res, const acb_t z, slong prec);
212 void _acb_hypgeom_ei_series(acb_ptr g, acb_srcptr h, slong hlen, slong len, slong prec);
213 void acb_hypgeom_ei_series(acb_poly_t g, const acb_poly_t h, slong len, slong prec);
214 
215 void acb_hypgeom_si_asymp(acb_t res, const acb_t z, slong prec);
216 void acb_hypgeom_si_1f2(acb_t res, const acb_t z, slong prec);
217 void acb_hypgeom_si(acb_t res, const acb_t z, slong prec);
218 void _acb_hypgeom_si_series(acb_ptr g, acb_srcptr h, slong hlen, slong len, slong prec);
219 void acb_hypgeom_si_series(acb_poly_t g, const acb_poly_t h, slong len, slong prec);
220 
221 void acb_hypgeom_ci_asymp(acb_t res, const acb_t z, slong prec);
222 void acb_hypgeom_ci_2f3(acb_t res, const acb_t z, slong prec);
223 void acb_hypgeom_ci(acb_t res, const acb_t z, slong prec);
224 void _acb_hypgeom_ci_series(acb_ptr g, acb_srcptr h, slong hlen, slong len, slong prec);
225 void acb_hypgeom_ci_series(acb_poly_t g, const acb_poly_t h, slong len, slong prec);
226 
227 void acb_hypgeom_shi(acb_t res, const acb_t z, slong prec);
228 void _acb_hypgeom_shi_series(acb_ptr g, acb_srcptr h, slong hlen, slong len, slong prec);
229 void acb_hypgeom_shi_series(acb_poly_t g, const acb_poly_t h, slong len, slong prec);
230 
231 void acb_hypgeom_chi_asymp(acb_t res, const acb_t z, slong prec);
232 void acb_hypgeom_chi_2f3(acb_t res, const acb_t z, slong prec);
233 void acb_hypgeom_chi(acb_t res, const acb_t z, slong prec);
234 void _acb_hypgeom_chi_series(acb_ptr g, acb_srcptr h, slong hlen, slong len, slong prec);
235 void acb_hypgeom_chi_series(acb_poly_t g, const acb_poly_t h, slong len, slong prec);
236 
237 void acb_hypgeom_li(acb_t res, const acb_t z, int offset, slong prec);
238 void _acb_hypgeom_li_series(acb_ptr g, acb_srcptr h, slong hlen, int offset, slong len, slong prec);
239 void acb_hypgeom_li_series(acb_poly_t g, const acb_poly_t h, int offset, slong len, slong prec);
240 
241 void acb_hypgeom_2f1_continuation(acb_t res0, acb_t res1,
242     const acb_t a, const acb_t b, const acb_t c, const acb_t z0,
243     const acb_t z1, const acb_t f0, const acb_t f1, slong prec);
244 
245 void acb_hypgeom_2f1_series_direct(acb_poly_t res, const acb_poly_t a, const acb_poly_t b,
246     const acb_poly_t c, const acb_poly_t z, int regularized, slong len, slong prec);
247 void acb_hypgeom_2f1_direct(acb_t res, const acb_t a, const acb_t b, const acb_t c, const acb_t z, int regularized, slong prec);
248 
249 void acb_hypgeom_2f1_transform(acb_t res, const acb_t a, const acb_t b,
250     const acb_t c, const acb_t z, int regularized, int which, slong prec);
251 
252 void acb_hypgeom_2f1_transform_limit(acb_t res, const acb_t a, const acb_t b,
253     const acb_t c, const acb_t z, int regularized, int which, slong prec);
254 
255 void acb_hypgeom_2f1_corner(acb_t res, const acb_t a, const acb_t b, const acb_t c, const acb_t z, int regularized, slong prec);
256 
257 int acb_hypgeom_2f1_choose(const acb_t z);
258 
259 void acb_hypgeom_2f1(acb_t res, const acb_t a, const acb_t b, const acb_t c, const acb_t z, int regularized, slong prec);
260 
261 #define ACB_HYPGEOM_2F1_REGULARIZED 1
262 #define ACB_HYPGEOM_2F1_AB 2   /* a-b integer */
263 #define ACB_HYPGEOM_2F1_AC 4   /* a-c integer */
264 #define ACB_HYPGEOM_2F1_BC 8   /* b-c integer */
265 #define ACB_HYPGEOM_2F1_ABC 16  /* a+b-c integer */
266 
267 void acb_hypgeom_legendre_p_uiui_rec(acb_t res, ulong n, ulong m, const acb_t z, slong prec);
268 void acb_hypgeom_legendre_p(acb_t res, const acb_t n, const acb_t m, const acb_t z, int type, slong prec);
269 void acb_hypgeom_legendre_q(acb_t res, const acb_t n, const acb_t m, const acb_t z, int type, slong prec);
270 void acb_hypgeom_jacobi_p(acb_t res, const acb_t n, const acb_t a, const acb_t b, const acb_t z, slong prec);
271 void acb_hypgeom_gegenbauer_c(acb_t res, const acb_t n, const acb_t m, const acb_t z, slong prec);
272 void acb_hypgeom_laguerre_l(acb_t res, const acb_t n, const acb_t m, const acb_t z, slong prec);
273 void acb_hypgeom_hermite_h(acb_t res, const acb_t n, const acb_t z, slong prec);
274 void acb_hypgeom_chebyshev_t(acb_t res, const acb_t n, const acb_t z, slong prec);
275 void acb_hypgeom_chebyshev_u(acb_t res, const acb_t n, const acb_t z, slong prec);
276 void acb_hypgeom_spherical_y(acb_t res, slong n, slong m, const acb_t theta, const acb_t phi, slong prec);
277 
278 void acb_hypgeom_dilog_bernoulli(acb_t res, const acb_t z, slong prec);
279 void acb_hypgeom_dilog_continuation(acb_t res, const acb_t a, const acb_t z, slong prec);
280 void acb_hypgeom_dilog_bitburst(acb_t res, acb_t z0, const acb_t z, slong prec);
281 void acb_hypgeom_dilog_transform(acb_t res, const acb_t z, int algorithm, slong prec);
282 void acb_hypgeom_dilog_zero_taylor(acb_t res, const acb_t z, slong prec);
283 void acb_hypgeom_dilog_zero(acb_t res, const acb_t z, slong prec);
284 void acb_hypgeom_dilog(acb_t res, const acb_t z, slong prec);
285 
286 #ifdef __cplusplus
287 }
288 #endif
289 
290 #endif
291 
292