r:=sqr(2);
input f$;
G$:="Z";
input e,i2;
input x1,y1,x2.y2;
label l1;
input h;
n:=(x2-x1)/h;
if int(n)<>n then print"re-enter":go l1;
dim x(n+1),y(n+1),a(i2+1),b(i2+1);
i1:=1;
label l7;
input z1;
label l6;
x3:=x1;
y3:=y1;
z3:=z1;
x(1):=x1;
y(1):=y1;
for i:=1 to n;
x:=x3;
y:=y3;
z:=z3;
p1:=h*val(f$);
p2:=h*val(g$);
y:=y+0.5*p1;
z:=z+0.5*p2;
q1:=p1;
q2:=p2;
x:=x3+0.5*h;
p1:=h*val(f$);
p2:=h*val(g$);
y:=y+(1-r*0.5)*(p1-q1);
z:=z+(1-r*0.5)*(p2-q2);
q1:=(3/r-2)*q1+(2-r)*p1;
q2:=(3/r-2)*q2+(2-r)*p2;
p1:=h*val(f$);
p2:=h*val(g$);
y:=y+(1+1/r)*(p1-q1);
z:=z+(1+1/r)*(p2-q2);
q1:=(2+r)*p1-(2+3/r)*q1;
q2:=(2+r)*p2-(2+3/r)*q2;
x:=x3+h;
p1:=h*val(f$);
p2:=h*val(g$);
y3:=y+p1/6-q1/3;
y(i+1):=y3;
x3:=x3+h;
z3:=z+p2/6-q2/3;
x(i+1):=x3;
next i;
if abs(y3-y2)
if i1=1 then a(1):=z1:b(i):=y3:i1:=2:go l3;
for o:=1 to i1-1;
if b(i)=y3 then l3;
next i;
a(i1):=z1;
b(i1):=y3;
for i:=1 to i1-1;
for j:=i+1 to i1;
if b(i)>=b(j) then l4;
w1:=b(i);
b(i):=b(j);
b(j):=w1;
w1:=a(i);
a(i):=a(j);
a(j):=w1;
label l4;
next j;
next i;
s1:=0;
s2:=1;
for i:=1 to i1;
s3:=1;
for j:=2 to i1;
if j=i then s3:=s3*(y2-b(j));go l5;
s3:=s3*(b(i)-b(j));
label l5;
next j;
s1:=s1+a(i)/s3;
s2:=s2*(y2-b(i));
next i;
z1:=s1*s2;
i1:=i1+1;
for i:=1 to i1-1;
if a(i)=z1 then l3;
next i;
gosub l6:go l6;
label l3;
gosub l6:go l7;
label l6;
for i:=1 to i1-1;
print a(i),b(i);
next i;
return;
label l2;
input n1;
for i:=1 to n+1 step n1/h;
print x(i),y(i);
next i;
end;