Collatz:= proc(b,a) #Axes switched local z:= a+b*I, k; #real part negated for k to 31 while abs(Im(z)) < 1 do z:= (1+4*z(1+2*z)*cos(Pi*z))/4 end do; k #escape time end proc:
#Test evalhf'ability:
evalhf(Collatz(0,1));
plotsetup( jpeg, plotoutput= "C:/Users/Carl/desktop/Collatz.jpg", plotoptions="height= 1024, width= 1024, quality= 95" );
CodeTools:Usage( plots:densityplot( Collatz, 1..1, # imaginary range 0.5..4.5, #negative of real range colorstyle= HUE, grid= [1024, 1024], style= patchnogrid, labels= [Im,Re], labelfont= [TIMES, BOLD, 14], axes= boxed, caption= cat(" Happy New Year ",
StringTools:FormatTime("%Y")), captionfont= [HELVETICA, BOLDOBLIQUE, 18] ) );
memory used=24.08MiB, alloc change=24.00MiB, cpu time=7.78s, real time=7.79s
