  nlogmax = 12;
  nvec = zeros ( nlogmax, 1 );
  nlogvec = zeros ( nlogmax, 1 );
  t1vec = zeros ( nlogmax, 1 );
  t2vec = zeros ( nlogmax, 1 );
  t3vec = zeros ( nlogmax, 1 );

  m = 1000;
  n = 1;

  for i = 1 : nlogmax
    nvec(i) = n;
    nlogvec(i) = i;
    tic
    a = sin_exp1 ( m, n );
    t1vec(i) = toc;
    tic
    b = sin_exp2 ( m, n );
    t2vec(i) = toc;
    tic
    c = sin_exp3 ( m, n );
    t3vec(i) = toc;
    n = n * 2;
  end
%
%  Plot actual times as a function of Log2(N).
%
  figure ( 1 )
  clf
  hold on
  plot ( nlogvec, t1vec, 'b-o', 'LineWidth', 2 );
  plot ( nlogvec, t2vec, 'g-o', 'LineWidth', 2 );
  plot ( nlogvec, t3vec, 'r-o', 'LineWidth', 2 );
  grid
  xlabel ( '<---Log2(N)--->' )
  ylabel ( '<---Time--->' )
  title ( 'Time Comparison of Three Equivalent Algorithms' )
  hold off
%
%  Plot relative times as a function of Log2(N).
%
  figure ( 2 )
  clf
  hold on
  plot ( nlogvec, t1vec ./ t1vec, 'b-o', 'LineWidth', 2 );
  plot ( nlogvec, t2vec ./ t1vec, 'g-o', 'LineWidth', 2 );
  plot ( nlogvec, t3vec ./ t1vec, 'r-o', 'LineWidth', 2 );
  grid
  xlabel ( '<---Log2(N)--->' )
  ylabel ( '<---Log2(Time)--->' )
  title ( 'Time Comparison of Three Equivalent Algorithms' )
  hold off

  figure ( 3 )
  clf
  hold on
  plot ( nlogvec, t1vec ./ t1vec, 'b-o', 'LineWidth', 2 );
  plot ( nlogvec, t1vec ./ t2vec, 'g-o', 'LineWidth', 2 );
  plot ( nlogvec, t1vec ./ t3vec, 'r-o', 'LineWidth', 2 );
  grid
  xlabel ( '<---Log2(N)--->' )
  ylabel ( '<---Time/Algorithm1 Time--->' )
  title ( 'Relative Speed Comparison of Three Equivalent Algorithms' )
  hold off

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Log2(N)  N  T1  T2  T3\n' );
  fprintf ( 1, '\n' );
  for i = 1 : nlogmax
    fprintf ( 1, '  %4d  %6d  %10g  %10g  %10g\n', nlogvec(i), nvec(i), t1vec(i), t2vec(i), t3vec(i) );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Log2(N)  N  T1/T1  T1/T2  T1/T3\n' );
  fprintf ( 1, '\n' );
  for i = 1 : nlogmax
    fprintf ( 1, '  %4d  %6d  %10g  %10g  %10g\n', nlogvec(i), nvec(i), ...
    t1vec(i)/t1vec(i), t1vec(i)/t2vec(i), t1vec(i)/t3vec(i) );
  end
