hypergeo (version 1.2-13)

complex_gamma: Gamma function for complex arguments

Description

Gamma and factorial functions for complex arguments

Usage

complex_gamma(z, log = FALSE) complex_factorial(z, log = FALSE) lanczos(z,log=FALSE)

Arguments

z
Primary argument, a complex vector
log
Boolean, with default FALSE meaning to return the function value and TRUE meaning to return its logarithm

Details

Method follows that of Lanczos, coefficients identical to those of the GSL

References

Lanczos, C. 1964. “A precision approximation of the gamma function”. Journal of the society for industrial and applied mathematics series B, Volume 1, pp86-96

M. Galassi et al, GNU Scientific Library Reference Manual (3rd Ed.), ISBN 0954612078.

Examples

Run this code

complex_gamma(5)  # should be 4!=24

complex_gamma(1+1i)   # takes complex arguments

complex_gamma(-5/2) + sqrt(pi)*8/15  # should be small

z <- pi + 1i*sqrt(2)
complex_gamma(z+1)-z*complex_gamma(z)   # should be small


complex_gamma(z)*complex_gamma(1-z) - pi/sin(pi*z)  # small


Run the code above in your browser using DataLab