Jump to content
IGNORED

Bench-marking FP Routines with Fractal Zoom


Recommended Posts

I decided to use a math-heavy BASIC program from Antic magazine called Fractal Zoom to test the built-in floating-point routines. I ran it in Atari BASIC, then BASIC-XE using it's own FP routines. I even made an Action! port that called the built-in routines.

 

All tests were done with the default values for A-corner, B-corner and Side, and in GTIA 9-colour mode.

 

To draw the first screen, Atari BASIC took 9.55 hours, and BASIC-XE using it's own FP took 3.02.

 

The Action! port took about 9.5 hours, almost as long as the Atari BASIC version. That in itself says a lot! :(

 

So, if you ever need to use floating-point in a speed-critical program, you might want to try something other than the built-in routines! :)

 

  • Like 5
Link to comment
Share on other sites

This fractal program took less than one hour :)

//Mad pascal 24-08-2017 
uses Crt,fastgraph;
const	
	lngth:byte = 79;
	height:byte = 191;
	colors:array[0..100] of byte=(
	15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
	15,15,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,13,
	13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,12,12,12,12,
	12,11,11,11,11,11,11,11,11,10,10,10,10,10,10, 9, 9, 9, 9, 9,
	 8, 8, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 3, 3, 2, 2, 1);
	four:single=4.0;
var x,y,count,lastc,nowc:byte;
	ac,az,az2,bc,bz,bz2,acorner,bcorner,side,gapl,gaph,size:single;
	xs,ys:single;
begin
 lastc:=0;ys:=0;
 acorner:=-2;
 bcorner:=-1.145288;
 side:=0.253866;
 gapl:=10*(side/single(lngth));
 gaph:=10*(side/single(height));
 Initgraph(9);
 for y:=0 to height do
 begin
  bc:=ys*gaph+bcorner;
  xs:=0;
  for x:=0 to lngth do
  begin
   ac:=xs*gapl+acorner;
   az:=0;
   bz:=0; 
   count:=0;
   repeat
    az2:=(az*az)-(bz*bz)+ac;
    bz2:=2*az*bz+bc;
    az:=az2;bz:=bz2;
    size:=az2*az2+bz2*bz2;
    inc(count);
   until ((size>four) or (count>99)); 
   nowc:=colors[count];
   if nowc<>lastc then 
   begin
    lastc:=nowc;
    SetColor(lastc);
   end;
   PutPixel(x,y);
   xs:=xs+1;
  end;
  ys:=ys+1;
 end;
 repeat until keypressed;	
end.

fractal.xex

  • Like 3
Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...