Code: Select all
#include <stdio.h>
#include <math.h>
#include <gray.h>
float a,b,c,d,e,g,h,i,j;
int x,y;
int xmax,ymax;
int k;
float l,m,n,o,p;
void main()
{
g_clg(G_WHITE);
xmax=255;
ymax=63;
a=0.10167; //b=0.1077;
b=0.105;
c=-0.60767; d=-0.6055;
e=4.0;
g=(b-a)/(float)xmax;
h=(d-c)/(float)ymax;
for(y=ymax; y>0; y--)
{
j=(float)y*h+c;
for(x=xmax; x>0; x--)
{
i=(float)x*g+a;
k=0;
l=0.0; m=0.0; n=0.0; o=0.0;
l110: k++;
if (k<100) // Iterations (if you have time, raise to 150 or more)
{
p=n-o+i;
m=2.0*l*m+j;
l=p;
n=l*l; o=m*m;
if ((n+o)<e) goto l110;
g_plot (15+x,y,k&3);
}
}
}
while (1) {}
}
EDIT: re-tuned to reduce the computation depth. Still very slow !
zcc +zx81 -subtype=grayarx -clib=arx64 -create-app -lm gmandel.c
zcc +zx81 -subtype=gray -clib=wrx64 -create-app -lm gmandel.c