hg <- acb_hypgeom_gamma
hgl <- acb_hypgeom_gamma_lower
hgu <- acb_hypgeom_gamma_upper
hb <- acb_hypgeom_beta
hbl <- acb_hypgeom_beta_lower
set.seed(0xcdefL)
r <- 10L
eps <- 0x1p-4
a <- flint:::complex.runif(r, modulus = c( 0, 1/eps))
b <- flint:::complex.runif(r, modulus = c( 0, 1/eps))
z <- flint:::complex.runif(r, modulus = c(eps, 1/eps))
## Some trivial identities
stopifnot(# http://dlmf.nist.gov/8.2.E3
all.equal(hgl(a, z) + hgu(a, z), hg(a), tolerance = 1e-5),
# https://dlmf.nist.gov/8.4.E5
all.equal(hgu(1, z), exp(-z), check.class = FALSE))
## Regularization
stopifnot(all.equal(hgl(a, z, flags = 1L), hgl(a, z)/hg(a )),
all.equal(hgu(a, z, flags = 1L), hgu(a, z)/hg(a )),
all.equal(hbl(a, b, z, flags = 1L), hbl(a, b, z)/hb(a, b)))
## A relation with the hypergeometric function from
## https://dlmf.nist.gov/8.17.E7 :
h2f1 <- acb_hypgeom_2f1
stopifnot(all.equal(hbl(a, b, z), z^a * h2f1(a, 1 - b, a + 1, z)/a))
Run the code above in your browser using DataLab