/* bs02d.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 bs02d_c(doublereal *data, integer *n, doublereal *skew,
doublereal *curt)
{
/* System generated locals */
integer i__1;
doublereal d__1;
/* Builtin functions */
double sqrt(doublereal);
/* Local variables */
static doublereal adev, sdev;
static integer j;
static doublereal p, s, ave, var;
/* 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.;
*skew = 0.;
*curt = 0.;
i__1 = *n;
for (j = 1; j <= i__1; ++j) {
s = data[j] - ave;
adev += abs(s);
p = s * s;
var += p;
p *= s;
*skew += p;
p *= s;
*curt += p;
/* L12: */
}
adev /= *n;
var /= *n - 1;
sdev = sqrt(var);
if (var == 0.) {
return 0;
}
/* Computing 3rd power */
d__1 = sdev;
*skew /= *n * (d__1 * (d__1 * d__1));
/* Computing 2nd power */
d__1 = var;
*curt = *curt / (*n * (d__1 * d__1)) - 3.;
return 0;
} /* bs02d_c */