begin
library A0, A1, A4, A5, A15;

   integer i, j, k, k1;
   real  t1,  t2, c;

   real procedure ICR(t); value t; real t;
      kdf9 2/0/0/0;
      SET 99; OUT; SET 47; FLOAT; {t}; -F; exit 
      algol 

  integer procedure ackermann(m, n);
      value  m, n;
      integer m, n;
      ackermann :=
         if m = 0 then
            n + 1
         else if n = 0 then
            ackermann(m - 1, 1)
         else
            ackermann(m - 1, ackermann(m, n - 1));

   integer procedure Ack(m, n);
      value  m, n;
      integer m, n;
      TAIL:
         if m = 0 then
            Ack := n + 1
         else if n = 0 then
            begin
               n := 1;
               m := m - 1;
               goto TAIL;
            end
         else
            begin
               n := Ack(m, n - 1);
               m := m - 1;
               goto TAIL;
            end 

   c  := ICR(0.0);
   c  := ICR(c);

   writetext(30, {Fully _ recursive{c}});

   k:= 16;
   k1 := 1;
   for i := 1 step 1 until 7 do
         begin
         t1 := ICR(0.0);
         j := ackermann(3, i);
         t2 := ICR(t1) - c;
         write(30, format({nds}),  i);
         write(30, format({ndddd}), 3 × t2 / (512 × k1 - 15 × k + 9 × i + 37) );
         writetext(30, { _ instructions _ per _ call{c}});
         k1 := 4 × k1;
         k := 2 × k;
         end 

   writetext(30, {With _ tail _ calls _ looping{c}});

   k:= 16;
   k1 := 1;
   for i := 1 step 1 until 7 do
         begin
         t1 := ICR(0.0);
         j := Ack(3, i);
         t2 := ICR(t1) - c;
         write(30, format({nds}),  i);
         write(30, format({ndddd}), 3 × t2 / (512 × k1 - 15 × k + 9 × i + 37) );
         writetext(30, { _ instructions _ per _ call{c}});
         k1 := 4 × k1;
         k := 2 × k;
         end 
end
|