function [ x, w ] = legendre_set_log ( n )

%*****************************************************************************80
%
%% LEGENDRE_SET_LOG sets a Gauss-Legendre rule for - LOG(X) * F(X) on [0,1].
%
%  Discussion:
%
%    The integral:
%
%      Integral ( 0 <= X <= 1 ) - LOG(X) * F(X) dX
%
%    The quadrature rule:
%
%      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    13 October 2005
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Abramowitz, Stegun,
%    Handbook of Mathematical Functions,
%    National Bureau of Standards, 1964, page 920.
%
%    Gwynne Evans,
%    Practical Numerical Integration,
%    Wiley, 1993, QA299.3E93, page 309.
%
%    Arthur Stroud, Don Secrest,
%    Gaussian Quadrature Formulas,
%    Prentice Hall, 1966,
%    LC: QA299.4G3S7.
%
%  Parameters:
%
%    Input, integer N, the order.
%    N must be between 1 through 8, or 16.
%
%    Output, real X(N), the abscissas.
%
%    Output, real W(N), the weights.
%
  x = zeros ( n, 1 );
  w = zeros ( n, 1 );

  if ( n == 1 )

    x(1) = 0.25;

    w(1) = 1.0;

  elseif ( n == 2 )

    x(1) = 0.112008806166976182957205488948;
    x(2) = 0.602276908118738102757080225338;

    w(1) = 0.718539319030384440665510200891;
    w(2) = 0.281460680969615559334489799109;

  elseif ( n == 3 )

    x(1) = 0.0638907930873254049961166031363;
    x(2) = 0.368997063715618765546197645857;
    x(3) = 0.766880303938941455423682659817;

    w(1) = 0.513404552232363325129300497567;
    w(2) = 0.391980041201487554806287180966;
    w(3) = 0.0946154065661491200644123214672;

  elseif ( n == 4 )

    x(1) = 0.0414484801993832208033213101564;
    x(2) = 0.245274914320602251939675759523;
    x(3) = 0.556165453560275837180184354376;
    x(4) = 0.848982394532985174647849188085;

    w(1) = 0.383464068145135124850046522343;
    w(2) = 0.386875317774762627336008234554;
    w(3) = 0.190435126950142415361360014547;
    w(4) = 0.0392254871299598324525852285552;

  elseif ( n == 5 )

    x(1) = 0.0291344721519720533037267621154;
    x(2) = 0.173977213320897628701139710829;
    x(3) = 0.411702520284902043174931924646;
    x(4) = 0.677314174582820380701802667998;
    x(5) = 0.894771361031008283638886204455;

    w(1) = 0.297893471782894457272257877888;
    w(2) = 0.349776226513224180375071870307;
    w(3) = 0.234488290044052418886906857943;
    w(4) = 0.0989304595166331469761807114404;
    w(5) = 0.0189115521431957964895826824218;

  elseif ( n == 6 )

    x(1) = 0.0216340058441169489956958558537;
    x(2) = 0.129583391154950796131158505009;
    x(3) = 0.314020449914765508798248188420;
    x(4) = 0.538657217351802144548941893993;
    x(5) = 0.756915337377402852164544156139;
    x(6) = 0.922668851372120237333873231507;

    w(1) = 0.238763662578547569722268303330;
    w(2) = 0.308286573273946792969383109211;
    w(3) = 0.245317426563210385984932540188;
    w(4) = 0.142008756566476685421345576030;
    w(5) = 0.0554546223248862900151353549662;
    w(6) = 0.0101689586929322758869351162755;

  elseif ( n == 7 )

    x(1) = 0.0167193554082585159416673609320;
    x(2) = 0.100185677915675121586885031757;
    x(3) = 0.246294246207930599046668547239;
    x(4) = 0.433463493257033105832882482601;
    x(5) = 0.632350988047766088461805812245;
    x(6) = 0.811118626740105576526226796782;
    x(7) = 0.940848166743347721760134113379;

    w(1) = 0.196169389425248207525427377585;
    w(2) = 0.270302644247272982145271719533;
    w(3) = 0.239681873007690948308072785252;
    w(4) = 0.165775774810432906560869687736;
    w(5) = 0.0889432271376579644357238403458;
    w(6) = 0.0331943043565710670254494111034;
    w(7) = 0.00593278701512592399918517844468;

  elseif ( n == 8 )

    x(1) = 0.0133202441608924650122526725243;
    x(2) = 0.0797504290138949384098277291424;
    x(3) = 0.197871029326188053794476159516;
    x(4) = 0.354153994351909419671463603538;
    x(5) = 0.529458575234917277706149699996;
    x(6) = 0.701814529939099963837152670310;
    x(7) = 0.849379320441106676048309202301;
    x(8) = 0.953326450056359788767379678514;

    w(1) = 0.164416604728002886831472568326;
    w(2) = 0.237525610023306020501348561960;
    w(3) = 0.226841984431919126368780402936;
    w(4) = 0.175754079006070244988056212006;
    w(5) = 0.112924030246759051855000442086;
    w(6) = 0.0578722107177820723985279672940;
    w(7) = 0.0209790737421329780434615241150;
    w(8) = 0.00368640710402761901335232127647;

  elseif ( n == 16 )

    x( 1) = 0.00389783448711591592405360527037;
    x( 2) = 0.0230289456168732398203176309848;
    x( 3) = 0.0582803983062404123483532298394;
    x( 4) = 0.108678365091054036487713613051;
    x( 5) = 0.172609454909843937760843776232;
    x( 6) = 0.247937054470578495147671753047;
    x( 7) = 0.332094549129917155984755859320;
    x( 8) = 0.422183910581948600115088366745;
    x( 9) = 0.515082473381462603476277704052;
    x(10) = 0.607556120447728724086384921709;
    x(11) = 0.696375653228214061156318166581;
    x(12) = 0.778432565873265405203868167732;
    x(13) = 0.850850269715391083233822761319;
    x(14) = 0.911086857222271905418818994060;
    x(15) = 0.957025571703542157591520509383;
    x(16) = 0.987047800247984476758697436516;

    w( 1) = 0.0607917100435912328511733871235;
    w( 2) = 0.102915677517582144387691736210;
    w( 3) = 0.122355662046009193557547513197;
    w( 4) = 0.127569246937015988717042209239;
    w( 5) = 0.123013574600070915423123365137;
    w( 6) = 0.111847244855485722621848903429;
    w( 7) = 0.0965963851521243412529681650802;
    w( 8) = 0.0793566643514731387824416770520;
    w( 9) = 0.0618504945819652070951360853113;
    w(10) = 0.0454352465077266686288299526509;
    w(11) = 0.0310989747515818064092528627927;
    w(12) = 0.0194597659273608420780860268669;
    w(13) = 0.0107762549632055256455393162159;
    w(14) = 0.00497254289008764171250524951646;
    w(15) = 0.00167820111005119451503546419059;
    w(16) = 0.000282353764668436321778085987413;

  else

    fprintf ( 1, '\n' );
    fprintf ( 1, 'LEGENDRE_SET_LOG - Fatal error!\n' );
    fprintf ( 1, '  Illegal value of N = %d\n', n );
    error ( 'LEGENDRE_SET_LOG - Fatal error!' );

  end

  return
end
