Last modified: December 2023

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/igamc.html
AHELP for CIAO 4.16 Sherpa

igamc

Context: utilities

Synopsis

Calculate the complement of the regularized incomplete Gamma function (upper).

Syntax

igamc(a, x)

a - scalar or array
x - scalar or array

Description

The function is defined using the regularized incomplete Gamma function - igam(a,x) - and the Gamma function - gamma(a) - as:

igamc(a,x) = 1 - igam(a,x)
           = 1 / gamma(a) Int_x^Inf e^(-t) t^(a-1) dt

Examples

Example 1

>>> igamc(1, 2)
0.1353352832366127

Example 2

>>> igamc([1,1], [2,3])
array([ 0.13533528,  0.04978707])

PARAMETERS

The parameters for this function are:

Parameter Definition
a a > 0
x x > 0

Return value

The return value from this function is:

val -- The incomplete Gamma function of the input.

Notes

In this implementation, which is provided by the Cephes Math Library [1] , 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. Using IEEE arithmetic, the relative errors are

domain domain # trials peak rms
0.5,100 0,100 200000 1.9e-14 1.7e-15
0.01,0.5 0,100 200000 1.4e-13 1.6e-15

References


Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

tools::response
color_color, modelflux
tools::statistics
aprates
utilities
calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat, gamma, igam, incbet, lgam