/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:10 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_dgami s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_dgami.h" int main( ) { long int i, ind; double a, p, q, s, sc, sx, x; static double xs[5]={1.0e0,2.0e0,3.0e0,4.0e0,5.0e0}; /* OFFSET Vectors w/subscript range: 1 to dimension */ double *const Xs = &xs[0] - 1; /* end of OFFSET VECTORS */ /*>> 2001-05-25 DRDGAMI Krogh Minor change for making .f90 version. *>> 1996-05-28 DRDGAMI Krogh Changed Fortran 90 code. *>> 1994-10-19 DRDGAMI Krogh Changes to use M77CON *>> 1994-08-15 DRDGAMI WV Snyder JPL set up for chgtyp *>> 1993-08-03 DRDGAMI WV Snyder JPL Original code *--D replaces "?": DR?GAMI, ?ERF, ?ERFC, ?GAMI, ?GAMIK * * Demo driver for incomplete gamma function. * Evaluate the identity P(1/2,x) = erf(sqrt(x)) and Q(1/2,x) = * erfc(sqrt(x)) for several values of x. * */ printf(" X P(1/2,X) ERF(SQRT(X)) Q(1/2,X) ERFC(SQRT(X))\n"); a = 0.5e0; ind = 0; dgamik( 0.0e0, 0.0e0, 0.0e0, 0 ); for (i = 1; i <= 5; i++) { x = Xs[i]; dgami( a, x, &p, &q, &ind ); sx = sqrt( x ); s = derf( sx ); sc = derfc( sx ); printf("%16.8e%16.8e%16.8e%16.8e%16.8e\n", x, p, s, q, sc); } exit(0); } /* end of function */