function cycle_brent_test03 ( )

%*****************************************************************************80
%
%% cycle_brent_test03() tests cycle_brent() for F3.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 June 2012
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'cycle_brent_test03():\n' );
  fprintf ( 1, '  Test cycle_brent() for f3().\n' );
  fprintf ( 1, '  f3(i) = mod ( 123 * i + 456, 100000 ).\n' );

  x0 = 789;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Starting argument X0 = %d\n', x0 );

  [ lam, mu ] = cycle_brent ( @f3, x0 );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Reported cycle length is %d\n', lam );
  fprintf ( 1, '  Expected value is 50000\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Reported distance to first cycle element is %d\n', mu );
  fprintf ( 1, '  Expected value is 0\n' );

  return
end
