Article View: sci.fractals
Article #446Mandelbrot Set plotting, short cuts
From: Jay R. Hill
Date: Thu, 22 Jul 1993 01:32
Date: Thu, 22 Jul 1993 01:32
83 lines
4429 bytes
4429 bytes
In article <1993Jul8.024029.18814@ast.saic.com>,
hilljr@jupiter.saic.com (Jay R. Hill) writes:
|> Attention Mandelbrot zoomers, ever wanted to zoom in on the island
|> Mandelbroties in the spike toward -2?
If you liked that one, well how about just speeding up the basic plotting
or MSet calculation process. Here are two tips I have come up with.
Fausto Arinos de Almeida Barbuto <BJ06@C53000.PETROBRAS.ANRJ.BR>, is
one of the pixel counter method MSet area estimators. From time to
time he used to post a new value as the result of ever more and more
samples. I sent him a suggestion for speeding up the process, one
we used in GIPPP#3 (with Yuval Fisher). In C++ (with complex arithmetic)
you can check z -> z^2 + c, c in the MSet for points in the main
cardioid and period 2 bud.
c4=4*c; if (abs(1-sqrt(1-c4))<1.0) true_period=1;
else if(abs(c4+4)<1.0) true_period=2; else true_period=UNKNOWN;
Fausto tried it, liked it and suggested a check for the circular one
(period 3) centered at (-.12256,.74486). He found a few % improvement
in speed. Here is a tweek on the idea. I have moved the center so
I can get as large a circle in without violating the boundary. I used
Dante Giarrusso's formula for the exact boundary as a check.
if (fsqr(center_x+0.1248710)+fsqr(fabs(center_y)-0.7439675)<=0.008916011)
true_period=3;
where fsqr is a function:
double fsqr(double x){return x*x;}
Now the next idea I consider really neat. ;-) It saves a lot of time.
I use period detection, suggested by Robert P Munafo <mrob@world.std.com>
in this news group. The iterations can get very lengthy if you are
pushing the limit, really trying to get a decision on a sample. Is it in
or out? I have advocated here before that high iteration limits are
better and Robert posted an analysis showing use of 2^31 for the limit.
Earlier I posted discussions of chaotic c, where the iterations can go
'forever'. Try c=(-0.23,0.64) if you don't believe me. Now I have
found an interesting property of these chaotic c. Their orbit periodicly
lands near (0,0), as do the periodic orbits for c on the boundary of a
component. Compare (0.25,0.5), which is a periodic c where the period
4 bud touches the cardioid, with the above c. The difference is that
the periodic orbit is further from (0,0) each time it approaches. This
is because the orbit is converging on (1-srqt(1-4*c))/2. But the
chaotic orbit gets closer to (0,0) as the iterations continue. This
leads me to a test, which I apply after some minimum iteration count.
It goes like this, here simplified:
#define MINITER 65536
#define MAXITER 2147483648
long itermax=MAXITER;
void find_M(complex c){
complex z; long i; double absz;
z=0; absz=0;
while(i<itermax && absz<2)){ // && other tests you may need
z=z*z+c; absz=abs(z);
if(i>MINITER){
if(i*absz*absz<1.0) // here is the test
i=itermax; // we are chaotic
}else {
period tests etc go here...
}i++;
}
}
I have used MINITER 16384 with good results. The upshot of all this is
very few remain beyond MINITER with the results as good as if we only
used the MAXITER limit. The time saved can be very great.
Enjoy!
Jay
Ref. GIPPP#3 is the Grand Internet Parallel Processing Project MSet area
calculation I organized with Yuval Fisher <fisher@inls1.ucsd.edu>
--
{ hilljr@jupiter.saic.com } begin writeln(3*ln(640320)/sqrt(163):17:15) end.
void main(){double sqrt(), y=1/sqrt(2.), a=.5, m=1,z; int n=0;
for(;m*=2,z=sqrt(1-y*y),y=(1-z)/(1+z),a=a*(1+y)*(1+y)-m*y,n<4;n++);
printf("%17.15lf\n",1/a);}
Technical Details
Message-ID:
<1993Jul22.013251.29600@ast.saic.com>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!usc!news.service.uci.edu!unogate!mvb.saic.com!ast.saic.com!jupiter!hilljrReferences:
<1993Jul8.024029.18814@ast.saic.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff06e,f9197332fd5e8e0f X-Google-Attributes: gidff06e,public X-Google-Thread: 10ed18,d7bfccbe7d1ce061 X-Google-Attributes: gid10ed18,public X-Google-ArrivalTime: 1993-07-21 19:33:04 PST Newsgroups: sci.fractals,bit.listserv.frac-l Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!usc!news.service.uci.edu!unogate!mvb.saic.com!ast.saic.com!jupiter!hilljr From: hilljr@jupiter.saic.com (Jay R. Hill) Subject: Mandelbrot Set plotting, short cuts Message-ID: <1993Jul22.013251.29600@ast.saic.com> Followup-To: sci.fractals Keywords: Mandelbrot set Lines: 83 Sender: news@ast.saic.com Organization: SAIC References: <1993Jul8.024029.18814@ast.saic.com> Date: Thu, 22 Jul 1993 01:32:51 GMT