to share – to copy, distribute and transmit the work
to remix – to adapt the work
Under the following conditions:
attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
/*
batch file for Maxima CAS
*/
kill(all);
remvalue(all);
GiveList(r0):=
/* computes forward orbit of point r0
and saves it to the list for draw package */
block(
[r,l,i],
r:r0, /* first point */
l:[[0,r]],
for i:1 thru 65 step 1 do
( r:r*r,
l:endcons([i,r], l)),
return(l)
)$
compile(all);
/* ----------------- computations -------------------------------*/
l:GiveList(9.9999999999999956e-01);
/* ---------------- draw ------------------------------- */
path:"~/maxima/batch/julia/hyperbolic/0/"$ /* if empty then file is in a home dir */
/* draw it using draw package by */
load(draw);
/* if graphic file is empty (= 0 bytes) then run draw2d command again */
draw2d(
terminal = 'svg,
file_name = sconcat(path,"p"),
user_preamble="set size square;set key top right",
title= "Radius r<1.0 after iterations using function f(r)=r*r",
dimensions = [1000, 1000],
yrange = [-0.01,1.01],
/*xrange = [ZxMin,ZyMax],*/
xlabel = "iteration ",
ylabel = "radius",
point_type = filled_circle,
points_joined =true,
point_size = 0.5,
color = red,
key = "radius",
points(l)
);
C src code
/* gcc i.c -Wall./a.out*/#include<stdio.h>#include<float.h> // DBL_EPSILONintmain(){doubler=1.0-DBL_EPSILON;// maximal double value < 1.0doublei=0.0;// iteration number//check r value if(r!=1.0)printf("initial r = %.16f and is good \n",r);elseprintf("r is not good, increase epsilon!!! \n");do{r*=r;// r*r = r^2i+=1.0;// increase iteration numberprintf("r = %.16e after i = %.0f iterations \n",r,i);}while(r>DBL_MIN);// isnormalprintf("final r = %.16e after i = %.0f iterations \n",r,i);return0;}
Captions
Add a one-line explanation of what this file represents