/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:12 */
/*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_drang s=dbov str=l x=f - prototypes */
#include <math.h>
#include "fcrt.h"
#include <stdio.h>
#include <stdlib.h>
#include "p_drang.h"
/*     program DRDRANG
 *>> 2001-05-22 DRDRANG  Krogh Minor change for making .f90 version.
 *>> 1996-05-28 DRDRANG  Krogh Added external statement.
 *>> 1994-10-19 DRDRANG  Krogh  Changes to use M77CON
 *>> 1987-12-09 DRDRANG  Lawson  Initial Code.
 *--D replaces "?": DR?RANG, ?RANG, ?STAT1, ?STAT2
 *     Demonstration driver for DRANG.  Generates random numbers
 *     from the Gaussian distribution.
 *     ------------------------------------------------------------------ */
		/* PARAMETER translations */
#define	NCELLS	(12 + 2)
#define	ZERO	0.0e0
		/* end of PARAMETER translations */
 
 
int main( )
{
	long int i, ihist[NCELLS];
	double stats[5], ytab[1];
	static long n = 10000;
	static double y1 = -3.0e0;
	static double y2 = 3.0e0;
		/* OFFSET Vectors w/subscript range: 1 to dimension */
	long *const Ihist = &ihist[0] - 1;
	double *const Stats = &stats[0] - 1;
	double *const Ytab = &ytab[0] - 1;
		/* end of OFFSET VECTORS */
 
 
	/*     ------------------------------------------------------------------ */
	Stats[1] = ZERO;
	for (i = 1; i <= n; i++)
	{
		/*                          GET RANDOM NUMBER */
		Ytab[1] = drang();
 
		/*                          Accumulate statistics and histogram.
		 * */
		dstat1( &Ytab[1], 1, stats, ihist, NCELLS, y1, y2 );
	}
	/*                          Print the statistics and histogram.
	 * */
	printf("             Gaussian random numbers from DRANG\n\n\n");
	dstat2( stats, ihist, NCELLS, y1, y2 );
	exit(0);
} /* end of function */