Standard logistic map x=r*(x(1-x))

Logistic map x=(r*r)*(x(1-x))

Logistic map x=sqrt(r)*(x(1-x))

#include <iostream>

#include <cmath>

using namespace std;

int main(void)

{

float r,x0,x;

const int NSAVE = 500;

const int NITER = 5000 + NSAVE;

for(r=-3;r<45;r+=0.005)

{

x0=0.9;

x=x0;

for(int i=0; i<NITER; i++)

{

x = (r*r)*(x*(1-x));

//x = x*exp(r*(1-x)); // eq. 4. May Nature 76

if(i>NITER-NSAVE)

if(isfinite(x))

cout << r << " " << x << endl;

}

}

return 1;

}

#include <cmath>

using namespace std;

int main(void)

{

float r,x0,x;

const int NSAVE = 500;

const int NITER = 5000 + NSAVE;

for(r=-3;r<45;r+=0.005)

{

x0=0.9;

x=x0;

for(int i=0; i<NITER; i++)

{

x = (r*r)*(x*(1-x));

//x = x*exp(r*(1-x)); // eq. 4. May Nature 76

if(i>NITER-NSAVE)

if(isfinite(x))

cout << r << " " << x << endl;

}

}

return 1;

}