| AHELP for CIAO 4.5 Sherpa v1 | igamc |
Context: utilities |
Synopsis
Calculate the complement of the regularized incomplete Gamma function (upper)
Syntax
igamc(a,x)
Description
Calculate the CEPHES function, igamc, in the range [a > 0; x > 0].
The function, igamc, is defined by
igamc(a,x) = 1 - igam(a,x)
= 1/gamma(a) Int_(x)^(Inf) e^(-t) t^(a-1) dt
where "igam" represents the regularized incomplete Gamma function (see "ahelp igam"), and "gamma(a)" the complete Gamma function. (If the igam and igamc functions are *not* regularized, then their sum is not one, but is the complete Gamma function, gamma(a).)
In this implementation, both arguments must be positive. The integral is evaluated by either a power series or continued fraction expansion, depending on the relative values of a and x. Arguments can be in scalar or array form.
Accuracy
Tested at random a, x.
a x Relative error:
| arithmetic | domain | domain | # trials | peak | rms |
|---|---|---|---|---|---|
| IEEE | 0.5,100 | 0,100 | 200000 | 1.9e-14 | 1.7e-15 |
| IEEE | 0.01,0.5 | 0,100 | 200000 | 1.4e-13 | 1.6e-15 |
Reference
Cephes Math Library Release 2.0: April, 1987. Copyright 1985, 1987 by Stephen L. Moshier. Direct inquiries to 30 Frost Street, Cambridge, MA 02140.
Example 1
sherpa> igamc(1,2)
Calculate igamc with a=1, x=2.
Example 2
sherpa> igamc([1,2],[2,3])
Calculate igamc with a=[1,2], x=[2,3] .
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- tools
- aprates, modelflux
- utilities
- calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat, gamma, igam, incbet, lgam

![[Sherpa Logo]](../imgs/sherpa_logo_navbar.gif)