regularized costFunction