var sum_x = 0; var sum_y = 0; var sum_x_squared = 0; var sum_y_squared = 0; var sum_xy = 0; var n  = array.length; for (var i = 0; i != n; ++i) { var x = i; var y = array[i]; sum_x += x; sum_y += y; sum_x_squared += x*x; sum_y_squared += y*y; sum_xy += x*y; } var x_average = sum_x / n; var y_average = sum_y / n; var sxx = sum_x_squared - n * x_average * x_average; var syy = sum_y_squared - n * y_average * y_average; var sxy = sum_xy - n * x_average * y_average; var r = sxy*sxy/(sxx*syy); return r; 
var sum_x = 0; var sum_y = 0; var sum_x_squared = 0; var sum_y_squared = 0; var sum_xy = 0; var n  = array.length; for (var i = 0; i != n; ++i) { var x = i; var y = array[i]; sum_x += x; sum_y += y; sum_x_squared += x*x; sum_y_squared += y*y; sum_xy += x*y; } var x_average = sum_x / n; var y_average = sum_y / n; var sxx = sum_x_squared - n * x_average * x_average; var syy = sum_y_squared - n * y_average * y_average; var sxy = sum_xy - n * x_average * y_average; var r = sxy*sxy/(sxx*syy); return r; 
function calculate_least_square_r(array){	var sum_x = 0;	var sum_y = 0;	var sum_x_squared = 0;	var sum_y_squared = 0;	var sum_xy = 0;	var n  = array.length;	for (var i = 0; i != n; ++i) {		var x = i;		var y = array[i];		sum_x += x;		sum_y += y;		sum_x_squared += x*x;		sum_y_squared += y*y;		sum_xy += x*y;	}	var x_average = sum_x / n;	var y_average = sum_y / n;	var sxx = sum_x_squared - n * x_average * x_average;	var syy = sum_y_squared - n * y_average * y_average;	var sxy = sum_xy - n * x_average * y_average;	var r = sxy*sxy/(sxx*syy);	return r; }
5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5459/3703c3c05f398a63e55992f7687ef65273b26d6a/regress-313967-01.js/clean/js/tests/js1_5/Regress/regress-313967-01.js