def pi(err, abs=abs):
    'Approximation of pi +/- err using the Mandlebrot set'
    n = 0
    z = c = complex(-0.75, err)
    while abs(z) < 2.0:
            n += 1
            z = z * z + c
    return n * err
Approximation of pi +/- err using the Mandlebrot set
recipes/Python/577584_Amazing_estimatiPi_using_Mandlebrot/recipe-577584.py