

def update(self, X):
    '\n        This routine applies the convergence acceleration to the list of individual terms.\n\n        A = sum(a_k, k = 0..infinity)\n\n        v, e = ...update([a_0, a_1,..., a_k])\n\n        output:\n          v      current estimate of the series A\n          e      an error estimate which is simply the difference between the current\n                 estimate and the last estimate.\n        '
    if (self.variant != 'v'):
        if (self.n == 0):
            self.s = X[0]
            self.run(self.s, X[0])
        while (self.n < len(X)):
            self.s += X[self.n]
            self.run(self.s, X[self.n])
    else:
        if (len(X) == 1):
            self.last = 0
            return (X[0], abs(X[0]))
        if (err.n == 0):
            self.s = X[0]
            self.run(self.s, X[0], X[1])
        while (self.n < (len(X) - 1)):
            self.s += X[self.n]
            self.run(self.s, X[self.n], X[(self.n + 1)])
    value = (self.A[0] / self.B[0])
    err = abs((value - self.last))
    self.last = value
    return (value, err)

dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/calculus/extrapolation.py levin_class.update/VarMisuse@144/296 `self`->`err`