The following Mathematica code demonstrates how to create a Julia set using the Inverse Iteration Method (IIM). This technique is good for showing the edges of the set, but some regions are faint because they attract much slower:

(* runtime: 4 seconds *)

c = -0.5 - 0.05 I; zlist = {0}; Do[zlist = Flatten[Map[(# - c)^(1/3){1, -(-1)^(1/3) , (-1)^(2/3)} &, zlist], 1], {10}];

ListPlot[{Re[#], Im[#]} & /@ zlist, PlotStyle -> PointSize[0.005], AspectRatio -> Automatic]



There are a variety of Modified Inverse Iteration Methods (MIIM) which can be used to speed up the calculation by pruning dense branches of the tree. One such method is to prune branches when the map becomes contractive (the cumulative derivative becomes large). The following Mathematica code was adapted from Peter Liepa's source code:

(* runtime: 3 seconds *)

power = 3; c = -0.5 - 0.05 I; zlist = {}; imax = 100; z = Table[0, {imax}]; dz = Table[1, {imax}]; roots = Table[1, {imax}]; i = 2;

While[i > 1, z[[i]] = {1, -(-1)^(1/3), (-1)^(2/3)}[[roots[[i]]]](z[[i - 1]] - c)^(1/power); dz[[i]] = power Abs[z[[i]]]^(power - 1)dz[[i - 1]]; zlist =Append[zlist, z[[i]]]; If[i < imax && dz[[i]] < 250.0, i++; roots[[i]] = 1, While[i > 1 && roots[[i]] == power, roots[[i]] = 1; i--]; roots[[i]]++]];

ListPlot[{Re[#],Im[#]} & /@ zlist, PlotStyle -> PointSize[0.005], AspectRatio -> Automatic]



Here is another approach for creating MIIM Julia sets, based on pixel hit counts:

(* runtime: * minutes *)



Here is another approach for creating MIIM Julia sets, adapted from Mark McClure’s Mathematica code:

(* runtime: 4 seconds *)

InvertList[zlist_] := Flatten[Map[Floor[130(# - c)^(1/3){1, -(-1)^(1/3), (-1)^(2/3)}]/130 &, zlist], 1];

c = -0.5 - 0.05 I; zlist = Nest[InvertList, {0}, 8]; zlist2 = zlist;

While[zlist2 =!= {}, zlist2 = Complement[InvertList[zlist2],zlist]; zlist = Union[zlist2, zlist]];

ListPlot[{Re[#], Im[#]} & /@ zlist,PlotStyle -> PointSize[0.005], AspectRatio -> Automatic]

