ar error2 = 0.0;
	for(var i = 0; i < interpolating_n; ++i) {
		error2 += Math.pow(points[i][1] - f(points[i][0]), 2);
	}
	return error2;
}

function approximation_with_autoweighted_interpolating_n(points, n, interpolating_n) {
	var weight = 1.0;
	var error2 = 1.0;
	while (error2 >= 1.0) {
		var f = approximation_with_weighted_interpolating_n(points, n, interpolating_n, weight);
		error2 = evaluate_by_interpolating_n_squared_error(f, points, interpolating_n);
		weight *= 2;
	}
	return f;
}

// the canvases
v