Skip to main content

hyppfq

Function hyppfq 

Source
pub fn hyppfq(a: &[f64], b: &[f64], z: f64) -> Option<f64>
Expand description

Generalized hypergeometric function $_pF_q$ for real arguments

This function is not available in SciPy.

§Notes

For $p \le q$, and for $\abs z < 1$ if $p = q + 1$,

$$ \hyp p q {a_1\enspace \cdots\enspace a_p} {b_1\enspace \cdots\enspace b_q} z = \sum_{n=0}^\infty {\rpow{a_1}{n} \cdots \rpow{a_p}{n} \over \rpow{b_1}{n} \cdots \rpow{b_q}{n}} {z^n \over n!} , $$

with the rising factorial $\rpow \square n$ (pow_rising) 1. For $p = q + 1$ and $z \le -1$, it is the analytic continuation. A non-positive integer $a_i = -n$ makes it a polynomial of degree at most $n$.

Each $a_i$ equal to a $b_j$ cancels it, also if it is a non-positive integer or infinite. The supported $p$ and $q$ that remain are:

$p$$q = 0$$q = 1$$q = 2$
0hyp0f0hyp0f1
1hyp1f0hyp1f1hyp1f2
2hyp2f1hyp2f2
3hyp3f2

and each other $p \le q + 1$.

It is:

  • 1 at $z = 0$, and for a $b_j = +\infty$ and a finite $z$ if $p \le q + 1$ or it is a polynomial, unless it is complex;
  • $+\infty$ if a $b_j$ is a non-positive integer $-m$, unless it is a polynomial of degree $\lt m$, for $_1F_0$ at $z = 1$ if $a_1 > 0$, and for $p = q + 1 \ge 3$ at $z = 1$ if $\sum_j b_j \le \sum_i a_i$, unless it is a polynomial;
  • infinite at $z = \pm\infty$ if it is a polynomial of degree $\ge 1$, with the sign of its last term, and otherwise at $z = +\infty$ for $p \le q$, with the sign of $\prod_j \Gamma(b_j) / \prod_i \Gamma(a_i)$;
  • 0 at $z = -\infty$ for $q \le p \le q + 1$ if all $a_i > 0$;
  • NaN for $p = q + 1$ and $z > 1$, where it is complex, unless it is a polynomial or $_1F_0 = (1 - z)^{-a_1}$ with an integer $a_1$, and if an argument is NaN.

§Returns None

  • for $p > q + 1$, unless it is a polynomial;
  • where it can’t be computed accurately: for $p = q + 1 \ge 3$ as for hyp3f2, for the other $p = q$ as for hyp2f2, for the other $p < q$ as for hyp1f2, and for the other $p \le q$ for large $\abs z$ if two $a_i$ differ by an integer;
  • for the other infinite arguments, unless $p \le 2$ and $q \le 1$ where the function in the table has a limit.

  1. NIST Digital Library of Mathematical Functions https://dlmf.nist.gov/16.2 ↩