source: sasview/src/sas/models/c_extension/cephes/gdtr.c @ 79492222

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 79492222 was 79492222, checked in by krzywon, 9 years ago

Changed the file and folder names to remove all SANS references.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*                                                      gdtr.c
2 *
3 *      Gamma distribution function
4 *
5 *
6 *
7 * SYNOPSIS:
8 *
9 * double a, b, x, y, gdtr();
10 *
11 * y = gdtr( a, b, x );
12 *
13 *
14 *
15 * DESCRIPTION:
16 *
17 * Returns the integral from zero to x of the gamma probability
18 * density function:
19 *
20 *
21 *                x
22 *        b       -
23 *       a       | |   b-1  -at
24 * y =  -----    |    t    e    dt
25 *       -     | |
26 *      | (b)   -
27 *               0
28 *
29 *  The incomplete gamma integral is used, according to the
30 * relation
31 *
32 * y = igam( b, ax ).
33 *
34 *
35 * ACCURACY:
36 *
37 * See igam().
38 *
39 * ERROR MESSAGES:
40 *
41 *   message         condition      value returned
42 * gdtr domain         x < 0            0.0
43 *
44 */
45/*                                                     gdtrc.c
46 *
47 *      Complemented gamma distribution function
48 *
49 *
50 *
51 * SYNOPSIS:
52 *
53 * double a, b, x, y, gdtrc();
54 *
55 * y = gdtrc( a, b, x );
56 *
57 *
58 *
59 * DESCRIPTION:
60 *
61 * Returns the integral from x to infinity of the gamma
62 * probability density function:
63 *
64 *
65 *               inf.
66 *        b       -
67 *       a       | |   b-1  -at
68 * y =  -----    |    t    e    dt
69 *       -     | |
70 *      | (b)   -
71 *               x
72 *
73 *  The incomplete gamma integral is used, according to the
74 * relation
75 *
76 * y = igamc( b, ax ).
77 *
78 *
79 * ACCURACY:
80 *
81 * See igamc().
82 *
83 * ERROR MESSAGES:
84 *
85 *   message         condition      value returned
86 * gdtrc domain         x < 0            0.0
87 *
88 */
89
90/*                                                      gdtr()  */
91
92
93/*
94Cephes Math Library Release 2.8:  June, 2000
95Copyright 1984, 1987, 1995, 2000 by Stephen L. Moshier
96*/
97
98#include "mconf.h"
99#ifdef ANSIPROT
100extern double igam ( double, double );
101extern double igamc ( double, double );
102#else
103double igam(), igamc();
104#endif
105
106double gdtr( a, b, x )
107double a, b, x;
108{
109
110if( x < 0.0 )
111        {
112        mtherr( "gdtr", DOMAIN );
113        return( 0.0 );
114        }
115return(  igam( b, a * x )  );
116}
117
118
119
120double gdtrc( a, b, x )
121double a, b, x;
122{
123
124if( x < 0.0 )
125        {
126        mtherr( "gdtrc", DOMAIN );
127        return( 0.0 );
128        }
129return(  igamc( b, a * x )  );
130}
Note: See TracBrowser for help on using the repository browser.