# Incomplete Gamma with Complex input

**URL:** <https://discourse.julialang.org/t/incomplete-gamma-with-complex-input/17281>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 7, 2018, 10:42pm UTC](https://discourse.julialang.org/t/incomplete-gamma-with-complex-input/17281 "2018-11-07T22:42:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [November 7, 2018, 10:42pm UTC](https://discourse.julialang.org/t/incomplete-gamma-with-complex-input/17281/1 "2018-11-07T22:42:39Z")

</div>

Does julia 1.0 have any implementation of incomplete gamma that takes complex values? The GSL version takes reals only.

---

<div class="post-metadata">

**Author:** ![yha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yha/32/3502_2.png) [@yha](https://discourse.julialang.org/u/yha)\
**Post date:** [November 7, 2018, 11:40pm UTC](https://discourse.julialang.org/t/incomplete-gamma-with-complex-input/17281/2 "2018-11-07T23:40:03Z")

</div>

The incomplete gamma may be expressed (in several ways) in terms of the hypergeometric function {}\_1F\_1, which may be expressed as a limit of {}\_2F\_1.  
GSL seems to have an implementation of {}\_2F\_1 with some of the arguments complex, so depending on which variable you want to take complex values, it might be useful.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [November 8, 2018, 12:13am UTC](https://discourse.julialang.org/t/incomplete-gamma-with-complex-input/17281/3 "2018-11-08T00:13:28Z")

</div>

Thanks for the info, that is useful to keep in mind. It is the parameter that is complex, not the integration bound.

---

<div class="post-metadata">

**Author:** ![konkam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/konkam/32/6598_2.png) [@konkam](https://discourse.julialang.org/u/konkam)\
**Post date:** [November 9, 2018, 9:58am UTC](https://discourse.julialang.org/t/incomplete-gamma-with-complex-input/17281/4 "2018-11-09T09:58:45Z")

</div>

Check Nemo: [http://nemocas.github.io/Nemo.jl/latest/acb.html#Nemo.gamma-Tuple{acb,acb}](http://nemocas.github.io/Nemo.jl/latest/acb.html#Nemo.gamma-Tuple%7Bacb,acb%7D)

I’ve only used it with real values, but it accepts complex values too.

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [November 9, 2018, 10:08am UTC](https://discourse.julialang.org/t/incomplete-gamma-with-complex-input/17281/5 "2018-11-09T10:08:54Z")

</div>

There’s also HypergeometricFunctions inside SingularIntegralEquations.jl. We’re in the process of splitting it out: [GitHub - JuliaMath/HypergeometricFunctions.jl: A Julia package for calculating hypergeometric functions](https://github.com/JuliaApproximation/HypergeometricFunctions.jl)

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [November 9, 2018, 10:14am UTC](https://discourse.julialang.org/t/incomplete-gamma-with-complex-input/17281/6 "2018-11-09T10:14:07Z")

</div>

Also this here, but it’s not up to date

[https://github.com/jkovacic/IncGammaBeta.jl](https://github.com/jkovacic/IncGammaBeta.jl)

I think it would be a fun exercise to write up my own Hypergeometric package too.

The GSL hypergeometric functions do not suit my needs.
