Remove[mndCompld10];
mndCompld10 =
Compile[{{steps, _Integer}, {maxiter, _Integer}, {xmax, _Real}},
Module[{z, c, iters},
Table[
iters = 0.;
z = c = -xmax + 2.*xmax*n/steps - 0.5 +
I*(-xmax + 2.*xmax*m/steps);
While[(iters < maxiter) && (Abs@z < 2),
iters++;
z = z^2 + c
];
Sqrt[iters/maxiter],
{m, 1, steps}, {n, 1, steps}
]
],
{{z, _Complex}, {c, _Complex}},
CompilationTarget -> "C",
RuntimeOptions -> "Speed"
];