/* bs01d.f -- translated by f2c (version 20000817).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* Subroutine */ int bs01d_c(doublereal *data, integer *n, doublereal *ave,
doublereal *adev, doublereal *var, doublereal *sdev)
{
/* System generated locals */
integer i__1;
/* Builtin functions */
double sqrt(doublereal);
/* Local variables */
static integer j;
static doublereal p, s;
/* IF(N.LE.1)PAUSE 'N must be at least 2' */
/* Parameter adjustments */
--data;
/* Function Body */
s = 0.;
i__1 = *n;
for (j = 1; j <= i__1; ++j) {
s += data[j];
/* L11: */
}
*ave = s / *n;
*adev = 0.;
*var = 0.;
i__1 = *n;
for (j = 1; j <= i__1; ++j) {
s = data[j] - *ave;
*adev += abs(s);
p = s * s;
*var += p;
/* L12: */
}
*adev /= *n;
*var /= *n - 1;
*sdev = sqrt(*var);
return 0;
} /* bs01d_c */