13 double suma = 0.0, sumb = 0.0, sumc = 0.0, sumd = 0.0, z, *xcopy;
16 if ((xcopy = (
double *)
malloc(n *
sizeof(
double))) ==
NULL) {
17 fprintf(stderr,
"Memory error in shapiro_francia\n");
21 for (i = 0; i <
n; ++i)
24 qsort(xcopy, n,
sizeof(
double),
dcmp);
26 for (i = 0; i <
n; ++i) {
27 z =
xinormal((i + 1 - 0.375) / (n + 0.25));
31 sumd += xcopy[i] * xcopy[i];
34 y[0] = suma * suma / sumb / (sumd - sumc * sumc /
n);
37 fprintf(stdout,
" TEST14 SF(N) =%10.4f\n", y[0]);
int dcmp(const void *i, const void *j)
double * shapiro_francia(double *x, int n)