Fractals: Mandelbrot & Julia Set in Mathematica

Julia Set: Program and Visualization

juliaC = 
        Compile[{x, y, lim, cx, 
            cy}, 
Module[{z, 
              ct = 0}, 
z = 
              x + I y; 
While[
              Abs[z] < 4.0 && ct < lim, 
z = 
                z^2 + cx + 
                  I cy; 
++ct]; 
ct]];

gr1 = 
        DensityPlot[
          juliaC[x, y, 
            50,  .27334,  .00742], 
{x, -1.5, 
            1.5}, {y, -1.5, 1.5}, PlotPoints -> 200, Mesh -> False, 
          ColorFunction -> Hue];

gr12 = 
        DensityPlot[
          juliaC[x, y, 150,  .2834,  .0007], 
{x, -1.5, 
            1.5}, {y, -1.5, 1.5}, PlotPoints -> 200, Mesh -> False, 
          ColorFunction -> Hue];

gr2 = 
        DensityPlot[
          juliaC[x, y, 
            50,  .27334,  .00742], 
{x, -0.1, - .5}, {y, - .1,  .4}, PlotPoints -> 200, Mesh -> False, 
          ColorFunction -> Hue];

juliaC1 = 
        Compile[{x, y, lim, cx, 
            cy}, 
Module[{z, 
              ct = 0}, 
z = 
              x + I y; 
While[
              Abs[z] < 90.0 && ct < lim, 
z = 
                Cos[z] (cx + 
                      I cy); 
++ct]; 
ct]];

gr11 = 
        DensityPlot[-juliaC1[x, y, 90, 
              3.96,  .01], 
{x, -3.5, 
            3.5}, {y, -3.5, 3.5}, PlotPoints -> 200, Mesh -> False, 
          ColorFunction -> Hue];

gr15 = 
        DensityPlot[
          juliaC1[x, y, 90, 
            3.96,  .01], 
{x, - .5,  .5}, {y, - .5,  .5}, PlotPoints -> 200, Mesh -> False, 
          ColorFunction -> Hue];

gr15 = 
        DensityPlot[
          juliaC1[x, y, 90, 
            3.96,  .01], 
{x, - .2,  .2}, {y, - .2,  .2}, PlotPoints -> 200, Mesh -> False, 
          ColorFunction -> Hue];

Mandelbrot Set

mandelbrotC = 
        Compile[{x, y, 
            lim}, 
Module[{z, 
              ct = 0}, 
z = 
              x + I y; 
While[
              Abs[z] < 2.0 && ct < lim, 
z = 
                z^2 + (x + 
                      I y); 
++ct]; 
ct]];

gr22 = 
        DensityPlot[
          mandelbrotC[x, y, 90], 
{x, -2.5, 
            1. }, {y, -1.5, 1.5}, PlotPoints -> 200, Mesh -> False, 
          ColorFunction -> Hue];

mandelbrotC1 = 
        Compile[{x, y, 
            lim}, 
Module[{z, 
              ct = 0}, 
z = 
              x + I y; 
While[
              Abs[z] < 3.0 && ct < lim, 
z = 
                z z z + (x + 
                      I y); 
++ct]; 
ct]];

gr22 = 
        DensityPlot[
          mandelbrotC1[x, y, 90], 
{x, -1.5, 
            1.5}, {y, -1.5, 1.5}, PlotPoints -> 200, Mesh -> False, 
          ColorFunction -> Hue];