def update(self, A):

        n = len(A)
        d = (3 + self.ctx.sqrt(8)) ** n
        d = (d + 1 / d) / 2
        b = -self.ctx.one
        c = -d
        s = 0

        for k in xrange(n):
            c = b - c
            if k % 2 == 0:
                s = s + c * A[k]
            else:
                s = s - c * A[k]
            b = 2 * (k + n) * (k - n) * b / ((2 * k + 1) * (k + self.ctx.one))

        value = s / d

        err = abs(value - self.last)
        self.last = value

        return value, err
Save service-environments many-to-many records.
dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/calculus/extrapolation.py/cohen_alt_class.update--crossover with--dataset/ETHPy150Open allegro/ralph/src/ralph/assets/api/serializers.py/SaveServiceSerializer._save_environments