  s = 0;
  k = 0;
  while ( true )
    k = k + 1;
    t = 1 / k^2;
    if ( t < eps * s )
      break
    end
    s = s + t;
  end
  s = sqrt ( 6 * s );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Pi             = %20.16f\n', pi );
  fprintf ( 1, '  Estimate       = %20.16f\n', s );
  fprintf ( 1, '  Absolute error = %g\n', abs ( s - pi ) );
  fprintf ( 1, '  Next term      = %g\n', t );
  fprintf ( 1, '  Used %d terms\n', k - 1 );

