function [ x, w ] = hermite_gk24_set ( n )

%*****************************************************************************80
%
%% hermite_gk24_set() sets a Genz-Keister 24 Hermite rule.
%
%  Discussion:
%
%    The integral:
%
%      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
%
%    The quadrature rule:
%
%      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
%
%    A nested family of rules for the Hermite integration problem
%    was produced by Genz and Keister.  The structure of the nested
%    family was denoted by 1+2+6+10+24, that is, it comprised rules
%    of successive orders O = 1, 3, 9, 19, and 43.
%
%    The precisions of these rules are P = 1, 5, 15, 29, and 67.
%
%    Some of the data in this function was kindly supplied directly by
%    Alan Genz on 24 April 2011.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 April 2011
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Alan Genz, Bradley Keister,
%    Fully symmetric interpolatory rules for multiple integrals
%    over infinite regions with Gaussian weight,
%    Journal of Computational and Applied Mathematics,
%    Volume 71, 1996, pages 299-309
%
%    Thomas Patterson,
%    The Optimal Addition of Points to Quadrature Formulae,
%    Mathematics of Computation,
%    Volume 22, Number 104, October 1968, pages 847-856.
%
%  Input:
%
%    integer N, the order.
%    Legal values are 1, 3, 9, 19, and 43.
%
%  Output:
%
%    real X(N,1), the abscissas.
%
%    real W(N,1), the weights.
%
  w = zeros ( n, 1 );
  x = zeros ( n, 1 );

  if ( n == 1 )

    x( 1) =   0.0000000000000000;

    w( 1) =   1.7724538509055159E+00;

  elseif ( n == 3 )

    x( 1) =  -1.2247448713915889;
    x( 2) =   0.0000000000000000;
    x( 3) =   1.2247448713915889;

    w( 1) =   2.9540897515091930E-01;
    w( 2) =   1.1816359006036772E+00;
    w( 3) =   2.9540897515091930E-01;

  elseif ( n == 9 )

    x( 1) =  -2.9592107790638380;
    x( 2) =  -2.0232301911005157;
    x( 3) =  -1.2247448713915889;
    x( 4) =  -0.52403354748695763;
    x( 5) =   0.0000000000000000;
    x( 6) =   0.52403354748695763;
    x( 7) =   1.2247448713915889;
    x( 8) =   2.0232301911005157;
    x( 9) =   2.9592107790638380;

    w( 1) =   1.6708826306882348E-04;
    w( 2) =   1.4173117873979098E-02;
    w( 3) =   1.6811892894767771E-01;
    w( 4) =   4.7869428549114124E-01;
    w( 5) =   4.5014700975378197E-01;
    w( 6) =   4.7869428549114124E-01;
    w( 7) =   1.6811892894767771E-01;
    w( 8) =   1.4173117873979098E-02;
    w( 9) =   1.6708826306882348E-04;

  elseif ( n == 19 )

    x( 1) =  -4.4995993983103881;
    x( 2) =  -3.6677742159463378;
    x( 3) =  -2.9592107790638380;
    x( 4) =  -2.2665132620567876;
    x( 5) =  -2.0232301911005157;
    x( 6) =  -1.8357079751751868;
    x( 7) =  -1.2247448713915889;
    x( 8) =  -0.87004089535290285;
    x( 9) =  -0.52403354748695763;
    x(10) =   0.0000000000000000;
    x(11) =   0.52403354748695763;
    x(12) =   0.87004089535290285;
    x(13) =   1.2247448713915889;
    x(14) =   1.8357079751751868;
    x(15) =   2.0232301911005157;
    x(16) =   2.2665132620567876;
    x(17) =   2.9592107790638380;
    x(18) =   3.6677742159463378;
    x(19) =   4.4995993983103881;

    w( 1) =   1.5295717705322357E-09;
    w( 2) =   1.0802767206624762E-06;
    w( 3) =   1.0656589772852267E-04;
    w( 4) =   5.1133174390883855E-03;
    w( 5) =  -1.1232438489069229E-02;
    w( 6) =   3.2055243099445879E-02;
    w( 7) =   1.1360729895748269E-01;
    w( 8) =   1.0838861955003017E-01;
    w( 9) =   3.6924643368920851E-01;
    w(10) =   5.3788160700510168E-01;
    w(11) =   3.6924643368920851E-01;
    w(12) =   1.0838861955003017E-01;
    w(13) =   1.1360729895748269E-01;
    w(14) =   3.2055243099445879E-02;
    w(15) =  -1.1232438489069229E-02;
    w(16) =   5.1133174390883855E-03;
    w(17) =   1.0656589772852267E-04;
    w(18) =   1.0802767206624762E-06;
    w(19) =   1.5295717705322357E-09;

  elseif ( n == 43 )

    x( 1) = -10.167574994881873;
    x( 2) =  -7.231746029072501;
    x( 3) =  -6.535398426382995;
    x( 4) =  -5.954781975039809;
    x( 5) =  -5.434053000365068;
    x( 6) =  -4.952329763008589;
    x( 7) =  -4.4995993983103881;
    x( 8) =  -4.071335874253583;
    x( 9) =  -3.6677742159463378;
    x(10) =  -3.295265921534226;
    x(11) =  -2.9592107790638380;
    x(12) =  -2.633356763661946;
    x(13) =  -2.2665132620567876;
    x(14) =  -2.089340389294661;
    x(15) =  -2.0232301911005157;
    x(16) =  -1.8357079751751868;
    x(17) =  -1.583643465293944;
    x(18) =  -1.2247448713915889;
    x(19) =  -0.87004089535290285;
    x(20) =  -0.52403354748695763;
    x(21) =  -0.196029453662011;
    x(22) =   0.0000000000000000;
    x(23) =   0.196029453662011;
    x(24) =   0.52403354748695763;
    x(25) =   0.87004089535290285;
    x(26) =   1.2247448713915889;
    x(27) =   1.583643465293944;
    x(28) =   1.8357079751751868;
    x(29) =   2.0232301911005157;
    x(30) =   2.089340389294661;
    x(31) =   2.2665132620567876;
    x(32) =   2.633356763661946;
    x(33) =   2.9592107790638380;
    x(34) =   3.295265921534226;
    x(35) =   3.6677742159463378;
    x(36) =   4.071335874253583;
    x(37) =   4.4995993983103881;
    x(38) =   4.952329763008589;
    x(39) =   5.434053000365068;
    x(40) =   5.954781975039809;
    x(41) =   6.535398426382995;
    x(42) =   7.231746029072501;
    x(43) =  10.167574994881873;

    w( 1) =   0.546191947478318097E-37;
    w( 2) =   0.87544909871323873E-23;
    w( 3) =   0.992619971560149097E-19;
    w( 4) =   0.122619614947864357E-15;
    w( 5) =   0.421921851448196032E-13;
    w( 6) =   0.586915885251734856E-11;
    w( 7) =   0.400030575425776948E-09;
    w( 8) =   0.148653643571796457E-07;
    w( 9) =   0.316018363221289247E-06;
    w(10) =   0.383880761947398577E-05;
    w(11) =   0.286802318064777813E-04;
    w(12) =   0.184789465688357423E-03;
    w(13) =   0.150909333211638847E-02;
    w(14) = - 0.38799558623877157E-02;
    w(15) =   0.67354758901013295E-02;
    w(16) =   0.139966252291568061E-02;
    w(17) =   0.163616873493832402E-01;
    w(18) =   0.450612329041864976E-01;
    w(19) =   0.928711584442575456E-01;
    w(20) =   0.145863292632147353E+00;
    w(21) =   0.164880913687436689E+00;
    w(22) =   0.579595986101181095E-01;
    w(23) =   0.164880913687436689E+00;
    w(24) =   0.145863292632147353E+00;
    w(25) =   0.928711584442575456E-01;
    w(26) =   0.450612329041864976E-01;
    w(27) =   0.163616873493832402E-01;
    w(28) =   0.139966252291568061E-02;
    w(29) =   0.67354758901013295E-02;
    w(30) = - 0.38799558623877157E-02;
    w(31) =   0.150909333211638847E-02;
    w(32) =   0.184789465688357423E-03;
    w(33) =   0.286802318064777813E-04;
    w(34) =   0.383880761947398577E-05;
    w(35) =   0.316018363221289247E-06;
    w(36) =   0.148653643571796457E-07;
    w(37) =   0.400030575425776948E-09;
    w(38) =   0.586915885251734856E-11;
    w(39) =   0.421921851448196032E-13;
    w(40) =   0.122619614947864357E-15;
    w(41) =   0.992619971560149097E-19;
    w(42) =   0.87544909871323873E-23;
    w(43) =   0.546191947478318097E-37;

  else

    fprintf ( 1, '\n' );
    fprintf ( 1, 'HERMITE_GK24_SET - Fatal error!\n' );
    fprintf ( 1, '  Illegal input value of N.\n' );
    fprintf ( 1, '  N must be 1, 3, 9, 19, or 43.\n' );
    error ( 'HERMITE_GK24_SET - Fatal error!' );

  end

  return
end
