function value = gram_beta ( n, m )

%*****************************************************************************80
%
%% gram_beta evaluates a factor used in evaluating Gram polynomials.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 June 2019
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Germund Dahlquist, Ake Bjorck,
%    Numerical Methods in Scientific Computing,
%    Volume 1,
%    SIAM, 2008,
%    ISBN: 978-0-898716-44-3,
%    LC: QA297.D335 2008.
%    
%  Input:
%
%    integer n, the index of the polynomial.
%    n < m.
%
%    integer m, the number of points used in defining the polynomials.
%
%  Output:
%
%    real value, the value of the factor.
%

  if ( n < 0 )
    value = 0.0;
  elseif ( m <= 0 )
    value = 0.0;
  elseif ( m <= n )
    value = 0.0;
  else
    value = ( m + n ) * ( m - n ) * n^2 / m^2 / ( 4.0 * n^2 - 1.0 );
  end

  return
end

