/* * Speedy Mandelbrot set main loop * On IBM Blue lightning 486, goes about 10% slower than fractint 19.5 * On Intel Pentium 200MMX goes twice as fast as fractint! * Timings based on time taken to calculate an image 320*200 with 20000 * iterations such that each pixel requires all 20000 iterations ie time taken * to calculate 1.28e9 iterations. This takes my Pentium 211.3 sec in Linux (and * dos too using DJGPP. With this number of iterations, the time spent by * fractint plotting pixels is completely insignificant (a fraction of a second * so it is a fair comparison. * flags -O3 -fomit-frame-pointer -ffast-math -funroll-loops -m486 * Yes, that is -m486! It goes quite a bit faster with this instead of * -mpentium which EGCS allows * C compiler:EGCS-2.90.29 980515 (egcs-1.0.3 release) * Hoppy 2/98 * r.hopkins@ic.ac.uk */ /* guess how to use it.... :-) */ unsigned int Mand (double initx, double inity, unsigned int iterations) { double cx,cy,xsq,ysq; unsigned int iter; cx=initx+initx*initx - inity*inity; cy=inity+initx*inity+initx*inity; for (iter=0;iter