# gammaz: Complex Gamma Function In pracma: Practical Numerical Math Functions

## Description

Gamma function valid in the entire complex plane.

## Usage

 `1` ```gammaz(z) ```

## Arguments

 `z` Real or complex number or a numeric or complex vector.

## Details

Computes the Gamma function for complex arguments using the Lanczos series approximation.

Accuracy is 15 significant digits along the real axis and 13 significant digits elsewhere.

To compute the logarithmic Gamma function use `log(gammaz(z))`.

## Value

Returns a complex vector of function values.

## Note

Copyright (c) 2001 Paul Godfrey for a Matlab version available on Mathwork's Matlab Central under BSD license.

Numerical Recipes used a 7 terms formula for a less effective approximation.

## References

Zhang, Sh., and J. Jin (1996). Computation of Special Functions. Wiley-Interscience, New York.

`gamma`, `gsl::lngamma_complex`

## Examples

 ```1 2 3 4 5 6 7``` ```max(gamma(1:10) - gammaz(1:10)) gammaz(-1) gammaz(c(-2-2i, -1-1i, 0, 1+1i, 2+2i)) # Euler's reflection formula z <- 1+1i gammaz(1-z) * gammaz(z) # == pi/sin(pi*z) ```

### Example output

```[1] 9.094947e-13
[1] Inf
[1]  0.01089768-0.00528297i -0.17153292-0.32648275i         Inf+0.00000000i
[4]  0.49801567-0.15494983i  0.11229424+0.32361289i
[1] 0+0.2720291i
```

pracma documentation built on Jan. 30, 2018, 3:01 a.m.