# Continuous Dwell
Linas Vepstas “Renormalizing the Mandelbrot Escape” (1997) derives the renormalized continuous escape time:
\[\mu = n + 1 - \log_2 \left( \log \left|z\right| \right)\]
In the above formula, the value of \(\mu\) is almost completely independent of the iteration count, and of the escape radius, despite the fact that the right-hand-side of the equation is explicitly dependent on both of these quantities. The renormalized iteration count \(\mu\) depends only on \(c\), and is a piecewise-continuous, differentiable function thereof. By using a different analysis, it can be seen that the renormalized iteration count \(\mu\) is in fact the residue remaining when a pole (due to the infinite sum) is removed. That is, the value of \(\mu\) closely approximates the result of having iterated to infinity, that is, of having an infinite escape radius, and an infinite maximum iteration count.
# 1 C99 Code
#include <complex.h>
#include <math.h>
double m_continuous_dwell(int N, double R, double _Complex c)
{
double _Complex z = 0;
for (int n = 0; n < N; ++n)
{
if (cabs(z) > R)
return n + 1 - log2(log(cabs(z)));
z = z * z + c;
}
return -1;
}