gradient descent with single variable