Skip to content

基函数与数值积分

基函数

The basis functions used here are Lagrange basis functions, wherein each function evaluates to 1 when assessed at its respective node and yields 0 at all other nodes.

The basis functions are defined on the simplices. The \(M\) dimensional simplex is defined by \(M+1\) vertices where every points within the simplex are convex combinations of those vertices.

A shape is considered convex if and only if any two points on the shape always form a segment that lies entirely within that shape. When a shape is convex, any point on that shape can be represented as the linear combination of the shape's vertices. For example, the triangle \(T\) can be represented as

\[ T(v_1, v_2, v_3)=\{ p: p = \xi_1 v_1 + \xi_2 v_2 + \xi_3 v_3; \quad \xi_1+\xi_2+\xi_3 \leq 1 \} \]

where the \(\xi_n\) are coefficients and \(v_n\) are three vertices.

If the \(M\) dimensional simplex has the basis function with highest order \(d\), then a basis function can be formed by \((d+1)^M\) monomials, with \(d+1\) nodes in each dimension.

基函数求导

假设 reference cell \(S_R\) 的坐标是 \(\vec{u}=(r,s,t)\)

有映射从 reference cell 到 real cell: \(F(\vec{u}): S_R \rightarrow Q\)

\(Q\) 的坐标是 \(F(\vec{u})=\vec{R}=(x,y,z)\), 则有 Jacobian matrix \(J=\frac{\partial F}{\partial u}\)

所以积分为

\[ \int_{Q} g(\vec{R}) \, dS = \int_{S_R} g(F(\vec{u})) |\det(J)| \, du. \]

注意,reference cell 上基函数的值与 real cell 上基函数的值相等:

\[ \hat{\phi}(\vec{u}) = \phi(F(\vec{u})) = \phi(\vec{R}) \]

Jacobian 除了出现在积分中,也出现在 gradient 中:

\[ \begin{aligned} \nabla \hat{\phi}(\vec{u}) &= F^\prime(\vec{u})^T \nabla\phi(\vec{R}) \\ &= J^T\nabla \phi(\vec{R}) \end{aligned} \]

因此也有:

\[ \nabla \phi(\vec{R}) = J^{-T} \nabla \hat{\phi}(\vec{u}) \]

展开写的话,就比较好理解为什么有转置了 (\(\hat{\nabla}_u = J^T \nabla_R\), \(\nabla_R=J^{-T} \hat{\nabla}_u\)) :

\[ \begin{aligned} & \frac{\partial \phi}{\partial r}=\frac{\partial \phi}{\partial x} \frac{\partial x}{\partial r}+\frac{\partial \phi}{\partial y} \frac{\partial y}{\partial r}+\frac{\partial \phi}{\partial z} \frac{\partial z}{\partial r} \\ & \frac{\partial \phi}{\partial s}=\frac{\partial \phi}{\partial x} \frac{\partial x}{\partial s}+\frac{\partial \phi}{\partial y} \frac{\partial y}{\partial s}+\frac{\partial \phi}{\partial y} \frac{\partial z}{\partial s} \\ & \frac{\partial \phi}{\partial t}=\frac{\partial \phi}{\partial x} \frac{\partial x}{\partial t}+\frac{\partial \phi}{\partial y} \frac{\partial y}{\partial t}+\frac{\partial \phi}{\partial z} \frac{\partial z}{\partial t} \end{aligned} \Rightarrow\left[\begin{array}{l} \frac{\partial \phi}{\partial r} \\ \frac{\partial \phi}{\partial s} \\ \frac{\partial \phi}{\partial t} \end{array}\right]=\left[\begin{array}{lll} \frac{\partial x}{\partial r} & \frac{\partial y}{\partial r} & \frac{\partial z}{\partial r} \\ \frac{\partial x}{\partial s} & \frac{\partial y}{\partial s} & \frac{\partial z}{\partial s} \\ \frac{\partial x}{\partial t} & \frac{\partial y}{\partial t} & \frac{\partial z}{\partial t} \end{array}\right]\left[\begin{array}{l} \frac{\partial \phi}{\partial x} \\ \frac{\partial \phi}{\partial y} \\ \frac{\partial \phi}{\partial z} \end{array}\right] \]

1D

The local basis function is \(\phi_i (x)\)

\[ \phi_i(x) = \prod_{j\neq i} \frac{x - x_j}{x_i - x_j} . \]

For the linear basis functions on the interval \([-1,1]\), we just have two linear piecewise functions \(\phi_1(x) = \frac{1}{2} (1-x)\), \(\phi_2(x)=\frac{1}{2}(x+1)\).

In theory, the accuracy of Gaussian quadrature is solely determined by the number of quadrature points, i.e. the quadrature of shape functions whose polynomial degree is less than \(2N+1\) is always exact using \(N+1\) Gauss quadrature points. Therefore, regardless of how interpolation points of local shape functions are selected, as long as the points are non-repetitive, we will just have the equivalent FEM results. The uniform points are the simplest case. However, I use Gauss-Lobatto points here for shape functions.

The automatic derivation of the 1D basis functions of any order based on Gauss-Lobatto points has been implemented in Mathematica (basis.nb).

2D

triangle

If the basis function has monomials with the highest order \(d\), then the triangle has \(d+1\) nodes in each dimension, and the grid point number is \(1+2+3+...+(d+1)=\frac{(d+2)(d+1)}{2}\). For instance, the degree-5 gridlines has the form:

输入图片说明

We can get expressions of basis functions on this website: https://defelement.com/elements/lagrange.html

affine mapping

Let the \(\mathcal{F}\) be the transformation that maps the reference element \(\vec{u}\) to the actual mesh \(\vec{x}\), namely \(\mathcal{F}: \vec{u} \rightarrow \vec{x}\), \(\mathcal{F}(\vec{u})=\vec{x}\) or \(\vec{u}=\mathcal{F}^{-1} (\vec{x})\)​. For the 2D case,

\[ \mathcal{F}\left( \begin{bmatrix} u_1\\ u_2 \end{bmatrix} \right) = \begin{bmatrix} \mathcal{F}_1 (u_1, u_2)\\ \mathcal{F}_2 (u_1, u_2) \end{bmatrix} = \begin{bmatrix} x_1\\ x_2 \end{bmatrix} \]

Because the mapping is linear,

\[ \begin{bmatrix} x\\ y \end{bmatrix} = \mathcal{F}\left( \begin{bmatrix} u_1\\ u_2 \end{bmatrix} \right) = A_T \begin{bmatrix} u_1\\ u_2 \end{bmatrix} + \begin{bmatrix} x_{0}\\ y_{0} \end{bmatrix} \]

The integral of any function \(\phi(\vec{x})\) is

\[ \int_V \phi(\vec{x}) d\vec{x} = \int_{\hat{V}} \phi\left(\mathcal{F}(\vec{u})\right) \det\left(\frac{\partial \mathcal{F}}{\partial \vec{u}}\right) d\vec{u} = \int_{\hat{V}} \hat{\phi}(\vec{u}) \mathcal{J} d\vec{u} \]

where the \(J=\frac{\partial \mathcal{F}}{\partial \vec{u}}\) is the Jacobian matrix \(J_{ij}=\frac{\partial \mathcal{F}_i}{\partial u_j} = \frac{\partial A_{Ti}}{\partial u_j}\), \(\mathcal{J}=\det(J)=\det(A_T)\) is the Jacobian factor, and \(\hat{V}\) denotes the volume of the reference element. (The basis function satisfy \(\hat{\phi}=\phi \circ \mathcal{F}\) ? This conclusion is intuitive without finding a rigorous proof at the moment, which can also be checked in (4.44) eqn. \(\phi(x)=\hat{\phi}(\hat{x})\) in book Automated Solution of Differential Equations by the Finite Element Method, The FEniCS Book, 2011. )

1D

For the 1D case, we map the interval \(\hat{x} \in [-1,1]\) to \(x \in [x_1, x_2]\) where \(x_1 < x_2\). If we assume that \(x = a \hat{x} + b\), then we have

\[ x = \frac{x_2 - x_1}{2} \hat{x} + \frac{x_2 + x_1}{2} \]

Thus the Jacobian factor \(\mathcal{J} = \det(\frac{\partial x}{\partial \hat{x}}) = \frac{x_2 - x_1}{2}\). The integral of any function \(\phi(x)\) defined in \([x_1, x_2]\) equals

\[ \int_{x_1}^{x_2} \phi(x) dx = \int_{-1}^{1} \phi \left(\mathcal{F}(\hat{x}) \right) \mathcal{J} d\hat{x} = \mathcal{J} \sum_{i} \phi \left(\mathcal{F}(\hat{x_i}) \right) w_i \]

If the function \(\phi(x)\) is the FEM basis function, then we have

\[ \int_{x_1}^{x_2} \phi(x) dx = \mathcal{J} \int_{-1}^{1} \hat{\phi}(\hat{x}) d\hat{x} = \mathcal{J} \sum_{i} \hat{\phi}(\hat{x}_i) w_i \]

2D

For the 2D case, we have the triangle area \(T\) corresponds to the reference triangle \(\hat{T}\) whose vertices are \((0,0)\), \((1,0)\) and \((0,1)\). If we assume

\[ \begin{bmatrix} x\\ y \end{bmatrix} = A_T \begin{bmatrix} \hat{x} \\ \hat{y} \end{bmatrix} + \begin{bmatrix} c_1 \\ c_2 \end{bmatrix} \]

and map \((0, 0)\) to \((x_1,y_1)\), \((1, 0)\) to \((x_2,y_2)\), \((0, 1)\) to \((x_3,y_3)\), then we have

\[ \begin{bmatrix} x\\ y \end{bmatrix} =\begin{bmatrix} x_2 - x_1 & x_3 - x_1 \\ y_2 - y_1 & y_3 - y_1 \end{bmatrix} \begin{bmatrix} \hat{x} \\ \hat{y} \end{bmatrix} + \begin{bmatrix} x_1 \\ y_1 \end{bmatrix} \]

and

\[ \hat{x} = \frac{(y_3 - y_1) (x - x_1) - (x_3 - x_1) (y-y_1)}{\mathcal{J}} \\ \hat{y} = \frac{-(y_2 - y_1) (x - x_1) + (x_2 - x_1) (y-y_1)}{\mathcal{J}} \]

Thus the Jacobian factor \(\mathcal{J} = \det(A_T) = \det(J) = (x_2 - x_1) (y_3 - y_1) - (x_3 - x_1)(y_2 - y_1)\), where the \(J\) is the Jacobian matrix. The integral of any function \(\phi(x, y)\) defined on \(T\) equals (the \(\frac{1}{2}\) corresponds to https://people.sc.fsu.edu/~jburkardt/datasets/quadrature_rules_tri/quadrature_rules_tri.html)

\[ \int_T \phi(x, y) dS = \int_{\hat{T}} \phi \left( \mathcal{F}(\hat{x}, \hat{y}) \right) \mathcal{J} d\hat{S} = \frac{1}{2} \mathcal{J} \sum_i \phi \left( \mathcal{F}(\hat{x}_i, \hat{y}_i) \right) w_i . \]

If the function \(\phi(x, y)\) is the FEM basis function, then we have

\[ \int_T \phi(x, y) dS = \int_{\hat{T}} \phi \left( \mathcal{F}(\hat{x}, \hat{y}) \right) \mathcal{J} d\hat{S} = \frac{1}{2} \mathcal{J} \sum_i \hat{\phi}(\hat{x}, \hat{y}) w_i \]

Note that ,

\[ \frac{\partial}{\partial y} = \frac{\partial}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial y} + \frac{\partial}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial y} \]
\[ \frac{\partial}{\partial x} = \frac{\partial}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial x} + \frac{\partial}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial x} \]
\[ \frac{\partial \phi}{\partial y} = \frac{\partial \hat{\phi}}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial y} + \frac{\partial \hat{\phi}}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial y} \]
\[ \frac{\partial \phi}{\partial x} = \frac{\partial \hat{\phi}}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial x} + \frac{\partial \hat{\phi}}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial x} \]
\[ \frac{\partial^2 \phi}{\partial y^2} = \left( \frac{\partial}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial y} + \frac{\partial}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial y} \right) \left( \frac{\partial \hat{\phi}}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial y} + \frac{\partial \hat{\phi}}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial y} \right) = \frac{\partial^2 \hat{\phi}}{\partial \hat{y}^2} \left( \frac{\partial \hat{y}}{\partial y} \right)^2 + 2 \frac{\partial^2 \hat{\phi}}{\partial \hat{x} \partial \hat{y}} \frac{\partial \hat{x}}{\partial y} \frac{\partial \hat{y}}{\partial y} + \frac{\partial^2 \hat{\phi}}{\partial \hat{x}^2} \left( \frac{\partial \hat{x}}{\partial y} \right)^2 \]
\[ \frac{\partial^2 \phi}{\partial x^2} = \left( \frac{\partial}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial x} + \frac{\partial}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial x} \right) \left( \frac{\partial \hat{\phi}}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial x} + \frac{\partial \hat{\phi}}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial x} \right) = \frac{\partial^2 \hat{\phi}}{\partial \hat{x}^2} \left( \frac{\partial \hat{x}}{\partial x} \right)^2 + 2 \frac{\partial^2 \hat{\phi}}{\partial \hat{x} \partial \hat{y}} \frac{\partial \hat{y}}{\partial x} \frac{\partial \hat{x}}{\partial x} + \frac{\partial^2 \hat{\phi}}{\partial \hat{y}^2} \left( \frac{\partial \hat{y}}{\partial x} \right)^2 \]
\[ \frac{\partial^2 \phi}{\partial x \partial y} = \frac{\partial}{\partial x} \left( \frac{\partial \phi}{\partial y} \right) = \left( \frac{\partial}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial x} + \frac{\partial}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial x} \right) \left( \frac{\partial \hat{\phi}}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial y} + \frac{\partial \hat{\phi}}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial y} \right)\\ = \frac{\partial^2 \hat{\phi}}{\partial \hat{x} \partial \hat{y}} \frac{\partial \hat{y}}{\partial y} \frac{\partial \hat{x}}{\partial x} + \frac{\partial^2 \hat{\phi}}{\partial \hat{x}^2} \frac{\partial \hat{x}}{\partial y} \frac{\partial \hat{x}}{\partial x} + \frac{\partial^2 \hat{\phi}}{\partial \hat{y}^2} \frac{\partial \hat{y}}{\partial y} \frac{\partial \hat{y}}{\partial x} + \frac{\partial^2 \hat{\phi}}{\partial \hat{x} \partial \hat{y}} \frac{\partial \hat{x}}{\partial y} \frac{\partial \hat{y}}{\partial x} \]

and

\[ \frac{\partial \hat{x}}{\partial x} = \frac{y_3 - y_1}{| J |} \]
\[ \frac{\partial \hat{y}}{\partial x} = \frac{y_1 - y_2}{| J |} \]
\[ \frac{\partial \hat{x}}{\partial y} = \frac{x_1 - x_3}{| J |} \]
\[ \frac{\partial \hat{y}}{\partial y} = \frac{x_2 - x_1}{| J |} \]

Thus in the Cartesian coordinate

\[ \nabla \phi = \left( \frac{\partial \phi}{\partial x}, \frac{\partial \phi}{\partial y} \right) = \left( \frac{\partial \hat{\phi}}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial x} + \frac{\partial \hat{\phi}}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial x}, \frac{\partial \hat{\phi}}{\partial \hat{y}} \frac{\partial \hat{y}}{\partial y} + \frac{\partial \hat{\phi}}{\partial \hat{x}} \frac{\partial \hat{x}}{\partial y} \right) \]

Gaussian quadrature

The Gaussian quadrature is based on several definitions and theorems.

  • Definition: inner product (Boyd, p65).

Let \(f(x)\) and \(g(x)\) be arbitrary functions. Then the inner product of \(f(x)\) with \(g(x)\) with respect to the weight function \(\omega(x)\) on the interval \([a,b]\) is defined by

\[ (f,g) = \int_a^b f(x) g(x) \omega(x) dx \]
  • Definition: orthogonality (Boyd, p65)

A set of basis functions \(\phi_n(x)\) is said to be orthogonal with respect to a given inner product if

\[ (\phi_m, \phi_n) = \delta_{mn} \nu_n^2 \]

where the \(\nu_n\) is called "normalization constants" and \(\nu_n \equiv \sqrt{(\phi_n, \phi_n)}\). If \(\nu_n = 1\), the set of basis functions are orthonormal.

  • Guass-Jacobi integration theorem (Boyd, p87).

If the \(N+1\) "interpolation points" or "abscissas" \({x_i}\) are chosen to be zero of \(P_{N+1}(x)\) where \(P_{N+1}(x)\) is the polynomial of degree \(N+1\) of the set of polynomials which are orthogonal on \(x\in[a,b]\) with respect to the weight function \(\rho(x)\), then the quadrature formula

\[ \int_a^b f(x) \rho(x) dx = \sum_{i=0}^{N} w_i f(x_i) \]

is exact for all \(f(x)\) which are polynomials of at most degree \(2N+1\).

The Legendre, Chebyshev, Gegenbauer, Hermite, and Laguerre polynomials merely correspond to different weights \(w_i\) where (https://mathworld.wolfram.com/GaussianQuadrature.html)

\[ \pi(x) = \prod_{i=1}^m (x-x_i) \\ w_i = \frac{1}{\pi^\prime(x_i)} \int_a^b \frac{\pi(x) \rho(x)}{x-x_i} dx \]

In summary, given a set of basis functions \(P_{N+1}(x)\) and its corresponding integral weight function \(\rho(x)\), the Gaussian quadrature is completely determined then (the abscissas are the roots of \(P_{N+1}(x)\), and the weights are determined by the weight function and the abscissas).

Gauss-Legendre quadrature

1D quadrature

For the Legendre polynomials \(P_n(x)\), the integral interval is \([-1,1]\), the weight function is \(\rho(x)=1\), and the quadrature is

\[ \int_{-1}^{1} f(x) dx = \sum_{i=0}^{N} w_i f(x_i) . \]

The weights and abscissas can be computed using the following code:

void legendre_com ( int norder, double xtab[], double weight[] )

//****************************************************************************80
//
//  Purpose: 
//
//    LEGENDRE_COM computes abscissas and weights for Gauss-Legendre quadrature.
//
//  Integration interval:
//
//    [ -1, 1 ]
//
//  Weight function:
//
//    1.
//
//  Integral to approximate:
//
//    Integral ( -1 <= X <= 1 ) F(X) dX.
//
//  Approximate integral:
//
//    sum ( 1 <= I <= NORDER ) WEIGHT(I) * F ( XTAB(I) ).
//
//  Licensing:
//
//    This code is distributed under the GNU LGPL license. 
//
//  Modified:
//
//    31 March 2005
//
//  Author:
//
//    John Burkardt
//
//  Parameters:
//
//    Input, int NORDER, the order of the rule.
//    NORDER must be greater than 0.
//
//    Output, double XTAB[NORDER], the abscissas of the rule.
//
//    Output, double WEIGHT[NORDER], the weights of the rule.
//    The weights are positive, symmetric, and should sum to 2.
//
{
# define PI 3.141592653589793

  double d1;
  double d2pn;
  double d3pn;
  double d4pn;
  double dp;
  double dpn;
  double e1;
  double fx;
  double h;
  int i;
  int iback;
  int k;
  int m;
  int mp1mi;
  int ncopy;
  int nmove;
  double p;
  double pk;
  double pkm1;
  double pkp1;
  double t;
  double u;
  double v;
  double x0;
  double xtemp;

  if ( norder < 1 )
  {
    cerr << "\n";
    cerr << "LEGENDRE_COM - Fatal error!\n";
    cerr << "  Illegal value of NORDER = " << norder << "\n";
    exit ( 1 );
  }

  e1 = ( double ) ( norder * ( norder + 1 ) );

  m = ( norder + 1 ) / 2;

  for ( i = 1; i <= ( norder + 1 ) / 2; i++ )
  {
    mp1mi = m + 1 - i;
    t = PI * ( double ) ( 4 * i - 1 ) / ( double ) ( 4 * norder + 2 );
    x0 = cos(t) * ( 1.0 - ( 1.0 - 1.0 / 
      ( double ) ( norder ) ) / ( double ) ( 8 * norder * norder ) );

    pkm1 = 1.0;
    pk = x0;

    for ( k = 2; k <= norder; k++ )
    {
      pkp1 = 2.0 * x0 * pk - pkm1 - ( x0 * pk - pkm1 ) / ( double ) ( k );
      pkm1 = pk;
      pk = pkp1;
    }

    d1 = ( double ) ( norder ) * ( pkm1 - x0 * pk );

    dpn = d1 / ( 1.0 - x0 * x0 );

    d2pn = ( 2.0 * x0 * dpn - e1 * pk ) / ( 1.0 - x0 * x0 );

    d3pn = ( 4.0 * x0 * d2pn + ( 2.0 - e1 ) * dpn ) / ( 1.0 - x0 * x0 );

    d4pn = ( 6.0 * x0 * d3pn + ( 6.0 - e1 ) * d2pn ) / ( 1.0 - x0 * x0 );

    u = pk / dpn;
    v = d2pn / dpn;
//
//  Initial approximation H:
//
    h = - u * ( 1.0 + 0.5 * u * ( v + u * ( v * v - d3pn 
      / ( 3.0 * dpn ) ) ) );
//
//  Refine H using one step of Newton's method:
//
    p = pk + h * ( dpn + 0.5 * h * ( d2pn + h / 3.0 
      * ( d3pn + 0.25 * h * d4pn ) ) );

    dp = dpn + h * ( d2pn + 0.5 * h * ( d3pn + h * d4pn / 3.0 ) );

    h = h - p / dp;

    xtemp = x0 + h;

    xtab[mp1mi-1] = xtemp;

    fx = d1 - h * e1 * ( pk + 0.5 * h * ( dpn + h / 3.0 
      * ( d2pn + 0.25 * h * ( d3pn + 0.2 * h * d4pn ) ) ) );

    weight[mp1mi-1] = 2.0 * ( 1.0 - xtemp * xtemp ) / ( fx * fx ); 
  }

  if ( ( norder % 2 ) == 1 )
  {
    xtab[0] = 0.0;
  }
//
//  Shift the data up.
//
  nmove = ( norder + 1 ) / 2;
  ncopy = norder - nmove;

  for ( i = 1; i <= nmove; i++ )
  {
    iback = norder + 1 - i;
    xtab[iback-1] = xtab[iback-ncopy-1];
    weight[iback-1] = weight[iback-ncopy-1];
  }
//
//  Reflect values for the negative abscissas.
//
  for ( i = 0; i < norder - nmove; i++ )
  {
    xtab[i] = - xtab[norder-1-i];
    weight[i] = weight[norder-1-i];
  }

  return;

# undef PI
}

The weights and abscissas can be checked in following code:

void legendre_set ( int n, double x[], double w[] )

//****************************************************************************80
//
//  Purpose:
//
//    LEGENDRE_SET sets abscissas and weights for Gauss-Legendre quadrature.
//
//  Discussion:
//
//    The integration interval is [ -1, 1 ].
//
//    The weight function w(x-1] = 1.0;
//
//    The integral to approximate:
//
//      Integral ( -1 <= X <= 1 ) F(X) dX
//
//    Quadrature rule:
//
//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
//
//    The quadrature rule will integrate exactly all polynomials up to
//    X**(2*N-1).
//
//    The abscissas of the rule are the zeroes of the Legendre polynomial
//    P(N)(X).
//
//    The integral produced by a Gauss-Legendre rule is equal to the
//    integral of the unique polynomial of degree N-1 which
//    agrees with the function at the N abscissas of the rule.
//
//  Licensing:
//
//    This code is distributed under the GNU LGPL license. 
//
//  Modified:
//
//    19 October 2009
//
//  Author:
//
//    John Burkardt
//
//  Reference:
//
//    Milton Abramowitz, Irene Stegun,
//    Handbook of Mathematical Functions,
//    National Bureau of Standards, 1964,
//    ISBN: 0-486-61272-4,
//    LC: QA47.A34.
//
//    Vladimir Krylov,
//    Approximate Calculation of Integrals,
//    Dover, 2006,
//    ISBN: 0486445798.
//
//    Arthur Stroud, Don Secrest,
//    Gaussian Quadrature Formulas,
//    Prentice Hall, 1966,
//    LC: QA299.4G3S7.
//
//    Daniel Zwillinger, editor,
//    CRC Standard Mathematical Tables and Formulae,
//    30th Edition,
//    CRC Press, 1996,
//    ISBN: 0-8493-2479-3.
//
//  Parameters:
//
//    Input, int N, the order of the rule.
//    N must be between 1 and 33, 63, 64, 65, 127 or 255.
//
//    Output, double X[N], the abscissas of the rule.
//
//    Output, double W[N], the weights of the rule.
//    The weights are positive, symmetric and should sum to 2.
//
{
  if ( n == 1 )
  {
    x[0] =   0.0;

    w[0] = 2.0;
  }
  else if ( n == 2 )
  {
    x[0] = - 0.577350269189625764509148780502;
    x[1] =   0.577350269189625764509148780502;

    w[0] = 1.0;
    w[1] = 1.0;
  }
  else if ( n == 3 )
  {
    x[0] = - 0.774596669241483377035853079956;
    x[1] =   0.0;
    x[2] =   0.774596669241483377035853079956;

    w[0] = 5.0 / 9.0;
    w[1] = 8.0 / 9.0;
    w[2] = 5.0 / 9.0;
  }
  else if ( n == 4 )
  {
    x[0] = - 0.861136311594052575223946488893;
    x[1] = - 0.339981043584856264802665759103;
    x[2] =   0.339981043584856264802665759103;
    x[3] =   0.861136311594052575223946488893;

    w[0] = 0.347854845137453857373063949222;
    w[1] = 0.652145154862546142626936050778;
    w[2] = 0.652145154862546142626936050778;
    w[3] = 0.347854845137453857373063949222;
  }
  else if ( n == 5 )
  {
    x[0] = - 0.906179845938663992797626878299;
    x[1] = - 0.538469310105683091036314420700;
    x[2] =   0.0;
    x[3] =   0.538469310105683091036314420700;
    x[4] =   0.906179845938663992797626878299;

    w[0] = 0.236926885056189087514264040720;
    w[1] = 0.478628670499366468041291514836;
    w[2] = 0.568888888888888888888888888889;
    w[3] = 0.478628670499366468041291514836;
    w[4] = 0.236926885056189087514264040720;
  }
  else if ( n == 6 )
  {
    x[0] = - 0.932469514203152027812301554494;
    x[1] = - 0.661209386466264513661399595020;
    x[2] = - 0.238619186083196908630501721681;
    x[3] =   0.238619186083196908630501721681;
    x[4] =   0.661209386466264513661399595020;
    x[5] =   0.932469514203152027812301554494;

    w[0] = 0.171324492379170345040296142173;
    w[1] = 0.360761573048138607569833513838;
    w[2] = 0.467913934572691047389870343990;
    w[3] = 0.467913934572691047389870343990;
    w[4] = 0.360761573048138607569833513838;
    w[5] = 0.171324492379170345040296142173;
  }
  else if ( n == 7 )
  {
    x[0] = - 0.949107912342758524526189684048;
    x[1] = - 0.741531185599394439863864773281;
    x[2] = - 0.405845151377397166906606412077;
    x[3] =   0.0;
    x[4] =   0.405845151377397166906606412077;
    x[5] =   0.741531185599394439863864773281;
    x[6] =   0.949107912342758524526189684048;

    w[0] = 0.129484966168869693270611432679;
    w[1] = 0.279705391489276667901467771424;
    w[2] = 0.381830050505118944950369775489;
    w[3] = 0.417959183673469387755102040816;
    w[4] = 0.381830050505118944950369775489;
    w[5] = 0.279705391489276667901467771424;
    w[6] = 0.129484966168869693270611432679;
  }
  else if ( n == 8 )
  {
    x[0] = - 0.960289856497536231683560868569;
    x[1] = - 0.796666477413626739591553936476;
    x[2] = - 0.525532409916328985817739049189;
    x[3] = - 0.183434642495649804939476142360;
    x[4] =   0.183434642495649804939476142360;
    x[5] =   0.525532409916328985817739049189;
    x[6] =   0.796666477413626739591553936476;
    x[7] =   0.960289856497536231683560868569;

    w[0] = 0.101228536290376259152531354310;
    w[1] = 0.222381034453374470544355994426;
    w[2] = 0.313706645877887287337962201987;
    w[3] = 0.362683783378361982965150449277;
    w[4] = 0.362683783378361982965150449277;
    w[5] = 0.313706645877887287337962201987;
    w[6] = 0.222381034453374470544355994426;
    w[7] = 0.101228536290376259152531354310;
  }
  else if ( n == 9 )
  {
    x[0] = - 0.968160239507626089835576202904;
    x[1] = - 0.836031107326635794299429788070;
    x[2] = - 0.613371432700590397308702039341;
    x[3] = - 0.324253423403808929038538014643;
    x[4] =   0.0;
    x[5] =   0.324253423403808929038538014643;
    x[6] =   0.613371432700590397308702039341;
    x[7] =   0.836031107326635794299429788070;
    x[8] =   0.968160239507626089835576202904;

    w[0] = 0.812743883615744119718921581105E-01;
    w[1] = 0.180648160694857404058472031243;
    w[2] = 0.260610696402935462318742869419;
    w[3] = 0.312347077040002840068630406584;
    w[4] = 0.330239355001259763164525069287;
    w[5] = 0.312347077040002840068630406584;
    w[6] = 0.260610696402935462318742869419;
    w[7] = 0.180648160694857404058472031243;
    w[8] = 0.812743883615744119718921581105E-01;
  }
  else if ( n == 10 )
  {
    x[0] =  - 0.973906528517171720077964012084;
    x[1] =  - 0.865063366688984510732096688423;
    x[2] =  - 0.679409568299024406234327365115;
    x[3] =  - 0.433395394129247190799265943166;
    x[4] =  - 0.148874338981631210884826001130;
    x[5] =    0.148874338981631210884826001130;
    x[6] =    0.433395394129247190799265943166;
    x[7] =    0.679409568299024406234327365115;
    x[8] =    0.865063366688984510732096688423;
    x[9] =   0.973906528517171720077964012084;

    w[0] =  0.666713443086881375935688098933E-01;
    w[1] =  0.149451349150580593145776339658;
    w[2] =  0.219086362515982043995534934228;
    w[3] =  0.269266719309996355091226921569;
    w[4] =  0.295524224714752870173892994651;
    w[5] =  0.295524224714752870173892994651;
    w[6] =  0.269266719309996355091226921569;
    w[7] =  0.219086362515982043995534934228;
    w[8] =  0.149451349150580593145776339658;
    w[9] = 0.666713443086881375935688098933E-01;
  }
  else if ( n == 11 )
  {
    x[0] =  - 0.978228658146056992803938001123;
    x[1] =  - 0.887062599768095299075157769304;
    x[2] =  - 0.730152005574049324093416252031;
    x[3] =  - 0.519096129206811815925725669459;
    x[4] =  - 0.269543155952344972331531985401;
    x[5] =    0.0;
    x[6] =    0.269543155952344972331531985401;
    x[7] =    0.519096129206811815925725669459;
    x[8] =    0.730152005574049324093416252031;
    x[9] =   0.887062599768095299075157769304;
    x[10] =   0.978228658146056992803938001123;

    w[0] =  0.556685671161736664827537204425E-01;
    w[1] =  0.125580369464904624634694299224;
    w[2] =  0.186290210927734251426097641432;
    w[3] =  0.233193764591990479918523704843;
    w[4] =  0.262804544510246662180688869891;
    w[5] =  0.272925086777900630714483528336;
    w[6] =  0.262804544510246662180688869891;
    w[7] =  0.233193764591990479918523704843;
    w[8] =  0.186290210927734251426097641432;
    w[9] = 0.125580369464904624634694299224;
    w[10] = 0.556685671161736664827537204425E-01;
  }
  else if ( n == 12 )
  {
    x[0] =  - 0.981560634246719250690549090149;
    x[1] =  - 0.904117256370474856678465866119;
    x[2] =  - 0.769902674194304687036893833213;
    x[3] =  - 0.587317954286617447296702418941;
    x[4] =  - 0.367831498998180193752691536644;
    x[5] =  - 0.125233408511468915472441369464;
    x[6] =    0.125233408511468915472441369464;
    x[7] =    0.367831498998180193752691536644;
    x[8] =    0.587317954286617447296702418941;
    x[9] =   0.769902674194304687036893833213;
    x[10] =   0.904117256370474856678465866119;
    x[11] =   0.981560634246719250690549090149;

    w[0] =  0.471753363865118271946159614850E-01;
    w[1] =  0.106939325995318430960254718194;
    w[2] =  0.160078328543346226334652529543;
    w[3] =  0.203167426723065921749064455810;
    w[4] =  0.233492536538354808760849898925;
    w[5] =  0.249147045813402785000562436043;
    w[6] =  0.249147045813402785000562436043;
    w[7] =  0.233492536538354808760849898925;
    w[8] =  0.203167426723065921749064455810;
    w[9] = 0.160078328543346226334652529543;
    w[10] = 0.106939325995318430960254718194;
    w[11] = 0.471753363865118271946159614850E-01;
  }
  else if ( n == 13 )
  {
    x[0] =  - 0.984183054718588149472829448807;
    x[1] =  - 0.917598399222977965206547836501;
    x[2] =  - 0.801578090733309912794206489583;
    x[3] =  - 0.642349339440340220643984606996;
    x[4] =  - 0.448492751036446852877912852128;
    x[5] =  - 0.230458315955134794065528121098;
    x[6] =    0.0;
    x[7] =    0.230458315955134794065528121098;
    x[8] =    0.448492751036446852877912852128;
    x[9] =   0.642349339440340220643984606996;
    x[10] =   0.801578090733309912794206489583;
    x[11] =   0.917598399222977965206547836501;
    x[12] =   0.984183054718588149472829448807;

    w[0] =  0.404840047653158795200215922010E-01;
    w[1] =  0.921214998377284479144217759538E-01;
    w[2] =  0.138873510219787238463601776869;
    w[3] =  0.178145980761945738280046691996;
    w[4] =  0.207816047536888502312523219306;
    w[5] =  0.226283180262897238412090186040;
    w[6] =  0.232551553230873910194589515269;
    w[7] =  0.226283180262897238412090186040;
    w[8] =  0.207816047536888502312523219306;
    w[9] = 0.178145980761945738280046691996;
    w[10] = 0.138873510219787238463601776869;
    w[11] = 0.921214998377284479144217759538E-01;
    w[12] = 0.404840047653158795200215922010E-01;
  }
  else if ( n == 14 )
  {
    x[0] =  - 0.986283808696812338841597266704;
    x[1] =  - 0.928434883663573517336391139378;
    x[2] =  - 0.827201315069764993189794742650;
    x[3] =  - 0.687292904811685470148019803019;
    x[4] =  - 0.515248636358154091965290718551;
    x[5] =  - 0.319112368927889760435671824168;
    x[6] =  - 0.108054948707343662066244650220;
    x[7] =    0.108054948707343662066244650220;
    x[8] =    0.319112368927889760435671824168;
    x[9] =   0.515248636358154091965290718551;
    x[10] =   0.687292904811685470148019803019;
    x[11] =   0.827201315069764993189794742650;
    x[12] =   0.928434883663573517336391139378;
    x[13] =   0.986283808696812338841597266704;

    w[0] =  0.351194603317518630318328761382E-01;
    w[1] =  0.801580871597602098056332770629E-01;
    w[2] =  0.121518570687903184689414809072;
    w[3] =  0.157203167158193534569601938624;
    w[4] =  0.185538397477937813741716590125;
    w[5] =  0.205198463721295603965924065661;
    w[6] =  0.215263853463157790195876443316;
    w[7] =  0.215263853463157790195876443316;
    w[8] =  0.205198463721295603965924065661;
    w[9] = 0.185538397477937813741716590125;
    w[10] = 0.157203167158193534569601938624;
    w[11] = 0.121518570687903184689414809072;
    w[12] = 0.801580871597602098056332770629E-01;
    w[13] = 0.351194603317518630318328761382E-01;
  }
  else if ( n == 15 )
  {
    x[0] =  - 0.987992518020485428489565718587;
    x[1] =  - 0.937273392400705904307758947710;
    x[2] =  - 0.848206583410427216200648320774;
    x[3] =  - 0.724417731360170047416186054614;
    x[4] =  - 0.570972172608538847537226737254;
    x[5] =  - 0.394151347077563369897207370981;
    x[6] =  - 0.201194093997434522300628303395;
    x[7] =    0.0;
    x[8] =    0.201194093997434522300628303395;
    x[9] =   0.394151347077563369897207370981;
    x[10] =   0.570972172608538847537226737254;
    x[11] =   0.724417731360170047416186054614;
    x[12] =   0.848206583410427216200648320774;
    x[13] =   0.937273392400705904307758947710;
    x[14] =   0.987992518020485428489565718587;

    w[0] =  0.307532419961172683546283935772E-01;
    w[1] =  0.703660474881081247092674164507E-01;
    w[2] =  0.107159220467171935011869546686;
    w[3] =  0.139570677926154314447804794511;
    w[4] =  0.166269205816993933553200860481;
    w[5] =  0.186161000015562211026800561866;
    w[6] =  0.198431485327111576456118326444;
    w[7] =  0.202578241925561272880620199968;
    w[8] =  0.198431485327111576456118326444;
    w[9] = 0.186161000015562211026800561866;
    w[10] = 0.166269205816993933553200860481;
    w[11] = 0.139570677926154314447804794511;
    w[12] = 0.107159220467171935011869546686;
    w[13] = 0.703660474881081247092674164507E-01;
    w[14] = 0.307532419961172683546283935772E-01;
  }
  else if ( n == 16 )
  {
    x[0] =  - 0.989400934991649932596154173450;
    x[1] =  - 0.944575023073232576077988415535;
    x[2] =  - 0.865631202387831743880467897712;
    x[3] =  - 0.755404408355003033895101194847;
    x[4] =  - 0.617876244402643748446671764049;
    x[5] =  - 0.458016777657227386342419442984;
    x[6] =  - 0.281603550779258913230460501460;
    x[7] =  - 0.950125098376374401853193354250E-01;
    x[8] =    0.950125098376374401853193354250E-01;
    x[9] =   0.281603550779258913230460501460;
    x[10] =   0.458016777657227386342419442984;
    x[11] =   0.617876244402643748446671764049;
    x[12] =   0.755404408355003033895101194847;
    x[13] =   0.865631202387831743880467897712;
    x[14] =   0.944575023073232576077988415535;
    x[15] =   0.989400934991649932596154173450;

    w[0] =  0.271524594117540948517805724560E-01;
    w[1] =  0.622535239386478928628438369944E-01;
    w[2] =  0.951585116824927848099251076022E-01;
    w[3] =  0.124628971255533872052476282192;
    w[4] =  0.149595988816576732081501730547;
    w[5] =  0.169156519395002538189312079030;
    w[6] =  0.182603415044923588866763667969;
    w[7] =  0.189450610455068496285396723208;
    w[8] =  0.189450610455068496285396723208;
    w[9] = 0.182603415044923588866763667969;
    w[10] = 0.169156519395002538189312079030;
    w[11] = 0.149595988816576732081501730547;
    w[12] = 0.124628971255533872052476282192;
    w[13] = 0.951585116824927848099251076022E-01;
    w[14] = 0.622535239386478928628438369944E-01;
    w[15] = 0.271524594117540948517805724560E-01;
  }
  else if ( n == 17 )
  {
    x[0] =  - 0.990575475314417335675434019941;
    x[1] =  - 0.950675521768767761222716957896;
    x[2] =  - 0.880239153726985902122955694488;
    x[3] =  - 0.781514003896801406925230055520;
    x[4] =  - 0.657671159216690765850302216643;
    x[5] =  - 0.512690537086476967886246568630;
    x[6] =  - 0.351231763453876315297185517095;
    x[7] =  - 0.178484181495847855850677493654;
    x[8] =    0.0;
    x[9] =   0.178484181495847855850677493654;
    x[10] =   0.351231763453876315297185517095;
    x[11] =   0.512690537086476967886246568630;
    x[12] =   0.657671159216690765850302216643;
    x[13] =   0.781514003896801406925230055520;
    x[14] =   0.880239153726985902122955694488;
    x[15] =   0.950675521768767761222716957896;
    x[16] =   0.990575475314417335675434019941;

    w[0] =  0.241483028685479319601100262876E-01;
    w[1] =  0.554595293739872011294401653582E-01;
    w[2] =  0.850361483171791808835353701911E-01;
    w[3] =  0.111883847193403971094788385626;
    w[4] =  0.135136368468525473286319981702;
    w[5] =  0.154045761076810288081431594802;
    w[6] =  0.168004102156450044509970663788;
    w[7] =  0.176562705366992646325270990113;
    w[8] =  0.179446470356206525458265644262;
    w[9] = 0.176562705366992646325270990113;
    w[10] = 0.168004102156450044509970663788;
    w[11] = 0.154045761076810288081431594802;
    w[12] = 0.135136368468525473286319981702;
    w[13] = 0.111883847193403971094788385626;
    w[14] = 0.850361483171791808835353701911E-01;
    w[15] = 0.554595293739872011294401653582E-01;
    w[16] = 0.241483028685479319601100262876E-01;
  }
  else if ( n == 18 )
  {
    x[0] =  - 0.991565168420930946730016004706;
    x[1] =  - 0.955823949571397755181195892930;
    x[2] =  - 0.892602466497555739206060591127;
    x[3] =  - 0.803704958972523115682417455015;
    x[4] =  - 0.691687043060353207874891081289;
    x[5] =  - 0.559770831073947534607871548525;
    x[6] =  - 0.411751161462842646035931793833;
    x[7] =  - 0.251886225691505509588972854878;
    x[8] =  - 0.847750130417353012422618529358E-01;
    x[9] =   0.847750130417353012422618529358E-01;
    x[10] =   0.251886225691505509588972854878;
    x[11] =   0.411751161462842646035931793833;
    x[12] =   0.559770831073947534607871548525;
    x[13] =   0.691687043060353207874891081289;
    x[14] =   0.803704958972523115682417455015;
    x[15] =   0.892602466497555739206060591127;
    x[16] =   0.955823949571397755181195892930;
    x[17] =   0.991565168420930946730016004706;

    w[0] =  0.216160135264833103133427102665E-01;
    w[1] =  0.497145488949697964533349462026E-01;
    w[2] =  0.764257302548890565291296776166E-01;
    w[3] =  0.100942044106287165562813984925;
    w[4] =  0.122555206711478460184519126800;
    w[5] =  0.140642914670650651204731303752;
    w[6] =  0.154684675126265244925418003836;
    w[7] =  0.164276483745832722986053776466;
    w[8] =  0.169142382963143591840656470135;
    w[9] = 0.169142382963143591840656470135;
    w[10] = 0.164276483745832722986053776466;
    w[11] = 0.154684675126265244925418003836;
    w[12] = 0.140642914670650651204731303752;
    w[13] = 0.122555206711478460184519126800;
    w[14] = 0.100942044106287165562813984925;
    w[15] = 0.764257302548890565291296776166E-01;
    w[16] = 0.497145488949697964533349462026E-01;
    w[17] = 0.216160135264833103133427102665E-01;
  }
  else if ( n == 19 )
  {
    x[0] =  - 0.992406843843584403189017670253;
    x[1] =  - 0.960208152134830030852778840688;
    x[2] =  - 0.903155903614817901642660928532;
    x[3] =  - 0.822714656537142824978922486713;
    x[4] =  - 0.720966177335229378617095860824;
    x[5] =  - 0.600545304661681023469638164946;
    x[6] =  - 0.464570741375960945717267148104;
    x[7] =  - 0.316564099963629831990117328850;
    x[8] =  - 0.160358645640225375868096115741;
    x[9] =   0.0;
    x[10] =   0.160358645640225375868096115741;
    x[11] =   0.316564099963629831990117328850;
    x[12] =   0.464570741375960945717267148104;
    x[13] =   0.600545304661681023469638164946;
    x[14] =   0.720966177335229378617095860824;
    x[15] =   0.822714656537142824978922486713;
    x[16] =   0.903155903614817901642660928532;
    x[17] =   0.960208152134830030852778840688;
    x[18] =   0.992406843843584403189017670253;

    w[0] =  0.194617882297264770363120414644E-01;
    w[1] =  0.448142267656996003328381574020E-01;
    w[2] =  0.690445427376412265807082580060E-01;
    w[3] =  0.914900216224499994644620941238E-01;
    w[4] =  0.111566645547333994716023901682;
    w[5] =  0.128753962539336227675515784857;
    w[6] =  0.142606702173606611775746109442;
    w[7] =  0.152766042065859666778855400898;
    w[8] =  0.158968843393954347649956439465;
    w[9] = 0.161054449848783695979163625321;
    w[10] = 0.158968843393954347649956439465;
    w[11] = 0.152766042065859666778855400898;
    w[12] = 0.142606702173606611775746109442;
    w[13] = 0.128753962539336227675515784857;
    w[14] = 0.111566645547333994716023901682;
    w[15] = 0.914900216224499994644620941238E-01;
    w[16] = 0.690445427376412265807082580060E-01;
    w[17] = 0.448142267656996003328381574020E-01;
    w[18] = 0.194617882297264770363120414644E-01;
  }
  else if ( n == 20 )
  {
    x[0] =  - 0.993128599185094924786122388471;
    x[1] =  - 0.963971927277913791267666131197;
    x[2] =  - 0.912234428251325905867752441203;
    x[3] =  - 0.839116971822218823394529061702;
    x[4] =  - 0.746331906460150792614305070356;
    x[5] =  - 0.636053680726515025452836696226;
    x[6] =  - 0.510867001950827098004364050955;
    x[7] =  - 0.373706088715419560672548177025;
    x[8] =  - 0.227785851141645078080496195369;
    x[9] = - 0.765265211334973337546404093988E-01;
    x[10] =   0.765265211334973337546404093988E-01;
    x[11] =   0.227785851141645078080496195369;
    x[12] =   0.373706088715419560672548177025;
    x[13] =   0.510867001950827098004364050955;
    x[14] =   0.636053680726515025452836696226;
    x[15] =   0.746331906460150792614305070356;
    x[16] =   0.839116971822218823394529061702;
    x[17] =   0.912234428251325905867752441203;
    x[18] =   0.963971927277913791267666131197;
    x[19] =   0.993128599185094924786122388471;

    w[0] =  0.176140071391521183118619623519E-01;
    w[1] =  0.406014298003869413310399522749E-01;
    w[2] =  0.626720483341090635695065351870E-01;
    w[3] =  0.832767415767047487247581432220E-01;
    w[4] =  0.101930119817240435036750135480;
    w[5] =  0.118194531961518417312377377711;
    w[6] =  0.131688638449176626898494499748;
    w[7] =  0.142096109318382051329298325067;
    w[8] =  0.149172986472603746787828737002;
    w[9] = 0.152753387130725850698084331955;
    w[10] = 0.152753387130725850698084331955;
    w[11] = 0.149172986472603746787828737002;
    w[12] = 0.142096109318382051329298325067;
    w[13] = 0.131688638449176626898494499748;
    w[14] = 0.118194531961518417312377377711;
    w[15] = 0.101930119817240435036750135480;
    w[16] = 0.832767415767047487247581432220E-01;
    w[17] = 0.626720483341090635695065351870E-01;
    w[18] = 0.406014298003869413310399522749E-01;
    w[19] = 0.176140071391521183118619623519E-01;
  }
  else if ( n == 21 )
  {
    x[ 0] =  -0.9937521706203896E+00;
    x[ 1] =  -0.9672268385663063E+00;
    x[ 2] =  -0.9200993341504008E+00;
    x[ 3] =  -0.8533633645833173E+00;
    x[ 4] =  -0.7684399634756779E+00;
    x[ 5] =  -0.6671388041974123E+00;
    x[ 6] =  -0.5516188358872198E+00;
    x[ 7] =  -0.4243421202074388E+00;
    x[ 8] =  -0.2880213168024011E+00;
    x[ 9] =  -0.1455618541608951E+00;
    x[10] =   0.0000000000000000E+00;
    x[11] =   0.1455618541608951E+00;
    x[12] =   0.2880213168024011E+00;
    x[13] =   0.4243421202074388E+00;
    x[14] =   0.5516188358872198E+00;
    x[15] =   0.6671388041974123E+00;
    x[16] =   0.7684399634756779E+00;
    x[17] =   0.8533633645833173E+00;
    x[18] =   0.9200993341504008E+00;
    x[19] =   0.9672268385663063E+00;
    x[20] =   0.9937521706203896E+00;

    w[ 0] =   0.1601722825777420E-01;
    w[ 1] =   0.3695378977085242E-01;
    w[ 2] =   0.5713442542685715E-01;
    w[ 3] =   0.7610011362837928E-01;
    w[ 4] =   0.9344442345603393E-01;
    w[ 5] =   0.1087972991671484E+00;
    w[ 6] =   0.1218314160537285E+00;
    w[ 7] =   0.1322689386333373E+00;
    w[ 8] =   0.1398873947910731E+00;
    w[ 9] =   0.1445244039899700E+00;
    w[10] =   0.1460811336496904E+00;
    w[11] =   0.1445244039899700E+00;
    w[12] =   0.1398873947910731E+00;
    w[13] =   0.1322689386333373E+00;
    w[14] =   0.1218314160537285E+00;
    w[15] =   0.1087972991671484E+00;
    w[16] =   0.9344442345603393E-01;
    w[17] =   0.7610011362837928E-01;
    w[18] =   0.5713442542685715E-01;
    w[19] =   0.3695378977085242E-01;
    w[20] =   0.1601722825777420E-01;
  }
  else if ( n == 22 )
  {
    x[ 0] =  -0.9942945854823994E+00;
    x[ 1] =  -0.9700604978354287E+00;
    x[ 2] =  -0.9269567721871740E+00;
    x[ 3] =  -0.8658125777203002E+00;
    x[ 4] =  -0.7878168059792081E+00;
    x[ 5] =  -0.6944872631866827E+00;
    x[ 6] =  -0.5876404035069116E+00;
    x[ 7] =  -0.4693558379867570E+00;
    x[ 8] =  -0.3419358208920842E+00;
    x [9] =  -0.2078604266882213E+00;
    x[10] =  -0.6973927331972223E-01;
    x[11] =   0.6973927331972223E-01;
    x[12] =   0.2078604266882213E+00;
    x[13] =   0.3419358208920842E+00;
    x[14] =   0.4693558379867570E+00;
    x[15] =   0.5876404035069116E+00;
    x[16] =   0.6944872631866827E+00;
    x[17] =   0.7878168059792081E+00;
    x[18] =   0.8658125777203002E+00;
    x[19] =   0.9269567721871740E+00;
    x[20] =   0.9700604978354287E+00;
    x[21] =   0.9942945854823994E+00;

    w[ 0] =   0.1462799529827203E-01;
    w[ 1] =   0.3377490158481413E-01;
    w[ 2] =   0.5229333515268327E-01;
    w[ 3] =   0.6979646842452038E-01;
    w[ 4] =   0.8594160621706777E-01;
    w[ 5] =   0.1004141444428809E+00;
    w[ 6] =   0.1129322960805392E+00;
    w[ 7] =   0.1232523768105124E+00;
    w[ 8] =   0.1311735047870623E+00;
    w[ 9] =   0.1365414983460152E+00;
    w[10] =   0.1392518728556321E+00;
    w[11] =   0.1392518728556321E+00;
    w[12] =   0.1365414983460152E+00;
    w[13] =   0.1311735047870623E+00;
    w[14] =   0.1232523768105124E+00;
    w[15] =   0.1129322960805392E+00;
    w[16] =   0.1004141444428809E+00;
    w[17] =   0.8594160621706777E-01;
    w[18] =   0.6979646842452038E-01;
    w[19] =   0.5229333515268327E-01;
    w[20] =   0.3377490158481413E-01;
    w[21] =   0.1462799529827203E-01;
  }
  else if ( n == 23 )
  {
    x[ 0] =  -0.9947693349975522E+00;
    x[ 1] =  -0.9725424712181152E+00;
    x[ 2] =  -0.9329710868260161E+00;
    x[ 3] =  -0.8767523582704416E+00;
    x[ 4] =  -0.8048884016188399E+00;
    x[ 5] =  -0.7186613631319502E+00;
    x[ 6] =  -0.6196098757636461E+00;
    x[ 7] =  -0.5095014778460075E+00;
    x[ 8] =  -0.3903010380302908E+00;
    x[ 9] =  -0.2641356809703449E+00;
    x[10] =  -0.1332568242984661E+00;
    x[11] =   0.0000000000000000E+00;
    x[12] =   0.1332568242984661E+00;
    x[13] =   0.2641356809703449E+00;
    x[14] =   0.3903010380302908E+00;
    x[15] =   0.5095014778460075E+00;
    x[16] =   0.6196098757636461E+00;
    x[17] =   0.7186613631319502E+00;
    x[18] =   0.8048884016188399E+00;
    x[19] =   0.8767523582704416E+00;
    x[20] =   0.9329710868260161E+00;
    x[21] =   0.9725424712181152E+00;
    x[22] =   0.9947693349975522E+00;

    w[ 0] =   0.1341185948714167E-01;
    w[ 1] =   0.3098800585697944E-01;
    w[ 2] =   0.4803767173108464E-01;
    w[ 3] =   0.6423242140852586E-01;
    w[ 4] =   0.7928141177671895E-01;
    w[ 5] =   0.9291576606003514E-01;
    w[ 6] =   0.1048920914645414E+00;
    w[ 7] =   0.1149966402224114E+00;
    w[ 8] =   0.1230490843067295E+00;
    w[ 9] =   0.1289057221880822E+00;
    w[10] =   0.1324620394046967E+00;
    w[11] =   0.1336545721861062E+00;
    w[12] =   0.1324620394046967E+00;
    w[13] =   0.1289057221880822E+00;
    w[14] =   0.1230490843067295E+00;
    w[15] =   0.1149966402224114E+00;
    w[16] =   0.1048920914645414E+00;
    w[17] =   0.9291576606003514E-01;
    w[18] =   0.7928141177671895E-01;
    w[19] =   0.6423242140852586E-01;
    w[20] =   0.4803767173108464E-01;
    w[21] =   0.3098800585697944E-01;
    w[22] =   0.1341185948714167E-01;
  }
  else if ( n == 24 )
  {
    x[ 0] =  -0.9951872199970213E+00;
    x[ 1] =  -0.9747285559713095E+00;
    x[ 2] =  -0.9382745520027327E+00;
    x[ 3] =  -0.8864155270044011E+00;
    x[ 4] =  -0.8200019859739029E+00;
    x[ 5] =  -0.7401241915785544E+00;
    x[ 6] =  -0.6480936519369755E+00;
    x[ 7] =  -0.5454214713888396E+00;
    x[ 8] =  -0.4337935076260451E+00;
    x[ 9] =  -0.3150426796961634E+00;
    x[10] =  -0.1911188674736163E+00;
    x[11] =  -0.6405689286260562E-01;
    x[12] =   0.6405689286260562E-01;
    x[13] =   0.1911188674736163E+00;
    x[14] =   0.3150426796961634E+00;
    x[15] =   0.4337935076260451E+00;
    x[16] =   0.5454214713888396E+00;
    x[17] =   0.6480936519369755E+00;
    x[18] =   0.7401241915785544E+00;
    x[19] =   0.8200019859739029E+00;
    x[20] =   0.8864155270044011E+00;
    x[21] =   0.9382745520027327E+00;
    x[22] =   0.9747285559713095E+00;
    x[23] =   0.9951872199970213E+00;

    w[ 0] =   0.1234122979998730E-01;
    w[ 1] =   0.2853138862893375E-01;
    w[ 2] =   0.4427743881741982E-01;
    w[ 3] =   0.5929858491543672E-01;
    w[ 4] =   0.7334648141108031E-01;
    w[ 5] =   0.8619016153195320E-01;
    w[ 6] =   0.9761865210411380E-01;
    w[ 7] =   0.1074442701159656E+00;
    w[ 8] =   0.1155056680537256E+00;
    w[ 9] =   0.1216704729278035E+00;
    w[10] =   0.1258374563468283E+00;
    w[11] =   0.1279381953467521E+00;
    w[12] =   0.1279381953467521E+00;
    w[13] =   0.1258374563468283E+00;
    w[14] =   0.1216704729278035E+00;
    w[15] =   0.1155056680537256E+00;
    w[16] =   0.1074442701159656E+00;
    w[17] =   0.9761865210411380E-01;
    w[18] =   0.8619016153195320E-01;
    w[19] =   0.7334648141108031E-01;
    w[20] =   0.5929858491543672E-01;
    w[21] =   0.4427743881741982E-01;
    w[22] =   0.2853138862893375E-01;
    w[23] =   0.1234122979998730E-01;
  }
  else if ( n == 25 )
  {
    x[ 0] =  -0.9955569697904981E+00;
    x[ 1] =  -0.9766639214595175E+00;
    x[ 2] =  -0.9429745712289743E+00;
    x[ 3] =  -0.8949919978782754E+00;
    x[ 4] =  -0.8334426287608340E+00;
    x[ 5] =  -0.7592592630373577E+00;
    x[ 6] =  -0.6735663684734684E+00;
    x[ 7] =  -0.5776629302412229E+00;
    x[ 8] =  -0.4730027314457150E+00;
    x[ 9] =  -0.3611723058093879E+00;
    x[10] =  -0.2438668837209884E+00;
    x[11] =  -0.1228646926107104E+00;
    x[12] =   0.0000000000000000E+00;
    x[13] =   0.1228646926107104E+00;
    x[14] =   0.2438668837209884E+00;
    x[15] =   0.3611723058093879E+00;
    x[16] =   0.4730027314457150E+00;
    x[17] =   0.5776629302412229E+00;
    x[18] =   0.6735663684734684E+00;
    x[19] =   0.7592592630373577E+00;
    x[20] =   0.8334426287608340E+00;
    x[21] =   0.8949919978782754E+00;
    x[22] =   0.9429745712289743E+00;
    x[23] =   0.9766639214595175E+00;
    x[24] =   0.9955569697904981E+00;

    w[ 0] =   0.1139379850102617E-01;
    w[ 1] =   0.2635498661503214E-01;
    w[ 2] =   0.4093915670130639E-01;
    w[ 3] =   0.5490469597583517E-01;
    w[ 4] =   0.6803833381235694E-01;
    w[ 5] =   0.8014070033500101E-01;
    w[ 6] =   0.9102826198296370E-01;
    w[ 7] =   0.1005359490670506E+00;
    w[ 8] =   0.1085196244742637E+00;
    w[ 9] =   0.1148582591457116E+00;
    w[10] =   0.1194557635357847E+00;
    w[11] =   0.1222424429903101E+00;
    w[12] =   0.1231760537267154E+00;
    w[13] =   0.1222424429903101E+00;
    w[14] =   0.1194557635357847E+00;
    w[15] =   0.1148582591457116E+00;
    w[16] =   0.1085196244742637E+00;
    w[17] =   0.1005359490670506E+00;
    w[18] =   0.9102826198296370E-01;
    w[19] =   0.8014070033500101E-01;
    w[20] =   0.6803833381235694E-01;
    w[21] =   0.5490469597583517E-01;
    w[22] =   0.4093915670130639E-01;
    w[23] =   0.2635498661503214E-01;
    w[24] =   0.1139379850102617E-01;
  }
  else if ( n == 26 )
  {
    x[ 0] =  -0.9958857011456169E+00;
    x[ 1] =  -0.9783854459564710E+00;
    x[ 2] =  -0.9471590666617142E+00;
    x[ 3] =  -0.9026378619843071E+00;
    x[ 4] =  -0.8454459427884981E+00;
    x[ 5] =  -0.7763859488206789E+00;
    x[ 6] =  -0.6964272604199573E+00;
    x[ 7] =  -0.6066922930176181E+00;
    x[ 8] =  -0.5084407148245057E+00;
    x[ 9] =  -0.4030517551234863E+00;
    x[10] =  -0.2920048394859569E+00;
    x[11] =  -0.1768588203568902E+00;
    x[12] =  -0.5923009342931320E-01;
    x[13] =   0.5923009342931320E-01;
    x[14] =   0.1768588203568902E+00;
    x[15] =   0.2920048394859569E+00;
    x[16] =   0.4030517551234863E+00;
    x[17] =   0.5084407148245057E+00;
    x[18] =   0.6066922930176181E+00;
    x[19] =   0.6964272604199573E+00;
    x[20] =   0.7763859488206789E+00;
    x[21] =   0.8454459427884981E+00;
    x[22] =   0.9026378619843071E+00;
    x[23] =   0.9471590666617142E+00;
    x[24] =   0.9783854459564710E+00;
    x[25] =   0.9958857011456169E+00;

    w[ 0] =   0.1055137261734304E-01;
    w[ 1] =   0.2441785109263173E-01;
    w[ 2] =   0.3796238329436282E-01;
    w[ 3] =   0.5097582529714782E-01;
    w[ 4] =   0.6327404632957484E-01;
    w[ 5] =   0.7468414976565967E-01;
    w[ 6] =   0.8504589431348521E-01;
    w[ 7] =   0.9421380035591416E-01;
    w[ 8] =   0.1020591610944255E+00;
    w[ 9] =   0.1084718405285765E+00;
    w[10] =   0.1133618165463197E+00;
    w[11] =   0.1166604434852967E+00;
    w[12] =   0.1183214152792622E+00;
    w[13] =   0.1183214152792622E+00;
    w[14] =   0.1166604434852967E+00;
    w[15] =   0.1133618165463197E+00;
    w[16] =   0.1084718405285765E+00;
    w[17] =   0.1020591610944255E+00;
    w[18] =   0.9421380035591416E-01;
    w[19] =   0.8504589431348521E-01;
    w[20] =   0.7468414976565967E-01;
    w[21] =   0.6327404632957484E-01;
    w[22] =   0.5097582529714782E-01;
    w[23] =   0.3796238329436282E-01;
    w[24] =   0.2441785109263173E-01;
    w[25] =   0.1055137261734304E-01;
  }
  else if ( n == 27 )
  {
    x[ 0] =  -0.9961792628889886E+00;
    x[ 1] =  -0.9799234759615012E+00;
    x[ 2] =  -0.9509005578147051E+00;
    x[ 3] =  -0.9094823206774911E+00;
    x[ 4] =  -0.8562079080182945E+00;
    x[ 5] =  -0.7917716390705082E+00;
    x[ 6] =  -0.7170134737394237E+00;
    x[ 7] =  -0.6329079719464952E+00;
    x[ 8] =  -0.5405515645794569E+00;
    x[ 9] =  -0.4411482517500269E+00;
    x[10] =  -0.3359939036385089E+00;
    x[11] =  -0.2264593654395369E+00;
    x[12] =  -0.1139725856095300E+00;
    x[13] =   0.0000000000000000E+00;
    x[14] =   0.1139725856095300E+00;
    x[15] =   0.2264593654395369E+00;
    x[16] =   0.3359939036385089E+00;
    x[17] =   0.4411482517500269E+00;
    x[18] =   0.5405515645794569E+00;
    x[19] =   0.6329079719464952E+00;
    x[20] =   0.7170134737394237E+00;
    x[21] =   0.7917716390705082E+00;
    x[22] =   0.8562079080182945E+00;
    x[23] =   0.9094823206774911E+00;
    x[24] =   0.9509005578147051E+00;
    x[25] =   0.9799234759615012E+00;
    x[26] =   0.9961792628889886E+00;

    w[ 0] =   0.9798996051294232E-02;
    w[ 1] =   0.2268623159618062E-01;
    w[ 2] =   0.3529705375741969E-01;
    w[ 3] =   0.4744941252061504E-01;
    w[ 4] =   0.5898353685983366E-01;
    w[ 5] =   0.6974882376624561E-01;
    w[ 6] =   0.7960486777305781E-01;
    w[ 7] =   0.8842315854375689E-01;
    w[ 8] =   0.9608872737002842E-01;
    w[ 9] =   0.1025016378177459E+00;
    w[10] =   0.1075782857885332E+00;
    w[11] =   0.1112524883568452E+00;
    w[12] =   0.1134763461089651E+00;
    w[13] =   0.1142208673789570E+00;
    w[14] =   0.1134763461089651E+00;
    w[15] =   0.1112524883568452E+00;
    w[16] =   0.1075782857885332E+00;
    w[17] =   0.1025016378177459E+00;
    w[18] =   0.9608872737002842E-01;
    w[19] =   0.8842315854375689E-01;
    w[20] =   0.7960486777305781E-01;
    w[21] =   0.6974882376624561E-01;
    w[22] =   0.5898353685983366E-01;
    w[23] =   0.4744941252061504E-01;
    w[24] =   0.3529705375741969E-01;
    w[25] =   0.2268623159618062E-01;
    w[26] =   0.9798996051294232E-02;
  }
  else if ( n == 28 )
  {
    x[ 0] =  -0.9964424975739544E+00;
    x[ 1] =  -0.9813031653708728E+00;
    x[ 2] =  -0.9542592806289382E+00;
    x[ 3] =  -0.9156330263921321E+00;
    x[ 4] =  -0.8658925225743951E+00;
    x[ 5] =  -0.8056413709171791E+00;
    x[ 6] =  -0.7356108780136318E+00;
    x[ 7] =  -0.6566510940388650E+00;
    x[ 8] =  -0.5697204718114017E+00;
    x[ 9] =  -0.4758742249551183E+00;
    x[10] =  -0.3762515160890787E+00;
    x[11] =  -0.2720616276351780E+00;
    x[12] =  -0.1645692821333808E+00;
    x[13] =  -0.5507928988403427E-01;
    x[14] =   0.5507928988403427E-01;
    x[15] =   0.1645692821333808E+00;
    x[16] =   0.2720616276351780E+00;
    x[17] =   0.3762515160890787E+00;
    x[18] =   0.4758742249551183E+00;
    x[19] =   0.5697204718114017E+00;
    x[20] =   0.6566510940388650E+00;
    x[21] =   0.7356108780136318E+00;
    x[22] =   0.8056413709171791E+00;
    x[23] =   0.8658925225743951E+00;
    x[24] =   0.9156330263921321E+00;
    x[25] =   0.9542592806289382E+00;
    x[26] =   0.9813031653708728E+00;
    x[27] =   0.9964424975739544E+00;

    w[ 0] =   0.9124282593094672E-02;
    w[ 1] =   0.2113211259277118E-01;
    w[ 2] =   0.3290142778230441E-01;
    w[ 3] =   0.4427293475900429E-01;
    w[ 4] =   0.5510734567571667E-01;
    w[ 5] =   0.6527292396699959E-01;
    w[ 6] =   0.7464621423456877E-01;
    w[ 7] =   0.8311341722890127E-01;
    w[ 8] =   0.9057174439303289E-01;
    w[ 9] =   0.9693065799792999E-01;
    w[10] =   0.1021129675780608E+00;
    w[11] =   0.1060557659228464E+00;
    w[12] =   0.1087111922582942E+00;
    w[13] =   0.1100470130164752E+00;
    w[14] =   0.1100470130164752E+00;
    w[15] =   0.1087111922582942E+00;
    w[16] =   0.1060557659228464E+00;
    w[17] =   0.1021129675780608E+00;
    w[18] =   0.9693065799792999E-01;
    w[19] =   0.9057174439303289E-01;
    w[20] =   0.8311341722890127E-01;
    w[21] =   0.7464621423456877E-01;
    w[22] =   0.6527292396699959E-01;
    w[23] =   0.5510734567571667E-01;
    w[24] =   0.4427293475900429E-01;
    w[25] =   0.3290142778230441E-01;
    w[26] =   0.2113211259277118E-01;
    w[27] =   0.9124282593094672E-02;
  }
  else if ( n == 29 )
  {
    x[ 0] =  -0.9966794422605966E+00;
    x[ 1] =  -0.9825455052614132E+00;
    x[ 2] =  -0.9572855957780877E+00;
    x[ 3] =  -0.9211802329530588E+00;
    x[ 4] =  -0.8746378049201028E+00;
    x[ 5] =  -0.8181854876152524E+00;
    x[ 6] =  -0.7524628517344771E+00;
    x[ 7] =  -0.6782145376026865E+00;
    x[ 8] =  -0.5962817971382278E+00;
    x[ 9] =  -0.5075929551242276E+00;
    x[10] =  -0.4131528881740087E+00;
    x[11] =  -0.3140316378676399E+00;
    x[12] =  -0.2113522861660011E+00;
    x[13] =  -0.1062782301326792E+00;
    x[14] =   0.0000000000000000E+00;
    x[15] =   0.1062782301326792E+00;
    x[16] =   0.2113522861660011E+00;
    x[17] =   0.3140316378676399E+00;
    x[18] =   0.4131528881740087E+00;
    x[19] =   0.5075929551242276E+00;
    x[20] =   0.5962817971382278E+00;
    x[21] =   0.6782145376026865E+00;
    x[22] =   0.7524628517344771E+00;
    x[23] =   0.8181854876152524E+00;
    x[24] =   0.8746378049201028E+00;
    x[25] =   0.9211802329530588E+00;
    x[26] =   0.9572855957780877E+00;
    x[27] =   0.9825455052614132E+00;
    x[28] =   0.9966794422605966E+00;

    w[ 0] =   0.8516903878746365E-02;
    w[ 1] =   0.1973208505612276E-01;
    w[ 2] =   0.3074049220209360E-01;
    w[ 3] =   0.4140206251868281E-01;
    w[ 4] =   0.5159482690249799E-01;
    w[ 5] =   0.6120309065707916E-01;
    w[ 6] =   0.7011793325505125E-01;
    w[ 7] =   0.7823832713576385E-01;
    w[ 8] =   0.8547225736617248E-01;
    w[ 9] =   0.9173775713925882E-01;
    w[10] =   0.9696383409440862E-01;
    w[11] =   0.1010912737599150E+00;
    w[12] =   0.1040733100777293E+00;
    w[13] =   0.1058761550973210E+00;
    w[14] =   0.1064793817183143E+00;
    w[15] =   0.1058761550973210E+00;
    w[16] =   0.1040733100777293E+00;
    w[17] =   0.1010912737599150E+00;
    w[18] =   0.9696383409440862E-01;
    w[19] =   0.9173775713925882E-01;
    w[20] =   0.8547225736617248E-01;
    w[21] =   0.7823832713576385E-01;
    w[22] =   0.7011793325505125E-01;
    w[23] =   0.6120309065707916E-01;
    w[24] =   0.5159482690249799E-01;
    w[25] =   0.4140206251868281E-01;
    w[26] =   0.3074049220209360E-01;
    w[27] =   0.1973208505612276E-01;
    w[28] =   0.8516903878746365E-02;
  }
  else if ( n == 30 )
  {
    x[ 0] =  -0.9968934840746495E+00;
    x[ 1] =  -0.9836681232797472E+00;
    x[ 2] =  -0.9600218649683075E+00;
    x[ 3] =  -0.9262000474292743E+00;
    x[ 4] =  -0.8825605357920526E+00;
    x[ 5] =  -0.8295657623827684E+00;
    x[ 6] =  -0.7677774321048262E+00;
    x[ 7] =  -0.6978504947933158E+00;
    x[ 8] =  -0.6205261829892429E+00;
    x[ 9] =  -0.5366241481420199E+00;
    x[10] =  -0.4470337695380892E+00;
    x[11] =  -0.3527047255308781E+00;
    x[12] =  -0.2546369261678899E+00;
    x[13] =  -0.1538699136085835E+00;
    x[14] =  -0.5147184255531770E-01;
    x[15] =   0.5147184255531770E-01;
    x[16] =   0.1538699136085835E+00;
    x[17] =   0.2546369261678899E+00;
    x[18] =   0.3527047255308781E+00;
    x[19] =   0.4470337695380892E+00;
    x[20] =   0.5366241481420199E+00;
    x[21] =   0.6205261829892429E+00;
    x[22] =   0.6978504947933158E+00;
    x[23] =   0.7677774321048262E+00;
    x[24] =   0.8295657623827684E+00;
    x[25] =   0.8825605357920526E+00;
    x[26] =   0.9262000474292743E+00;
    x[27] =   0.9600218649683075E+00;
    x[28] =   0.9836681232797472E+00;
    x[29] =   0.9968934840746495E+00;

    w[ 0] =   0.7968192496166648E-02;
    w[ 1] =   0.1846646831109099E-01;
    w[ 2] =   0.2878470788332330E-01;
    w[ 3] =   0.3879919256962704E-01;
    w[ 4] =   0.4840267283059405E-01;
    w[ 5] =   0.5749315621761905E-01;
    w[ 6] =   0.6597422988218052E-01;
    w[ 7] =   0.7375597473770516E-01;
    w[ 8] =   0.8075589522942023E-01;
    w[ 9] =   0.8689978720108314E-01;
    w[10] =   0.9212252223778619E-01;
    w[11] =   0.9636873717464424E-01;
    w[12] =   0.9959342058679524E-01;
    w[13] =   0.1017623897484056E+00;
    w[14] =   0.1028526528935587E+00;
    w[15] =   0.1028526528935587E+00;
    w[16] =   0.1017623897484056E+00;
    w[17] =   0.9959342058679524E-01;
    w[18] =   0.9636873717464424E-01;
    w[19] =   0.9212252223778619E-01;
    w[20] =   0.8689978720108314E-01;
    w[21] =   0.8075589522942023E-01;
    w[22] =   0.7375597473770516E-01;
    w[23] =   0.6597422988218052E-01;
    w[24] =   0.5749315621761905E-01;
    w[25] =   0.4840267283059405E-01;
    w[26] =   0.3879919256962704E-01;
    w[27] =   0.2878470788332330E-01;
    w[28] =   0.1846646831109099E-01;
    w[29] =   0.7968192496166648E-02;
  }
  else if ( n == 31 )
  {
    x[ 0] =  -0.99708748181947707454263838179654;    
    x[ 1] =  -0.98468590966515248400211329970113;    
    x[ 2] =  -0.96250392509294966178905249675943;    
    x[ 3] =  -0.93075699789664816495694576311725;    
    x[ 4] =  -0.88976002994827104337419200908023;    
    x[ 5] =  -0.83992032014626734008690453594388;    
    x[ 6] =  -0.78173314841662494040636002019484;    
    x[ 7] =  -0.71577678458685328390597086536649;    
    x[ 8] =  -0.64270672292426034618441820323250;    
    x[ 9] =  -0.56324916140714926272094492359516;    
    x[10] =  -0.47819378204490248044059403935649;    
    x[11] =  -0.38838590160823294306135146128752;    
    x[12] =  -0.29471806998170161661790389767170;    
    x[13] =  -0.19812119933557062877241299603283;    
    x[14] =  -0.99555312152341520325174790118941E-01;
    x[15] =   0.00000000000000000000000000000000;   
    x[16] =   0.99555312152341520325174790118941E-01;
    x[17] =   0.19812119933557062877241299603283;    
    x[18] =   0.29471806998170161661790389767170;    
    x[19] =   0.38838590160823294306135146128752;    
    x[20] =   0.47819378204490248044059403935649;    
    x[21] =   0.56324916140714926272094492359516;    
    x[22] =   0.64270672292426034618441820323250;    
    x[23] =   0.71577678458685328390597086536649;    
    x[24] =   0.78173314841662494040636002019484;    
    x[25] =   0.83992032014626734008690453594388;    
    x[26] =   0.88976002994827104337419200908023;    
    x[27] =   0.93075699789664816495694576311725;    
    x[28] =   0.96250392509294966178905249675943;    
    x[29] =   0.98468590966515248400211329970113;    
    x[30] =   0.99708748181947707454263838179654;

    w[ 0] =   0.74708315792487746093913218970494E-02;
    w[ 1] =   0.17318620790310582463552990782414E-01;
    w[ 2] =   0.27009019184979421800608642617676E-01;
    w[ 3] =   0.36432273912385464024392008749009E-01;
    w[ 4] =   0.45493707527201102902315857856518E-01;
    w[ 5] =   0.54103082424916853711666259085477E-01;
    w[ 6] =   0.62174786561028426910343543686657E-01;
    w[ 7] =   0.69628583235410366167756126255124E-01;
    w[ 8] =   0.76390386598776616426357674901331E-01;
    w[ 9] =   0.82392991761589263903823367431962E-01;
    w[10] =   0.87576740608477876126198069695333E-01;
    w[11] =   0.91890113893641478215362871607150E-01;
    w[12] =   0.95290242912319512807204197487597E-01;
    w[13] =   0.97743335386328725093474010978997E-01;
    w[14] =   0.99225011226672307874875514428615E-01;
    w[15] =   0.99720544793426451427533833734349E-01;
    w[16] =   0.99225011226672307874875514428615E-01;
    w[17] =   0.97743335386328725093474010978997E-01;
    w[18] =   0.95290242912319512807204197487597E-01;
    w[19] =   0.91890113893641478215362871607150E-01;
    w[20] =   0.87576740608477876126198069695333E-01;
    w[21] =   0.82392991761589263903823367431962E-01;
    w[22] =   0.76390386598776616426357674901331E-01;
    w[23] =   0.69628583235410366167756126255124E-01;
    w[24] =   0.62174786561028426910343543686657E-01;
    w[25] =   0.54103082424916853711666259085477E-01;
    w[26] =   0.45493707527201102902315857856518E-01;
    w[27] =   0.36432273912385464024392008749009E-01;
    w[28] =   0.27009019184979421800608642617676E-01;
    w[29] =   0.17318620790310582463552990782414E-01;
    w[30] =   0.74708315792487746093913218970494E-02;
  }
  else if ( n == 32 )
  {
    x[0] =  - 0.997263861849481563544981128665;
    x[1] =  - 0.985611511545268335400175044631;
    x[2] =  - 0.964762255587506430773811928118;
    x[3] =  - 0.934906075937739689170919134835;
    x[4] =  - 0.896321155766052123965307243719;
    x[5] =  - 0.849367613732569970133693004968;
    x[6] =  - 0.794483795967942406963097298970;
    x[7] =  - 0.732182118740289680387426665091;
    x[8] =  - 0.663044266930215200975115168663;
    x[9] =  - 0.587715757240762329040745476402;
    x[10] = - 0.506899908932229390023747474378;
    x[11] = - 0.421351276130635345364119436172;
    x[12] = - 0.331868602282127649779916805730;
    x[13] = - 0.239287362252137074544603209166;
    x[14] = - 0.144471961582796493485186373599;
    x[15] = - 0.483076656877383162348125704405E-01;
    x[16] =   0.483076656877383162348125704405E-01;
    x[17] =   0.144471961582796493485186373599;
    x[18] =   0.239287362252137074544603209166;
    x[19] =   0.331868602282127649779916805730;
    x[20] =   0.421351276130635345364119436172;
    x[21] =   0.506899908932229390023747474378;
    x[22] =   0.587715757240762329040745476402;
    x[23] =   0.663044266930215200975115168663;
    x[24] =   0.732182118740289680387426665091;
    x[25] =   0.794483795967942406963097298970;
    x[26] =   0.849367613732569970133693004968;
    x[27] =   0.896321155766052123965307243719;
    x[28] =   0.934906075937739689170919134835;
    x[29] =   0.964762255587506430773811928118;
    x[30] =   0.985611511545268335400175044631;
    x[31] =   0.997263861849481563544981128665;

    w[0] =  0.701861000947009660040706373885E-02;
    w[1] =  0.162743947309056706051705622064E-01;
    w[2] =  0.253920653092620594557525897892E-01;
    w[3] =  0.342738629130214331026877322524E-01;
    w[4] =  0.428358980222266806568786466061E-01;
    w[5] =  0.509980592623761761961632446895E-01;
    w[6] =  0.586840934785355471452836373002E-01;
    w[7] =  0.658222227763618468376500637069E-01;
    w[8] =  0.723457941088485062253993564785E-01;
    w[9] =  0.781938957870703064717409188283E-01;
    w[10] = 0.833119242269467552221990746043E-01;
    w[11] = 0.876520930044038111427714627518E-01;
    w[12] = 0.911738786957638847128685771116E-01;
    w[13] = 0.938443990808045656391802376681E-01;
    w[14] = 0.956387200792748594190820022041E-01;
    w[15] = 0.965400885147278005667648300636E-01;
    w[16] = 0.965400885147278005667648300636E-01;
    w[17] = 0.956387200792748594190820022041E-01;
    w[18] = 0.938443990808045656391802376681E-01;
    w[19] = 0.911738786957638847128685771116E-01;
    w[20] = 0.876520930044038111427714627518E-01;
    w[21] = 0.833119242269467552221990746043E-01;
    w[22] = 0.781938957870703064717409188283E-01;
    w[23] = 0.723457941088485062253993564785E-01;
    w[24] = 0.658222227763618468376500637069E-01;
    w[25] = 0.586840934785355471452836373002E-01;
    w[26] = 0.509980592623761761961632446895E-01;
    w[27] = 0.428358980222266806568786466061E-01;
    w[28] = 0.342738629130214331026877322524E-01;
    w[29] = 0.253920653092620594557525897892E-01;
    w[30] = 0.162743947309056706051705622064E-01;
    w[31] = 0.701861000947009660040706373885E-02;
  }
  else if ( n == 33 )
  {
    x[ 0] =  -0.9974246942464552;    
    x[ 1] =  -0.9864557262306425;
    x[ 2] =  -0.9668229096899927;
    x[ 3] =  -0.9386943726111684;    
    x[ 4] =  -0.9023167677434336;    
    x[ 5] =  -0.8580096526765041;    
    x[ 6] =  -0.8061623562741665;    
    x[ 7] =  -0.7472304964495622;    
    x[ 8] =  -0.6817319599697428;    
    x[ 9] =  -0.6102423458363790;    
    x[10] =  -0.5333899047863476;    
    x[11] =  -0.4518500172724507;    
    x[12] =  -0.3663392577480734;    
    x[13] =  -0.2776090971524970;    
    x[14] =  -0.1864392988279916;    
    x[15] =  -0.09363106585473338;
    x[16] =   0.000000000000000;
    x[17] =   0.09363106585473338;
    x[18] =   0.1864392988279916;    
    x[19] =   0.2776090971524970;    
    x[20] =   0.3663392577480734;    
    x[21] =   0.4518500172724507;    
    x[22] =   0.5333899047863476;    
    x[23] =   0.6102423458363790;    
    x[24] =   0.6817319599697428;    
    x[25] =   0.7472304964495622;    
    x[26] =   0.8061623562741665;    
    x[27] =   0.8580096526765041;    
    x[28] =   0.9023167677434336;    
    x[29] =   0.9386943726111684;    
    x[30] =   0.9668229096899927;    
    x[31] =   0.9864557262306425;    
    x[32] =   0.9974246942464552;    

    w[ 0] =   0.6606227847587558E-02;
    w[ 1] =   0.1532170151293465E-01;
    w[ 2] =   0.2391554810174960E-01;
    w[ 3] =   0.3230035863232891E-01;
    w[ 4] =   0.4040154133166965E-01;
    w[ 5] =   0.4814774281871162E-01;
    w[ 6] =   0.5547084663166357E-01;
    w[ 7] =   0.6230648253031755E-01;
    w[ 8] =   0.6859457281865676E-01;
    w[ 9] =   0.7427985484395420E-01;
    w[10] =   0.7931236479488685E-01;
    w[11] =   0.8364787606703869E-01;
    w[12] =   0.8724828761884425E-01;
    w[13] =   0.9008195866063859E-01;
    w[14] =   0.9212398664331678E-01;
    w[15] =   0.9335642606559612E-01;
    w[16] =   0.9376844616020999E-01;
    w[17] =   0.9335642606559612E-01;
    w[18] =   0.9212398664331678E-01;
    w[19] =   0.9008195866063859E-01;
    w[20] =   0.8724828761884425E-01;
    w[21] =   0.8364787606703869E-01;
    w[22] =   0.7931236479488685E-01;
    w[23] =   0.7427985484395420E-01;
    w[24] =   0.6859457281865676E-01;
    w[25] =   0.6230648253031755E-01;
    w[26] =   0.5547084663166357E-01;
    w[27] =   0.4814774281871162E-01;
    w[28] =   0.4040154133166965E-01;
    w[29] =   0.3230035863232891E-01;
    w[30] =   0.2391554810174960E-01;
    w[31] =   0.1532170151293465E-01;
    w[32] =   0.6606227847587558E-02;
  }
  else if ( n == 64 )
  {
    x[0] =  - 0.999305041735772139456905624346;
    x[1] =  - 0.996340116771955279346924500676;
    x[2] =  - 0.991013371476744320739382383443;
    x[3] =  - 0.983336253884625956931299302157;
    x[4] =  - 0.973326827789910963741853507352;
    x[5] =  - 0.961008799652053718918614121897;
    x[6] =  - 0.946411374858402816062481491347;
    x[7] =  - 0.929569172131939575821490154559;
    x[8] =  - 0.910522137078502805756380668008;
    x[9] =  - 0.889315445995114105853404038273;
    x[10] = - 0.865999398154092819760783385070;
    x[11] = - 0.840629296252580362751691544696;
    x[12] = - 0.813265315122797559741923338086;
    x[13] = - 0.783972358943341407610220525214;
    x[14] = - 0.752819907260531896611863774886;
    x[15] = - 0.719881850171610826848940217832;
    x[16] = - 0.685236313054233242563558371031;
    x[17] = - 0.648965471254657339857761231993;
    x[18] = - 0.611155355172393250248852971019;
    x[19] = - 0.571895646202634034283878116659;
    x[20] = - 0.531279464019894545658013903544;
    x[21] = - 0.489403145707052957478526307022;
    x[22] = - 0.446366017253464087984947714759;
    x[23] = - 0.402270157963991603695766771260;
    x[24] = - 0.357220158337668115950442615046;
    x[25] = - 0.311322871990210956157512698560;
    x[26] = - 0.264687162208767416373964172510;
    x[27] = - 0.217423643740007084149648748989;
    x[28] = - 0.169644420423992818037313629748;
    x[29] = - 0.121462819296120554470376463492;
    x[30] = - 0.729931217877990394495429419403E-01;
    x[31] = - 0.243502926634244325089558428537E-01;
    x[32] =   0.243502926634244325089558428537E-01;
    x[33] =   0.729931217877990394495429419403E-01;
    x[34] =   0.121462819296120554470376463492;
    x[35] =   0.169644420423992818037313629748;
    x[36] =   0.217423643740007084149648748989;
    x[37] =   0.264687162208767416373964172510;
    x[38] =   0.311322871990210956157512698560;
    x[39] =   0.357220158337668115950442615046;
    x[40] =   0.402270157963991603695766771260;
    x[41] =   0.446366017253464087984947714759;
    x[42] =   0.489403145707052957478526307022;
    x[43] =   0.531279464019894545658013903544;
    x[44] =   0.571895646202634034283878116659;
    x[45] =   0.611155355172393250248852971019;
    x[46] =   0.648965471254657339857761231993;
    x[47] =   0.685236313054233242563558371031;
    x[48] =   0.719881850171610826848940217832;
    x[49] =   0.752819907260531896611863774886;
    x[50] =   0.783972358943341407610220525214;
    x[51] =   0.813265315122797559741923338086;
    x[52] =   0.840629296252580362751691544696;
    x[53] =   0.865999398154092819760783385070;
    x[54] =   0.889315445995114105853404038273;
    x[55] =   0.910522137078502805756380668008;
    x[56] =   0.929569172131939575821490154559;
    x[57] =   0.946411374858402816062481491347;
    x[58] =   0.961008799652053718918614121897;
    x[59] =   0.973326827789910963741853507352;
    x[60] =   0.983336253884625956931299302157;
    x[61] =   0.991013371476744320739382383443;
    x[62] =   0.996340116771955279346924500676;
    x[63] =   0.999305041735772139456905624346;

    w[0] =  0.178328072169643294729607914497E-02;
    w[1] =  0.414703326056246763528753572855E-02;
    w[2] =  0.650445796897836285611736039998E-02;
    w[3] =  0.884675982636394772303091465973E-02;
    w[4] =  0.111681394601311288185904930192E-01;
    w[5] =  0.134630478967186425980607666860E-01;
    w[6] =  0.157260304760247193219659952975E-01;
    w[7] =  0.179517157756973430850453020011E-01;
    w[8] =  0.201348231535302093723403167285E-01;
    w[9] =  0.222701738083832541592983303842E-01;
    w[10] = 0.243527025687108733381775504091E-01;
    w[11] = 0.263774697150546586716917926252E-01;
    w[12] = 0.283396726142594832275113052002E-01;
    w[13] = 0.302346570724024788679740598195E-01;
    w[14] = 0.320579283548515535854675043479E-01;
    w[15] = 0.338051618371416093915654821107E-01;
    w[16] = 0.354722132568823838106931467152E-01;
    w[17] = 0.370551285402400460404151018096E-01;
    w[18] = 0.385501531786156291289624969468E-01;
    w[19] = 0.399537411327203413866569261283E-01;
    w[20] = 0.412625632426235286101562974736E-01;
    w[21] = 0.424735151236535890073397679088E-01;
    w[22] = 0.435837245293234533768278609737E-01;
    w[23] = 0.445905581637565630601347100309E-01;
    w[24] = 0.454916279274181444797709969713E-01;
    w[25] = 0.462847965813144172959532492323E-01;
    w[26] = 0.469681828162100173253262857546E-01;
    w[27] = 0.475401657148303086622822069442E-01;
    w[28] = 0.479993885964583077281261798713E-01;
    w[29] = 0.483447622348029571697695271580E-01;
    w[30] = 0.485754674415034269347990667840E-01;
    w[31] = 0.486909570091397203833653907347E-01;
    w[32] = 0.486909570091397203833653907347E-01;
    w[33] = 0.485754674415034269347990667840E-01;
    w[34] = 0.483447622348029571697695271580E-01;
    w[35] = 0.479993885964583077281261798713E-01;
    w[36] = 0.475401657148303086622822069442E-01;
    w[37] = 0.469681828162100173253262857546E-01;
    w[38] = 0.462847965813144172959532492323E-01;
    w[39] = 0.454916279274181444797709969713E-01;
    w[40] = 0.445905581637565630601347100309E-01;
    w[41] = 0.435837245293234533768278609737E-01;
    w[42] = 0.424735151236535890073397679088E-01;
    w[43] = 0.412625632426235286101562974736E-01;
    w[44] = 0.399537411327203413866569261283E-01;
    w[45] = 0.385501531786156291289624969468E-01;
    w[46] = 0.370551285402400460404151018096E-01;
    w[47] = 0.354722132568823838106931467152E-01;
    w[48] = 0.338051618371416093915654821107E-01;
    w[49] = 0.320579283548515535854675043479E-01;
    w[50] = 0.302346570724024788679740598195E-01;
    w[51] = 0.283396726142594832275113052002E-01;
    w[52] = 0.263774697150546586716917926252E-01;
    w[53] = 0.243527025687108733381775504091E-01;
    w[54] = 0.222701738083832541592983303842E-01;
    w[55] = 0.201348231535302093723403167285E-01;
    w[56] = 0.179517157756973430850453020011E-01;
    w[57] = 0.157260304760247193219659952975E-01;
    w[58] = 0.134630478967186425980607666860E-01;
    w[59] = 0.111681394601311288185904930192E-01;
    w[60] = 0.884675982636394772303091465973E-02;
    w[61] = 0.650445796897836285611736039998E-02;
    w[62] = 0.414703326056246763528753572855E-02;
    w[63] = 0.178328072169643294729607914497E-02;
  }
  else if ( n == 65 )
  {
    x[ 0] =  -0.9993260970754129;    
    x[ 1] =  -0.9964509480618492;    
    x[ 2] =  -0.9912852761768016;    
    x[ 3] =  -0.9838398121870350;    
    x[ 4] =  -0.9741315398335512;    
    x[ 5] =  -0.9621827547180553;    
    x[ 6] =  -0.9480209281684076;    
    x[ 7] =  -0.9316786282287494;    
    x[ 8] =  -0.9131934405428462;    
    x[ 9] =  -0.8926078805047389;    
    x[10] =  -0.8699692949264071;    
    x[11] =  -0.8453297528999303;    
    x[12] =  -0.8187459259226514;    
    x[13] =  -0.7902789574921218;    
    x[14] =  -0.7599943224419998;    
    x[15] =  -0.7279616763294247;    
    x[16] =  -0.6942546952139916;    
    x[17] =  -0.6589509061936252;    
    x[18] =  -0.6221315090854003;    
    x[19] =  -0.5838811896604873;    
    x[20] =  -0.5442879248622271;    
    x[21] =  -0.5034427804550069;    
    x[22] =  -0.4614397015691450;    
    x[23] =  -0.4183752966234090;    
    x[24] =  -0.3743486151220660;    
    x[25] =  -0.3294609198374864;    
    x[26] =  -0.2838154539022487;    
    x[27] =  -0.2375172033464168;    
    x[28] =  -0.1906726556261428;    
    x[29] =  -0.1433895546989752;    
    x[30] =  -0.9577665320919751E-01;
    x[31] =  -0.4794346235317186E-01;
    x[32] =    0.000000000000000;    
    x[33] =   0.4794346235317186E-01;
    x[34] =   0.9577665320919751E-01;
    x[35] =   0.1433895546989752;    
    x[36] =   0.1906726556261428;    
    x[37] =   0.2375172033464168;    
    x[38] =   0.2838154539022487;    
    x[39] =   0.3294609198374864;    
    x[40] =   0.3743486151220660;    
    x[41] =   0.4183752966234090;    
    x[42] =   0.4614397015691450;    
    x[43] =   0.5034427804550069;    
    x[44] =   0.5442879248622271;    
    x[45] =   0.5838811896604873;    
    x[46] =   0.6221315090854003;    
    x[47] =   0.6589509061936252;    
    x[48] =   0.6942546952139916;    
    x[49] =   0.7279616763294247;    
    x[50] =   0.7599943224419998;    
    x[51] =   0.7902789574921218;    
    x[52] =   0.8187459259226514;    
    x[53] =   0.8453297528999303;    
    x[54] =   0.8699692949264071;    
    x[55] =   0.8926078805047389;    
    x[56] =   0.9131934405428462;    
    x[57] =   0.9316786282287494;    
    x[58] =   0.9480209281684076;    
    x[59] =   0.9621827547180553;    
    x[60] =   0.9741315398335512;    
    x[61] =   0.9838398121870350;    
    x[62] =   0.9912852761768016;    
    x[63] =   0.9964509480618492;    
    x[64] =   0.9993260970754129;    

    w[ 0] =   0.1729258251300218E-02;
    w[ 1] =   0.4021524172003703E-02;
    w[ 2] =   0.6307942578971821E-02;
    w[ 3] =   0.8580148266881443E-02;
    w[ 4] =   0.1083267878959798E-01;
    w[ 5] =   0.1306031163999490E-01;
    w[ 6] =   0.1525791214644825E-01;
    w[ 7] =   0.1742042199767025E-01;
    w[ 8] =   0.1954286583675005E-01;
    w[ 9] =   0.2162036128493408E-01;
    w[10] =   0.2364812969128723E-01;
    w[11] =   0.2562150693803776E-01;
    w[12] =   0.2753595408845034E-01;
    w[13] =   0.2938706778931066E-01;
    w[14] =   0.3117059038018911E-01;
    w[15] =   0.3288241967636860E-01;
    w[16] =   0.3451861839854901E-01;
    w[17] =   0.3607542322556527E-01;
    w[18] =   0.3754925344825770E-01;
    w[19] =   0.3893671920405121E-01;
    w[20] =   0.4023462927300549E-01;
    w[21] =   0.4143999841724028E-01;
    w[22] =   0.4255005424675579E-01;
    w[23] =   0.4356224359580051E-01;
    w[24] =   0.4447423839508296E-01;
    w[25] =   0.4528394102630023E-01;
    w[26] =   0.4598948914665173E-01;
    w[27] =   0.4658925997223349E-01;
    w[28] =   0.4708187401045461E-01;
    w[29] =   0.4746619823288551E-01;
    w[30] =   0.4774134868124067E-01;
    w[31] =   0.4790669250049590E-01;
    w[32] =   0.4796184939446662E-01;
    w[33] =   0.4790669250049590E-01;
    w[34] =   0.4774134868124067E-01;
    w[35] =   0.4746619823288551E-01;
    w[36] =   0.4708187401045461E-01;
    w[37] =   0.4658925997223349E-01;
    w[38] =   0.4598948914665173E-01;
    w[39] =   0.4528394102630023E-01;
    w[40] =   0.4447423839508296E-01;
    w[41] =   0.4356224359580051E-01;
    w[42] =   0.4255005424675579E-01;
    w[43] =   0.4143999841724028E-01;
    w[44] =   0.4023462927300549E-01;
    w[45] =   0.3893671920405121E-01;
    w[46] =   0.3754925344825770E-01;
    w[47] =   0.3607542322556527E-01;
    w[48] =   0.3451861839854901E-01;
    w[49] =   0.3288241967636860E-01;
    w[50] =   0.3117059038018911E-01;
    w[51] =   0.2938706778931066E-01;
    w[52] =   0.2753595408845034E-01;
    w[53] =   0.2562150693803776E-01;
    w[54] =   0.2364812969128723E-01;
    w[55] =   0.2162036128493408E-01;
    w[56] =   0.1954286583675005E-01;
    w[57] =   0.1742042199767025E-01;
    w[58] =   0.1525791214644825E-01;
    w[59] =   0.1306031163999490E-01;
    w[60] =   0.1083267878959798E-01;
    w[61] =   0.8580148266881443E-02;
    w[62] =   0.6307942578971821E-02;
    w[63] =   0.4021524172003703E-02;
    w[64] =   0.1729258251300218E-02;
  }
  else if ( n == 127 ) 
  {
    x[  0] =  -0.99982213041530614629963254927125E+00;
    x[  1] =  -0.99906293435531189513828920479421E+00;    
    x[  2] =  -0.99769756618980462107441703193392E+00;    
    x[  3] =  -0.99572655135202722663543337085008E+00;    
    x[  4] =  -0.99315104925451714736113079489080E+00;  
    x[  5] =  -0.98997261459148415760778669967548E+00;   
    x[  6] =  -0.98619317401693166671043833175407E+00;    
    x[  7] =  -0.98181502080381411003346312451200E+00;    
    x[  8] =  -0.97684081234307032681744391886221E+00;    
    x[  9] =  -0.97127356816152919228894689830512E+00;    
    x[ 10] =  -0.96511666794529212109082507703391E+00;    
    x[ 11] =  -0.95837384942523877114910286998060E+00;    
    x[ 12] =  -0.95104920607788031054790764659636E+00;   
    x[ 13] =  -0.94314718462481482734544963026201E+00;    
    x[ 14] =  -0.93467258232473796857363487794906E+00;    
    x[ 15] =  -0.92563054405623384912746466814259E+00;    
    x[ 16] =  -0.91602655919146580931308861741716E+00;   
    x[ 17] =  -0.90586645826182138280246131760282E+00;    
    x[ 18] =  -0.89515640941708370896904382642451E+00;   
    x[ 19] =  -0.88390291468002656994525794802849E+00;    
    x[ 20] =  -0.87211280599856071141963753428864E+00;    
    x[ 21] =  -0.85979324109774080981203134414483E+00;   
    x[ 22] =  -0.84695169913409759845333931085437E+00;    
    x[ 23] =  -0.83359597615489951437955716480123E+00;    
    x[ 24] =  -0.81973418036507867415511910167470E+00;   
    x[ 25] =  -0.80537472720468021466656079404644E+00;   
    x[ 26] =  -0.79052633423981379994544995252740E+00;   
    x[ 27] =  -0.77519801587020238244496276354566E+00;  
    x[ 28] =  -0.75939907785653667155666366659810E+00;   
    x[ 29] =  -0.74313911167095451292056688997595E+00;   
    x[ 30] =  -0.72642798867407268553569290153270E+00;    
    x[ 31] =  -0.70927585412210456099944463906757E+00;   
    x[ 32] =  -0.69169312100770067015644143286666E+00; 
    x[ 33] =  -0.67369046373825048534668253831602E+00;
    x[ 34] =  -0.65527881165548263027676505156852E+00;
    x[ 35] =  -0.63646934240029724134760815684175E+00;
    x[ 36] =  -0.61727347512685828385763916340822E+00; 
    x[ 37] =  -0.59770286357006522938441201887478E+00; 
    x[ 38] =  -0.57776938897061258000325165713764E+00; 
    x[ 39] =  -0.55748515286193223292186190687872E+00; 
    x[ 40] =  -0.53686246972339756745816636353452E+00;
    x[ 41] =  -0.51591385950424935727727729906662E+00; 
    x[ 42] =  -0.49465204002278211739494017368636E+00;
    x[ 43] =  -0.47308991924540524164509989939699E+00;
    x[ 44] =  -0.45124058745026622733189858020729E+00;
    x[ 45] =  -0.42911730928019337626254405355418E+00;
    x[ 46] =  -0.40673351568978256340867288124339E+00;
    x[ 47] =  -0.38410279579151693577907781452239E+00;
    x[ 48] =  -0.36123888860586970607092484346723E+00;
    x[ 49] =  -0.33815567472039850137600027657095E+00;
    x[ 50] =  -0.31486716786289498148601475374890E+00; 
    x[ 51] =  -0.29138750639370562079451875284568E+00; 
    x[ 52] =  -0.26773094472238862088834352027938E+00;
    x[ 53] =  -0.24391184465391785797071324453138E+00;
    x[ 54] =  -0.21994466666968754245452337866940E+00;
    x[ 55] =  -0.19584396114861085150428162519610E+00;
    x[ 56] =  -0.17162435953364216500834492248954E+00; 
    x[ 57] =  -0.14730056544908566938932929319807E+00;
    x[ 58] =  -0.12288734577408297172603365288567E+00;
    x[ 59] =  -0.98399521677698970751091751509101E-01;
    x[ 60] =  -0.73851959621048545273440409360569E-01;
    x[ 61] =  -0.49259562331926630315379321821927E-01;
    x[ 62] =  -0.24637259757420944614897071846088E-01;
    x[ 63] =   0.00000000000000000000000000000000E+00;
    x[ 64] =   0.24637259757420944614897071846088E-01;
    x[ 65] =   0.49259562331926630315379321821927E-01;
    x[ 66] =   0.73851959621048545273440409360569E-01;
    x[ 67] =   0.98399521677698970751091751509101E-01;
    x[ 68] =   0.12288734577408297172603365288567E+00;
    x[ 69] =   0.14730056544908566938932929319807E+00;
    x[ 70] =   0.17162435953364216500834492248954E+00;
    x[ 71] =   0.19584396114861085150428162519610E+00;
    x[ 72] =   0.21994466666968754245452337866940E+00;    
    x[ 73] =   0.24391184465391785797071324453138E+00;   
    x[ 74] =   0.26773094472238862088834352027938E+00;   
    x[ 75] =   0.29138750639370562079451875284568E+00;   
    x[ 76] =   0.31486716786289498148601475374890E+00;    
    x[ 77] =   0.33815567472039850137600027657095E+00;   
    x[ 78] =   0.36123888860586970607092484346723E+00;    
    x[ 79] =   0.38410279579151693577907781452239E+00;    
    x[ 80] =   0.40673351568978256340867288124339E+00;  
    x[ 81] =   0.42911730928019337626254405355418E+00;    
    x[ 82] =   0.45124058745026622733189858020729E+00;   
    x[ 83] =   0.47308991924540524164509989939699E+00;   
    x[ 84] =   0.49465204002278211739494017368636E+00; 
    x[ 85] =   0.51591385950424935727727729906662E+00; 
    x[ 86] =   0.53686246972339756745816636353452E+00; 
    x[ 87] =   0.55748515286193223292186190687872E+00;   
    x[ 88] =   0.57776938897061258000325165713764E+00;  
    x[ 89] =   0.59770286357006522938441201887478E+00;  
    x[ 90] =   0.61727347512685828385763916340822E+00;  
    x[ 91] =   0.63646934240029724134760815684175E+00;    
    x[ 92] =   0.65527881165548263027676505156852E+00;  
    x[ 93] =   0.67369046373825048534668253831602E+00;   
    x[ 94] =   0.69169312100770067015644143286666E+00;   
    x[ 95] =   0.70927585412210456099944463906757E+00;   
    x[ 96] =   0.72642798867407268553569290153270E+00;   
    x[ 97] =   0.74313911167095451292056688997595E+00;    
    x[ 98] =   0.75939907785653667155666366659810E+00;   
    x[ 99] =   0.77519801587020238244496276354566E+00;    
    x[100] =   0.79052633423981379994544995252740E+00;   
    x[101] =   0.80537472720468021466656079404644E+00;   
    x[102] =   0.81973418036507867415511910167470E+00;  
    x[103] =   0.83359597615489951437955716480123E+00;   
    x[104] =   0.84695169913409759845333931085437E+00;   
    x[105] =   0.85979324109774080981203134414483E+00; 
    x[106] =   0.87211280599856071141963753428864E+00;  
    x[107] =   0.88390291468002656994525794802849E+00;   
    x[108] =   0.89515640941708370896904382642451E+00;    
    x[109] =   0.90586645826182138280246131760282E+00;   
    x[110] =   0.91602655919146580931308861741716E+00;  
    x[111] =   0.92563054405623384912746466814259E+00; 
    x[112] =   0.93467258232473796857363487794906E+00; 
    x[113] =   0.94314718462481482734544963026201E+00;  
    x[114] =   0.95104920607788031054790764659636E+00; 
    x[115] =   0.95837384942523877114910286998060E+00; 
    x[116] =   0.96511666794529212109082507703391E+00;
    x[117] =   0.97127356816152919228894689830512E+00; 
    x[118] =   0.97684081234307032681744391886221E+00; 
    x[119] =   0.98181502080381411003346312451200E+00;  
    x[120] =   0.98619317401693166671043833175407E+00;
    x[121] =   0.98997261459148415760778669967548E+00;
    x[122] =   0.99315104925451714736113079489080E+00; 
    x[123] =   0.99572655135202722663543337085008E+00; 
    x[124] =   0.99769756618980462107441703193392E+00; 
    x[125] =   0.99906293435531189513828920479421E+00;
    x[126] =   0.99982213041530614629963254927125E+00; 

    w[  0] =   0.45645726109586654495731936146574E-03;
    w[  1] =   0.10622766869538486959954760554099E-02;
    w[  2] =   0.16683488125171936761028811985672E-02;
    w[  3] =   0.22734860707492547802810838362671E-02;
    w[  4] =   0.28772587656289004082883197417581E-02;
    w[  5] =   0.34792893810051465908910894094105E-02;
    w[  6] =   0.40792095178254605327114733456293E-02;
    w[  7] =   0.46766539777779034772638165662478E-02;
    w[  8] =   0.52712596565634400891303815906251E-02;
    w[  9] =   0.58626653903523901033648343751367E-02;
    w[ 10] =   0.64505120486899171845442463868748E-02;
    w[ 11] =   0.70344427036681608755685893032552E-02;
    w[ 12] =   0.76141028256526859356393930849227E-02;
    w[ 13] =   0.81891404887415730817235884718726E-02;
    w[ 14] =   0.87592065795403145773316804234385E-02;
    w[ 15] =   0.93239550065309714787536985834029E-02;
    w[ 16] =   0.98830429087554914716648010899606E-02;
    w[ 17] =   0.10436130863141005225673171997668E-01;
    w[ 18] =   0.10982883090068975788799657376065E-01;
    w[ 19] =   0.11522967656921087154811609734510E-01;
    w[ 20] =   0.12056056679400848183529562144697E-01;
    w[ 21] =   0.12581826520465013101514365424172E-01;
    w[ 22] =   0.13099957986718627426172681912499E-01;
    w[ 23] =   0.13610136522139249906034237533759E-01;
    w[ 24] =   0.14112052399003395774044161633613E-01;
    w[ 25] =   0.14605400905893418351737288078952E-01;
    w[ 26] =   0.15089882532666922992635733981431E-01;
    w[ 27] =   0.15565203152273955098532590262975E-01;
    w[ 28] =   0.16031074199309941802254151842763E-01;
    w[ 29] =   0.16487212845194879399346060358146E-01;
    w[ 30] =   0.16933342169871654545878815295200E-01;
    w[ 31] =   0.17369191329918731922164721250350E-01;
    w[ 32] =   0.17794495722974774231027912900351E-01;
    w[ 33] =   0.18208997148375106468721469154479E-01;
    w[ 34] =   0.18612443963902310429440419898958E-01;
    w[ 35] =   0.19004591238555646611148901044533E-01;
    w[ 36] =   0.19385200901246454628112623489471E-01;
    w[ 37] =   0.19754041885329183081815217323169E-01;
    w[ 38] =   0.20110890268880247225644623956287E-01;
    w[ 39] =   0.20455529410639508279497065713301E-01;
    w[ 40] =   0.20787750081531811812652137291250E-01;
    w[ 41] =   0.21107350591688713643523847921658E-01;
    w[ 42] =   0.21414136912893259295449693233545E-01;
    w[ 43] =   0.21707922796373466052301324695331E-01;
    w[ 44] =   0.21988529885872983756478409758807E-01;
    w[ 45] =   0.22255787825930280235631416460158E-01;
    w[ 46] =   0.22509534365300608085694429903050E-01;
    w[ 47] =   0.22749615455457959852242553240982E-01;
    w[ 48] =   0.22975885344117206754377437838947E-01;
    w[ 49] =   0.23188206663719640249922582981729E-01;
    w[ 50] =   0.23386450514828194170722043496950E-01;
    w[ 51] =   0.23570496544381716050033676844306E-01;
    w[ 52] =   0.23740233018760777777714726703424E-01;
    w[ 53] =   0.23895556891620665983864481754172E-01;
    w[ 54] =   0.24036373866450369675132086026456E-01;
    w[ 55] =   0.24162598453819584716522917710986E-01;
    w[ 56] =   0.24274154023278979833195063936748E-01;
    w[ 57] =   0.24370972849882214952813561907241E-01;
    w[ 58] =   0.24452996155301467956140198471529E-01;
    w[ 59] =   0.24520174143511508275183033290175E-01;
    w[ 60] =   0.24572466031020653286354137335186E-01;
    w[ 61] =   0.24609840071630254092545634003360E-01;
    w[ 62] =   0.24632273575707679066033370218017E-01;
    w[ 63] =   0.24639752923961094419579417477503E-01;
    w[ 64] =   0.24632273575707679066033370218017E-01;
    w[ 65] =   0.24609840071630254092545634003360E-01;
    w[ 66] =   0.24572466031020653286354137335186E-01;
    w[ 67] =   0.24520174143511508275183033290175E-01;
    w[ 68] =   0.24452996155301467956140198471529E-01;
    w[ 69] =   0.24370972849882214952813561907241E-01;
    w[ 70] =   0.24274154023278979833195063936748E-01;
    w[ 71] =   0.24162598453819584716522917710986E-01;
    w[ 72] =   0.24036373866450369675132086026456E-01;
    w[ 73] =   0.23895556891620665983864481754172E-01;
    w[ 74] =   0.23740233018760777777714726703424E-01;
    w[ 75] =   0.23570496544381716050033676844306E-01;
    w[ 76] =   0.23386450514828194170722043496950E-01;
    w[ 77] =   0.23188206663719640249922582981729E-01;
    w[ 78] =   0.22975885344117206754377437838947E-01;
    w[ 79] =   0.22749615455457959852242553240982E-01;
    w[ 80] =   0.22509534365300608085694429903050E-01;
    w[ 81] =   0.22255787825930280235631416460158E-01;
    w[ 82] =   0.21988529885872983756478409758807E-01;
    w[ 83] =   0.21707922796373466052301324695331E-01;
    w[ 84] =   0.21414136912893259295449693233545E-01;
    w[ 85] =   0.21107350591688713643523847921658E-01;
    w[ 86] =   0.20787750081531811812652137291250E-01;
    w[ 87] =   0.20455529410639508279497065713301E-01;
    w[ 88] =   0.20110890268880247225644623956287E-01;
    w[ 89] =   0.19754041885329183081815217323169E-01;
    w[ 90] =   0.19385200901246454628112623489471E-01;
    w[ 91] =   0.19004591238555646611148901044533E-01;
    w[ 92] =   0.18612443963902310429440419898958E-01;
    w[ 93] =   0.18208997148375106468721469154479E-01;
    w[ 94] =   0.17794495722974774231027912900351E-01;
    w[ 95] =   0.17369191329918731922164721250350E-01;
    w[ 96] =   0.16933342169871654545878815295200E-01;
    w[ 97] =   0.16487212845194879399346060358146E-01;
    w[ 98] =   0.16031074199309941802254151842763E-01;
    w[ 99] =   0.15565203152273955098532590262975E-01;
    w[100] =   0.15089882532666922992635733981431E-01;
    w[101] =   0.14605400905893418351737288078952E-01;
    w[102] =   0.14112052399003395774044161633613E-01;
    w[103] =   0.13610136522139249906034237533759E-01;
    w[104] =   0.13099957986718627426172681912499E-01;
    w[105] =   0.12581826520465013101514365424172E-01;
    w[106] =   0.12056056679400848183529562144697E-01;
    w[107] =   0.11522967656921087154811609734510E-01;
    w[108] =   0.10982883090068975788799657376065E-01;
    w[109] =   0.10436130863141005225673171997668E-01;
    w[110] =   0.98830429087554914716648010899606E-02;
    w[111] =   0.93239550065309714787536985834029E-02;
    w[112] =   0.87592065795403145773316804234385E-02;
    w[113] =   0.81891404887415730817235884718726E-02;
    w[114] =   0.76141028256526859356393930849227E-02;
    w[115] =   0.70344427036681608755685893032552E-02;
    w[116] =   0.64505120486899171845442463868748E-02;
    w[117] =   0.58626653903523901033648343751367E-02;
    w[118] =   0.52712596565634400891303815906251E-02;
    w[119] =   0.46766539777779034772638165662478E-02;
    w[120] =   0.40792095178254605327114733456293E-02;
    w[121] =   0.34792893810051465908910894094105E-02;
    w[122] =   0.28772587656289004082883197417581E-02;
    w[123] =   0.22734860707492547802810838362671E-02;
    w[124] =   0.16683488125171936761028811985672E-02;
    w[125] =   0.10622766869538486959954760554099E-02;
    w[126] =   0.45645726109586654495731936146574E-03;
  }
  else if ( n == 255 )
  {
    x[ 0] =      -0.9999557053175637;
    x[ 1] =      -0.9997666213120006;
    x[ 2] =        -0.99942647468017;
    x[ 3] =      -0.9989352412846546;
    x[ 4] =      -0.9982929861369679;
    x[ 5] =      -0.9974998041266158;
    x[ 6] =      -0.9965558144351986;
    x[ 7] =      -0.9954611594800263;
    x[ 8] =      -0.9942160046166302;
    x[ 9] =      -0.9928205380219891;
    x[10] =      -0.9912749706303856;
    x[11] =      -0.9895795360859201;
    x[12] =      -0.9877344906997324;
    x[13] =      -0.9857401134074193;
    x[14] =      -0.9835967057247763;
    x[15] =      -0.9813045917010171;
    x[16] =      -0.9788641178690681;
    x[17] =       -0.976275653192736;
    x[18] =      -0.9735395890106436;
    x[19] =      -0.9706563389768804;
    x[20] =      -0.9676263389983388;
    x[21] =      -0.9644500471687263;
    x[22] =      -0.9611279436992478;
    x[23] =       -0.957660530845962;
    x[24] =      -0.9540483328338163;
    x[25] =      -0.9502918957773683;
    x[26] =      -0.9463917875982043;
    x[27] =      -0.9423485979390644;
    x[28] =      -0.9381629380746873;
    x[29] =      -0.9338354408193861;
    x[30] =      -0.9293667604313699;
    x[31] =      -0.9247575725138244;
    x[32] =      -0.9200085739127664;
    x[33] =       -0.915120482611687;
    x[34] =      -0.9100940376230008;
    x[35] =       -0.904929998876315;
    x[36] =      -0.8996291471035368;
    x[37] =      -0.8941922837208367;
    x[38] =      -0.8886202307074841;
    x[39] =      -0.8829138304815741;
    x[40] =      -0.8770739457726654;
    x[41] =      -0.8711014594913465;
    x[42] =      -0.8649972745957512;
    x[43] =       -0.858762313955043;
    x[44] =      -0.8523975202098902;
    x[45] =      -0.8459038556299511;
    x[46] =       -0.839282301968391;
    x[47] =      -0.8325338603134556;
    x[48] =      -0.8256595509371186;
    x[49] =      -0.8186604131408319;
    x[50] =      -0.8115375050983958;
    x[51] =      -0.8042919036959787;
    x[52] =      -0.7969247043693057;
    x[53] =      -0.7894370209380444;
    x[54] =      -0.7818299854374094;
    x[55] =      -0.7741047479470157;
    x[56] =      -0.7662624764170006;
    x[57] =      -0.7583043564914468;
    x[58] =      -0.7502315913291283;
    x[59] =      -0.7420454014216102;
    x[60] =      -0.7337470244087263;
    x[61] =      -0.7253377148914649;
    x[62] =      -0.7168187442422908;
    x[63] =      -0.7081914004129306;
    x[64] =      -0.6994569877396524;
    x[65] =      -0.6906168267460676;
    x[66] =      -0.6816722539434864;
    x[67] =      -0.6726246216288551;
    x[68] =       -0.663475297680307;
    x[69] =      -0.6542256653503588;
    x[70] =      -0.6448771230567811;
    x[71] =      -0.6354310841711771;
    x[72] =      -0.6258889768052999;
    x[73] =      -0.6162522435951415;
    x[74] =      -0.6065223414828266;
    x[75] =      -0.5967007414963417;
    x[76] =      -0.5867889285271373;
    x[77] =      -0.5767884011056313;
    x[78] =      -0.5667006711746527;
    x[79] =      -0.5565272638608558;
    x[80] =      -0.5462697172441424;
    x[81] =      -0.5359295821251249;
    x[82] =      -0.5255084217906666;
    x[83] =      -0.5150078117775342;
    x[84] =      -0.5044293396341982;
    x[85] =       -0.493774604680817;
    x[86] =       -0.483045217767442;
    x[87] =      -0.4722428010304787;
    x[88] =      -0.4613689876474424;
    x[89] =      -0.4504254215900437;
    x[90] =      -0.4394137573756426;
    x[91] =      -0.4283356598171081;
    x[92] =      -0.4171928037711214;
    x[93] =      -0.4059868738849605;
    x[94] =      -0.3947195643418044;
    x[95] =      -0.3833925786045958;
    x[96] =      -0.3720076291585012;
    x[97] =      -0.3605664372520062;
    x[98] =      -0.3490707326366864;
    x[99] =      -0.3375222533056927;
    x[100] =      -0.3259227452309905;
    x[101] =      -0.3142739620993925;
    x[102] =      -0.3025776650474256;
    x[103] =      -0.2908356223950708;
    x[104] =      -0.2790496093784178;
    x[105] =      -0.2672214078812731;
    x[106] =      -0.2553528061657641;
    x[107] =       -0.243445598601978;
    x[108] =      -0.2315015853966777;
    x[109] =      -0.2195225723211354;
    x[110] =      -0.2075103704381242;
    x[111] =      -0.1954667958281108;
    x[112] =      -0.1833936693146885;
    x[113] =      -0.1712928161892939;
    x[114] =      -0.1591660659352477;
    x[115] =       -0.147015251951162;
    x[116] =      -0.1348422112737553;
    x[117] =      -0.1226487843001178;
    x[118] =      -0.1104368145094688;
    x[119] =     -0.09820814818444755;
    x[120] =     -0.08596463413198061;
    x[121] =     -0.07370812340376778;
    x[122] =     -0.06144046901642827;
    x[123] =     -0.04916352567134998;
    x[124] =     -0.03687914947428402;
    x[125] =     -0.02458919765472701;
    x[126] =     -0.01229552828513332;
    x[127] =                        0;
    x[128] =      0.01229552828513332;
    x[129] =      0.02458919765472701;
    x[130] =      0.03687914947428402;
    x[131] =      0.04916352567134998;
    x[132] =      0.06144046901642827;
    x[133] =      0.07370812340376778;
    x[134] =      0.08596463413198061;
    x[135] =      0.09820814818444755;
    x[136] =       0.1104368145094688;
    x[137] =       0.1226487843001178;
    x[138] =       0.1348422112737553;
    x[139] =        0.147015251951162;
    x[140] =       0.1591660659352477;
    x[141] =       0.1712928161892939;
    x[142] =       0.1833936693146885;
    x[143] =       0.1954667958281108;
    x[144] =       0.2075103704381242;
    x[145] =       0.2195225723211354;
    x[146] =       0.2315015853966777;
    x[147] =        0.243445598601978;
    x[148] =       0.2553528061657641;
    x[149] =       0.2672214078812731;
    x[150] =       0.2790496093784178;
    x[151] =       0.2908356223950708;
    x[152] =       0.3025776650474256;
    x[153] =       0.3142739620993925;
    x[154] =       0.3259227452309905;
    x[155] =       0.3375222533056927;
    x[156] =       0.3490707326366864;
    x[157] =       0.3605664372520062;
    x[158] =       0.3720076291585012;
    x[159] =       0.3833925786045958;
    x[160] =       0.3947195643418044;
    x[161] =       0.4059868738849605;
    x[162] =       0.4171928037711214;
    x[163] =       0.4283356598171081;
    x[164] =       0.4394137573756426;
    x[165] =       0.4504254215900437;
    x[166] =       0.4613689876474424;
    x[167] =       0.4722428010304787;
    x[168] =        0.483045217767442;
    x[169] =        0.493774604680817;
    x[170] =       0.5044293396341982;
    x[171] =       0.5150078117775342;
    x[172] =       0.5255084217906666;
    x[173] =       0.5359295821251249;
    x[174] =       0.5462697172441424;
    x[175] =       0.5565272638608558;
    x[176] =       0.5667006711746527;
    x[177] =       0.5767884011056313;
    x[178] =       0.5867889285271373;
    x[179] =       0.5967007414963417;
    x[180] =       0.6065223414828266;
    x[181] =       0.6162522435951415;
    x[182] =       0.6258889768052999;
    x[183] =       0.6354310841711771;
    x[184] =       0.6448771230567811;
    x[185] =       0.6542256653503588;
    x[186] =        0.663475297680307;
    x[187] =       0.6726246216288551;
    x[188] =       0.6816722539434864;
    x[189] =       0.6906168267460676;
    x[190] =       0.6994569877396524;
    x[191] =       0.7081914004129306;
    x[192] =       0.7168187442422908;
    x[193] =       0.7253377148914649;
    x[194] =       0.7337470244087263;
    x[195] =       0.7420454014216102;
    x[196] =       0.7502315913291283;
    x[197] =       0.7583043564914468;
    x[198] =       0.7662624764170006;
    x[199] =       0.7741047479470157;
    x[200] =       0.7818299854374094;
    x[201] =       0.7894370209380444;
    x[202] =       0.7969247043693057;
    x[203] =       0.8042919036959787;
    x[204] =       0.8115375050983958;
    x[205] =       0.8186604131408319;
    x[206] =       0.8256595509371186;
    x[207] =       0.8325338603134556;
    x[208] =        0.839282301968391;
    x[209] =       0.8459038556299511;
    x[210] =       0.8523975202098902;
    x[211] =        0.858762313955043;
    x[212] =       0.8649972745957512;
    x[213] =       0.8711014594913465;
    x[214] =       0.8770739457726654;
    x[215] =       0.8829138304815741;
    x[216] =       0.8886202307074841;
    x[217] =       0.8941922837208367;
    x[218] =       0.8996291471035368;
    x[219] =        0.904929998876315;
    x[220] =       0.9100940376230008;
    x[221] =        0.915120482611687;
    x[222] =       0.9200085739127664;
    x[223] =       0.9247575725138244;
    x[224] =       0.9293667604313699;
    x[225] =       0.9338354408193861;
    x[226] =       0.9381629380746873;
    x[227] =       0.9423485979390644;
    x[228] =       0.9463917875982043;
    x[229] =       0.9502918957773683;
    x[230] =       0.9540483328338163;
    x[231] =        0.957660530845962;
    x[232] =       0.9611279436992478;
    x[233] =       0.9644500471687263;
    x[234] =       0.9676263389983388;
    x[235] =       0.9706563389768804;
    x[236] =       0.9735395890106436;
    x[237] =        0.976275653192736;
    x[238] =       0.9788641178690681;
    x[239] =       0.9813045917010171;
    x[240] =       0.9835967057247763;
    x[241] =       0.9857401134074193;
    x[242] =       0.9877344906997324;
    x[243] =       0.9895795360859201;
    x[244] =       0.9912749706303856;
    x[245] =       0.9928205380219891;
    x[246] =       0.9942160046166302;
    x[247] =       0.9954611594800263;
    x[248] =       0.9965558144351986;
    x[249] =       0.9974998041266158;
    x[250] =       0.9982929861369679;
    x[251] =       0.9989352412846546;
    x[252] =         0.99942647468017;
    x[253] =       0.9997666213120006;
    x[254] =       0.9999557053175637;

    w[ 0] =    0.0001136736199914808;
    w[ 1] =    0.0002645938711908564;
    w[ 2] =    0.0004156976252681932;
    w[ 3] =    0.0005667579456482639;
    w[ 4] =    0.0007177364780061286;
    w[ 5] =    0.0008686076661194581;
    w[ 6] =     0.001019347976427318;
    w[ 7] =       0.0011699343729388;
    w[ 8] =     0.001320343990022177;
    w[ 9] =     0.001470554042778403;
    w[10] =     0.001620541799041545;
    w[11] =     0.001770284570660304;
    w[12] =     0.001919759711713187;
    w[13] =     0.002068944619501569;
    w[14] =     0.002217816736754017;
    w[15] =     0.002366353554396287;
    w[16] =      0.00251453261459971;
    w[17] =     0.002662331513971696;
    w[18] =      0.00280972790682046;
    w[19] =     0.002956699508457498;
    w[20] =     0.003103224098519095;
    w[21] =     0.003249279524294296;
    w[22] =     0.003394843704053401;
    w[23] =     0.003539894630372244;
    w[24] =     0.003684410373449933;
    w[25] =     0.003828369084417135;
    w[26] =     0.003971748998634907;
    w[27] =     0.004114528438981242;
    w[28] =     0.004256685819126112;
    w[29] =     0.004398199646792759;
    w[30] =      0.00453904852700618;
    w[31] =     0.004679211165326077;
    w[32] =     0.004818666371065699;
    w[33] =      0.00495739306049505;
    w[34] =     0.005095370260027839;
    w[35] =     0.005232577109391968;
    w[36] =     0.005368992864783177;
    w[37] =     0.005504596902000804;
    w[38] =     0.005639368719565862;
    w[39] =     0.005773287941820301;
    w[40] =     0.005906334322007422;
    w[41] =     0.006038487745332765;
    w[42] =     0.006169728232005295;
    w[43] =     0.006300035940257733;
    w[44] =     0.006429391169346602;
    w[45] =     0.006557774362530328;
    w[46] =     0.006685166110026254;
    w[47] =     0.006811547151944815;
    w[48] =     0.006936898381201466;
    w[49] =     0.007061200846405536;
    w[50] =     0.007184435754724984;
    w[51] =     0.007306584474728122;
    w[52] =     0.007427628539199977;
    w[53] =     0.007547549647934514;
    w[54] =     0.007666329670501377;
    w[55] =     0.007783950648986801;
    w[56] =     0.007900394800708624;
    w[57] =     0.008015644520904983;
    w[58] =     0.008129682385395602;
    w[59] =     0.008242491153216323;
    w[60] =     0.008354053769225508;
    w[61] =     0.008464353366682819;
    w[62] =     0.008573373269798925;
    w[63] =     0.008681096996256795;
    w[64] =     0.008787508259703609;
    w[65] =     0.008892590972213036;
    w[66] =     0.008996329246717397;
    w[67] =     0.009098707399409718;
    w[68] =     0.009199709952114802;
    w[69] =     0.009299321634629343;
    w[70] =     0.009397527387030594;
    w[71] =     0.009494312361953241;
    w[72] =     0.009589661926834022;
    w[73] =     0.009683561666124043;
    w[74] =     0.009775997383468165;
    w[75] =     0.009866955103851452;
    w[76] =     0.009956421075711706;
    w[77] =      0.01004438177301882;
    w[78] =      0.01013082389731963;
    w[79] =      0.01021573437974821;
    w[80] =       0.0102991003830022;
    w[81] =      0.01038090930328312;
    w[82] =      0.01046114877220228;
    w[83] =      0.01053980665865038;
    w[84] =      0.01061687107063194;
    w[85] =      0.01069233035706287;
    w[86] =      0.01076617310953212;
    w[87] =      0.01083838816402652;
    w[88] =      0.01090896460261843;
    w[89] =      0.01097789175511656;
    w[90] =      0.01104515920067912;
    w[91] =      0.01111075676938929;
    w[92] =      0.01117467454379268;
    w[93] =      0.01123690286039691;
    w[94] =      0.01129743231113249;
    w[95] =      0.01135625374477508;
    w[96] =      0.01141335826832922;
    w[97] =      0.01146873724837283;
    w[98] =      0.01152238231236217;
    w[99] =      0.01157428534989815;
    w[100] =      0.01162443851395193;
    w[101] =      0.01167283422205182;
    w[102] =      0.01171946515742932;
    w[103] =      0.01176432427012535;
    w[104] =      0.01180740477805627;
    w[105] =      0.01184870016803913;
    w[106] =      0.01188820419677619;
    w[107] =      0.01192591089179929;
    w[108] =      0.01196181455237226;
    w[109] =      0.01199590975035326;
    w[110] =      0.01202819133101508;
    w[111] =      0.01205865441382472;
    w[112] =      0.01208729439318107;
    w[113] =      0.01211410693911137;
    w[114] =      0.01213908799792579;
    w[115] =      0.01216223379283022;
    w[116] =      0.01218354082449738;
    w[117] =      0.01220300587159574;
    w[118] =      0.01222062599127671;
    w[119] =      0.01223639851961942;
    w[120] =      0.01225032107203351;
    w[121] =      0.01226239154361966;
    w[122] =      0.01227260810948789;
    w[123] =      0.01228096922503318;
    w[124] =      0.01228747362616942;
    w[125] =      0.01229212032952021;
    w[126] =      0.01229490863256759;
    w[127] =      0.01229583811375833;
    w[128] =      0.01229490863256759;
    w[129] =      0.01229212032952021;
    w[130] =      0.01228747362616942;
    w[131] =      0.01228096922503318;
    w[132] =      0.01227260810948789;
    w[133] =      0.01226239154361966;
    w[134] =      0.01225032107203351;
    w[135] =      0.01223639851961942;
    w[136] =      0.01222062599127671;
    w[137] =      0.01220300587159574;
    w[138] =      0.01218354082449738;
    w[139] =      0.01216223379283022;
    w[140] =      0.01213908799792579;
    w[141] =      0.01211410693911137;
    w[142] =      0.01208729439318107;
    w[143] =      0.01205865441382472;
    w[144] =      0.01202819133101508;
    w[145] =      0.01199590975035326;
    w[146] =      0.01196181455237226;
    w[147] =      0.01192591089179929;
    w[148] =      0.01188820419677619;
    w[149] =      0.01184870016803913;
    w[150] =      0.01180740477805627;
    w[151] =      0.01176432427012535;
    w[152] =      0.01171946515742932;
    w[153] =      0.01167283422205182;
    w[154] =      0.01162443851395193;
    w[155] =      0.01157428534989815;
    w[156] =      0.01152238231236217;
    w[157] =      0.01146873724837283;
    w[158] =      0.01141335826832922;
    w[159] =      0.01135625374477508;
    w[160] =      0.01129743231113249;
    w[161] =      0.01123690286039691;
    w[162] =      0.01117467454379268;
    w[163] =      0.01111075676938929;
    w[164] =      0.01104515920067912;
    w[165] =      0.01097789175511656;
    w[166] =      0.01090896460261843;
    w[167] =      0.01083838816402652;
    w[168] =      0.01076617310953212;
    w[169] =      0.01069233035706287;
    w[170] =      0.01061687107063194;
    w[171] =      0.01053980665865038;
    w[172] =      0.01046114877220228;
    w[173] =      0.01038090930328312;
    w[174] =       0.0102991003830022;
    w[175] =      0.01021573437974821;
    w[176] =      0.01013082389731963;
    w[177] =      0.01004438177301882;
    w[178] =     0.009956421075711706;
    w[179] =     0.009866955103851452;
    w[180] =     0.009775997383468165;
    w[181] =     0.009683561666124043;
    w[182] =     0.009589661926834022;
    w[183] =     0.009494312361953241;
    w[184] =     0.009397527387030594;
    w[185] =     0.009299321634629343;
    w[186] =     0.009199709952114802;
    w[187] =     0.009098707399409718;
    w[188] =     0.008996329246717397;
    w[189] =     0.008892590972213036;
    w[190] =     0.008787508259703609;
    w[191] =     0.008681096996256795;
    w[192] =     0.008573373269798925;
    w[193] =     0.008464353366682819;
    w[194] =     0.008354053769225508;
    w[195] =     0.008242491153216323;
    w[196] =     0.008129682385395602;
    w[197] =     0.008015644520904983;
    w[198] =     0.007900394800708624;
    w[199] =     0.007783950648986801;
    w[200] =     0.007666329670501377;
    w[201] =     0.007547549647934514;
    w[202] =     0.007427628539199977;
    w[203] =     0.007306584474728122;
    w[204] =     0.007184435754724984;
    w[205] =     0.007061200846405536;
    w[206] =     0.006936898381201466;
    w[207] =     0.006811547151944815;
    w[208] =     0.006685166110026254;
    w[209] =     0.006557774362530328;
    w[210] =     0.006429391169346602;
    w[211] =     0.006300035940257733;
    w[212] =     0.006169728232005295;
    w[213] =     0.006038487745332765;
    w[214] =     0.005906334322007422;
    w[215] =     0.005773287941820301;
    w[216] =     0.005639368719565862;
    w[217] =     0.005504596902000804;
    w[218] =     0.005368992864783177;
    w[219] =     0.005232577109391968;
    w[220] =     0.005095370260027839;
    w[221] =      0.00495739306049505;
    w[222] =     0.004818666371065699;
    w[223] =     0.004679211165326077;
    w[224] =      0.00453904852700618;
    w[225] =     0.004398199646792759;
    w[226] =     0.004256685819126112;
    w[227] =     0.004114528438981242;
    w[228] =     0.003971748998634907;
    w[229] =     0.003828369084417135;
    w[230] =     0.003684410373449933;
    w[231] =     0.003539894630372244;
    w[232] =     0.003394843704053401;
    w[233] =     0.003249279524294296;
    w[234] =     0.003103224098519095;
    w[235] =     0.002956699508457498;
    w[236] =      0.00280972790682046;
    w[237] =     0.002662331513971696;
    w[238] =      0.00251453261459971;
    w[239] =     0.002366353554396287;
    w[240] =     0.002217816736754017;
    w[241] =     0.002068944619501569;
    w[242] =     0.001919759711713187;
    w[243] =     0.001770284570660304;
    w[244] =     0.001620541799041545;
    w[245] =     0.001470554042778403;
    w[246] =     0.001320343990022177;
    w[247] =       0.0011699343729388;
    w[248] =     0.001019347976427318;
    w[249] =    0.0008686076661194581;
    w[250] =    0.0007177364780061286;
    w[251] =    0.0005667579456482639;
    w[252] =    0.0004156976252681932;
    w[253] =    0.0002645938711908564;
    w[254] =    0.0001136736199914808;
  }
  else
  {
    cerr << "\n";
    cerr << "LEGENDRE_SET - Fatal error!\n";
    cerr << "  Illegal value of N = " << n << "\n";
    cerr << "  Legal values are 1 through 33, 63, 64, 65, 127 or 255.\n";
    exit ( 1 );
  }
  return;
}

2D quadrature

The 2D quadrature for a unit triangle is implemented in the following code (ref theory: https://people.sc.fsu.edu/~jburkardt/datasets/quadrature_rules_tri/quadrature_rules_tri.html):

void triangle_unit_set ( int rule, double xtab[], double ytab[], 
  double weight[] )

//****************************************************************************80
//
//  Purpose: 
//
//    TRIANGLE_UNIT_SET sets a quadrature rule in a unit triangle.
//
//  Integration region:
//
//    Points (X,Y) such that
//
//      0 <= X,
//      0 <= Y, and
//      X + Y <= 1.
//
//  Graph:
//
//      ^
//    1 | *
//      | ..
//    Y | . .
//      | .  .
//    0 | *---*
//      +------->
//        0 X 1
//
//  Licensing:
//
//    This code is distributed under the GNU LGPL license. 
//
//  Modified:
//
//    06 September 2005
//
//  Author:
//
//    John Burkardt
//
//  References:
//
//    H R Schwarz,
//    Methode der Finiten Elemente,
//    Teubner Studienbuecher, 1980.
//
//    Strang and Fix,
//    An Analysis of the Finite Element Method,
//    Prentice Hall, 1973, page 184.
//
//    Arthur H Stroud,
//    Approximate Calculation of Multiple Integrals,
//    Prentice Hall, 1971.
//
//    O C Zienkiewicz,
//    The Finite Element Method,
//    McGraw Hill, Third Edition, 1977, page 201.
//
//  Parameters:
//
//    Input, int RULE, the index of the rule.
//
//     1, NORDER =  1, precision 1, Zienkiewicz #1.
//     2, NORDER =  3, precision 1, the "vertex rule".
//     3, NORDER =  3, precision 2, Strang and Fix formula #1.
//     4, NORDER =  3, precision 2, Strang and Fix formula #2, Zienkiewicz #2.
//     5, NORDER =  4, precision 3, Strang and Fix formula #3, Zienkiewicz #3.
//     6, NORDER =  6, precision 3, Strang and Fix formula #4.
//     7, NORDER =  6, precision 3, Stroud formula T2:3-1.
//     8, NORDER =  6, precision 4, Strang and Fix formula #5.
//     9, NORDER =  7, precision 4, Strang and Fix formula #6.
//    10, NORDER =  7, precision 5, Strang and Fix formula #7,
//        Stroud formula T2:5-1, Zienkiewicz #4, Schwarz Table 2.2.
//    11, NORDER =  9, precision 6, Strang and Fix formula #8.
//    12, NORDER = 12, precision 6, Strang and Fix formula #9.
//    13, ORDER = 13, precision 7, Strang and Fix formula #10.
//        Note that there is a typographical error in Strang and Fix
//        which lists the value of the XSI(3) component of the
//        last generator point as 0.4869... when it should be 0.04869...
//    14, ORDER =  7, precision ?.
//    15, ORDER = 16, precision 7, conical product Gauss, Stroud formula T2:7-1.
//    16, ORDER = 64, precision 15, triangular product Gauss rule.
//    17, ORDER = 19, precision 8, from CUBTRI, ACM TOMS #584.
//    18, ORDER = 19, precision 9, from TRIEX, Lyness and Jespersen.
//    19, ORDER = 28, precision 11, from TRIEX, Lyness and Jespersen.
//    20, ORDER = 37, precision 13, from ACM TOMS #706.
//
//    Output, double XTAB[NORDER], YTAB[NORDER], the abscissas.
//
//    Output, double WEIGHT[NORDER], the weights of the rule.
//
{
  double a;
  double b;
  double c;
  double d;
  double e;
  double f;
  double g;
  int i;
  int j;
  int k;
  int order2;
  double p;
  double q;
  double r;
  double s;
  double t;
  double u;
  double v;
  double w;
  double w1;
  double w2;
  double w3;
  double w4;
  double w5;
  double w6;
  double w7;
  double w8;
  double w9;
  double weight1[8];
  double weight2[8];
  double wx;
  double x;
  double xtab1[8];
  double xtab2[8];
  double y;
  double z;
//
//  1 point, precision 1.
//
  if ( rule == 1 )
  {
    xtab[0] = 1.0 / 3.0;
    ytab[0] = 1.0 / 3.0;
    weight[0] = 1.0;
  }
//
//  3 points, precision 1, the "vertex rule".
//
  else if ( rule == 2 )
  {
    xtab[0] = 1.0;
    xtab[1] = 0.0;
    xtab[2] = 0.0;

    ytab[0] = 0.0;
    ytab[1] = 1.0;
    ytab[2] = 0.0;

    weight[0] = 1.0 / 3.0;
    weight[1] = 1.0 / 3.0;
    weight[2] = 1.0 / 3.0;
  }
//
//  3 points, precision 2, Strang and Fix formula #1.
//
  else if ( rule == 3 )
  {
    xtab[0] = 4.0 / 6.0;
    xtab[1] = 1.0 / 6.0;
    xtab[2] = 1.0 / 6.0;

    ytab[0] = 1.0 / 6.0;
    ytab[1] = 4.0 / 6.0;
    ytab[2] = 1.0 / 6.0;

    weight[0] = 1.0 / 3.0;
    weight[1] = 1.0 / 3.0;
    weight[2] = 1.0 / 3.0;
  }
//
//  3 points, precision 2, Strang and Fix formula #2.
//
  else if ( rule == 4 )
  {
    xtab[0] = 0.0;
    xtab[1] = 1.0 / 2.0;
    xtab[2] = 1.0 / 2.0;

    ytab[0] = 1.0 / 2.0;
    ytab[1] = 0.0;
    ytab[2] = 1.0 / 2.0;

    weight[0] = 1.0 / 3.0;
    weight[1] = 1.0 / 3.0;
    weight[2] = 1.0 / 3.0;
  }
//
//  4 points, precision 3, Strang and Fix formula #3.
//
  else if ( rule == 5 )
  {
    xtab[0] = 10.0 / 30.0;
    xtab[1] = 18.0 / 30.0;
    xtab[2] =  6.0 / 30.0;
    xtab[3] =  6.0 / 30.0;

    ytab[0] = 10.0 / 30.0;
    ytab[1] =  6.0 / 30.0;
    ytab[2] = 18.0 / 30.0;
    ytab[3] =  6.0 / 30.0;

    weight[0] = -27.0 / 48.0;
    weight[1] =  25.0 / 48.0;
    weight[2] =  25.0 / 48.0;
    weight[3] =  25.0 / 48.0;
  }
//
//  6 points, precision 3, Strang and Fix formula #4.
//
  else if ( rule == 6 )
  {
    xtab[0] = 0.659027622374092;
    xtab[1] = 0.659027622374092;
    xtab[2] = 0.231933368553031;
    xtab[3] = 0.231933368553031;
    xtab[4] = 0.109039009072877;
    xtab[5] = 0.109039009072877;

    ytab[0] = 0.231933368553031;
    ytab[1] = 0.109039009072877;
    ytab[2] = 0.659027622374092;
    ytab[3] = 0.109039009072877;
    ytab[4] = 0.659027622374092;
    ytab[5] = 0.231933368553031;

    weight[0] = 1.0 / 6.0;
    weight[1] = 1.0 / 6.0;
    weight[2] = 1.0 / 6.0;
    weight[3] = 1.0 / 6.0;
    weight[4] = 1.0 / 6.0;
    weight[5] = 1.0 / 6.0;
  }
//
//  6 points, precision 3, Stroud T2:3-1.
//
  else if ( rule == 7 )
  {
    xtab[0] = 0.0;
    xtab[1] = 0.5;
    xtab[2] = 0.5;
    xtab[3] = 2.0 /  3.0;
    xtab[4] = 1.0 /  6.0;
    xtab[5] = 1.0 /  6.0;

    ytab[0] = 0.5;
    ytab[1] = 0.0;
    ytab[2] = 0.5;
    ytab[3] = 1.0 /  6.0;
    ytab[4] = 2.0 /  3.0;
    ytab[5] = 1.0 /  6.0;

    weight[0] = 1.0 / 30.0;
    weight[1] = 1.0 / 30.0;
    weight[2] = 1.0 / 30.0;
    weight[3] = 3.0 / 10.0;
    weight[4] = 3.0 / 10.0;
    weight[5] = 3.0 / 10.0;
  }
//
//  6 points, precision 4, Strang and Fix, formula #5.
//
  else if ( rule == 8 )
  {
    xtab[0] = 0.816847572980459;
    xtab[1] = 0.091576213509771;
    xtab[2] = 0.091576213509771;
    xtab[3] = 0.108103018168070;
    xtab[4] = 0.445948490915965;
    xtab[5] = 0.445948490915965;

    ytab[0] = 0.091576213509771;
    ytab[1] = 0.816847572980459;
    ytab[2] = 0.091576213509771;
    ytab[3] = 0.445948490915965;
    ytab[4] = 0.108103018168070;
    ytab[5] = 0.445948490915965;

    weight[0] = 0.109951743655322;
    weight[1] = 0.109951743655322;
    weight[2] = 0.109951743655322;
    weight[3] = 0.223381589678011;
    weight[4] = 0.223381589678011;
    weight[5] = 0.223381589678011;
  }
//
//  7 points, precision 4, Strang and Fix formula #6.
//
  else if ( rule == 9 )
  {
    xtab[0] = 1.0 / 3.0;
    xtab[1] = 0.736712498968435;
    xtab[2] = 0.736712498968435;
    xtab[3] = 0.237932366472434;
    xtab[4] = 0.237932366472434;
    xtab[5] = 0.025355134551932;
    xtab[6] = 0.025355134551932;

    ytab[0] = 1.0 / 3.0;
    ytab[1] = 0.237932366472434;
    ytab[2] = 0.025355134551932;
    ytab[3] = 0.736712498968435;
    ytab[4] = 0.025355134551932;
    ytab[5] = 0.736712498968435;
    ytab[6] = 0.237932366472434;

    weight[0] = 0.375;
    weight[1] = 0.1041666666666667;
    weight[2] = 0.1041666666666667;
    weight[3] = 0.1041666666666667;
    weight[4] = 0.1041666666666667;
    weight[5] = 0.1041666666666667;
    weight[6] = 0.1041666666666667;
  }
//
//  7 points, precision 5, Strang and Fix formula #7, Stroud T2:5-1
//
  else if ( rule == 10 )
  {
    xtab[0] = 1.0 / 3.0;
    xtab[1] = ( 9.0 + 2.0 * sqrt ( 15.0 ) ) / 21.0;
    xtab[2] = ( 6.0 -           sqrt ( 15.0 ) ) / 21.0;
    xtab[3] = ( 6.0 -           sqrt ( 15.0 ) ) / 21.0;
    xtab[4] = ( 9.0 - 2.0 * sqrt ( 15.0 ) ) / 21.0;
    xtab[5] = ( 6.0 +           sqrt ( 15.0 ) ) / 21.0;
    xtab[6] = ( 6.0 +           sqrt ( 15.0 ) ) / 21.0;

    ytab[0] = 1.0 / 3.0;
    ytab[1] = ( 6.0 -           sqrt ( 15.0 ) ) / 21.0;
    ytab[2] = ( 9.0 + 2.0 * sqrt ( 15.0 ) ) / 21.0;
    ytab[3] = ( 6.0 -           sqrt ( 15.0 ) ) / 21.0;
    ytab[4] = ( 6.0 +           sqrt ( 15.0 ) ) / 21.0;
    ytab[5] = ( 9.0 - 2.0 * sqrt ( 15.0 ) ) / 21.0;
    ytab[6] = ( 6.0 +           sqrt ( 15.0 ) ) / 21.0;

    weight[0] = 0.225;
    weight[1] = ( 155.0 - sqrt ( 15.0 ) ) / 1200.0;
    weight[2] = ( 155.0 - sqrt ( 15.0 ) ) / 1200.0;
    weight[3] = ( 155.0 - sqrt ( 15.0 ) ) / 1200.0;
    weight[4] = ( 155.0 + sqrt ( 15.0 ) ) / 1200.0;
    weight[5] = ( 155.0 + sqrt ( 15.0 ) ) / 1200.0;
    weight[6] = ( 155.0 + sqrt ( 15.0 ) ) / 1200.0;
  }
//
//  9 points, precision 6, Strang and Fix formula #8.
//
  else if ( rule == 11 )
  {
    xtab[0] = 0.124949503233232;
    xtab[1] = 0.437525248383384;
    xtab[2] = 0.437525248383384;
    xtab[3] = 0.797112651860071;
    xtab[4] = 0.797112651860071;
    xtab[5] = 0.165409927389841;
    xtab[6] = 0.165409927389841;
    xtab[7] = 0.037477420750088;
    xtab[8] = 0.037477420750088;

    ytab[0] = 0.437525248383384;
    ytab[1] = 0.124949503233232;
    ytab[2] = 0.437525248383384;
    ytab[3] = 0.165409927389841;
    ytab[4] = 0.037477420750088;
    ytab[5] = 0.797112651860071;
    ytab[6] = 0.037477420750088;
    ytab[7] = 0.797112651860071;
    ytab[8] = 0.165409927389841;

    weight[0] = 0.205950504760887;
    weight[1] = 0.205950504760887;
    weight[2] = 0.205950504760887;
    weight[3] = 0.063691414286223;
    weight[4] = 0.063691414286223;
    weight[5] = 0.063691414286223;
    weight[6] = 0.063691414286223;
    weight[7] = 0.063691414286223;
    weight[8] = 0.063691414286223;
  }
//
//  12 points, precision 6, Strang and Fix, formula #9.
//
  else if ( rule == 12 )
  {
    xtab[0] = 0.873821971016996;
    xtab[1] = 0.063089014491502;
    xtab[2] = 0.063089014491502;
    xtab[3] = 0.249286745170910;
    xtab[4] = 0.501426509658179;
    xtab[5] = 0.249286745170910;
    xtab[6] = 0.636502499121399;
    xtab[7] = 0.636502499121399;
    xtab[8] = 0.310352451033785;
    xtab[9] = 0.310352451033785;
    xtab[10] = 0.053145049844816;
    xtab[11] = 0.053145049844816;

    ytab[0] = 0.063089014491502;
    ytab[1] = 0.873821971016996;
    ytab[2] = 0.063089014491502;
    ytab[3] = 0.501426509658179;
    ytab[4] = 0.249286745170910;
    ytab[5] = 0.249286745170910;
    ytab[6] = 0.310352451033785;
    ytab[7] = 0.053145049844816;
    ytab[8] = 0.636502499121399;
    ytab[9] = 0.053145049844816;
    ytab[10] = 0.636502499121399;
    ytab[11] = 0.310352451033785;

    weight[0] = 0.050844906370207;
    weight[1] = 0.050844906370207;
    weight[2] = 0.050844906370207;
    weight[3] = 0.116786275726379;
    weight[4] = 0.116786275726379;
    weight[5] = 0.116786275726379;
    weight[6] = 0.082851075618374;
    weight[7] = 0.082851075618374;
    weight[8] = 0.082851075618374;
    weight[9] = 0.082851075618374;
    weight[10] = 0.082851075618374;
    weight[11] = 0.082851075618374;
  }
//
//  13 points, precision 7, Strang and Fix, formula #10.
//
  else if ( rule == 13 )
  {
    xtab[0] = 0.479308067841923;
    xtab[1] = 0.260345966079038;
    xtab[2] = 0.260345966079038;
    xtab[3] = 0.869739794195568;
    xtab[4] = 0.065130102902216;
    xtab[5] = 0.065130102902216;
    xtab[6] = 0.638444188569809;
    xtab[7] = 0.638444188569809;
    xtab[8] = 0.312865496004875;
    xtab[9] = 0.312865496004875;
    xtab[10] = 0.048690315425316;
    xtab[11] = 0.048690315425316;
    xtab[12] = 1.0 / 3.0;

    ytab[0] = 0.260345966079038;
    ytab[1] = 0.479308067841923;
    ytab[2] = 0.260345966079038;
    ytab[3] = 0.065130102902216;
    ytab[4] = 0.869739794195568;
    ytab[5] = 0.065130102902216;
    ytab[6] = 0.312865496004875;
    ytab[7] = 0.048690315425316;
    ytab[8] = 0.638444188569809;
    ytab[9] = 0.048690315425316;
    ytab[10] = 0.638444188569809;
    ytab[11] = 0.312865496004875;
    ytab[12] = 1.0 / 3.0;

    weight[0] = 0.175615257433204;
    weight[1] = 0.175615257433204;
    weight[2] = 0.175615257433204;
    weight[3] = 0.053347235608839;
    weight[4] = 0.053347235608839;
    weight[5] = 0.053347235608839;
    weight[6] = 0.077113760890257;
    weight[7] = 0.077113760890257;
    weight[8] = 0.077113760890257;
    weight[9] = 0.077113760890257;
    weight[10] = 0.077113760890257;
    weight[11] = 0.077113760890257;
    weight[12] = -0.149570044467670;
  }
//
//  7 points, precision ?.
//
  else if ( rule == 14 )
  {
    a = 1.0 / 3.0;
    b = 1.0;
    c = 0.5;
    z = 0.0;

    u = 27.0 / 60.0;
    v =  3.0 / 60.0;
    w =  8.0 / 60.0;

    xtab[0] = a;
    xtab[1] = b;
    xtab[2] = z;
    xtab[3] = z;
    xtab[4] = z;
    xtab[5] = c;
    xtab[6] = c;

    ytab[0] = a;
    ytab[1] = z;
    ytab[2] = b;
    ytab[3] = z;
    ytab[4] = c;
    ytab[5] = z;
    ytab[6] = c;

    weight[0] = u;
    weight[1] = v;
    weight[2] = v;
    weight[3] = v;
    weight[4] = w;
    weight[5] = w;
    weight[6] = w;
    weight[7] = w;
  }
//
//  16 points.
//
  else if ( rule == 15 )
  {
//
//  Legendre rule of order 4.
//
    order2 = 4;

    xtab1[0] = -0.861136311594052575223946488893;
    xtab1[1] = -0.339981043584856264802665759103;
    xtab1[2] =  0.339981043584856264802665759103;
    xtab1[3] =  0.861136311594052575223946488893;

    weight1[0] = 0.347854845137453857373063949222;
    weight1[1] = 0.652145154862546142626936050778;
    weight1[2] = 0.652145154862546142626936050778;
    weight1[3] = 0.347854845137453857373063949222;

    for ( i = 0; i < order2; i++ )
    {
      xtab1[i] = 0.5 * ( xtab1[i] + 1.0 );
    }

    weight2[0] = 0.1355069134;
    weight2[1] = 0.2034645680;
    weight2[2] = 0.1298475476;
    weight2[3] = 0.0311809709;

    xtab2[0] = 0.0571041961;
    xtab2[1] = 0.2768430136;
    xtab2[2] = 0.5835904324;
    xtab2[3] = 0.8602401357;

    k = 0;
    for ( i = 0; i < order2; i++ )
    {
      for ( j = 0; j < order2; j++ )
      {
        xtab[k] = xtab2[j];
        ytab[k] = xtab1[i] * ( 1.0 - xtab2[j] );
        weight[k] = weight1[i] * weight2[j];
        k = k + 1;
      }
    }
  }
//
//  64 points, precision 15.
//
  else if ( rule == 16 )
  {
//
//  Legendre rule of order 8.
//
    order2 = 8;

    xtab1[0] = -0.960289856497536231683560868569;
    xtab1[1] = -0.796666477413626739591553936476;
    xtab1[2] = -0.525532409916328985817739049189;
    xtab1[3] = -0.183434642495649804939476142360;
    xtab1[4] =  0.183434642495649804939476142360;
    xtab1[5] =  0.525532409916328985817739049189;
    xtab1[6] =  0.796666477413626739591553936476;
    xtab1[7] =  0.960289856497536231683560868569;

    weight1[0] = 0.101228536290376259152531354310;
    weight1[1] = 0.222381034453374470544355994426;
    weight1[2] = 0.313706645877887287337962201987;
    weight1[3] = 0.362683783378361982965150449277;
    weight1[4] = 0.362683783378361982965150449277;
    weight1[5] = 0.313706645877887287337962201987;
    weight1[6] = 0.222381034453374470544355994426;
    weight1[7] = 0.101228536290376259152531354310;

    weight2[0] = 0.00329519144;
    weight2[1] = 0.01784290266;
    weight2[2] = 0.04543931950;
    weight2[3] = 0.07919959949;
    weight2[4] = 0.10604735944;
    weight2[5] = 0.11250579947;
    weight2[6] = 0.09111902364;
    weight2[7] = 0.04455080436;

    xtab2[0] = 0.04463395529;
    xtab2[1] = 0.14436625704;
    xtab2[2] = 0.28682475714;
    xtab2[3] = 0.45481331520;
    xtab2[4] = 0.62806783542;
    xtab2[5] = 0.78569152060;
    xtab2[6] = 0.90867639210;
    xtab2[7] = 0.98222008485;

    k = 0;
    for ( j = 0; j < order2; j++ )
    {
      for ( i = 0; i < order2; i++ )
      {
        xtab[k] = 1.0 - xtab2[j];
        ytab[k] = 0.5 * ( 1.0 + xtab1[i] ) * xtab2[j];
        weight[k] = weight1[i] * weight2[j];
        k = k + 1;
      }
    }
  }
//
//  19 points, precision 8.
//
  else if ( rule == 17 )
  {
    a = 1.0 / 3.0;
    b = ( 9.0 + 2.0 * sqrt ( 15.0 ) ) / 21.0;
    c = ( 6.0 -       sqrt ( 15.0 ) ) / 21.0;
    d = ( 9.0 - 2.0 * sqrt ( 15.0 ) ) / 21.0;
    e = ( 6.0 +       sqrt ( 15.0 ) ) / 21.0;
    f = ( 40.0 - 10.0 * sqrt ( 15.0 ) 
      + 10.0 * sqrt ( 7.0 ) + 2.0 * sqrt ( 105.0 ) ) / 90.0;
    g = ( 25.0 +  5.0 * sqrt ( 15.0 ) 
      -  5.0 * sqrt ( 7.0 ) - sqrt ( 105.0 ) ) / 90.0;
    p = ( 40.0 + 10.0 * sqrt ( 15.0 ) 
      + 10.0 * sqrt ( 7.0 ) - 2.0 * sqrt ( 105.0 ) ) / 90.0;
    q = ( 25.0 -  5.0 * sqrt ( 15.0 ) 
      -  5.0 * sqrt ( 7.0 ) + sqrt ( 105.0 ) ) / 90.0;
    r = ( 40.0 + 10.0 * sqrt ( 7.0 ) ) / 90.0;
    s = ( 25.0 +  5.0 * sqrt ( 15.0 ) - 5.0 * sqrt ( 7.0 ) 
      - sqrt ( 105.0 ) ) / 90.0;
    t = ( 25.0 -  5.0 * sqrt ( 15.0 ) - 5.0 * sqrt ( 7.0 ) 
      + sqrt ( 105.0 ) ) / 90.0;

    w1 = ( 7137.0 - 1800.0 * sqrt ( 7.0 ) ) / 62720.0;
    w2 = -9301697.0 / 4695040.0 - 13517313.0 * sqrt ( 15.0 ) 
      / 23475200.0 + 764885.0 * sqrt ( 7.0 ) / 939008.0 
      + 198763.0 * sqrt ( 105.0 ) / 939008.0;
    w2 = w2 / 3.0;
    w3 = -9301697.0 / 4695040.0 + 13517313.0 * sqrt ( 15.0 ) 
      / 23475200.0 
      + 764885.0 * sqrt ( 7.0 ) / 939008.0 
      - 198763.0 * sqrt ( 105.0 ) / 939008.0;
    w3 = w3 / 3.0;
    w4 = ( 102791225.0 - 23876225.0 * sqrt ( 15.0 ) 
      - 34500875.0 * sqrt ( 7.0 ) 
      + 9914825.0 * sqrt ( 105.0 ) ) / 59157504.0;
    w4 = w4 / 3.0;
    w5 = ( 102791225.0 + 23876225.0 * sqrt ( 15.0 ) 
      - 34500875.0 * sqrt ( 7.0 ) 
      - 9914825 * sqrt ( 105.0 ) ) / 59157504.0;
    w5 = w5 / 3.0;
    w6 = ( 11075.0 - 3500.0 * sqrt ( 7.0 ) ) / 8064.0;
    w6 = w6 / 6.0;

    xtab[0] = a;
    xtab[1] = b;
    xtab[2] = c;
    xtab[3] = c;
    xtab[4] = d;
    xtab[5] = e;
    xtab[6] = e;
    xtab[7] = f;
    xtab[8] = g;
    xtab[9] = g;
    xtab[10] = p;
    xtab[11] = q;
    xtab[12] = q;
    xtab[13] = r;
    xtab[14] = r;
    xtab[15] = s;
    xtab[16] = s;
    xtab[17] = t;
    xtab[18] = t;

    ytab[0] = a;
    ytab[1] = c;
    ytab[2] = b;
    ytab[3] = c;
    ytab[4] = e;
    ytab[5] = d;
    ytab[6] = e;
    ytab[7] = g;
    ytab[8] = f;
    ytab[9] = g;
    ytab[10] = q;
    ytab[11] = p;
    ytab[12] = q;
    ytab[13] = s;
    ytab[14] = t;
    ytab[15] = r;
    ytab[16] = t;
    ytab[17] = r;
    ytab[18] = s;

    weight[0] = w1;
    weight[1] = w2;
    weight[2] = w2;
    weight[3] = w2;
    weight[4] = w3;
    weight[5] = w3;
    weight[6] = w3;
    weight[7] = w4;
    weight[8] = w4;
    weight[9] = w4;
    weight[10] = w5;
    weight[11] = w5;
    weight[12] = w5;
    weight[13] = w6;
    weight[14] = w6;
    weight[15] = w6;
    weight[16] = w6;
    weight[17] = w6;
    weight[18] = w6;
  }
//
//  19 points, precision 9.
//
  else if ( rule == 18 )
  {
    a = 1.0 / 3.0;
    b = 0.02063496160252593;
    c = 0.4896825191987370;
    d = 0.1258208170141290;
    e = 0.4370895914929355;
    f = 0.6235929287619356;
    g = 0.1882035356190322;
    r = 0.9105409732110941;
    s = 0.04472951339445297;
    t = 0.7411985987844980;
    u = 0.03683841205473626;
    v = 0.22196288916076574;

    w1 = 0.09713579628279610;
    w2 = 0.03133470022713983;
    w3 = 0.07782754100477543;
    w4 = 0.07964773892720910;
    w5 = 0.02557767565869810;
    w6 = 0.04328353937728940;

    xtab[0] = a;
    xtab[1] = b;
    xtab[2] = c;
    xtab[3] = c;
    xtab[4] = d;
    xtab[5] = e;
    xtab[6] = e;
    xtab[7] = f;
    xtab[8] = g;
    xtab[9] = g;
    xtab[10] = r;
    xtab[11] = s;
    xtab[12] = s;
    xtab[13] = t;
    xtab[14] = t;
    xtab[15] = u;
    xtab[16] = u;
    xtab[17] = v;
    xtab[18] = v;

    ytab[0] = a;
    ytab[1] = c;
    ytab[2] = b;
    ytab[3] = c;
    ytab[4] = e;
    ytab[5] = d;
    ytab[6] = e;
    ytab[7] = g;
    ytab[8] = f;
    ytab[9] = g;
    ytab[10] = s;
    ytab[11] = r;
    ytab[12] = s;
    ytab[13] = u;
    ytab[14] = v;
    ytab[15] = t;
    ytab[16] = v;
    ytab[17] = t;
    ytab[18] = u;

    weight[0] = w1;
    weight[1] = w2;
    weight[2] = w2;
    weight[3] = w2;
    weight[4] = w3;
    weight[5] = w3;
    weight[6] = w3;
    weight[7] = w4;
    weight[8] = w4;
    weight[9] = w4;
    weight[10] = w5;
    weight[11] = w5;
    weight[12] = w5;
    weight[13] = w6;
    weight[14] = w6;
    weight[15] = w6;
    weight[16] = w6;
    weight[17] = w6;
    weight[18] = w6;
  }
//
//  28 points, precision 11.
//
  else if ( rule == 19 )
  {
    a = 1.0 / 3.0;
    b = 0.9480217181434233;
    c = 0.02598914092828833;
    d = 0.8114249947041546;
    e = 0.09428750264792270;
    f = 0.01072644996557060;
    g = 0.4946367750172147;
    p = 0.5853132347709715;
    q = 0.2073433826145142;
    r = 0.1221843885990187;
    s = 0.4389078057004907;
    t = 0.6779376548825902;
    u = 0.04484167758913055;
    v = 0.27722066752827925;
    w = 0.8588702812826364;
    x = 0.0;
    y = 0.1411297187173636;

    w1 = 0.08797730116222190;
    w2 = 0.008744311553736190;
    w3 = 0.03808157199393533;
    w4 = 0.01885544805613125;
    w5 = 0.07215969754474100;
    w6 = 0.06932913870553720;
    w7 = 0.04105631542928860;
    w8 = 0.007362383783300573;

    xtab[0] = a;
    xtab[1] = b;
    xtab[2] = c;
    xtab[3] = c;
    xtab[4] = d;
    xtab[5] = e;
    xtab[6] = e;
    xtab[7] = f;
    xtab[8] = g;
    xtab[9] = g;
    xtab[10] = p;
    xtab[11] = q;
    xtab[12] = q;
    xtab[13] = r;
    xtab[14] = s;
    xtab[15] = s;
    xtab[16] = t;
    xtab[17] = t;
    xtab[18] = u;
    xtab[19] = u;
    xtab[20] = v;
    xtab[21] = v;
    xtab[22] = w;
    xtab[23] = w;
    xtab[24] = x;
    xtab[25] = x;
    xtab[26] = y;
    xtab[27] = y;

    ytab[0] = a;
    ytab[1] = c;
    ytab[2] = b;
    ytab[3] = c;
    ytab[4] = e;
    ytab[5] = d;
    ytab[6] = e;
    ytab[7] = g;
    ytab[8] = f;
    ytab[9] = g;
    ytab[10] = q;
    ytab[11] = p;
    ytab[12] = q;
    ytab[13] = s;
    ytab[14] = r;
    ytab[15] = s;
    ytab[16] = u;
    ytab[17] = v;
    ytab[18] = t;
    ytab[19] = v;
    ytab[20] = t;
    ytab[21] = u;
    ytab[22] = x;
    ytab[23] = y;
    ytab[24] = w;
    ytab[25] = y;
    ytab[26] = w;
    ytab[27] = x;

    weight[0] = w1;
    weight[1] = w2;
    weight[2] = w2;
    weight[3] = w2;
    weight[4] = w3;
    weight[5] = w3;
    weight[6] = w3;
    weight[7] = w4;
    weight[8] = w4;
    weight[9] = w4;
    weight[10] = w5;
    weight[11] = w5;
    weight[12] = w5;
    weight[13] = w6;
    weight[14] = w6;
    weight[15] = w6;
    weight[16] = w7;
    weight[17] = w7;
    weight[18] = w7;
    weight[19] = w7;
    weight[20] = w7;
    weight[21] = w7;
    weight[22] = w8;
    weight[23] = w8;
    weight[24] = w8;
    weight[25] = w8;
    weight[26] = w8;
    weight[27] = w8;
  }
//
//  37 points, precision 13.
//
  else if ( rule == 20 )
  {
    a = 1.0 / 3.0;
    b = 0.950275662924105565450352089520;
    c = 0.024862168537947217274823955239;
    d = 0.171614914923835347556304795551;
    e = 0.414192542538082326221847602214;
    f = 0.539412243677190440263092985511;
    g = 0.230293878161404779868453507244;

    w1 = 0.051739766065744133555179145422;
    w2 = 0.008007799555564801597804123460;
    w3 = 0.046868898981821644823226732071;
    w4 = 0.046590940183976487960361770070;
    w5 = 0.031016943313796381407646220131;
    w6 = 0.010791612736631273623178240136;
    w7 = 0.032195534242431618819414482205;
    w8 = 0.015445834210701583817692900053;
    w9 = 0.017822989923178661888748319485;
    wx = 0.037038683681384627918546472190;

    xtab[0] = a;
    xtab[1] = b;
    xtab[2] = c;
    xtab[3] = c;
    xtab[4] = d;
    xtab[5] = e;
    xtab[6] = e;
    xtab[7] = f;
    xtab[8] = g;
    xtab[9] = g;

    ytab[0] = a;
    ytab[1] = c;
    ytab[2] = b;
    ytab[3] = c;
    ytab[4] = e;
    ytab[5] = d;
    ytab[6] = e;
    ytab[7] = g;
    ytab[8] = f;
    ytab[9] = g;

    weight[0] = w1;
    weight[1] = w2;
    weight[2] = w2;
    weight[3] = w2;
    weight[4] = w3;
    weight[5] = w3;
    weight[6] = w3;
    weight[7] = w4;
    weight[8] = w4;
    weight[9] = w4;
    weight[10] = w5;
    weight[11] = w5;
    weight[12] = w5;
    weight[13] = w6;
    weight[14] = w6;
    weight[15] = w6;
    weight[16] = w7;
    weight[17] = w7;
    weight[18] = w7;
    weight[19] = w8;
    weight[20] = w8;
    weight[21] = w8;
    weight[22] = w8;
    weight[23] = w8;
    weight[24] = w8;
    weight[25] = w9;
    weight[26] = w9;
    weight[27] = w9;
    weight[28] = w9;
    weight[29] = w9;
    weight[30] = w9;
    weight[31] = wx;
    weight[32] = wx;
    weight[33] = wx;
    weight[34] = wx;
    weight[35] = wx;
    weight[36] = wx;

    a = 0.772160036676532561750285570113;
    b = 0.113919981661733719124857214943;

    xtab[10] = a;
    ytab[10] = b;

    xtab[11] = b;
    ytab[11] = a;

    xtab[12] = b;
    ytab[12] = b;

    a = 0.009085399949835353883572964740;
    b = 0.495457300025082323058213517632;

    xtab[13] = a;
    ytab[13] = b;

    xtab[14] = b;
    ytab[14] = a;

    xtab[15] = b;
    ytab[15] = b;

    a = 0.062277290305886993497083640527;
    b = 0.468861354847056503251458179727;

    xtab[16] = a;
    ytab[16] = b;

    xtab[17] = b;
    ytab[17] = a;

    xtab[18] = b;
    ytab[18] = b;

    a = 0.022076289653624405142446876931;
    b = 0.851306504174348550389457672223;
    c = 1.0 - a - b;

    xtab[19] = a;
    ytab[19] = b;

    xtab[20] = a;
    ytab[20] = c;

    xtab[21] = b;
    ytab[21] = a;

    xtab[22] = b;
    ytab[22] = c;

    xtab[23] = c;
    ytab[23] = a;

    xtab[24] = c;
    ytab[24] = b;

    a = 0.018620522802520968955913511549;
    b = 0.689441970728591295496647976487;
    c = 1.0 - a - b;

    xtab[25] = a;
    ytab[25] = b;

    xtab[26] = a;
    ytab[26] = c;

    xtab[27] = b;
    ytab[27] = a;

    xtab[28] = b;
    ytab[28] = c;

    xtab[29] = c;
    ytab[29] = a;

    xtab[30] = c;
    ytab[30] = b;

    a = 0.096506481292159228736516560903;
    b = 0.635867859433872768286976979827;
    c = 1.0 - a - b;

    xtab[31] = a;
    ytab[31] = b;

    xtab[32] = a;
    ytab[32] = c;

    xtab[33]  = b;
    ytab[33] = a;

    xtab[34] = b;
    ytab[34] = c;

    xtab[35] = c;
    ytab[35] = a;

    xtab[36] = c;
    ytab[36] = b;
  }
  else
  {
    cerr << "\n";
    cerr << "TRIANGLE_UNIT_SET - Fatal error!\n";
    cerr << "  Illegal value of RULE = " << rule << "\n";
    exit ( 1 );
  }

  return;
}