Good day! I need to implement one of Knut's tests. Chose the criterion of serial correlation. The second volume of Knut gives the formula

I'm trying to calculate this correlation coefficient from it and I get it at N = 50 equal to 1.04. But it cannot be, by module, more than one! ... Help, please, sort it out ...

A piece of code:

`const int M=N; unsigned int null_num, first_num, numerator_n, numerator_2, denominator_n, denominator_2; long double C; null_num = (a*x+c)%4294967296; numerator_n=0; numerator_2 = null_num; denominator_n = null_num*null_num; for (i=0; i<M; i++) { first_num = (a*null_num+c)%4294967296; numerator_n = numerator_n + null_num*first_num; numerator_2 = numerator_2 + first_num; denominator_n = denominator_n + first_num*first_num; null_num = first_num; } numerator_n = numerator_n + null_num*((a*x+c)%4294967296); numerator_2 = numerator_2 + null_num; denominator_2 = numerator_2; denominator_n = denominator_n + null_num*null_num; C = (double)((numerator_n*M)-(numerator_2*numerator_2))/(double)((denominator_n*M)-(denominator_2*denominator_2)); printf("Coefficient: %f \n\n", C);`