Flint2-0.1.0.5: Haskell bindings for the flint library for number theory
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Number.Flint.Arb.Hypgeom

Description

See Data.Number.Flint.Acb.Hypgeom for the general implementation of hypergeometric functions.

For convenience, this module provides versions of the same functions for real variables represented using Arb and ArbPoly. Most methods are simple wrappers around the complex versions, but some of the functions in this module have been further optimized specifically for real variables.

This module also provides certain functions exclusive to real variables, such as functions for computing real roots of common special functions.

Synopsis

Hypergeometric functions of real variables

Rising factorials

_arb_hypgeom_rising_coeffs_1 :: Ptr CULong -> CULong -> CLong -> IO () Source #

_arb_hypgeom_rising_coeffs_1 c k n

_arb_hypgeom_rising_coeffs_2 :: Ptr CULong -> CULong -> CLong -> IO () Source #

_arb_hypgeom_rising_coeffs_2 c k n

_arb_hypgeom_rising_coeffs_fmpz :: Ptr CFmpz -> CULong -> CLong -> IO () Source #

_arb_hypgeom_rising_coeffs_fmpz c k n

Sets c to the coefficients of the rising factorial polynomial \((X+k)_n\). The 1 and 2 versions respectively compute single-word and double-word coefficients, without checking for overflow, while the fmpz version allows arbitrarily large coefficients. These functions are mostly intended for internal use; the fmpz version does not use an asymptotically fast algorithm. The degree n must be at least 2.

arb_hypgeom_rising_ui_forward :: Ptr CArb -> Ptr CArb -> CULong -> CLong -> IO () Source #

arb_hypgeom_rising_ui_forward res x n prec

arb_hypgeom_rising_ui_bs :: Ptr CArb -> Ptr CArb -> CULong -> CLong -> IO () Source #

arb_hypgeom_rising_ui_bs res x n prec

arb_hypgeom_rising_ui_rs :: Ptr CArb -> Ptr CArb -> CULong -> CULong -> CLong -> IO () Source #

arb_hypgeom_rising_ui_rs res x n m prec

arb_hypgeom_rising_ui_rec :: Ptr CArb -> Ptr CArb -> CULong -> CLong -> IO () Source #

arb_hypgeom_rising_ui_rec res x n prec

arb_hypgeom_rising_ui :: Ptr CArb -> Ptr CArb -> CULong -> CLong -> IO () Source #

arb_hypgeom_rising_ui res x n prec

arb_hypgeom_rising :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_rising res x n prec

Computes the rising factorial \((x)_n\).

The forward version uses the forward recurrence. The bs version uses binary splitting. The rs version uses rectangular splitting. It takes an extra tuning parameter m which can be set to zero to choose automatically. The rec version chooses an algorithm automatically, avoiding use of the gamma function (so that it can be used in the computation of the gamma function). The default versions (rising_ui and rising_ui) choose an algorithm automatically and may additionally fall back on the gamma function.

arb_hypgeom_rising_ui_jet_powsum :: Ptr CArb -> Ptr CArb -> CULong -> CLong -> CLong -> IO () Source #

arb_hypgeom_rising_ui_jet_powsum res x n len prec

arb_hypgeom_rising_ui_jet_bs :: Ptr CArb -> Ptr CArb -> CULong -> CLong -> CLong -> IO () Source #

arb_hypgeom_rising_ui_jet_bs res x n len prec

arb_hypgeom_rising_ui_jet_rs :: Ptr CArb -> Ptr CArb -> CULong -> CULong -> CLong -> CLong -> IO () Source #

arb_hypgeom_rising_ui_jet_rs res x n m len prec

arb_hypgeom_rising_ui_jet :: Ptr CArb -> Ptr CArb -> CULong -> CLong -> CLong -> IO () Source #

arb_hypgeom_rising_ui_jet res x n len prec

Computes the jet of the rising factorial \((x)_n\), truncated to length len. In other words, constructs the polynomial \((X + x)_n \in \mathbb{R}[X]\), truncated if \(\operatorname{len} < n + 1\) (and zero-extended if \(\operatorname{len} > n + 1\)).

The powsum version computes the sequence of powers of x and forms integral linear combinations of these. The bs version uses binary splitting. The rs version uses rectangular splitting. It takes an extra tuning parameter m which can be set to zero to choose automatically. The default version chooses an algorithm automatically.

Gamma function

_arb_hypgeom_gamma_stirling_term_bounds :: Ptr CLong -> Ptr CMag -> CLong -> IO () Source #

_arb_hypgeom_gamma_stirling_term_bounds bound zinv N

For \(1 \le n < N\), sets bound to an exponent bounding the n-th term in the Stirling series for the gamma function, given a precomputed upper bound for \(|z|^{-1}\). This function is intended for internal use and does not check for underflow or underflow in the exponents.

arb_hypgeom_gamma_stirling_sum_horner :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> IO () Source #

arb_hypgeom_gamma_stirling_sum_horner res z N prec

arb_hypgeom_gamma_stirling_sum_improved :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

arb_hypgeom_gamma_stirling_sum_improved res z N K prec

Sets res to the final sum in the Stirling series for the gamma function truncated before the term with index N, i.e. computes \(\sum_{n=1}^{N-1} B_{2n} / (2n(2n-1) z^{2n-1})\). The horner version uses Horner scheme with gradual precision adjustments. The improved version uses rectangular splitting for the low-index terms and reexpands the high-index terms as hypergeometric polynomials, using a splitting parameter K (which can be set to 0 to use a default value).

arb_hypgeom_gamma_stirling :: Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_gamma_stirling res x reciprocal prec

Sets res to the gamma function of x computed using the Stirling series together with argument reduction. If reciprocal is set, the reciprocal gamma function is computed instead.

arb_hypgeom_gamma_taylor :: Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO CInt Source #

arb_hypgeom_gamma_taylor res x reciprocal prec

Attempts to compute the gamma function of x using Taylor series together with argument reduction. This is only supported if x and prec are both small enough. If successful, returns 1; otherwise, does nothing and returns 0. If reciprocal is set, the reciprocal gamma function is computed instead.

arb_hypgeom_gamma :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_gamma res x prec

arb_hypgeom_gamma_fmpq :: Ptr CArb -> Ptr CFmpq -> CLong -> IO () Source #

arb_hypgeom_gamma_fmpq res x prec

arb_hypgeom_gamma_fmpz :: Ptr CArb -> Ptr CFmpz -> CLong -> IO () Source #

arb_hypgeom_gamma_fmpz res x prec

Sets res to the gamma function of x computed using a default algorithm choice.

arb_hypgeom_rgamma :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_rgamma res x prec

Sets res to the reciprocal gamma function of x computed using a default algorithm choice.

arb_hypgeom_lgamma :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_lgamma res x prec

Sets res to the log-gamma function of x computed using a default algorithm choice.

Binomial coefficients

arb_hypgeom_central_bin_ui :: Ptr CArb -> CULong -> CLong -> IO () Source #

arb_hypgeom_central_bin_ui res n prec

Computes the central binomial coefficient \({2n \choose n}\).

Generalized hypergeometric function

arb_hypgeom_pfq :: Ptr CArb -> Ptr CArb -> CLong -> Ptr CArb -> CLong -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_pfq res a p b q z regularized prec

Computes the generalized hypergeometric function \({}_pF_{q}(z)\), or the regularized version if regularized is set.

Confluent hypergeometric functions

arb_hypgeom_0f1 :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_0f1 res a z regularized prec

Computes the confluent hypergeometric limit function \({}_0F_1(a,z)\), or \(\frac{1}{\Gamma(a)} {}_0F_1(a,z)\) if regularized is set.

arb_hypgeom_m :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_m res a b z regularized prec

Computes the confluent hypergeometric function \(M(a,b,z) = {}_1F_1(a,b,z)\), or \(\mathbf{M}(a,b,z) = \frac{1}{\Gamma(b)} {}_1F_1(a,b,z)\) if regularized is set.

arb_hypgeom_1f1 :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_1f1 res a b z regularized prec

Alias for arb_hypgeom_m.

arb_hypgeom_1f1_integration :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_1f1_integration res a b z regularized prec

Computes the confluent hypergeometric function using numerical integration of the representation

\[`\] \[{}_1F_1(a,b,z) = \frac{\Gamma(b)}{\Gamma(a) \Gamma(b-a)} \int_0^1 e^{zt} t^{a-1} (1-t)^{b-a-1} dt.\]

This algorithm can be useful if the parameters are large. This will currently only return a finite enclosure if \(a \ge 1\) and \(b - a \ge 1\).

arb_hypgeom_u :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_u res a b z prec

Computes the confluent hypergeometric function \(U(a,b,z)\).

arb_hypgeom_u_integration :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_u_integration res a b z regularized prec

Computes the confluent hypergeometric function \(U(a,b,z)\) using numerical integration of the representation

\[`\] \[U(a,b,z) = \frac{1}{\Gamma(a)} \int_0^{\infty} e^{-zt} t^{a-1} (1+t)^{b-a-1} dt.\]

This algorithm can be useful if the parameters are large. This will currently only return a finite enclosure if \(a \ge 1\) and \(z > 0\).

Gauss hypergeometric function

arb_hypgeom_2f1 :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_2f1 res a b c z regularized prec

Computes the Gauss hypergeometric function \({}_2F_1(a,b,c,z)\), or \(\mathbf{F}(a,b,c,z) = \frac{1}{\Gamma(c)} {}_2F_1(a,b,c,z)\) if regularized is set.

Additional evaluation flags can be passed via the regularized argument; see acb_hypgeom_2f1 for documentation.

arb_hypgeom_2f1_integration :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_2f1_integration res a b z regularized prec

Computes the Gauss hypergeometric function using numerical integration of the representation

\[`\] \[{}_2F_1(a,b,c,z) = \frac{\Gamma(a)}{\Gamma(b) \Gamma(c-b)} \int_0^1 t^{b-1} (1-t)^{c-b-1} (1-zt)^{-a} dt.\]

This algorithm can be useful if the parameters are large. This will currently only return a finite enclosure if \(b \ge 1\) and \(c - b \ge 1\) and \(z < 1\), possibly with a and b exchanged.

Error functions and Fresnel integrals

arb_hypgeom_erf :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_erf res z prec

Computes the error function \(\operatorname{erf}(z)\).

_arb_hypgeom_erf_series :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_erf_series res z zlen len prec

arb_hypgeom_erf_series :: Ptr CArbPoly -> Ptr CArbPoly -> CLong -> CLong -> IO () Source #

arb_hypgeom_erf_series res z len prec

Computes the error function of the power series z, truncated to length len.

arb_hypgeom_erfc :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_erfc res z prec

Computes the complementary error function \(\operatorname{erfc}(z) = 1 - \operatorname{erf}(z)\). This function avoids catastrophic cancellation for large positive z.

_arb_hypgeom_erfc_series :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_erfc_series res z zlen len prec

arb_hypgeom_erfc_series :: Ptr CArbPoly -> Ptr CArbPoly -> CLong -> CLong -> IO () Source #

arb_hypgeom_erfc_series res z len prec

Computes the complementary error function of the power series z, truncated to length len.

arb_hypgeom_erfi :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_erfi res z prec

Computes the imaginary error function \(\operatorname{erfi}(z) = -i\operatorname{erf}(iz)\).

_arb_hypgeom_erfi_series :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_erfi_series res z zlen len prec

arb_hypgeom_erfi_series :: Ptr CArbPoly -> Ptr CArbPoly -> CLong -> CLong -> IO () Source #

arb_hypgeom_erfi_series res z len prec

Computes the imaginary error function of the power series z, truncated to length len.

arb_hypgeom_erfinv :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_erfinv res z prec

arb_hypgeom_erfcinv :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_erfcinv res z prec

Computes the inverse error function \(\operatorname{erf}^{-1}(z)\) or inverse complementary error function \(\operatorname{erfc}^{-1}(z)\).

arb_hypgeom_fresnel :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_fresnel res1 res2 z normalized prec

Sets res1 to the Fresnel sine integral \(S(z)\) and res2 to the Fresnel cosine integral \(C(z)\). Optionally, just a single function can be computed by passing NULL as the other output variable. The definition \(S(z) = \int_0^z \sin(t^2) dt\) is used if normalized is 0, and \(S(z) = \int_0^z \sin(\tfrac{1}{2} \pi t^2) dt\) is used if normalized is 1 (the latter is the Abramowitz & Stegun convention). \(C(z)\) is defined analogously.

_arb_hypgeom_fresnel_series :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> CInt -> CLong -> CLong -> IO () Source #

_arb_hypgeom_fresnel_series res1 res2 z zlen normalized len prec

arb_hypgeom_fresnel_series :: Ptr CArbPoly -> Ptr CArbPoly -> Ptr CArbPoly -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_fresnel_series res1 res2 z normalized len prec

Sets res1 to the Fresnel sine integral and res2 to the Fresnel cosine integral of the power series z, truncated to length len. Optionally, just a single function can be computed by passing NULL as the other output variable.

Incomplete gamma and beta functions

arb_hypgeom_gamma_upper :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_gamma_upper res s z regularized prec

If regularized is 0, computes the upper incomplete gamma function \(\Gamma(s,z)\).

If regularized is 1, computes the regularized upper incomplete gamma function \(Q(s,z) = \Gamma(s,z) / \Gamma(s)\).

If regularized is 2, computes the generalized exponential integral \(z^{-s} \Gamma(s,z) = E_{1-s}(z)\) instead (this option is mainly intended for internal use; arb_hypgeom_expint is the intended interface for computing the exponential integral).

arb_hypgeom_gamma_upper_integration :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_gamma_upper_integration res s z regularized prec

Computes the upper incomplete gamma function using numerical integration.

_arb_hypgeom_gamma_upper_series :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> CInt -> CLong -> CLong -> IO () Source #

_arb_hypgeom_gamma_upper_series res s z zlen regularized n prec

arb_hypgeom_gamma_upper_series :: Ptr CArbPoly -> Ptr CArb -> Ptr CArbPoly -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_gamma_upper_series res s z regularized n prec

Sets res to an upper incomplete gamma function where s is a constant and z is a power series, truncated to length n. The regularized argument has the same interpretation as in arb_hypgeom_gamma_upper.

arb_hypgeom_gamma_lower :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_gamma_lower res s z regularized prec

If regularized is 0, computes the lower incomplete gamma function \(\gamma(s,z) = \frac{z^s}{s} {}_1F_1(s, s+1, -z)\).

If regularized is 1, computes the regularized lower incomplete gamma function \(P(s,z) = \gamma(s,z) / \Gamma(s)\).

If regularized is 2, computes a further regularized lower incomplete gamma function \(\gamma^{*}(s,z) = z^{-s} P(s,z)\).

_arb_hypgeom_gamma_lower_series :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> CInt -> CLong -> CLong -> IO () Source #

_arb_hypgeom_gamma_lower_series res s z zlen regularized n prec

arb_hypgeom_gamma_lower_series :: Ptr CArbPoly -> Ptr CArb -> Ptr CArbPoly -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_gamma_lower_series res s z regularized n prec

Sets res to an lower incomplete gamma function where s is a constant and z is a power series, truncated to length n. The regularized argument has the same interpretation as in arb_hypgeom_gamma_lower.

arb_hypgeom_beta_lower :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_beta_lower res a b z regularized prec

Computes the (lower) incomplete beta function, defined by \(B(a,b;z) = \int_0^z t^{a-1} (1-t)^{b-1}\), optionally the regularized incomplete beta function \(I(a,b;z) = B(a,b;z) / B(a,b;1)\).

_arb_hypgeom_beta_lower_series :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> CInt -> CLong -> CLong -> IO () Source #

_arb_hypgeom_beta_lower_series res a b z zlen regularized n prec

arb_hypgeom_beta_lower_series :: Ptr CArbPoly -> Ptr CArb -> Ptr CArb -> Ptr CArbPoly -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_beta_lower_series res a b z regularized n prec

Sets res to the lower incomplete beta function \(B(a,b;z)\) (optionally the regularized version \(I(a,b;z)\)) where a and b are constants and z is a power series, truncating the result to length n. The underscore method requires positive lengths and does not support aliasing.

Internal evaluation functions

_arb_hypgeom_gamma_lower_sum_rs_1 :: Ptr CArb -> CULong -> CULong -> Ptr CArb -> CLong -> CLong -> IO () Source #

_arb_hypgeom_gamma_lower_sum_rs_1 res p q z N prec

Computes \(\sum_{k=0}^{N-1} z^k / (a)_k\) where \(a = p/q\) using rectangular splitting. It is assumed that \(p + qN\) fits in a limb.

_arb_hypgeom_gamma_upper_sum_rs_1 :: Ptr CArb -> CULong -> CULong -> Ptr CArb -> CLong -> CLong -> IO () Source #

_arb_hypgeom_gamma_upper_sum_rs_1 res p q z N prec

Computes \(\sum_{k=0}^{N-1} (a)_k / z^k\) where \(a = p/q\) using rectangular splitting. It is assumed that \(p + qN\) fits in a limb.

_arb_hypgeom_gamma_upper_fmpq_inf_choose_N :: Ptr CMag -> Ptr CFmpq -> Ptr CArb -> Ptr CMag -> IO CLong Source #

_arb_hypgeom_gamma_upper_fmpq_inf_choose_N err a z abs_tol

Returns number of terms N and sets err to the truncation error for evaluating \(\Gamma(a,z)\) using the asymptotic series at infinity, targeting an absolute tolerance of abs_tol. The error may be set to err if the tolerance cannot be achieved. Assumes that z is positive.

_arb_hypgeom_gamma_upper_fmpq_inf_bsplit :: Ptr CArb -> Ptr CFmpq -> Ptr CArb -> CLong -> CLong -> IO () Source #

_arb_hypgeom_gamma_upper_fmpq_inf_bsplit res a z N prec

Sets res to the approximation of \(\Gamma(a,z)\) obtained by truncating the asymptotic series at infinity before term N. The truncation error bound has to be added separately.

_arb_hypgeom_gamma_lower_fmpq_0_choose_N :: Ptr CMag -> Ptr CFmpq -> Ptr CArb -> Ptr CMag -> IO CLong Source #

_arb_hypgeom_gamma_lower_fmpq_0_choose_N err a z abs_tol

Returns number of terms N and sets err to the truncation error for evaluating \(\gamma(a,z)\) using the Taylor series at zero, targeting an absolute tolerance of abs_tol. Assumes that z is positive.

_arb_hypgeom_gamma_lower_fmpq_0_bsplit :: Ptr CArb -> Ptr CFmpq -> Ptr CArb -> CLong -> CLong -> IO () Source #

_arb_hypgeom_gamma_lower_fmpq_0_bsplit res a z N prec

Sets res to the approximation of \(\gamma(a,z)\) obtained by truncating the Taylor series at zero before term N. The truncation error bound has to be added separately.

_arb_hypgeom_gamma_upper_singular_si_choose_N :: Ptr CMag -> CLong -> Ptr CArb -> Ptr CMag -> IO CLong Source #

_arb_hypgeom_gamma_upper_singular_si_choose_N err n z abs_tol

Returns number of terms N and sets err to the truncation error for evaluating \(\Gamma(-n,z)\) using the Taylor series at zero, targeting an absolute tolerance of abs_tol.

_arb_hypgeom_gamma_upper_singular_si_bsplit :: Ptr CArb -> CLong -> Ptr CArb -> CLong -> CLong -> IO () Source #

_arb_hypgeom_gamma_upper_singular_si_bsplit res n z N prec

Sets res to the approximation of \(\Gamma(-n,z)\) obtained by truncating the Taylor series at zero before term N. The truncation error bound has to be added separately.

_arb_gamma_upper_fmpq_step_bsplit :: Ptr CArb -> Ptr CFmpq -> Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CMag -> CLong -> IO () Source #

_arb_gamma_upper_fmpq_step_bsplit Gz1 a z0 z1 Gz0 expmz0 abs_tol prec

Given Gz0 and expmz0 representing the values \(\Gamma(a,z_0)\) and \(\exp(-z_0)\), computes \(\Gamma(a,z_1)\) using the Taylor series at \(z_0\) evaluated using binary splitting, targeting an absolute error of abs_tol. Assumes that \(z_0\) and \(z_1\) are positive.

Exponential and trigonometric integrals

arb_hypgeom_expint :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_expint res s z prec

Computes the generalized exponential integral \(E_s(z)\).

arb_hypgeom_ei :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_ei res z prec

Computes the exponential integral \(\operatorname{Ei}(z)\).

_arb_hypgeom_ei_series :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_ei_series res z zlen len prec

arb_hypgeom_ei_series :: Ptr CArbPoly -> Ptr CArbPoly -> CLong -> CLong -> IO () Source #

arb_hypgeom_ei_series res z len prec

Computes the exponential integral of the power series z, truncated to length len.

_arb_hypgeom_si_asymp :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> IO () Source #

_arb_hypgeom_si_asymp res z N prec

_arb_hypgeom_si_1f2 :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_si_1f2 res z N wp prec

arb_hypgeom_si :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_si res z prec

Computes the sine integral \(\operatorname{Si}(z)\).

_arb_hypgeom_si_series :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_si_series res z zlen len prec

arb_hypgeom_si_series :: Ptr CArbPoly -> Ptr CArbPoly -> CLong -> CLong -> IO () Source #

arb_hypgeom_si_series res z len prec

Computes the sine integral of the power series z, truncated to length len.

_arb_hypgeom_ci_asymp :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> IO () Source #

_arb_hypgeom_ci_asymp res z N prec

_arb_hypgeom_ci_2f3 :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_ci_2f3 res z N wp prec

arb_hypgeom_ci :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_ci res z prec

Computes the cosine integral \(\operatorname{Ci}(z)\). The result is indeterminate if \(z < 0\) since the value of the function would be complex.

_arb_hypgeom_ci_series :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_ci_series res z zlen len prec

arb_hypgeom_ci_series :: Ptr CArbPoly -> Ptr CArbPoly -> CLong -> CLong -> IO () Source #

arb_hypgeom_ci_series res z len prec

Computes the cosine integral of the power series z, truncated to length len.

arb_hypgeom_shi :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_shi res z prec

Computes the hyperbolic sine integral \(\operatorname{Shi}(z) = -i \operatorname{Si}(iz)\).

_arb_hypgeom_shi_series :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_shi_series res z zlen len prec

arb_hypgeom_shi_series :: Ptr CArbPoly -> Ptr CArbPoly -> CLong -> CLong -> IO () Source #

arb_hypgeom_shi_series res z len prec

Computes the hyperbolic sine integral of the power series z, truncated to length len.

arb_hypgeom_chi :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_chi res z prec

Computes the hyperbolic cosine integral \(\operatorname{Chi}(z)\). The result is indeterminate if \(z < 0\) since the value of the function would be complex.

_arb_hypgeom_chi_series :: Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_chi_series res z zlen len prec

arb_hypgeom_chi_series :: Ptr CArbPoly -> Ptr CArbPoly -> CLong -> CLong -> IO () Source #

arb_hypgeom_chi_series res z len prec

Computes the hyperbolic cosine integral of the power series z, truncated to length len.

arb_hypgeom_li :: Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_li res z offset prec

If offset is zero, computes the logarithmic integral \(\operatorname{li}(z) = \operatorname{Ei}(\log(z))\).

If offset is nonzero, computes the offset logarithmic integral \(\operatorname{Li}(z) = \operatorname{li}(z) - \operatorname{li}(2)\).

The result is indeterminate if \(z < 0\) since the value of the function would be complex.

_arb_hypgeom_li_series :: Ptr CArb -> Ptr CArb -> CLong -> CInt -> CLong -> CLong -> IO () Source #

_arb_hypgeom_li_series res z zlen offset len prec

arb_hypgeom_li_series :: Ptr CArbPoly -> Ptr CArbPoly -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_li_series res z offset len prec

Computes the logarithmic integral (optionally the offset version) of the power series z, truncated to length len.

Bessel functions

arb_hypgeom_bessel_j :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_bessel_j res nu z prec

Computes the Bessel function of the first kind \(J_{\nu}(z)\).

arb_hypgeom_bessel_y :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_bessel_y res nu z prec

Computes the Bessel function of the second kind \(Y_{\nu}(z)\).

arb_hypgeom_bessel_jy :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_bessel_jy res1 res2 nu z prec

Sets res1 to \(J_{\nu}(z)\) and res2 to \(Y_{\nu}(z)\), computed simultaneously.

arb_hypgeom_bessel_i :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_bessel_i res nu z prec

Computes the modified Bessel function of the first kind \(I_{\nu}(z) = z^{\nu} (iz)^{-\nu} J_{\nu}(iz)\).

arb_hypgeom_bessel_i_scaled :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_bessel_i_scaled res nu z prec

Computes the function \(e^{-z} I_{\nu}(z)\).

arb_hypgeom_bessel_k :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_bessel_k res nu z prec

Computes the modified Bessel function of the second kind \(K_{\nu}(z)\).

arb_hypgeom_bessel_k_scaled :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_bessel_k_scaled res nu z prec

Computes the function \(e^{z} K_{\nu}(z)\).

arb_hypgeom_bessel_i_integration :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_bessel_i_integration res nu z scaled prec

arb_hypgeom_bessel_k_integration :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_bessel_k_integration res nu z scaled prec

Computes the modified Bessel functions using numerical integration.

Airy functions

arb_hypgeom_airy :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_airy ai ai_prime bi bi_prime z prec

Computes the Airy functions \((\operatorname{Ai}(z), \operatorname{Ai}'(z), \operatorname{Bi}(z), \operatorname{Bi}'(z))\) simultaneously. Any of the four function values can be omitted by passing NULL for the unwanted output variables, speeding up the evaluation.

arb_hypgeom_airy_jet :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> CLong -> IO () Source #

arb_hypgeom_airy_jet ai bi z len prec

Writes to ai and bi the respective Taylor expansions of the Airy functions at the point z, truncated to length len. Either of the outputs can be NULL to avoid computing that function. The variable z is not allowed to be aliased with the outputs. To simplify the implementation, this method does not compute the series expansions of the primed versions directly; these are easily obtained by computing one extra coefficient and differentiating the output with _arb_poly_derivative.

_arb_hypgeom_airy_series :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_airy_series ai ai_prime bi bi_prime z zlen len prec

arb_hypgeom_airy_series :: Ptr CArbPoly -> Ptr CArbPoly -> Ptr CArbPoly -> Ptr CArbPoly -> Ptr CArbPoly -> CLong -> CLong -> IO () Source #

arb_hypgeom_airy_series ai ai_prime bi bi_prime z len prec

Computes the Airy functions evaluated at the power series z, truncated to length len. As with the other Airy methods, any of the outputs can be NULL.

arb_hypgeom_airy_zero :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CFmpz -> CLong -> IO () Source #

arb_hypgeom_airy_zero a a_prime b b_prime n prec

Computes the n-th real zero \(a_n\), \(a'_n\), \(b_n\), or \(b'_n\) for the respective Airy function or Airy function derivative. Any combination of the four output variables can be NULL. The zeros are indexed by increasing magnitude, starting with \(n = 1\) to follow the convention in the literature. An index n that is not positive is invalid input. The implementation uses asymptotic expansions for the zeros [PS1991] together with the interval Newton method for refinement.

Coulomb wave functions

arb_hypgeom_coulomb :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_coulomb F G l eta z prec

Writes to F, G the values of the respective Coulomb wave functions \(F_{\ell}(\eta,z)\) and \(G_{\ell}(\eta,z)\). Either of the outputs can be NULL.

arb_hypgeom_coulomb_jet :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> CLong -> IO () Source #

arb_hypgeom_coulomb_jet F G l eta z len prec

Writes to F, G the respective Taylor expansions of the Coulomb wave functions at the point z, truncated to length len. Either of the outputs can be NULL.

_arb_hypgeom_coulomb_series :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> CLong -> CLong -> IO () Source #

_arb_hypgeom_coulomb_series F G l eta z zlen len prec

arb_hypgeom_coulomb_series :: Ptr CArbPoly -> Ptr CArbPoly -> Ptr CArb -> Ptr CArb -> Ptr CArbPoly -> CLong -> CLong -> IO () Source #

arb_hypgeom_coulomb_series F G l eta z len prec

Computes the Coulomb wave functions evaluated at the power series z, truncated to length len. Either of the outputs can be NULL.

Orthogonal polynomials and functions

arb_hypgeom_chebyshev_t :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_chebyshev_t res nu z prec

arb_hypgeom_chebyshev_u :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_chebyshev_u res nu z prec

arb_hypgeom_jacobi_p :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_jacobi_p res n a b z prec

arb_hypgeom_gegenbauer_c :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_gegenbauer_c res n m z prec

arb_hypgeom_laguerre_l :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_laguerre_l res n m z prec

arb_hypgeom_hermite_h :: Ptr CArb -> Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_hermite_h res nu z prec

Computes Chebyshev, Jacobi, Gegenbauer, Laguerre or Hermite polynomials, or their extensions to non-integer orders.

arb_hypgeom_legendre_p :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_legendre_p res n m z type prec

arb_hypgeom_legendre_q :: Ptr CArb -> Ptr CArb -> Ptr CArb -> Ptr CArb -> CInt -> CLong -> IO () Source #

arb_hypgeom_legendre_q res n m z type prec

Computes Legendre functions of the first and second kind. See acb_hypgeom_legendre_p and acb_hypgeom_legendre_q for definitions.

arb_hypgeom_legendre_p_ui_deriv_bound :: Ptr CMag -> Ptr CMag -> CULong -> Ptr CArb -> Ptr CArb -> IO () Source #

arb_hypgeom_legendre_p_ui_deriv_bound dp dp2 n x x2sub1

Sets dp to an upper bound for \(P'_n(x)\) and dp2 to an upper bound for \(P''_n(x)\) given x assumed to represent a real number with \(|x| \le 1\). The variable x2sub1 must contain the precomputed value \(1-x^2\) (or \(x^2-1\)). This method is used internally to bound the propagated error for Legendre polynomials.

arb_hypgeom_legendre_p_ui_zero :: Ptr CArb -> Ptr CArb -> CULong -> Ptr CArb -> CLong -> CLong -> IO () Source #

arb_hypgeom_legendre_p_ui_zero res res_prime n x K prec

arb_hypgeom_legendre_p_ui_one :: Ptr CArb -> Ptr CArb -> CULong -> Ptr CArb -> CLong -> CLong -> IO () Source #

arb_hypgeom_legendre_p_ui_one res res_prime n x K prec

arb_hypgeom_legendre_p_ui_asymp :: Ptr CArb -> Ptr CArb -> CULong -> Ptr CArb -> CLong -> CLong -> IO () Source #

arb_hypgeom_legendre_p_ui_asymp res res_prime n x K prec

arb_hypgeom_legendre_p_ui :: Ptr CArb -> Ptr CArb -> CULong -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_legendre_p_ui res res_prime n x prec

Evaluates the ordinary Legendre polynomial \(P_n(x)\). If res_prime is non-NULL, simultaneously evaluates the derivative \(P'_n(x)\).

The overall algorithm is described in [JM2018].

The versions zero, one respectively use the hypergeometric series expansions at \(x = 0\) and \(x = 1\) while the asymp version uses an asymptotic series on \((-1,1)\) intended for large n. The parameter K specifies the exact number of expansion terms to use (if the series expansion truncated at this point does not give the exact polynomial, an error bound is computed automatically). The asymptotic expansion with error bounds is given in [Bog2012]. The rec version uses the forward recurrence implemented using fixed-point arithmetic; it is only intended for the interval \((-1,1)\), moderate n and modest precision.

The default version attempts to choose the best algorithm automatically. It also estimates the amount of cancellation in the hypergeometric series and increases the working precision to compensate, bounding the propagated error using derivative bounds.

arb_hypgeom_legendre_p_ui_root :: Ptr CArb -> Ptr CArb -> CULong -> CULong -> CLong -> IO () Source #

arb_hypgeom_legendre_p_ui_root res weight n k prec

Sets res to the k-th root of the Legendre polynomial \(P_n(x)\). We index the roots in decreasing order

\[`\] \[1 > x_0 > x_1 > \ldots > x_{n-1} > -1\]

(which corresponds to ordering the roots of \(P_n(\cos(\theta))\) in order of increasing \(\theta\)). If weight is non-NULL, it is set to the weight corresponding to the node \(x_k\) for Gaussian quadrature on \([-1,1]\). Note that only \(\lceil n / 2 \rceil\) roots need to be computed, since the remaining roots are given by \(x_k = -x_{n-1-k}\).

We compute an enclosing interval using an asymptotic approximation followed by some number of Newton iterations, using the error bounds given in [Pet1999]. If very high precision is requested, the root is subsequently refined using interval Newton steps with doubling working precision.

Dilogarithm

arb_hypgeom_dilog :: Ptr CArb -> Ptr CArb -> CLong -> IO () Source #

arb_hypgeom_dilog res z prec

Computes the dilogarithm \(\operatorname{Li}_2(z)\).

Hypergeometric sums

arb_hypgeom_sum_fmpq_arb_forward :: Ptr CArb -> Ptr CFmpq -> CLong -> Ptr CFmpq -> CLong -> Ptr CArb -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_sum_fmpq_arb_forward res a alen b blen z reciprocal N prec

arb_hypgeom_sum_fmpq_arb_rs :: Ptr CArb -> Ptr CFmpq -> CLong -> Ptr CFmpq -> CLong -> Ptr CArb -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_sum_fmpq_arb_rs res a alen b blen z reciprocal N prec

arb_hypgeom_sum_fmpq_arb :: Ptr CArb -> Ptr CFmpq -> CLong -> Ptr CFmpq -> CLong -> Ptr CArb -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_sum_fmpq_arb res a alen b blen z reciprocal N prec

Sets res to the finite hypergeometric sum \(\sum_{n=0}^{N-1} (\textbf{a})_n z^n / (\textbf{b})_n\) where \(\textbf{x}_n = (x_1)_n (x_2)_n \cdots\), given vectors of rational parameters a (of length alen) and b (of length blen). If reciprocal is set, replace \(z\) by \(1 / z\). The forward version uses the forward recurrence, optimized by delaying divisions, the rs version uses rectangular splitting, and the default version uses an automatic algorithm choice.

arb_hypgeom_sum_fmpq_imag_arb_forward :: Ptr CArb -> Ptr CArb -> Ptr CFmpq -> CLong -> Ptr CFmpq -> CLong -> Ptr CArb -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_sum_fmpq_imag_arb_forward res1 res2 a alen b blen z reciprocal N prec

arb_hypgeom_sum_fmpq_imag_arb_rs :: Ptr CArb -> Ptr CArb -> Ptr CFmpq -> CLong -> Ptr CFmpq -> CLong -> Ptr CArb -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_sum_fmpq_imag_arb_rs res1 res2 a alen b blen z reciprocal N prec

arb_hypgeom_sum_fmpq_imag_arb_bs :: Ptr CArb -> Ptr CArb -> Ptr CFmpq -> CLong -> Ptr CFmpq -> CLong -> Ptr CArb -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_sum_fmpq_imag_arb_bs res1 res2 a alen b blen z reciprocal N prec

arb_hypgeom_sum_fmpq_imag_arb :: Ptr CArb -> Ptr CArb -> Ptr CFmpq -> CLong -> Ptr CFmpq -> CLong -> Ptr CArb -> CInt -> CLong -> CLong -> IO () Source #

arb_hypgeom_sum_fmpq_imag_arb res1 res2 a alen b blen z reciprocal N prec

Sets res1 and res2 to the real and imaginary part of the finite hypergeometric sum \(\sum_{n=0}^{N-1} (\textbf{a})_n (i z)^n / (\textbf{b})_n\). If reciprocal is set, replace \(z\) by \(1 / z\).