{1. First: sin^2(x)+cos^2(x)=1 (using 2 variables, even!)}
INCLUDE 'COSY'; {includes necessary functions and the begin statement}
procedure run;
variable x 80;
variable v 100;
function random fillfactor;
DARAN random fillfactor; {weird reversed function}
endfunction;
function f x y;
{enter function here}
f:=(sqr(sin(x))+sqr(cos(x))+sqr(sin(y))+sqr(cos(y)))
/2 {number of variables};
endfunction;
daini 5 2 0 x ; {order} {number of variables} {0} {doesn't matter}
v:=f(random(.5),random(.5)); {derivatives of the function}
write 6 v;
endprocedure;
run;
end;
{2.Beware evil formatting problems. Ok, here's exp(a+b)-exp(a)*exp(b)=0}
INCLUDE 'COSY'; {includes necessary functions and the begin statement}
procedure run;
variable x 80;
variable v 100;
function random fillfactor;
DARAN random fillfactor;
{weird reversed function}
endfunction;
function f x y;
{enter function here}
f:=exp(x+y)-exp(x)*exp(y);
{number of variables}
endfunction;
daini 5 2 0 x ; {order} {number of variables} {0} {doesn't matter}
v:=f(random(.5),random(.5)); {derivatives of the function}
write 6 v;
endprocedure;
run;
end;
{3.And then there's exp(log(abs(x)))-abs(x)= 0:}
INCLUDE 'COSY'; {includes necessary functions and the begin statement}
procedure run;
variable x 80;
variable v 100;
function random fillfactor;
DARAN random fillfactor;
{weird reversed function}
endfunction;
function f x ;
{enter function here}
f:=exp(log(abs(x)))-abs(x);
{number of variables}
endfunction;
daini 5 1 0 x ; {order} {number of variables} {0} {doesn't matter}
v:=f(random(.5)); {derivatives of the function}
write 6 v;
endprocedure;
run;
end;
{4.And finally cosh^2(x)-sinh^2(x)=1:}
INCLUDE 'COSY'; {includes necessary functions and the begin statement}
procedure run;
variable x 80;
variable v 100;
function random fillfactor;
DARAN random fillfactor;
{weird reversed function}
endfunction;
function f x;
{enter function here}
f:=sqr(cosh(x))-sqr(sinh(x));
{number of variables}
endfunction;
daini 5 1 0 x ; {order} {number of variables} {0} {doesn't matter}
v:=f(random(.5)); {derivatives of the function}
write 6 v;
endprocedure;
run;
end;
{5.Whew! Ok, finally. I found the book and wrote those test programs. Yea!
./cosy Got it? telnet dvorak right I will remember this. trigun.pl dev.fox convert.pl use wordpad to open with proper formatting. Though, quite frankly, I don't remember why this is here. It may be an attempt.}
INCLUDE 'COSY'; {includes necessary functions and the begin statement}
procedure run;
variable x 80;
variable v 100;
function random fillfactor;
DARAN random fillfactor; {weird reversed function}
endfunction;
function f x y;
{enter function here}
f:=(sqr(sin(x))+sqr(cos(x))+sqr(sin(y))+sqr(cos(y)))
/2 {number of variables}; # {exp(log(x))-x = 0}{exp(a+b)=exp(a)*exp(b) arcsin(sin(x))-x cosh^2(x)-sinh^2(x)=1}
endfunction;
daini 5 2 0 x ; {order} {number of variables} {0} {doesn't matter}
v:=f(random(.5),random(.5)); {derivatives of the function}
write 6 v;
endprocedure;
run;
end;