/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:16 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_sgami s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_sgami.h" int main( ) { long int i, ind; float a, p, q, s, sc, sx, x; static float xs[5]={1.0e0,2.0e0,3.0e0,4.0e0,5.0e0}; /* OFFSET Vectors w/subscript range: 1 to dimension */ float *const Xs = &xs[0] - 1; /* end of OFFSET VECTORS */ /*>> 2001-05-25 DRSGAMI Krogh Minor change for making .f90 version. *>> 1996-05-28 DRSGAMI Krogh Changed Fortran 90 code. *>> 1994-10-19 DRSGAMI Krogh Changes to use M77CON *>> 1994-08-15 DRSGAMI WV Snyder JPL set up for chgtyp *>> 1993-08-03 DRSGAMI WV Snyder JPL Original code *--S 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; sgamik( 0.0e0, 0.0e0, 0.0e0, 0 ); for (i = 1; i <= 5; i++) { x = Xs[i]; sgami( a, x, &p, &q, &ind ); sx = sqrtf( x ); s = serf( sx ); sc = serfc( sx ); printf("%16.8e%16.8e%16.8e%16.8e%16.8e\n", x, p, s, q, sc); } exit(0); } /* end of function */