Complete regularized cost function.