arb_hypgeom.h
#include <flint/arb_hypgeom.h>This module evaluates hypergeometric and related special functions of real arguments given as balls (arb_t) or real power series (arb_poly_t), with rigorous error bounds. It provides the functions of acb_hypgeom for real variables. Most of them convert their arguments to complex balls, call the complex function, and return the real part. A smaller set is implemented directly for real arguments because a dedicated algorithm is much faster there: the gamma function and rising factorials, the error functions and their inverses, the sine and cosine integrals, central binomial coefficients, Legendre polynomials of integer degree and their roots, the real zeros of the Airy functions, the incomplete gamma function at rational parameters, and finite hypergeometric sums with rational parameters. Several functions also have variants based on rigorous numerical integration, which work for large parameters where series expansions fail.
Evaluating special functions explains how FLINT evaluates special functions and which methods each function uses; The gamma function and Hypergeometric functions describe the two main families of algorithms in detail. The same functions are available through the generic interface of gr_special: for the context of real balls (gr_ctx_init_real_arb), gr_gamma, gr_erf, gr_hypgeom_2f1, gr_bessel_j and their relatives call the functions documented here.
Conventions#
- Precision and accuracy. Every function returns a ball that contains the exact value of the function at every point of the input balls. The working precision
precbounds the relative accuracy of the result, which is close toprecbits for exact inputs away from zeros and singularities of the function; the functions add guard bits internally to compensate for the cancellation they can predict. For inexact inputs, most functions evaluate at the midpoint and add a bound for the propagated error, and lower the working precision to what the accuracy of the input justifies. - Undefined values. If the function is undefined or not real at some point of the input (a pole, a branch cut, a real argument for which the value is complex), or if no finite enclosure could be computed, the output is indeterminate (NaN midpoint, infinite radius; see
arb_indeterminate). The functions that wrap a complex function return an indeterminate result whenever the complex result is not finite or has an imaginary part that is not exactly zero. An indeterminate or very wide result for a valid input means that the input is too wide or the precision too low, not that the function is undefined; increasingprecusually helps. - Aliasing. Inputs and outputs of the functions taking
arb_targuments may be the same object, except where stated (the jet functions). The underscore power series functions require positive lengths, write exactlylencoefficients and must not have the output overlap the input; the non-underscore versions accept any lengths and aliasing. - Optional outputs. Functions that compute several related values (Fresnel integrals, Airy functions, Coulomb functions, Legendre polynomials with their derivative) accept
NULLfor the outputs that are not wanted, and then skip their computation when this saves time. - Regularized and normalized variants. An
intargumentregularizedselects the regularized function (divided by gamma functions, so that it is entire in the parameters) instead of the ordinary one; the exact meaning is given for each function.
The guide Using acb_hypgeom illustrates these conventions with examples.
Rising factorials#
void arb_hypgeom_rising_ui_forward(arb_t res, const arb_t x, ulong n, slong prec)void arb_hypgeom_rising_ui_bs(arb_t res, const arb_t x, ulong n, slong prec)void arb_hypgeom_rising_ui_rec(arb_t res, const arb_t x, ulong n, slong prec)void arb_hypgeom_rising_ui(arb_t res, const arb_t x, ulong n, slong prec)void arb_hypgeom_rising(arb_t res, const arb_t x, const arb_t n, slong prec)Sets res to the rising factorial , with ; arb_hypgeom_rising allows any real and computes .
void arb_hypgeom_rising_ui_jet_rs(arb_ptr res, const arb_t x, ulong n, ulong m, slong len, slong prec)Sets the vector res of length len to the coefficients of the polynomial , truncated to length len if and padded with zeros if . The coefficient of is the -th derivative of with respect to divided by .
Gamma function#
void arb_hypgeom_gamma(arb_t res, const arb_t x, slong prec)void arb_hypgeom_gamma_fmpq(arb_t res, const fmpq_t x, slong prec)void arb_hypgeom_gamma_fmpz(arb_t res, const fmpz_t x, slong prec)Sets res to the gamma function . The result is indeterminate if contains a pole .
void arb_hypgeom_rgamma(arb_t res, const arb_t x, slong prec)Sets res to the reciprocal gamma function , which is entire and zero at the nonpositive integers.
void arb_hypgeom_lgamma(arb_t res, const arb_t x, slong prec)Sets res to for . The result is indeterminate unless is positive; acb_hypgeom_lgamma computes the log-gamma function of negative and complex arguments.
void arb_hypgeom_gamma_stirling_sum_horner(arb_t res, const arb_t z, slong N, slong prec)void arb_hypgeom_gamma_stirling_sum_improved(arb_t res, const arb_t z, slong N, slong K, slong prec)Sets res to the sum of the Stirling series for , truncated before the term of index . No bound for the truncation error is added.
void arb_hypgeom_gamma_stirling(arb_t res, const arb_t x, int reciprocal, slong prec)Sets res to , or if reciprocal is nonzero, computed with the Stirling series after argument reduction.
int arb_hypgeom_gamma_taylor(arb_t res, const arb_t x, int reciprocal, slong prec)Attempts to compute , or if reciprocal is nonzero, using a precomputed Taylor series. Returns 1 and sets res on success; returns 0 without changing res if or prec is too large for the method.
Binomial coefficients#
void arb_hypgeom_central_bin_ui(arb_t res, ulong n, slong prec)Sets res to the central binomial coefficient .
Generalized hypergeometric function#
void arb_hypgeom_pfq(arb_t res, arb_srcptr a, slong p, arb_srcptr b, slong q, const arb_t z, int regularized, slong prec)Sets res to the generalized hypergeometric function , or the regularized function if regularized is nonzero. Wrapper of acb_hypgeom_pfq.
Confluent hypergeometric functions#
void arb_hypgeom_0f1(arb_t res, const arb_t a, const arb_t z, int regularized, slong prec)Sets res to the confluent hypergeometric limit function , or if regularized is nonzero. Wrapper of acb_hypgeom_0f1.
void arb_hypgeom_m(arb_t res, const arb_t a, const arb_t b, const arb_t z, int regularized, slong prec)void arb_hypgeom_1f1(arb_t res, const arb_t a, const arb_t b, const arb_t z, int regularized, slong prec)Sets res to Kummer's confluent hypergeometric function , or if regularized is nonzero. The two names denote the same function, a wrapper of acb_hypgeom_m.
Sets res to Tricomi's confluent hypergeometric function , which is real for . Wrapper of acb_hypgeom_u.
void arb_hypgeom_1f1_integration(arb_t res, const arb_t a, const arb_t b, const arb_t z, int regularized, slong prec)Computes (regularized if regularized is nonzero) by rigorous numerical integration of
The result is finite only if and .
MoreComputes by rigorous numerical integration of
The result is finite only if and . acb_hypgeom_u uses it as a fallback for real arguments in the same way as arb_hypgeom_1f1_integration.
Gauss hypergeometric function#
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)Sets res to the Gauss hypergeometric function , or if the bit ACB_HYPGEOM_2F1_REGULARIZED (= 1) is set in regularized. Wrapper of acb_hypgeom_2f1; the flags of that function, which declare that a parameter difference is an exact integer, can be set in regularized too. The value is real for ; on the branch cut the result is indeterminate unless the function is a polynomial.
void arb_hypgeom_2f1_integration(arb_t res, const arb_t a, const arb_t b, const arb_t c, const arb_t z, int regularized, slong prec)Computes (regularized if regularized is nonzero) by rigorous numerical integration of
The result is finite only if , and , possibly after exchanging and . acb_hypgeom_2f1 uses it as a fallback for real arguments.
Error functions and Fresnel integrals#
void arb_hypgeom_erf(arb_t res, const arb_t z, slong prec)Sets res to the error function .
void arb_hypgeom_erfc(arb_t res, const arb_t z, slong prec)Sets res to the complementary error function , accurately also for large positive where is tiny.
void arb_hypgeom_erfi(arb_t res, const arb_t z, slong prec)Sets res to the imaginary error function . Wrapper of acb_hypgeom_erfi.
void arb_hypgeom_erfinv(arb_t res, const arb_t x, slong prec)void arb_hypgeom_erfcinv(arb_t res, const arb_t x, slong prec)Sets res to the inverse error function for , or the inverse complementary error function for . The values at the endpoints are ; arguments outside the domain give an indeterminate result.
void _arb_hypgeom_erf_series(arb_ptr res, arb_srcptr z, slong zlen, slong len, slong prec)void arb_hypgeom_erf_series(arb_poly_t res, const arb_poly_t z, slong len, slong prec)void _arb_hypgeom_erfc_series(arb_ptr res, arb_srcptr z, slong zlen, slong len, slong prec)void arb_hypgeom_erfc_series(arb_poly_t res, const arb_poly_t z, slong len, slong prec)void _arb_hypgeom_erfi_series(arb_ptr res, arb_srcptr z, slong zlen, slong len, slong prec)void arb_hypgeom_erfi_series(arb_poly_t res, const arb_poly_t z, slong len, slong prec)Sets res to , or of the power series , truncated to length len.
void arb_hypgeom_fresnel(arb_t res1, arb_t res2, const arb_t z, int normalized, slong prec)Sets res1 to the Fresnel sine integral and res2 to the Fresnel cosine integral ; either output may be NULL. If normalized is 0, and ; if normalized is 1, and , the convention of Abramowitz and Stegun and of the DLMF [NIST2012]. Wrapper of acb_hypgeom_fresnel.
void _arb_hypgeom_fresnel_series(arb_ptr res1, arb_ptr res2, arb_srcptr z, slong zlen, int normalized, slong len, slong prec)void arb_hypgeom_fresnel_series(arb_poly_t res1, arb_poly_t res2, const arb_poly_t z, int normalized, slong len, slong prec)Sets res1 and res2 to the Fresnel sine and cosine integrals of the power series , truncated to length len. Either output may be NULL.
Incomplete gamma and beta functions#
void arb_hypgeom_gamma_upper(arb_t res, const arb_t s, const arb_t z, int regularized, slong prec)Sets res to the upper incomplete gamma function if regularized is 0, to if regularized is 1, and to if regularized is 2. Wrapper of acb_hypgeom_gamma_upper.
void arb_hypgeom_gamma_upper_integration(arb_t res, const arb_t s, const arb_t z, int regularized, slong prec)Computes the upper incomplete gamma function (with the same meaning of regularized as arb_hypgeom_gamma_upper) from , using arb_hypgeom_u_integration. The result is finite only for . acb_hypgeom_gamma_upper uses it as a fallback for real arguments.
void _arb_hypgeom_gamma_upper_series(arb_ptr res, const arb_t s, arb_srcptr z, slong zlen, int regularized, slong n, slong prec)void arb_hypgeom_gamma_upper_series(arb_poly_t res, const arb_t s, const arb_poly_t z, int regularized, slong n, slong prec)Sets res to the upper incomplete gamma function of the constant and the power series , truncated to length . regularized has the same meaning as in arb_hypgeom_gamma_upper.
void arb_hypgeom_gamma_lower(arb_t res, const arb_t s, const arb_t z, int regularized, slong prec)Sets res to the lower incomplete gamma function if regularized is 0, to if regularized is 1, and to , which is entire in both variables, if regularized is 2. Wrapper of acb_hypgeom_gamma_lower.
void _arb_hypgeom_gamma_lower_series(arb_ptr res, const arb_t s, arb_srcptr z, slong zlen, int regularized, slong n, slong prec)void arb_hypgeom_gamma_lower_series(arb_poly_t res, const arb_t s, const arb_poly_t z, int regularized, slong n, slong prec)Sets res to the lower incomplete gamma function of the constant and the power series , truncated to length , with regularized as in arb_hypgeom_gamma_lower.
void arb_hypgeom_beta_lower(arb_t res, const arb_t a, const arb_t b, const arb_t z, int regularized, slong prec)Sets res to the incomplete beta function , or the regularized function if regularized is nonzero. The precise definition by analytic continuation is given for acb_hypgeom_beta_lower, of which this is a wrapper.
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 n, slong prec)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 n, slong prec)Sets res to (or if regularized is nonzero) for constants and the power series , truncated to length .
Exponential and trigonometric integrals#
void arb_hypgeom_expint(arb_t res, const arb_t s, const arb_t z, slong prec)Sets res to the generalized exponential integral . Wrapper of acb_hypgeom_expint.
void arb_hypgeom_ei(arb_t res, const arb_t z, slong prec)Sets res to the exponential integral (a principal value for ), defined for real . Wrapper of acb_hypgeom_ei.
void _arb_hypgeom_ei_series(arb_ptr res, arb_srcptr z, slong zlen, slong len, slong prec)void arb_hypgeom_ei_series(arb_poly_t res, const arb_poly_t z, slong len, slong prec)Sets res to the exponential integral of the power series , truncated to length len.
void arb_hypgeom_si(arb_t res, const arb_t z, slong prec)Sets res to the sine integral .
void _arb_hypgeom_si_series(arb_ptr res, arb_srcptr z, slong zlen, slong len, slong prec)void arb_hypgeom_si_series(arb_poly_t res, const arb_poly_t z, slong len, slong prec)Sets res to the sine integral of the power series , truncated to length len.
void arb_hypgeom_ci(arb_t res, const arb_t z, slong prec)Sets res to the cosine integral for . The result is indeterminate unless is positive, since the value is complex for .
void _arb_hypgeom_ci_series(arb_ptr res, arb_srcptr z, slong zlen, slong len, slong prec)void arb_hypgeom_ci_series(arb_poly_t res, const arb_poly_t z, slong len, slong prec)Sets res to the cosine integral of the power series , truncated to length len.
void arb_hypgeom_shi(arb_t res, const arb_t z, slong prec)Sets res to the hyperbolic sine integral . Wrapper of acb_hypgeom_shi.
void _arb_hypgeom_shi_series(arb_ptr res, arb_srcptr z, slong zlen, slong len, slong prec)void arb_hypgeom_shi_series(arb_poly_t res, const arb_poly_t z, slong len, slong prec)Sets res to the hyperbolic sine integral of the power series , truncated to length len.
void arb_hypgeom_chi(arb_t res, const arb_t z, slong prec)Sets res to the hyperbolic cosine integral for . The result is indeterminate unless is positive. Wrapper of acb_hypgeom_chi.
void _arb_hypgeom_chi_series(arb_ptr res, arb_srcptr z, slong zlen, slong len, slong prec)void arb_hypgeom_chi_series(arb_poly_t res, const arb_poly_t z, slong len, slong prec)Sets res to the hyperbolic cosine integral of the power series , truncated to length len.
void arb_hypgeom_li(arb_t res, const arb_t z, int offset, slong prec)Sets res to the logarithmic integral if offset is zero, or the offset logarithmic integral if offset is nonzero, for . The result is indeterminate unless is nonnegative. Wrapper of acb_hypgeom_li.
void _arb_hypgeom_li_series(arb_ptr res, arb_srcptr z, slong zlen, int offset, slong len, slong prec)void arb_hypgeom_li_series(arb_poly_t res, const arb_poly_t z, int offset, slong len, slong prec)Sets res to the logarithmic integral (the offset version if offset is nonzero) of the power series , truncated to length len.
Bessel functions#
void arb_hypgeom_bessel_j(arb_t res, const arb_t nu, const arb_t z, slong prec)void arb_hypgeom_bessel_y(arb_t res, const arb_t nu, const arb_t z, slong prec)Sets res to the Bessel function of the first kind or of the second kind . Wrappers of acb_hypgeom_bessel_j and acb_hypgeom_bessel_y; the result is indeterminate where the value is not real, for example with .
Sets res1 to and res2 to , computed together, which is faster than two separate calls. Wrapper of acb_hypgeom_bessel_jy.
void arb_hypgeom_bessel_i(arb_t res, const arb_t nu, const arb_t z, slong prec)void arb_hypgeom_bessel_i_scaled(arb_t res, const arb_t nu, const arb_t z, slong prec)Sets res to the modified Bessel function of the first kind , or to the scaled function , which does not overflow for large . Wrappers of acb_hypgeom_bessel_i and acb_hypgeom_bessel_i_scaled.
void arb_hypgeom_bessel_k(arb_t res, const arb_t nu, const arb_t z, slong prec)void arb_hypgeom_bessel_k_scaled(arb_t res, const arb_t nu, const arb_t z, slong prec)Sets res to the modified Bessel function of the second kind , or to the scaled function , which does not underflow for large . Wrappers of acb_hypgeom_bessel_k and acb_hypgeom_bessel_k_scaled.
void arb_hypgeom_bessel_i_integration(arb_t res, const arb_t nu, const arb_t z, int scaled, slong prec)void arb_hypgeom_bessel_k_integration(arb_t res, const arb_t nu, const arb_t z, int scaled, slong prec)Computes or (multiplied by or if scaled is nonzero) by rigorous numerical integration of an integral representation. These functions are intended for large , where the series expansions are slow; acb_hypgeom_bessel_i and acb_hypgeom_bessel_k use them as fallbacks for real arguments.
void _arb_hypgeom_bessel_j_series(arb_ptr res, const arb_t nu, arb_srcptr z, slong zlen, slong len, slong prec)void arb_hypgeom_bessel_j_series(arb_poly_t res, const arb_t nu, const arb_poly_t z, slong len, slong prec)Sets res to for the constant and the power series , truncated to length len.
Airy functions#
void arb_hypgeom_airy(arb_t ai, arb_t ai_prime, arb_t bi, arb_t bi_prime, const arb_t z, slong prec)Sets ai, ai_prime, bi, bi_prime to the Airy functions , , , . Any of the outputs may be NULL, and omitting outputs speeds up the evaluation. Wrapper of acb_hypgeom_airy.
Sets the vectors ai and bi to the Taylor coefficients of and at the point , truncated to length len. Either output may be NULL; must not alias the outputs.
void _arb_hypgeom_airy_series(arb_ptr ai, arb_ptr ai_prime, arb_ptr bi, arb_ptr bi_prime, arb_srcptr z, slong zlen, slong len, slong prec)void arb_hypgeom_airy_series(arb_poly_t ai, arb_poly_t ai_prime, arb_poly_t bi, arb_poly_t bi_prime, const arb_poly_t z, slong len, slong prec)Sets the outputs to the Airy functions and their derivatives evaluated at the power series , truncated to length len. Any of the outputs may be NULL.
void arb_hypgeom_airy_zero(arb_t a, arb_t a_prime, arb_t b, arb_t b_prime, const fmpz_t n, slong prec)Sets a, a_prime, b, b_prime to the -th real zero , , , of , , , respectively; any of them may be NULL. The zeros are negative and indexed by increasing magnitude starting with , as in the literature. An index raises an exception.
Coulomb wave functions#
void arb_hypgeom_coulomb(arb_t F, arb_t G, const arb_t l, const arb_t eta, const arb_t z, slong prec)Sets F and G to the regular and irregular Coulomb wave functions and . Either output may be NULL. An output is indeterminate if its complex value is not real. Wrapper of acb_hypgeom_coulomb, which gives the definitions.
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)Sets the vectors F and G to the Taylor coefficients of the Coulomb wave functions at the point , truncated to length len. Either output may be NULL.
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)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)Sets F and G to the Coulomb wave functions evaluated at the power series , truncated to length len. Either output may be NULL.
Orthogonal polynomials and functions#
void arb_hypgeom_chebyshev_t(arb_t res, const arb_t nu, const arb_t z, slong prec)void arb_hypgeom_chebyshev_u(arb_t res, const arb_t nu, const arb_t z, slong prec)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)void arb_hypgeom_hermite_h(arb_t res, const arb_t nu, const arb_t z, slong prec)Sets res to the Chebyshev polynomial or , the Jacobi polynomial , the Gegenbauer polynomial , the Laguerre polynomial or the Hermite polynomial , or their extensions to non-integer degree. Wrappers of the functions of the same name in acb_hypgeom, which give the definitions.
void arb_hypgeom_legendre_p(arb_t res, const arb_t n, const arb_t m, const arb_t z, int type, slong prec)void arb_hypgeom_legendre_q(arb_t res, const arb_t n, const arb_t m, const arb_t z, int type, slong prec)Sets res to the associated Legendre function of the first kind or of the second kind , with the branch cut convention selected by type (0 or 1) as described for acb_hypgeom_legendre_p and acb_hypgeom_legendre_q. For and a nonnegative integer , arb_hypgeom_legendre_p calls arb_hypgeom_legendre_p_ui; otherwise both functions wrap the complex versions.
void arb_hypgeom_legendre_p_ui_zero(arb_t res, arb_t res_prime, ulong n, const arb_t x, slong K, slong prec)void arb_hypgeom_legendre_p_ui_one(arb_t res, arb_t res_prime, ulong n, const arb_t x, slong K, slong prec)void arb_hypgeom_legendre_p_ui_asymp(arb_t res, arb_t res_prime, ulong n, const arb_t x, slong K, slong prec)Sets res to the Legendre polynomial and res_prime to its derivative . Either output may be NULL.
Sets res to the -th root of the Legendre polynomial , with the roots in decreasing order , and, if weight is not NULL, sets weight to the corresponding weight of Gauss–Legendre quadrature on . Requires . See Roots of Legendre polynomials and Gauss–Legendre nodes.
Dilogarithm#
void arb_hypgeom_dilog(arb_t res, const arb_t z, slong prec)Sets res to the dilogarithm for ; the result is indeterminate for , where the value is complex. Wrapper of acb_hypgeom_dilog.
Hypergeometric sums#
These functions sum a finite number of terms of a hypergeometric series with rational parameters and a real ball argument. They are the building blocks of several real functions (sine and cosine integrals, error functions, incomplete gamma functions) and are useful on their own for constants and functions given by such series. No truncation error is added: the caller chooses and bounds the tail. See Hypergeometric sums with rational parameters and Sums of hypergeometric series with rational parameters.
void arb_hypgeom_sum_fmpq_arb_forward(arb_t res, const fmpq * a, slong alen, const fmpq * b, slong blen, const arb_t z, int reciprocal, slong N, slong prec)void arb_hypgeom_sum_fmpq_arb_rs(arb_t res, const fmpq * a, slong alen, const fmpq * b, slong blen, const arb_t z, int reciprocal, slong N, slong prec)void arb_hypgeom_sum_fmpq_arb_bs(arb_t res, const fmpq * a, slong alen, const fmpq * b, slong blen, const arb_t z, int reciprocal, slong N, slong prec)void arb_hypgeom_sum_fmpq_arb(arb_t res, const fmpq * a, slong alen, const fmpq * b, slong blen, const arb_t z, int reciprocal, slong N, slong prec)Sets res to the finite sum with rational parameters and , where , or if reciprocal is nonzero. There is no implicit : include for the usual normalisation.
void arb_hypgeom_sum_fmpq_imag_arb_forward(arb_t res1, arb_t res2, const fmpq * a, slong alen, const fmpq * b, slong blen, const arb_t z, int reciprocal, slong N, slong prec)void arb_hypgeom_sum_fmpq_imag_arb_rs(arb_t res1, arb_t res2, const fmpq * a, slong alen, const fmpq * b, slong blen, const arb_t z, int reciprocal, slong N, slong prec)void arb_hypgeom_sum_fmpq_imag_arb_bs(arb_t res1, arb_t res2, const fmpq * a, slong alen, const fmpq * b, slong blen, const arb_t z, int reciprocal, slong N, slong prec)void arb_hypgeom_sum_fmpq_imag_arb(arb_t res1, arb_t res2, const fmpq * a, slong alen, const fmpq * b, slong blen, const arb_t z, int reciprocal, slong N, slong prec)Sets res1 and res2 to the real and imaginary parts of the finite sum with , or if reciprocal is nonzero, using only real arithmetic.
Internal functions#
void _arb_hypgeom_rising_coeffs_1(ulong * c, ulong k, slong n)void _arb_hypgeom_rising_coeffs_2(ulong * c, ulong k, slong n)void _arb_hypgeom_rising_coeffs_fmpz(fmpz * c, ulong k, slong n)Sets to the coefficients of the monic polynomial (the leading 1 is not stored). Requires and raises an exception otherwise.
Morevoid _arb_hypgeom_gamma_stirling_term_bounds(slong * bound, const mag_t zinv, slong N)For , sets bound[n] to an exponent such that the -th term of the Stirling series is at most , given an upper bound zinv for . Does not check for overflow or underflow of the exponents.
The number of entries (536) of the table of Taylor coefficients of and their precision in bits (3456).
Describes one tabulated coefficient: its exponent (exp), its position in the limb table (tab_pos), its number of limbs (nlimbs) and its sign (negative).
The table arb_hypgeom_gamma_coeff_t arb_hypgeom_gamma_coeffs[ARB_HYPGEOM_GAMMA_TAB_NUM] describing the Taylor coefficients of , used by arb_hypgeom_gamma_taylor and acb_hypgeom_gamma_taylor.
int _arb_hypgeom_gamma_coeff_shallow(arf_t c, mag_t err, slong i, slong prec)Sets c to a shallow copy of the tabulated coefficient of , ARB_HYPGEOM_GAMMA_TAB_NUM, truncated to prec bits (rounded up to whole limbs), and err (if not NULL) to a bound for the truncation error. Returns 0, without setting anything, if prec exceeds the precision of the table and 1 otherwise. c points into static data and must not be modified or cleared; is not checked.
void _arb_hypgeom_gamma_lower_sum_rs_1(arb_t res, ulong p, ulong q, const arb_t z, slong N, slong prec)Sets res to with , computed by rectangular splitting. Requires that fits in a word. Used for the error function.
void _arb_hypgeom_gamma_upper_sum_rs_1(arb_t res, ulong p, ulong q, const arb_t z, slong N, slong prec)Sets res to with , computed by rectangular splitting. Requires that fits in a word. Used for the asymptotic expansion of the error function.
slong _arb_hypgeom_gamma_upper_fmpq_inf_choose_N(mag_t err, const fmpq_t a, const arb_t z, const mag_t abs_tol)Returns a number of terms of the asymptotic series of at infinity that gives an absolute error at most abs_tol, and sets err to a bound for the truncation error. Returns if the tolerance cannot be reached. Assumes .
void _arb_hypgeom_gamma_upper_fmpq_inf_bsplit(arb_t res, const fmpq_t a, const arb_t z, slong N, slong prec)Sets res to the asymptotic series of at infinity, including the prefactor , truncated before the term of index and computed by binary splitting. The truncation error is not included.
slong _arb_hypgeom_gamma_lower_fmpq_0_choose_N(mag_t err, const fmpq_t a, const arb_t z, const mag_t abs_tol)Returns a number of terms of the Taylor series of at zero that gives an absolute error at most abs_tol, and sets err to a bound for the truncation error. Assumes .
void _arb_hypgeom_gamma_lower_fmpq_0_bsplit(arb_t res, const fmpq_t a, const arb_t z, slong N, slong prec)Sets res to the series truncated before the term of index and computed by binary splitting. The truncation error is not included.
slong _arb_hypgeom_gamma_upper_singular_si_choose_N(mag_t err, slong n, const arb_t z, const mag_t abs_tol)Returns a number of terms of the series at zero of , for an integer , that gives an absolute error at most abs_tol, and sets err to a bound for the truncation error.
void _arb_hypgeom_gamma_upper_singular_si_bsplit(arb_t res, slong n, const arb_t z, slong N, slong prec)Sets res to the series at zero of , for an integer , truncated before the term of index and computed by binary splitting. The truncation error is not included.
The following functions compute jets (truncated power series in of length len) for rational , and are used by acb_dirichlet_l_fmpq_afe_jet. The choose_N functions set err to a bound for the truncation error which is valid simultaneously for every coefficient of the jet; this bound is computed from majorant series for the differentiated terms of the corresponding scalar series. With len = 1, they reduce to the corresponding scalar functions. Where a parameter logz (or logz0) appears, it may be passed an enclosure of to avoid recomputing it, or NULL.
void _arb_hypgeom_gamma_fmpq_jet(arb_ptr res, const fmpq_t a, slong len, slong prec)Sets res to the jet of for rational which is not a nonpositive integer, computed as with an integer at precision , as in arb_hypgeom_gamma_fmpq: the lower series at and the asymptotic series at (at reduced precision, since is small) are both evaluated by binary splitting. If the asymptotic series does not converge to the required accuracy (at low precision or for large ), is increased until it does, or until the second term is negligible. With len = 1, this calls arb_gamma_fmpq.
slong _arb_hypgeom_gamma_upper_fmpq_inf_choose_N_jet(mag_t err, const fmpq_t a, const arb_t z, const mag_t abs_tol, slong len)void _arb_hypgeom_gamma_upper_fmpq_inf_bsplit_jet(arb_ptr res, const fmpq_t a, const arb_t z, const arb_t logz, slong N, slong len, slong prec)Jet versions of _arb_hypgeom_gamma_upper_fmpq_inf_choose_N and _arb_hypgeom_gamma_upper_fmpq_inf_bsplit. The truncation error is bounded using majorants for the polynomial factor and for . The choose_N function requires (otherwise it returns ).
slong _arb_hypgeom_gamma_lower_fmpq_0_choose_N_jet(mag_t err, const fmpq_t a, const arb_t z, const mag_t abs_tol, slong len)void _arb_hypgeom_gamma_lower_fmpq_0_bsplit_jet(arb_ptr res, const fmpq_t a, const arb_t z, const arb_t logz, slong N, slong len, slong prec)Jet versions of _arb_hypgeom_gamma_lower_fmpq_0_choose_N and _arb_hypgeom_gamma_lower_fmpq_0_bsplit.
slong _arb_hypgeom_gamma_upper_singular_si_choose_N_jet(mag_t err, slong n, const arb_t z, const mag_t abs_tol, slong len)void _arb_hypgeom_gamma_upper_singular_si_bsplit_jet(arb_ptr res, slong n, const arb_t z, const arb_t logz, slong N, arb_srcptr gamma1, slong len, slong prec)Jet versions of _arb_hypgeom_gamma_upper_singular_si_choose_N and _arb_hypgeom_gamma_upper_singular_si_bsplit, computing the jet of for an integer . This uses
If gamma1 is not NULL, it should contain the jet of of length len + 1; otherwise this is computed internally.
void _arb_gamma_upper_fmpq_step_bsplit_jet(arb_ptr Gz1, const fmpq_t a, const arb_t z0, const arb_t logz0, const arb_t z1, arb_srcptr Gz0, const arb_t expmz0, const mag_t abs_tol, slong len, slong prec)Jet version of _arb_gamma_upper_fmpq_step_bsplit: given the jet Gz0 of and expmz0 containing , sets Gz1 to the jet of . The matrix binary splitting is done with power series entries. The truncation error is bounded using Cauchy estimates on a circle of radius around , with an extra factor where bounds on the circle; the radius is chosen with this factor taken into account.
void _arb_gamma_upper_fmpq_step_bsplit(arb_t Gz1, const fmpq_t a, const arb_t z0, const arb_t z1, const arb_t Gz0, const arb_t expmz0, const mag_t abs_tol, slong prec)Given Gz0 and expmz0 containing and , sets Gz1 to , computed from the Taylor series at by binary splitting with an absolute truncation error at most abs_tol (included in the output). Assumes . This is one step of the bit-burst algorithm.
int arb_hypgeom_erf_bb(arb_t res, const arb_t z, int complementary, slong prec)Attempts to compute , or if complementary is nonzero, with the bit-burst algorithm applied to . Returns 1 on success. Returns 0 without changing res if is not finite, if or if .
void _arb_hypgeom_si_asymp(arb_t res, const arb_t z, slong N, slong prec)Compute with terms of the asymptotic expansion, or of the series summed at working precision wp and rounded to prec, including a bound for the truncation error. These are the two methods of arb_hypgeom_si.
void _arb_hypgeom_ci_asymp(arb_t res, const arb_t z, slong N, slong prec)Compute with terms of the asymptotic expansion or of the series, including a bound for the truncation error. These are the two methods of arb_hypgeom_ci.
void arb_hypgeom_legendre_p_ui_deriv_bound(mag_t dp, mag_t dp2, ulong n, const arb_t x, const arb_t x2sub1)Sets dp to an upper bound for and dp2 to an upper bound for , for representing real numbers with , given the precomputed x2sub1 (or ). Used to bound the propagated error in arb_hypgeom_legendre_p_ui.
References#
- [NIST2012] National Institute of Standards and Technology, Digital Library of Mathematical Functions (2012), https://dlmf.nist.gov/
The FLINT team, “arb_hypgeom.h (module overview),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arb_hypgeom/index.html (generated 2026-11-02).
@misc{flint-doc-arb-hypgeom-index,
author = {{The FLINT team}},
title = {{arb\_hypgeom.h (module overview)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/arb_hypgeom/index.html},
note = {Generated 2026-11-02}
}