Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
This interface implements Levin's (nonlinear) sequence transformation for
convergence acceleration and summation of divergent series. It performs
better than the Shanks/Wynn-epsilon algorithm for logarithmic convergent
or alternating divergent series.

Let *A* be the series we want to sum:

.. math ::

    A = \sum_{k=0}^{\infty} a_k(more...)

src/s/y/sympy-0.7.5/sympy/mpmath/tests/test_levin.py   sympy(Download)
def test_levin_0():
    mp.dps = 17
    eps = mp.mpf(mp.eps)
    with mp.extraprec(2 * mp.prec):
        L = mp.levin(method = "levin", variant = "u")
def test_levin_1():
    mp.dps = 17
    eps = mp.mpf(mp.eps)
    with mp.extraprec(2 * mp.prec):
        L = mp.levin(method = "levin", variant = "v")
    eps = mp.mpf(mp.eps)
    with mp.extraprec(2 * mp.prec):
        L = mp.levin(method = "sidi", variant = "t")
        n = 0
        while 1:
    eps = mp.mpf(mp.eps)
    with mp.extraprec(7*mp.prec):  # we need copious amount of precision to sum this highly divergent series
        L = mp.levin(method = "levin", variant = "t")
        n, s = 0, 0
        while 1: