(load("rk_adaptive"),done);
done;

(data:rk_adaptive(-1/10*x,x,1,t,0,100,maxabserr=1e-4),done);
done;

is(last(data[1])>=100);
true;

is(first(data[1])=0);
true;

is(apply('max,map(lambda([t,x],abs(x-%e^(-(t/10)))),data[1],data[2]))<1e-3);
true;

is(apply('max,map(lambda([t,x],abs(x-%e^(-(t/10)))),data[1],data[2]))>1e-4);
true;

is(length(data[1])>1000);
true;

(data:rk_adaptive(-1/10*x,x,1,t,0,100,maxabserr=1e-5),done);
done;

is(last(data[1])>=100);
true;

is(first(data[1])=0);
true;

is(apply('max,map(lambda([t,x],abs(x-%e^(-(t/10)))),data[1],data[2]))<1e-4);
true;

is(length(data[1])>3000);
true;

(data:rk_adaptive(1/10*x,x,1,t,100.0,0,maxabserr=1e-4),done);
done;

is(apply('max,map(lambda([t,x],abs(x-%e^(-10)*%e^(t/10))),data[1],data[2]))<1e-3);
true;

(kill(data),done);
done;