Question: Call procedure with same input gives different output!!

Dear Maple's expertise 

Here is the code in simple way with the output. 

The peoblem that I am calling the procedure with the same input but from time to time it gives different output shown in bold below. Although I make  restart for Mape?Is it bug in maple??Any Suggestions please.Should make clearing for some varibale and how?

 

Thanks in advance

The code is

> restart;


> Chisqr1 := proc (w) local x, y, A, B, C, Ds, j, X, altern1, altern2, altern3, altern4, EqCo1, EqCo2, EqCo3, EqCo4, M, XX, M1, M2, MM, ChiSqr, Syss, SS, AA, BB, CC, DDs, S;

x := Vector([0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48]);

y := Vector([16759.00586, 19630.75977, 15190.14551, 11532.44141, 6447.006836, 7827.111816, 3531.188965, 5167.17334, 10127.59277, 11626.91504, 5197.712402, 6539.370605, 6164.602539]);

for j from 1 to 13 do S := S+(y[j]-A-x[j]*B-C*cos(w*x[j])-Ds*sin(w*x[j]))^2 end do;

Syss := Student:-MultivariateCalculus:-Jacobian([S], [A, B, C, Ds]);

X := LinearAlgebra:-Transpose(Syss);

altern1 := simplify(LinearAlgebra:-Determinant(X[1]));

altern2 := simplify(LinearAlgebra:-Determinant(X[2]));

altern3 := simplify(LinearAlgebra:-Determinant(X[3]));

altern4 := simplify(LinearAlgebra:-Determinant(X[4]));

EqCo1 := coeffs(altern1, [A, B, C, Ds]);

EqCo2 := coeffs(altern2, [A, B, C, Ds]);

EqCo3 := coeffs(altern3, [A, B, C, Ds]);

EqCo4 := coeffs(altern4, [A, B, C, Ds]);

M := ArrayTools:-Concatenate(2, EqCo1, EqCo2, EqCo3, EqCo4);

XX := convert(M, Matrix);

M1 := ArrayTools:-Concatenate(1, ArrayTools:-Concatenate(1, linalg:-col(XX, 1 .. 5)), ArrayTools:-Concatenate(1, linalg:-col(XX, 6 .. 10)), ArrayTools:-Concatenate(1, linalg:-col(XX, 11 .. 15)), ArrayTools:-Concatenate(1, linalg:-col(XX, 16 .. 20)));

MM := linalg:-swapcol(M1, 1, 5);

M2 := linalg:-gaussjord(MM);

AA := M2[1, 5];

BB := M2[2, 5];

CC := M2[3, 5];

DDs := M2[4, 5];

SS := 0;

for j from 1 to 13 do SS := SS+(y[j]-AA-x[j]*BB-CC*cos(w*x[j])-DDs*sin(w*x[j]))^2 end do end proc;

for wx from 1 to 200 do ChiSqr2 := Chisqr1(7.14371);

printf("%f\n", ChiSqr2);

end do;

 

 

The output: I don't know From where the bold output is coming from??

5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
2441295475000.000000
5180185704.000000
5180185704.000000
2323901683.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
2441295475000.000000
5180185704.000000
5180185704.000000
2323901683.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
2441295475000.000000
5180185704.000000
5180185704.000000
2323901683.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
2441295475000.000000
5180185704.000000
5180185704.000000
2323901683.000000
5180185704.000000
5180185704.000000
5180185704.000000
5180185704.000000
3027269579.000000
5180185704.000000
5180185704.000000

Please Wait...