def getPredictedStep(hConst, hDiag, gradient):
    K = len(gradient)
    numSum = 0.0
    for i in range(0, K):
        numSum += (gradient[i] / hDiag[i])
    denSum = 0.0
    for i in range(0, K):
        denSum += (1.0 / hDiag[i])
    b = (numSum / ((1.0 / hConst) + denSum))
    retVal = ([0] * K)
    for i in range(0, K):
        retVal[i] = ((b - gradient[i]) / hDiag[i])
    return retVal
def getPredictedStep(hConst, hDiag, gradient):
    K = len(gradient)
    numSum = 0.0
    for i in range(0, K):
        numSum += (gradient[i] / hDiag[i])
    denSum = 0.0
    for i in range(0, K):
        denSum += (1.0 / hDiag[i])
    b = (numSum / ((1.0 / hConst) + denSum))
    retVal = ([0] * K)
    for i in range(0, K):
        retVal[i] = ((b - gradient[i]) / hDiag[i])
    return retVal