### Question:
GaussHermiteWeightAndAbscissaFunction implements QuadratureWeightAndAbscissaFunction { @Override public GaussianQuadratureData generate(int n) { ArgChecker.isTrue(n > 0); double[] x = new double[n]; double[] w = new double[n]; boolean odd = n % 2 != 0; int m = (n + 1) / 2 - (odd ? 1 : 0); Pair<DoubleFunction1D, DoubleFunction1D>[] polynomials = HERMITE.getPolynomialsAndFirstDerivative(n); Pair<DoubleFunction1D, DoubleFunction1D> pair = polynomials[n]; DoubleFunction1D function = pair.getFirst(); DoubleFunction1D derivative = pair.getSecond(); double root = 0; for (int i = 0; i < m; i++) { root = getInitialRootGuess(root, i, n, x); root = ROOT_FINDER.getRoot(function, derivative, root); double dp = derivative.applyAsDouble(root); x[i] = -root; x[n - 1 - i] = root; w[i] = 2. / (dp * dp); w[n - 1 - i] = w[i]; } if (odd) { double dp = derivative.applyAsDouble(0.0); w[m] = 2. / dp / dp; } return new GaussianQuadratureData(x, w); }  @Override GaussianQuadratureData generate(int n);  }### Answer:
@Test public void test() { assertResults(F.generate(2), X2, W2); assertResults(F.generate(3), X3, W3); assertResults(F.generate(4), X4, W4); }