how can a software engineer possibly be so optimistic?!
hehe.
Most of the code is from emilio.
I think there is some comment in Italian too.
I don't know much either about the Metropolis-hasting algorithm.
I think that "quite well" is : good enough to produce the expected result
I switched to Visual Studio (but i'm trying to keep the code standard enough so it may be portable)
So i created a new repository :
https://github.com/ker2x/WinbuddhaVS/I cleaned some more code, switched to std::complex, added some optimisation.
double cr = begin.real();
double ci = begin.imag();
double ci2 = ci*ci;
//Quick rejection check if c is in 2nd order period bulb
if( (cr+1.0) * (cr+1.0) + ci2 < 0.0625) return -1;
//Quick rejection check if c is in main cardioid
double q = (cr-0.25)*(cr-0.25) + ci2;
if( q*(q+(cr-0.25)) < 0.25*ci2) return -1;
// test for the smaller bulb left of the period-2 bulb
if (( ((cr+1.309)*(cr+1.309)) + ci*ci) < 0.00345) return -1;
// check for the smaller bulbs on top and bottom of the cardioid
if ((((cr+0.125)*(cr+0.125)) + (ci-0.744)*(ci-0.744)) < 0.0088) return -1;
if ((((cr+0.125)*(cr+0.125)) + (ci+0.744)*(ci+0.744)) < 0.0088) return -1;
It very ugly, i did that before switching to std::complex.
Now that i switched to std::complex i can probably use this instead (it's fortran code) :
IF(((ABS(c - CMPLX(-1,0) )) < 0.25) .OR. ((ABS( 1.0 - SQRT(1-(4*c)) )) < 1.0 ) ) THEN
I'll try tomorrow.
Good night