I'm reading a chapter in this fascinating book about using genetic programming to interactively evolve images. Most of the function set is comprised of simple arithmetic and trig functions (which really operation on and return images). These functions make up the internal nodes of the parse trees that encode our images. The leaves of the tree, or the terminal values, are random numbers and x,y coordinates.
There's a section about adding iterative functions of the complex plane to the function set:
Say the genetics inserts a particular Mandelbrot set as a node somewhere in a bushy tree. The function expects two arguments: mandel(cReal, cImag), treating them as real and imaginary coordinates in the complex plane. If the genome just happened to supply the pixel coordinates (x,y), and mandel() were the root node, you would get the familiar Mset. But chances are that cReal and cImag are themselves the results of whole branches of functions, with many instances of coordinates x,y scattered out among the leaves. Enter the iteration loop, orbit around for a while, and finally escape with some measure of distance to the Mset attractor, such as the number of iterations.
My question is how would you make a Mandelbrot set renderer as a function that takes the real and imaginary coordinates of a point on the complex plane as arguments and returns a rendering of the Mandelbrot set?