function [ x, w ] = hermite_probabilist_set ( n )

%*****************************************************************************80
%
%% HERMITE_PROBABILIST_SET: probabilist Hermite quadrature.
%
%  Discussion:
%
%    The integral:
%
%      integral ( -oo < x < +oo ) f(x) * rho(x) dx
%
%    The weight:
%
%      rho(x) = exp ( - x * x / 2 ) / sqrt ( 2 * pi ) dx
%
%    The quadrature rule:
%
%      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    08 June 2013
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Stephen Wolfram,
%    The Mathematica Book,
%    Fourth Edition,
%    Cambridge University Press, 1999,
%    ISBN: 0-521-64314-7,
%    LC: QA76.95.W65.
%
%  Parameters:
%
%    Input, integer N, the order.
%
%    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.0;

    w(1) = 1.00000000000000000000000000000;

  elseif ( n == 2 )

    x(1) = -1.00000000000000000000000000000;
    x(2) = +1.00000000000000000000000000000;

    w(1) = 0.50000000000000000000000000000;
    w(2) = 0.50000000000000000000000000000;

  elseif ( n == 3 )

    x(1) = -1.73205080756887729352744634151;
    x(2) =  0.0;
    x(3) = +1.73205080756887729352744634151;

    w(1) = 0.166666666666666666666666666667;
    w(2) = 0.666666666666666666666666666667;
    w(3) = 0.166666666666666666666666666667;

  elseif ( n == 4 )

    x(1) = -2.33441421833897723931751226721;
    x(2) = -0.741963784302725857648513596726;
    x(3) = +0.741963784302725857648513596726;
    x(4) = +2.33441421833897723931751226721;

    w(1) = 0.0458758547680684918168929937745;
    w(2) = 0.454124145231931508183107006225;
    w(3) = 0.454124145231931508183107006225;
    w(4) = 0.0458758547680684918168929937745;

  elseif ( n == 5 )

    x(1) = -2.85697001387280565416230426401;
    x(2) = -1.35562617997426586583052129087;
    x(3) =  0.0;
    x(4) = +1.35562617997426586583052129087;
    x(5) = +2.85697001387280565416230426401;

    w(1) = 0.0112574113277206889333702151856;
    w(2) = 0.222075922005612644399963118148;
    w(3) = 0.533333333333333333333333333333;
    w(4) = 0.222075922005612644399963118148;
    w(5) = 0.0112574113277206889333702151856;

  elseif ( n == 6 )

    x(1) = -3.32425743355211895236183546247;
    x(2) = -1.88917587775371067550566789858;
    x(3) = -0.616706590192594152193686099399;
    x(4) = +0.616706590192594152193686099399;
    x(5) = +1.88917587775371067550566789858;
    x(6) = +3.32425743355211895236183546247;

    w(1) = 0.00255578440205624643060629074383;
    w(2) = 0.0886157460419145274808558830057;
    w(3) = 0.40882846955602922608853782625;
    w(4) = 0.40882846955602922608853782625;
    w(5) = 0.0886157460419145274808558830057;
    w(6) = 0.00255578440205624643060629074383;

  elseif ( n == 7 )

    x(1) = -3.75043971772574225630392202571;
    x(2) = -2.36675941073454128861885646856;
    x(3) = -1.15440539473996812723959775884;
    x(4) =  0.0;
    x(5) = +1.15440539473996812723959775884;
    x(6) = +2.36675941073454128861885646856;
    x(7) = +3.75043971772574225630392202571;

    w(1) = 0.000548268855972217791621570532802;
    w(2) = 0.0307571239675864970396450057164;
    w(3) = 0.240123178605012713740161995179;
    w(4) = 0.457142857142857142857142857143;
    w(5) = 0.240123178605012713740161995179;
    w(6) = 0.0307571239675864970396450057164;
    w(7) = 0.000548268855972217791621570532802;

  elseif ( n == 8 )

    x(1) = -4.14454718612589433206019783917;
    x(2) = -2.80248586128754169911301080618;
    x(3) = -1.63651904243510799922544657297;
    x(4) = -0.539079811351375108072461918694;
    x(5) = +0.539079811351375108072461918694;
    x(6) = +1.63651904243510799922544657297;
    x(7) = +2.80248586128754169911301080618;
    x(8) = +4.14454718612589433206019783917;

    w(1) = 0.00011261453837536777039380201687;
    w(2) = 0.00963522012078826718691913771988;
    w(3) = 0.117239907661759015117137525962;
    w(4) = 0.373012257679077349925549534301;
    w(5) = 0.373012257679077349925549534301;
    w(6) = 0.117239907661759015117137525962;
    w(7) = 0.00963522012078826718691913771988;
    w(8) = 0.00011261453837536777039380201687;

  elseif ( n == 9 )

    x(1) = -4.51274586339978266756667884317;
    x(2) = -3.20542900285646994336567590292;
    x(3) = -2.07684797867783010652215614374;
    x(4) = -1.02325566378913252482814822581;
    x(5) =  0.0;
    x(6) = +1.02325566378913252482814822581;
    x(7) = +2.07684797867783010652215614374;
    x(8) = +3.20542900285646994336567590292;
    x(9) = +4.51274586339978266756667884317;

    w(1) = 0.0000223458440077465836484639907118;
    w(2) = 0.00278914132123176862881344575164;
    w(3) = 0.0499164067652178740433414693826;
    w(4) = 0.2440975028949394361410220177;
    w(5) = 0.406349206349206349206349206349;
    w(6) = 0.2440975028949394361410220177;
    w(7) = 0.0499164067652178740433414693826;
    w(8) = 0.00278914132123176862881344575164;
    w(9) = 0.0000223458440077465836484639907118;

  elseif ( n == 10 )

    x(1) =  -4.85946282833231215015516494660;
    x(2) =  -3.58182348355192692277623675546;
    x(3) =  -2.48432584163895458087625118368;
    x(4) =  -1.46598909439115818325066466416;
    x(5) =  -0.484935707515497653046233483105;
    x(6) =  +0.484935707515497653046233483105;
    x(7) =  +1.46598909439115818325066466416;
    x(8) =  +2.48432584163895458087625118368;
    x(9) =  +3.58182348355192692277623675546;
    x(10) = +4.85946282833231215015516494660;

    w(1) =  0.0000043106526307182867322209547262;
    w(2) =  0.000758070934312217670069636036508;
    w(3) =  0.0191115805007702856047383687629;
    w(4) =  0.135483702980267735563431657727;
    w(5) =  0.344642334932019042875028116518;
    w(6) =  0.344642334932019042875028116518;
    w(7) =  0.135483702980267735563431657727;
    w(8) =  0.0191115805007702856047383687629;
    w(9) =  0.000758070934312217670069636036508;
    w(10) = 0.0000043106526307182867322209547262;

  else

    fprintf ( 1, '\n' );
    fprintf ( 1, 'HERMITE_PROBABILIST_SET - Fatal error!\n' );
    fprintf ( 1, '  Illegal value of N = %d\n', n );
    fprintf ( 1, '  Legal values are 1:10.\n' );
    error ( 'HERMITE_PROBABILIST_SET - Fatal error!' );

  end

  return
end
