Category: Escape-time Fractal

This is the 'speed' version of the complex Mandelbrot algorithm. It makes use of Maple V's evalhf command, which conducts floating-point calculations by using the hardware coprocessor. As a result a calculation that takes around 25 minutes with complex arithmetics is finished after around two minutes on a Pentium 90 MHz PC.

> restart: with(plots):

> mandelbrot_fast:=proc(x, y)
>    local xn, xnold, yn, m;
>    Digits:=10; # optional
>    xn:=x;
>    yn:=y;
>    for m from 0 to 25 while evalhf(sqrt(xn^2+yn^2)) < 2 do
>       xnold:=xn;   
>       xn:=evalhf(xn^2-yn^2+x);
>       yn:=evalhf(2*xnold*yn+y)
>    od;
>    m;
> end:

> plot3d(0, -2 .. 0.7, -1.1 .. 1.1, orientation=[-90,0], grid=[250, 250], 
> style=patchnogrid, scaling=constrained, color=mandelbrot_fast);

See also Faster Generation of Fractals for tips on how to transform complex formulas to corresponding real ones in order use the evalhf command.

last back next

MAPLE V FRACTALS MandelbrotFast #1.00b current as of July 27, 1996
Author: Alexander F. Walz,
Original file location: