1 /*
2     Copyright (C) 2016 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 ARB_HYPGEOM_H
13 #define ARB_HYPGEOM_H
14 
15 #include "arb.h"
16 #include "arb_poly.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 void _arb_hypgeom_rising_coeffs_1(ulong * c, ulong k, slong l);
23 void _arb_hypgeom_rising_coeffs_2(ulong * c, ulong k, slong l);
24 void _arb_hypgeom_rising_coeffs_fmpz(fmpz * c, ulong k, slong l);
25 
26 void arb_hypgeom_rising_ui_forward(arb_t res, const arb_t x, ulong n, slong prec);
27 void arb_hypgeom_rising_ui_rs(arb_t res, const arb_t x, ulong n, ulong m, slong prec);
28 void arb_hypgeom_rising_ui_bs(arb_t res, const arb_t x, ulong n, slong prec);
29 void arb_hypgeom_rising_ui_rec(arb_t res, const arb_t x, ulong n, slong prec);
30 void arb_hypgeom_rising_ui(arb_t y, const arb_t x, ulong n, slong prec);
31 void arb_hypgeom_rising(arb_t y, const arb_t x, const arb_t n, slong prec);
32 
33 void arb_hypgeom_rising_ui_jet_powsum(arb_ptr res, const arb_t x, ulong n, slong len, slong prec);
34 void arb_hypgeom_rising_ui_jet_rs(arb_ptr res, const arb_t x, ulong n, ulong m, slong len, slong prec);
35 void arb_hypgeom_rising_ui_jet_bs(arb_ptr res, const arb_t x, ulong n, slong len, slong prec);
36 void arb_hypgeom_rising_ui_jet(arb_ptr res, const arb_t x, ulong n, slong len, slong prec);
37 
38 void _arb_hypgeom_gamma_stirling_term_bounds(slong * bound, const mag_t zinv, slong N);
39 void arb_hypgeom_gamma_stirling_sum_horner(arb_t s, const arb_t z, slong N, slong prec);
40 void arb_hypgeom_gamma_stirling_sum_improved(arb_t s, const arb_t z, slong N, slong K, slong prec);
41 
42 #define ARB_HYPGEOM_GAMMA_TAB_NUM 536
43 #define ARB_HYPGEOM_GAMMA_TAB_PREC 3456
44 
45 typedef struct
46 {
47     short exp;
48     short tab_pos;
49     char nlimbs;
50     char negative;
51 } arb_hypgeom_gamma_coeff_t;
52 
53 ARB_DLL extern arb_hypgeom_gamma_coeff_t arb_hypgeom_gamma_coeffs[ARB_HYPGEOM_GAMMA_TAB_NUM];
54 int _arb_hypgeom_gamma_coeff_shallow(arf_t c, mag_t err, slong i, slong prec);
55 
56 void arb_hypgeom_gamma_stirling(arb_t res, const arb_t x, int reciprocal, slong prec);
57 int arb_hypgeom_gamma_taylor(arb_t res, const arb_t x, int reciprocal, slong prec);
58 
59 void arb_hypgeom_gamma(arb_t y, const arb_t x, slong prec);
60 void arb_hypgeom_rgamma(arb_t y, const arb_t x, slong prec);
61 
62 void arb_hypgeom_lgamma(arb_t y, const arb_t x, slong prec);
63 
64 void arb_hypgeom_gamma_fmpq(arb_t y, const fmpq_t x, slong prec);
65 void arb_hypgeom_gamma_fmpz(arb_t y, const fmpz_t x, slong prec);
66 
67 void arb_hypgeom_pfq(arb_t res, arb_srcptr a, slong p, arb_srcptr b, slong q,
68     const arb_t z, int regularized, slong prec);
69 
70 void arb_hypgeom_0f1(arb_t res, const arb_t a, const arb_t z, int regularized, slong prec);
71 void arb_hypgeom_m(arb_t res, const arb_t a, const arb_t b, const arb_t z, int regularized, slong prec);
72 void arb_hypgeom_1f1(arb_t res, const arb_t a, const arb_t b, const arb_t z, int regularized, slong prec);
73 void arb_hypgeom_u(arb_t res, const arb_t a, const arb_t b, const arb_t z, slong prec);
74 void arb_hypgeom_2f1(arb_t res, const arb_t a, const arb_t b, const arb_t c, const arb_t z, int regularized, slong prec);
75 
76 void arb_hypgeom_erf(arb_t res, const arb_t z, slong prec);
77 void _arb_hypgeom_erf_series(arb_ptr g, arb_srcptr h, slong hlen, slong len, slong prec);
78 void arb_hypgeom_erf_series(arb_poly_t g, const arb_poly_t h, slong len, slong prec);
79 
80 void arb_hypgeom_erfc(arb_t res, const arb_t z, slong prec);
81 void _arb_hypgeom_erfc_series(arb_ptr g, arb_srcptr h, slong hlen, slong len, slong prec);
82 void arb_hypgeom_erfc_series(arb_poly_t g, const arb_poly_t h, slong len, slong prec);
83 
84 void arb_hypgeom_erfi(arb_t res, const arb_t z, slong prec);
85 void _arb_hypgeom_erfi_series(arb_ptr g, arb_srcptr h, slong hlen, slong len, slong prec);
86 void arb_hypgeom_erfi_series(arb_poly_t g, const arb_poly_t h, slong len, slong prec);
87 
88 void arb_hypgeom_fresnel(arb_t res1, arb_t res2, const arb_t z, int normalized, slong prec);
89 void _arb_hypgeom_fresnel_series(arb_ptr s, arb_ptr c, arb_srcptr h, slong hlen, int normalized, slong len, slong prec);
90 void arb_hypgeom_fresnel_series(arb_poly_t s, arb_poly_t c, const arb_poly_t h, int normalized, slong len, slong prec);
91 
92 void arb_hypgeom_ei(arb_t res, const arb_t z, slong prec);
93 void _arb_hypgeom_ei_series(arb_ptr g, arb_srcptr h, slong hlen, slong len, slong prec);
94 void arb_hypgeom_ei_series(arb_poly_t g, const arb_poly_t h, slong len, slong prec);
95 
96 void arb_hypgeom_si(arb_t res, const arb_t z, slong prec);
97 void _arb_hypgeom_si_series(arb_ptr g, arb_srcptr h, slong hlen, slong len, slong prec);
98 void arb_hypgeom_si_series(arb_poly_t g, const arb_poly_t h, slong len, slong prec);
99 
100 void arb_hypgeom_ci(arb_t res, const arb_t z, slong prec);
101 void _arb_hypgeom_ci_series(arb_ptr g, arb_srcptr h, slong hlen, slong len, slong prec);
102 void arb_hypgeom_ci_series(arb_poly_t g, const arb_poly_t h, slong len, slong prec);
103 
104 void arb_hypgeom_shi(arb_t res, const arb_t z, slong prec);
105 void _arb_hypgeom_shi_series(arb_ptr g, arb_srcptr h, slong hlen, slong len, slong prec);
106 void arb_hypgeom_shi_series(arb_poly_t g, const arb_poly_t h, slong len, slong prec);
107 
108 void arb_hypgeom_chi(arb_t res, const arb_t z, slong prec);
109 void _arb_hypgeom_chi_series(arb_ptr g, arb_srcptr h, slong hlen, slong len, slong prec);
110 void arb_hypgeom_chi_series(arb_poly_t g, const arb_poly_t h, slong len, slong prec);
111 
112 void arb_hypgeom_li(arb_t res, const arb_t z, int offset, slong prec);
113 void _arb_hypgeom_li_series(arb_ptr g, arb_srcptr h, slong hlen, int offset, slong len, slong prec);
114 void arb_hypgeom_li_series(arb_poly_t g, const arb_poly_t h, int offset, slong len, slong prec);
115 
116 void arb_hypgeom_bessel_j(arb_t res, const arb_t nu, const arb_t z, slong prec);
117 void arb_hypgeom_bessel_y(arb_t res, const arb_t nu, const arb_t z, slong prec);
118 void arb_hypgeom_bessel_jy(arb_t res1, arb_t res2, const arb_t nu, const arb_t z, slong prec);
119 void arb_hypgeom_bessel_i(arb_t res, const arb_t nu, const arb_t z, slong prec);
120 void arb_hypgeom_bessel_k(arb_t res, const arb_t nu, const arb_t z, slong prec);
121 
122 void arb_hypgeom_bessel_i_scaled(arb_t res, const arb_t nu, const arb_t z, slong prec);
123 void arb_hypgeom_bessel_k_scaled(arb_t res, const arb_t nu, const arb_t z, slong prec);
124 
125 void arb_hypgeom_airy(arb_t ai, arb_t aip, arb_t bi, arb_t bip, const arb_t z, slong prec);
126 void arb_hypgeom_airy_jet(arb_ptr ai, arb_ptr bi, const arb_t z, slong len, slong prec);
127 void arb_hypgeom_airy_series(arb_poly_t ai, arb_poly_t ai_prime,
128     arb_poly_t bi, arb_poly_t bi_prime, const arb_poly_t z, slong len, slong prec);
129 void _arb_hypgeom_airy_series(arb_ptr ai, arb_ptr ai_prime,
130     arb_ptr bi, arb_ptr bi_prime, arb_srcptr z, slong zlen, slong len, slong prec);
131 
132 void arb_hypgeom_airy_zero(arb_t ai, arb_t aip, arb_t bi, arb_t bip, const fmpz_t n, slong prec);
133 
134 void arb_hypgeom_coulomb(arb_t F, arb_t G, const arb_t l, const arb_t eta, const arb_t z, slong prec);
135 void arb_hypgeom_coulomb_jet(arb_ptr F, arb_ptr G, const arb_t l, const arb_t eta, const arb_t z, slong len, slong prec);
136 void _arb_hypgeom_coulomb_series(arb_ptr F, arb_ptr G, const arb_t l, const arb_t eta, arb_srcptr z, slong zlen, slong len, slong prec);
137 void arb_hypgeom_coulomb_series(arb_poly_t F, arb_poly_t G, const arb_t l, const arb_t eta, const arb_poly_t z, slong len, slong prec);
138 
139 void arb_hypgeom_expint(arb_t res, const arb_t s, const arb_t z, slong prec);
140 
141 void arb_hypgeom_gamma_lower(arb_t res, const arb_t s, const arb_t z, int regularized, slong prec);
142 void _arb_hypgeom_gamma_lower_series(arb_ptr g, const arb_t s, arb_srcptr h, slong hlen, int regularized, slong n, slong prec);
143 void arb_hypgeom_gamma_lower_series(arb_poly_t g, const arb_t s, const arb_poly_t h, int regularized, slong n, slong prec);
144 
145 void arb_hypgeom_gamma_upper(arb_t res, const arb_t s, const arb_t z, int regularized, slong prec);
146 void _arb_hypgeom_gamma_upper_series(arb_ptr g, const arb_t s, arb_srcptr h, slong hlen, int regularized, slong n, slong prec);
147 void arb_hypgeom_gamma_upper_series(arb_poly_t g, const arb_t s, const arb_poly_t h, int regularized, slong n, slong prec);
148 
149 void arb_hypgeom_beta_lower(arb_t res, const arb_t a, const arb_t c, const arb_t z, int regularized, slong prec);
150 void arb_hypgeom_beta_lower_series(arb_poly_t res, const arb_t a, const arb_t b, const arb_poly_t z, int regularized, slong len, slong prec);
151 void _arb_hypgeom_beta_lower_series(arb_ptr res, const arb_t a, const arb_t b, arb_srcptr z, slong zlen, int regularized, slong len, slong prec);
152 
153 void arb_hypgeom_chebyshev_t(arb_t res, const arb_t nu, const arb_t z, slong prec);
154 void arb_hypgeom_chebyshev_u(arb_t res, const arb_t nu, const arb_t z, slong prec);
155 void arb_hypgeom_jacobi_p(arb_t res, const arb_t n, const arb_t a, const arb_t b, const arb_t z, slong prec);
156 void arb_hypgeom_gegenbauer_c(arb_t res, const arb_t n, const arb_t m, const arb_t z, slong prec);
157 void arb_hypgeom_laguerre_l(arb_t res, const arb_t n, const arb_t m, const arb_t z, slong prec);
158 void arb_hypgeom_hermite_h(arb_t res, const arb_t nu, const arb_t z, slong prec);
159 void arb_hypgeom_legendre_p(arb_t res, const arb_t n, const arb_t m, const arb_t z, int type, slong prec);
160 void arb_hypgeom_legendre_q(arb_t res, const arb_t n, const arb_t m, const arb_t z, int type, slong prec);
161 
162 void arb_hypgeom_legendre_p_ui_deriv_bound(mag_t dp, mag_t dp2, ulong n, const arb_t x, const arb_t x2sub1);
163 void arb_hypgeom_legendre_p_ui_rec(arb_t res, arb_t res_prime, ulong n, const arb_t x, slong prec);
164 void arb_hypgeom_legendre_p_ui_asymp(arb_t res, arb_t res2, ulong n, const arb_t x, slong K, slong prec);
165 void arb_hypgeom_legendre_p_ui_one(arb_t res, arb_t res2, ulong n, const arb_t x, slong K, slong prec);
166 void arb_hypgeom_legendre_p_ui_zero(arb_t res, arb_t res2, ulong n, const arb_t x, slong K, slong prec);
167 void arb_hypgeom_legendre_p_ui(arb_t res, arb_t res_prime, ulong n, const arb_t x, slong prec);
168 
169 void arb_hypgeom_legendre_p_ui_root(arb_t res, arb_t weight, ulong n, ulong k, slong prec);
170 
171 void arb_hypgeom_central_bin_ui(arb_t res, ulong n, slong prec);
172 
173 void arb_hypgeom_dilog(arb_t res, const arb_t z, slong prec);
174 
175 #ifdef __cplusplus
176 }
177 #endif
178 
179 #endif
180 
181