Regularized cost and gradient computed