Well, I'll say it in English someday, but here it is in Elisp, by Jim Blandy: (defvar mand-max-iterations 200 "*Maximum length of sequence to test for divergence. If a point's sequence does not diverge after this many elements, we guess that the point is in the Mandelbrot set.") (defun not-mand-member-p (c) "Return nil if C is in the Mandelbrot set, non-nil otherwise. C has the form (REAL . IMAGINARY), representing a complex number. If C is not in the mandelbrot set, the return value is the number of iterations it took for the point to escape the circle of radius 2 centered at the origin (points outside this circle always diverge)." (let* ((cr (float (car c))) (ci (float (cdr c))) (zr cr) (zi ci) (iter 0)) (while (and (< iter mand-max-iterations) (<= (+ (* zr zr) (* zi zi)) 4)) ;; We're computing ;; zr + i zi := (zr + i zi)^2 + (cr + i ci) ;; Separating this into real and imaginary portions, that's ;; zr = zr^2 - zi^2 + cr ;; and ;; zi = 2 zr zi + ci (setq zi (prog1 (+ (* 2 zr zi) ci) (setq zr (+ (* zr zr) (- (* zi zi)) cr))) iter (1+ iter))) (if (< iter mand-max-iterations) iter)))