subroutine bashforth_set ( order, xtab, weight ) !*****************************************************************************80 ! !! BASHFORTH_SET sets abscissas and weights for Adams-Bashforth quadrature. ! ! Discussion: ! ! Adams-Bashforth quadrature formulas are normally used in solving ! ordinary differential equations, and are not really suitable for ! general quadrature computations. However, an Adams-Bashforth formula ! is equivalent to approximating the integral of F(Y(X)) between X(M) ! and X(M+1), using an explicit formula that relies only on known values ! of F(Y(X)) at X(M-N+1) through X(M). For this reason, the formulas ! have been included here. ! ! Suppose the unknown function is denoted by Y(X), with derivative ! F(Y(X)), and that approximate values of the function are known at a ! series of X values, which we write as X(1), X(2), ..., X(M). We write ! the value Y(X(1)) as Y(1) and so on. ! ! Then the solution of the ODE Y'=F(X,Y) at the next point X(M+1) is ! computed by: ! ! Y(M+1) = Y(M) + Integral ( X(M) < X < X(M+1) ) F(Y(X)) dX ! = Y(M) + H * Sum ( 1 <= I <= N ) W(I) * F(Y(M+1-I)) approximately. ! ! In the documentation that follows, we replace F(Y(X)) by F(X). ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = 1.0; ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) F(X) dX. ! ! The quadrature formula: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( 1 - I ), ! ! The Adams-Bashforth formulas require equally spaced data. ! ! Here is how the formula is applied in the case with non-unit spacing: ! ! Integral ( A <= X <= A+H ) F(X) dX = ! H * Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( A - (I-1)*H ), ! approximately. ! ! The reference lists the second coefficient of the order 8 Adams-Bashforth ! formula as ! weight(2) = -1162169.0D+00 / 120960.0D+00 ! but this should be ! weight(2) = -1152169.0D+00 / 120960.0D+00 ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 28 April 2006 ! ! 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. ! ! Leon Lapidus, John Seinfeld, ! Numerical Solution of Ordinary Differential Equations, ! Academic Press, 1971, ! ISBN: 0124366503, ! LC: QA3.M32.v74. ! ! Daniel Zwillinger, editor, ! CRC Standard Mathematical Tables and Formulae, ! 30th Edition, ! CRC Press, 1996, ! ISBN: 0-8493-2479-3, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ORDER should be ! between 1 and 10, 12, 14, 16, 18 or 20. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! WEIGHT(1) is the weight at XTAB(1) = 0, ! WEIGHT(2) the weight at XTAB(2) = -1, ! and so on. The weights are rational, and should sum to 1. Some ! weights may be negative. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) d integer ( kind = 4 ) i real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) if ( order == 1 ) then weight(1) = 1.0D+00 else if ( order == 2 ) then d = 2.0D+00 weight(1) = 3.0D+00 / d weight(2) = - 1.0D+00 / d else if ( order == 3 ) then d = 12.0D+00 weight(1) = 23.0D+00 / d weight(2) = - 16.0D+00 / d weight(3) = 5.0D+00 / d else if ( order == 4 ) then d = 24.0D+00 weight(1) = 55.0D+00 / d weight(2) = - 59.0D+00 / d weight(3) = 37.0D+00 / d weight(4) = - 9.0D+00 / d else if ( order == 5 ) then d = 720.0D+00 weight(1) = 1901.0D+00 / d weight(2) = - 2774.0D+00 / d weight(3) = 2616.0D+00 / d weight(4) = - 1274.0D+00 / d weight(5) = 251.0D+00 / d else if ( order == 6 ) then d = 1440.0D+00 weight(1) = 4277.0D+00 / d weight(2) = - 7923.0D+00 / d weight(3) = 9982.0D+00 / d weight(4) = - 7298.0D+00 / d weight(5) = 2877.0D+00 / d weight(6) = - 475.0D+00 / d else if ( order == 7 ) then d = 60480.0D+00 weight(1) = 198721.0D+00 / d weight(2) = - 447288.0D+00 / d weight(3) = 705549.0D+00 / d weight(4) = - 688256.0D+00 / d weight(5) = 407139.0D+00 / d weight(6) = - 134472.0D+00 / d weight(7) = 19087.0D+00 / d else if ( order == 8 ) then d = 120960.0D+00 weight(1) = 434241.0D+00 / d weight(2) = - 1152169.0D+00 / d weight(3) = 2183877.0D+00 / d weight(4) = - 2664477.0D+00 / d weight(5) = 2102243.0D+00 / d weight(6) = - 1041723.0D+00 / d weight(7) = 295767.0D+00 / d weight(8) = - 36799.0D+00 / d else if ( order == 9 ) then d = 3628800.0D+00 weight(1) = 14097247.0D+00 / d weight(2) = -43125206.0D+00 / d weight(3) = 95476786.0D+00 / d weight(4) = -139855262.0D+00 / d weight(5) = 137968480.0D+00 / d weight(6) = -91172642.0D+00 / d weight(7) = 38833486.0D+00 / d weight(8) = -9664106.0D+00 / d weight(9) = 1070017.0D+00 / d else if ( order == 10 ) then d = 7257600.0D+00 weight( 1) = 30277247.0D+00 / d weight( 2) = -104995189.0D+00 / d weight( 3) = 265932680.0D+00 / d weight( 4) = -454661776.0D+00 / d weight( 5) = 538363838.0D+00 / d weight( 6) = -444772162.0D+00 / d weight( 7) = 252618224.0D+00 / d weight( 8) = -94307320.0D+00 / d weight( 9) = 20884811.0D+00 / d weight(10) = -2082753.0D+00 / d else if ( order == 12 ) then d = 958003200.0D+00 weight( 1) = 4527766399.0D+00 / d weight( 2) = -19433810163.0D+00 / d weight( 3) = 61633227185.0D+00 / d weight( 4) = -135579356757.0D+00 / d weight( 5) = 214139355366.0D+00 / d weight( 6) = -247741639374.0D+00 / d weight( 7) = 211103573298.0D+00 / d weight( 8) = -131365867290.0D+00 / d weight( 9) = 58189107627.0D+00 / d weight(10) = -17410248271.0D+00 / d weight(11) = 3158642445.0D+00 / d weight(12) = -262747265.0D+00 / d else if ( order == 14 ) then d = 5230697472000.0D+00 weight( 1) = 27511554976875.0D+00 / d weight( 2) = -140970750679621.0D+00 / d weight( 3) = 537247052515662.0D+00 / d weight( 4) = -1445313351681906.0D+00 / d weight( 5) = 2854429571790805.0D+00 / d weight( 6) = -4246767353305755.0D+00 / d weight( 7) = 4825671323488452.0D+00 / d weight( 8) = -4204551925534524.0D+00 / d weight( 9) = 2793869602879077.0D+00 / d weight(10) = -1393306307155755.0D+00 / d weight(11) = 505586141196430.0D+00 / d weight(12) = -126174972681906.0D+00 / d weight(13) = 19382853593787.0D+00 / d weight(14) = -1382741929621.0D+00 / d else if ( order == 16 ) then d = 62768369664000.0D+00 weight( 1) = 362555126427073.0D+00 / d weight( 2) = -2161567671248849.0D+00 / d weight( 3) = 9622096909515337.0D+00 / d weight( 4) = -30607373860520569.0D+00 / d weight( 5) = 72558117072259733.0D+00 / d weight( 6) = -131963191940828581.0D+00 / d weight( 7) = 187463140112902893.0D+00 / d weight( 8) = -210020588912321949.0D+00 / d weight( 9) = 186087544263596643.0D+00 / d weight(10) = -129930094104237331.0D+00 / d weight(11) = 70724351582843483.0D+00 / d weight(12) = -29417910911251819.0D+00 / d weight(13) = 9038571752734087.0D+00 / d weight(14) = -1934443196892599.0D+00 / d weight(15) = 257650275915823.0D+00 / d weight(16) = -16088129229375.0D+00 / d else if ( order == 18 ) then d = 64023737057280000.0D+00 weight( 1) = 401972381695456831.0D+00 / d weight( 2) = -2735437642844079789.0D+00 / d weight( 3) = 13930159965811142228.0D+00 / d weight( 4) = -51150187791975812900.0D+00 / d weight( 5) = 141500575026572531760.0D+00 / d weight( 6) = -304188128232928718008.0D+00 / d weight( 7) = 518600355541383671092.0D+00 / d weight( 8) = -710171024091234303204.0D+00 / d weight( 9) = 786600875277595877750.0D+00 / d weight(10) = -706174326992944287370.0D+00 / d weight(11) = 512538584122114046748.0D+00 / d weight(12) = -298477260353977522892.0D+00 / d weight(13) = 137563142659866897224.0D+00 / d weight(14) = -49070094880794267600.0D+00 / d weight(15) = 13071639236569712860.0D+00 / d weight(16) = -2448689255584545196.0D+00 / d weight(17) = 287848942064256339.0D+00 / d weight(18) = -15980174332775873.0D+00 / d else if ( order == 20 ) then d = 102181884343418880000.0D+00 weight( 1) = 691668239157222107697.0D+00 / d weight( 2) = -5292843584961252933125.0D+00 / d weight( 3) = 30349492858024727686755.0D+00 / d weight( 4) = -126346544855927856134295.0D+00 / d weight( 5) = 399537307669842150996468.0D+00 / d weight( 6) = -991168450545135070835076.0D+00 / d weight( 7) = 1971629028083798845750380.0D+00 / d weight( 8) = -3191065388846318679544380.0D+00 / d weight( 9) = 4241614331208149947151790.0D+00 / d weight(10) = -4654326468801478894406214.0D+00 / d weight(11) = 4222756879776354065593786.0D+00 / d weight(12) = -3161821089800186539248210.0D+00 / d weight(13) = 1943018818982002395655620.0D+00 / d weight(14) = -970350191086531368649620.0D+00 / d weight(15) = 387739787034699092364924.0D+00 / d weight(16) = -121059601023985433003532.0D+00 / d weight(17) = 28462032496476316665705.0D+00 / d weight(18) = -4740335757093710713245.0D+00 / d weight(19) = 498669220956647866875.0D+00 / d weight(20) = -24919383499187492303.0D+00 / d else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'BASHFORTH_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are 1 through 10, 12, 14, 16, 18 or 20.' stop end if do i = 1, order xtab(i) = real ( 1 - i, kind = 8 ) end do return end subroutine bdf_set ( order, alpha, beta, gamma ) !*****************************************************************************80 ! !! BDF_SET sets weights for backward differentiation ODE weights. ! ! Discussion: ! ! GAMMA * Y(N+1) = Sum ( 1 <= I <= ORDER ) ALPHA(I) * Y(N+1-I) ! + dX * BETA * Y'(X(N+1),Y(N+1)) ! ! This is equivalent to the backward differentiation corrector formulas. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 30 December 1999 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order, between 1 and 6. ! ! Output, real ( kind = 8 ) ALPHA(ORDER), BETA, GAMMA, the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha(order) real ( kind = 8 ) beta real ( kind = 8 ) gamma if ( order == 1 ) then beta = 1.0D+00 gamma = 1.0D+00 alpha(1) = 1.0D+00 else if ( order == 2 ) then beta = 2.0D+00 gamma = 3.0D+00 alpha(1) = 4.0D+00 alpha(2) = - 1.0D+00 else if ( order == 3 ) then beta = 6.0D+00 gamma = 11.0D+00 alpha(1) = 18.0D+00 alpha(2) = - 9.0D+00 alpha(3) = 2.0D+00 else if ( order == 4 ) then beta = 12.0D+00 gamma = 25.0D+00 alpha(1) = 48.0D+00 alpha(2) = - 36.0D+00 alpha(3) = 16.0D+00 alpha(4) = - 3.0D+00 else if ( order == 5 ) then beta = 60.0D+00 gamma = 137.0D+00 alpha(1) = 300.0D+00 alpha(2) = - 300.0D+00 alpha(3) = 200.0D+00 alpha(4) = - 75.0D+00 alpha(5) = 12.0D+00 else if ( order == 6 ) then beta = 60.0D+00 gamma = 147.0D+00 alpha(1) = 360.0D+00 alpha(2) = - 450.0D+00 alpha(3) = 400.0D+00 alpha(4) = - 225.0D+00 alpha(5) = 72.0D+00 alpha(6) = - 10.0D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'BDF_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal order requested = ', order stop end if return end subroutine bdfc_set ( order, xtab, weight ) !*****************************************************************************80 ! !! BDFC_SET sets weights for backward differentiation corrector quadrature. ! ! Discussion: ! ! A backward differentiation corrector formula is defined for a set ! of evenly spaced abscissas X(I) with X(1) = 1 and X(2) = 0. Assuming ! that the values of the function to be integrated are known at the ! abscissas, the formula is written in terms of the function value at ! X(1), and the backward differences at X(1) that approximate the ! derivatives there. ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = 1.0; ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * BD**(I-1) F ( 1 ). ! ! Here, "BD**(I-1) F ( 1 )" denotes the (I-1)st backward difference ! of F at X = 1, using a spacing of 1. In particular, ! ! BD**0 F(1) = F(1) ! BD**1 F(1) = F(1) - F(0) ! BD**2 F(1) = F(1) - 2 * F(0) + F(-1 ) ! ! The relationship between a backward difference corrector and the ! corresponding Adams-Moulton formula may be illustrated for the ! BDF corrector of order 4: ! ! BD**0 F(1) - 1/2 * BD**1 F(1) - 1/12 * BD**2 F(1) - 1/24 * BDF**3 F(1) ! = F(1) ! - 1/2 * ( F(1) - F(0) ) ! - 1/12 * ( F(1) - 2 * F(0) + F(-1) ) ! - 1/24 * ( F(1) - 3 * F(0) + 3 * F(-1) - F(-2) ) ! = 9/24 * F(1) + 19/24 * F(0) - 5/24 * F(-1) + 1/24 * F(-2) ! ! which is the Adams-Moulton formula of order 4. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 28 February 2000 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Simeon Fatunla, ! Numerical Methods for Initial Value Problems in Ordinary ! Differential Equations, ! Academic Press, 1988, ! ISBN: 0122499301, ! LC: QA372.F35. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order, which can be ! any value from 1 to 19. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ), parameter :: order_max = 19 integer ( kind = 4 ) order integer ( kind = 4 ) i real ( kind = 8 ) w(order_max) real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) w(1) = 1.0D+00 w(2) = - 1.0D+00 / 2.0D+00 w(3) = - 1.0D+00 / 12.0D+00 w(4) = - 1.0D+00 / 24.0D+00 w(5) = - 19.0D+00 / 720.0D+00 w(6) = - 3.0D+00 / 160.0D+00 w(7) = - 863.0D+00 / 60480.0D+00 w(8) = - 275.0D+00 / 24792.0D+00 w(9) = - 33953.0D+00 / 3628800.0D+00 w(10) = - 8183.0D+00 / 1036800.0D+00 w(11) = - 3250433.0D+00 / 479001600.0D+00 w(12) = - 4671.0D+00 / 788480.0D+00 w(13) = - 13695779093.0D+00 / 2615348736000.0D+00 w(14) = - 2224234463.0D+00 / 475517952000.0D+00 w(15) = - 132282840127.0D+00 / 31384184832000.0D+00 w(16) = - 2639651053.0D+00 / 689762304000.0D+00 w(17) = 111956703448001.0D+00 / 3201186852864.0D+00 w(18) = 50188465.0D+00 / 15613165568.0D+00 w(19) = 2334028946344463.0D+00 / 786014494949376.0D+00 if ( order_max < order ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'BDFC_SET - Fatal error!' write ( *, '(a)' ) ' Input order ORDER = ', order write ( *, '(a)' ) ' exceeds maximum order ORDER_MAX = ', order_max stop end if weight(1:order) = w(1:order) do i = 1, order xtab(i) = real ( 2 - i, kind = 8 ) end do return end subroutine bdfp_set ( order, xtab, weight ) !*****************************************************************************80 ! !! BDFP_SET sets weights for backward differentiation predictor quadrature. ! ! Discussion: ! ! A backward differentiation predictor formula is defined for a set ! of evenly spaced abscissas X(I) with X(1) = 1 and X(2) = 0. Assuming ! that the values of the function to be integrated are known at the ! abscissas, the formula is written in terms of the function value at ! X(2), and the backward differences at X(2) that approximate the ! derivatives there. A backward differentiation predictor formula ! is equivalent to an Adams-Bashforth formula of the same order. ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = 1.0; ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * BD**(I-1) F ( 0 ), ! ! Here, "BD**(I-1) F ( 0 )" denotes the (I-1)st backward difference ! of F at X = 0, using a spacing of 1. In particular, ! ! BD**0 F(0) = F(0) ! BD**1 F(0) = F(0) - F(-1) ! BD**2 F(0) = F(0) - 2 * F(-1) + F(-2 ) ! ! The relationship between a backward difference predictor and the ! corresponding Adams-Bashforth formula may be illustrated for the ! BDF predictor of order 3: ! ! BD**0 F(0) + 0.5 * BD**1 F(0) + 5/12 * BD**2 F(0) ! = F(0) ! + 1/2 * ( F(0) - F(1) ) ! + 5/12 * ( F(0) - 2 * F(-1) + F(-2) ) ! = 23/12 * F(0) - 16/12 * F(-1) + 5/12 F(-2) ! ! which is the Adams-Bashforth formula of order 3. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 29 February 2000 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Simeon Fatunla, ! Numerical Methods for Initial Value Problems in Ordinary ! Differential Equations, ! Academic Press, 1988, ! ISBN: 0122499301, ! LC: QA372.F35.. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order, which can be ! any value from 1 to 19. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ), parameter :: order_max = 19 integer ( kind = 4 ) order integer ( kind = 4 ) i real ( kind = 8 ) w(order_max) real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) w(1) = 1.0D+00 w(2) = 1.0D+00 / 2.0D+00 w(3) = 5.0D+00 / 12.0D+00 w(4) = 3.0D+00 / 8.0D+00 w(5) = 251.0D+00 / 720.0D+00 w(6) = 95.0D+00 / 288.0D+00 w(7) = 19087.0D+00 / 60480.0D+00 w(8) = 5257.0D+00 / 17280.0D+00 w(9) = 1070017.0D+00 / 3628800.0D+00 w(10) = 25713.0D+00 / 89600.0D+00 w(11) = 26842253.0D+00 / 95800320.0D+00 w(12) = 4777223.0D+00 / 17418240.0D+00 w(13) = 703604254357.0D+00 / 2615348736000.0D+00 w(14) = 106364763817.0D+00 / 402361344000.0D+00 w(15) = 1166309819657.0D+00 / 4483454976000.0D+00 w(16) = 25221445.0D+00 / 98402304.0D+00 w(17) = 8092989203533249.0D+00 / 3201186852864.0D+00 w(18) = 85455477715379.0D+00 / 34237292544.0D+00 w(19) = 12600467236042756559.0D+00 / 5109094217170944.0D+00 if ( order_max < order ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'BDFP_SET - Fatal error!' write ( *, '(a)' ) ' Input order ORDER = ', order write ( *, '(a)' ) ' exceeds maximum order ORDER_MAX = ', order_max stop end if weight(1:order) = w(1:order) do i = 1, order xtab(i) = real ( 1 - i, kind = 8 ) end do return end subroutine bdf_sum ( func, order, xtab, weight, result ) !*****************************************************************************80 ! !! BDF_SUM: an explicit backward difference quadrature rule for [0,1]. ! ! Discussion: ! ! The integral to approximate is: ! ! Integral ( 0 <= X <= 1 ) F(X) dX ! ! The quadrature formula is: ! ! RESULT = Sum ( 1 <= I <= ORDER ) WEIGHT(I) * BDF**(I-1) FUNC ( 0 ) ! ! The integral from 0 to 1 is approximated using data at X = 0, ! -1, -2, ..., -ORDER+1. This is a form of extrapolation, and ! the approximation can become poor as ORDER increases. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 12 October 2005 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, external FUNC, the name of the FORTRAN function which evaluates ! the integrand. The function must have the form ! function func ( x ). ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ! Input, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Input, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! ! Output, real ( kind = 8 ) RESULT, the approximate value of the integral. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) diftab(order) real ( kind = 8 ), external :: func integer ( kind = 4 ) i integer ( kind = 4 ) j real ( kind = 8 ) result real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) do i = 1, order diftab(i) = func ( xtab(i) ) end do do i = 2, order do j = i, order diftab(order+i-j) = ( diftab(order+i-j-1) - diftab(order+i-j) ) end do end do result = dot_product ( weight(1:order), diftab(1:order) ) return end subroutine cheb_set ( order, xtab, weight ) !*****************************************************************************80 ! !! CHEB_SET sets abscissas and weights for Chebyshev quadrature. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1.0; ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! The Chebyshev rule is distinguished by using equal weights. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 27 October 2000 ! ! 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. ! ! Hermann Engels, ! Numerical Quadrature and Cubature, ! Academic Press, 1980, ! ISBN: 012238850X, ! LC: QA299.3E5. ! ! Zdenek Kopal, ! Numerical Analysis, ! John Wiley, 1955, ! LC: QA297.K6. ! ! Daniel Zwillinger, editor, ! CRC Standard Mathematical Tables and Formulae, ! 30th Edition, ! CRC Press, 1996, ! ISBN: 0-8493-2479-3, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER may only have the values 1, 2, 3, 4, 5, 6, 7 or 9. ! There are NO other Chebyshev rules with real abscissas. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas, ! which are symmetric in [-1,1]. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights, ! which should each equal 2 / ORDER. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) if ( order == 1 ) then xtab(1) = 0.0D+00 else if ( order == 2 ) then xtab(1) = - 1.0D+00 / sqrt ( 3.0D+00 ) xtab(2) = 1.0D+00 / sqrt ( 3.0D+00 ) else if ( order == 3 ) then xtab(1) = - 1.0D+00 / sqrt ( 2.0D+00 ) xtab(2) = 0.0D+00 xtab(3) = 1.0D+00 / sqrt ( 2.0D+00 ) else if ( order == 4 ) then xtab(1) = - sqrt ( ( 1.0D+00 + 2.0D+00/ sqrt ( 5.0D+00 ) ) / 3.0D+00 ) xtab(2) = - sqrt ( ( 1.0D+00 - 2.0D+00/ sqrt ( 5.0D+00 ) ) / 3.0D+00 ) xtab(3) = sqrt ( ( 1.0D+00 - 2.0D+00/ sqrt ( 5.0D+00 ) ) / 3.0D+00 ) xtab(4) = sqrt ( ( 1.0D+00 + 2.0D+00/ sqrt ( 5.0D+00 ) ) / 3.0D+00 ) else if ( order == 5 ) then xtab(1) = - sqrt ( ( 5.0D+00 + sqrt ( 11.0D+00 ) ) / 12.0D+00 ) xtab(2) = - sqrt ( ( 5.0D+00 - sqrt ( 11.0D+00 ) ) / 12.0D+00 ) xtab(3) = 0.0D+00 xtab(4) = sqrt ( ( 5.0D+00 - sqrt ( 11.0D+00 ) ) / 12.0D+00 ) xtab(5) = sqrt ( ( 5.0D+00 + sqrt ( 11.0D+00 ) ) / 12.0D+00 ) else if ( order == 6 ) then xtab(1) = - 0.866246818107820591383598D+00 xtab(2) = - 0.422518653761111529118546D+00 xtab(3) = - 0.266635401516704720331534D+00 xtab(4) = 0.266635401516704720331534D+00 xtab(5) = 0.422518653761111529118546D+00 xtab(6) = 0.866246818107820591383598D+00 else if ( order == 7 ) then xtab(1) = - 0.883861700758049035704224D+00 xtab(2) = - 0.529656775285156811385048D+00 xtab(3) = - 0.323911810519907637519673D+00 xtab(4) = 0.0D+00 xtab(5) = 0.323911810519907637519673D+00 xtab(6) = 0.529656775285156811385048D+00 xtab(7) = 0.883861700758049035704224D+00 else if ( order == 9 ) then xtab(1) = - 0.911589307728434473664949D+00 xtab(2) = - 0.601018655380238071428128D+00 xtab(3) = - 0.528761783057879993260181D+00 xtab(4) = - 0.167906184214803943068031D+00 xtab(5) = 0.0D+00 xtab(6) = 0.167906184214803943068031D+00 xtab(7) = 0.528761783057879993260181D+00 xtab(8) = 0.601018655380238071428128D+00 xtab(9) = 0.911589307728434473664949D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'CHEB_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are 1 through 7, and 9.' stop end if weight(1:order) = 2.0D+00 / real ( order, kind = 8 ) return end subroutine chebyshev1_compute ( order, x, w ) !*****************************************************************************80 ! !! CHEBYSHEV1_COMPUTE computes a Gauss-Chebyshev type 1 quadrature rule. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1.0 / sqrt ( 1 - x^2 ). ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) / sqrt ( 1 - x^2 ) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 22 February 2008 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Philip Davis, Philip Rabinowitz, ! Methods of Numerical Integration, ! Second Edition, ! Dover, 2007, ! ISBN: 0486453391, ! LC: QA299.3.D28. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be greater than 0. ! ! Output, real ( kind = 8 ) X(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) W(ORDER), the weights. ! implicit none integer ( kind = 4 ) order integer ( kind = 4 ) i real ( kind = 8 ) :: pi = 3.141592653589793D+00 real ( kind = 8 ) x(order) real ( kind = 8 ) w(order) if ( order < 1 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'CHEBYSHEV1_COMPUTE - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order stop end if w(1:order) = pi / real ( order, kind = 8 ) do i = 1, order x(i) = cos ( pi * real ( 2 * order + 1 - 2 * i, kind = 8 ) & / real ( 2 * order, kind = 8 ) ) end do return end subroutine chebyshev1_integral ( expon, exact ) !*****************************************************************************80 ! !! CHEBYSHEV1_INTEGRAL evaluates a monomial Chebyshev type 1 integral. ! ! Discussion: ! ! To test a Chebyshev type 1 quadrature rule, we use it to approximate the ! integral of a monomial: ! ! integral ( -1 <= x <= +1 ) x^n / sqrt ( 1 - x^2 ) dx ! ! This routine is given the value of the exponent, and returns the ! exact value of the integral. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 22 February 2008 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) EXPON, the exponent. ! ! Output, real ( kind = 8 ) EXACT, the value of the exact integral. ! implicit none real ( kind = 8 ) bot real ( kind = 8 ) exact integer ( kind = 4 ) expon integer ( kind = 4 ) i real ( kind = 8 ), parameter :: pi = 3.141592653589793D+00 real ( kind = 8 ) top ! ! Get the exact value of the integral. ! if ( mod ( expon, 2 ) == 0 ) then top = 1 bot = 1 do i = 2, expon, 2 top = top * ( i - 1 ) bot = bot * i end do exact = pi * real ( top, kind = 8 ) / real ( bot, kind = 8 ) else exact = 0.0D+00 end if return end subroutine chebyshev2_compute ( order, x, w ) !*****************************************************************************80 ! !! CHEBYSHEV2_COMPUTE computes a Gauss-Chebyshev type 2 quadrature rule. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = sqrt ( 1 - x^2 ). ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) sqrt ( 1 - x^2 ) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 22 February 2008 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Philip Davis, Philip Rabinowitz, ! Methods of Numerical Integration, ! Second Edition, ! Dover, 2007, ! ISBN: 0486453391, ! LC: QA299.3.D28. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be greater than 0. ! ! Output, real ( kind = 8 ) X(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) W(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) angle integer ( kind = 4 ) i real ( kind = 8 ) :: pi = 3.141592653589793D+00 real ( kind = 8 ) x(order) real ( kind = 8 ) w(order) if ( order < 1 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'CHEBYSHEV2_COMPUTE - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order stop end if do i = 1, order angle = pi * real ( order + 1 - i, kind = 8 ) / real ( order + 1, kind = 8 ) w(i) = pi / real ( order + 1, kind = 8 ) * ( sin ( angle ) )**2 x(i) = cos ( angle ) end do return end subroutine chebyshev2_integral ( expon, exact ) !*****************************************************************************80 ! !! CHEBYSHEV2_INTEGRAL evaluates a monomial Chebyshev type 2 integral. ! ! Discussion: ! ! To test a Chebyshev type 2 quadrature rule, we use it to approximate the ! integral of a monomial: ! ! integral ( -1 <= x <= +1 ) x^n * sqrt ( 1 - x^2 ) dx ! ! This routine is given the value of the exponent, and returns the ! exact value of the integral. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 22 February 2008 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) EXPON, the exponent. ! ! Output, real ( kind = 8 ) EXACT, the value of the exact integral. ! implicit none real ( kind = 8 ) bot real ( kind = 8 ) exact integer ( kind = 4 ) expon integer ( kind = 4 ) i real ( kind = 8 ), parameter :: pi = 3.141592653589793D+00 real ( kind = 8 ) top ! ! Get the exact value of the integral. ! if ( mod ( expon, 2 ) == 0 ) then top = 1 bot = 1 do i = 2, expon, 2 top = top * ( i - 1 ) bot = bot * i end do bot = bot * real ( expon + 2, kind = 8 ) exact = pi * real ( top, kind = 8 ) / real ( bot, kind = 8 ) else exact = 0.0D+00 end if return end subroutine chebyshev3_compute ( order, xtab, weight ) !*****************************************************************************80 ! !! CHEBYSHEV3_COMPUTE computs a Gauss-Chebyshev type 3 quadrature rule. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1 / sqrt ( 1 - x**2 ) ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) f(x) / sqrt ( 1 - x**2 ) dx ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! The ORDER = 1 rule is exceptional. It consists of a single ! point at 0, with weight PI. ! ! For rules with ORDER = 2 or greater, the following remarks apply: ! ! If ORDER points are used, then Gauss-Chebyshev quadrature ! will compute the integral exactly, whenever F(X) is a polynomial ! of degree 2*ORDER-3 or less. ! ! The abscissas include -1 and 1. ! ! The first and last weights are 0.5 * PI / ( ORDER - 1), ! and all other weights are PI / ( ORDER - 1 ). ! ! If the order is doubled, the abscissas of the new rule include ! all the points of the old rule. This fact can be used to ! efficiently implement error estimation. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 15 November 2005 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Daniel Zwillinger, editor, ! CRC Standard Mathematical Tables and Formulae, ! 30th Edition, ! CRC Press, 1996, ! ISBN: 0-8493-2479-3, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order, which must ! be at least 1. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) angle integer ( kind = 4 ) i real ( kind = 8 ) :: pi = 3.141592653589793D+00 real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) if ( order < 1 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'CHEBYSHEV3_COMPUTE - Fatal error!' write ( *, '(a)' ) ' ORDER must be at least 1.' write ( *, '(a,i8)' ) ' The input value was ORDER = ', order stop end if ! ! Take care of the special case ORDER = 1. ! if ( order == 1 ) then xtab(1) = 0.0D+00 weight(1) = pi return end if do i = 1, order angle = real ( order - i, kind = 8 ) * pi & / real ( order - 1, kind = 8 ) xtab(i) = cos ( angle ) end do weight(1) = pi / real ( 2 * ( order - 1 ), kind = 8 ) weight(2:order-1) = pi / real ( order - 1, kind = 8 ) weight(order) = pi / real ( 2 * ( order - 1 ), kind = 8 ) return end subroutine clenshaw_curtis_compute ( n, x, w ) !*****************************************************************************80 ! !! CLENSHAW_CURTIS_COMPUTE computes a Clenshaw Curtis quadrature rule. ! ! Discussion: ! ! This method uses a direct approach. The paper by Waldvogel ! exhibits a more efficient approach using Fourier transforms. ! ! The integration interval is [ -1, 1 ]. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( X(I) ) ! ! The abscissas for the rule of order ORDER can be regarded ! as the cosines of equally spaced angles between 180 and 0 degrees: ! ! X(I) = cos ( ( ORDER - I ) * PI / ( ORDER - 1 ) ) ! ! except for the basic case ORDER = 1, when ! ! X(1) = 0. ! ! A Clenshaw-Curtis rule that uses ORDER points will integrate ! exactly all polynomials of degrees 0 through ORDER-1. If ORDER ! is odd, then by symmetry the polynomial of degree ORDER will ! also be integrated exactly. ! ! If the value of ORDER is increased in a sensible way, then ! the new set of abscissas will include the old ones. One such ! sequence would be ORDER(K) = 2*K+1 for K = 0, 1, 2, ... ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 04 December 2007 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Charles Clenshaw, Alan Curtis, ! A Method for Numerical Integration on an Automatic Computer, ! Numerische Mathematik, ! Volume 2, Number 1, December 1960, pages 197-205. ! ! Philip Davis, Philip Rabinowitz, ! Methods of Numerical Integration, ! Second Edition, ! Dover, 2007, ! ISBN: 0486453391, ! LC: QA299.3.D28. ! ! Joerg Waldvogel, ! Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules, ! BIT Numerical Mathematics, ! Volume 43, Number 1, 2003, pages 1-18. ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. ! ! Output, real ( kind = 8 ) X(N), W(N), the abscissas and weights. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) b integer ( kind = 4 ) i integer ( kind = 4 ) j real ( kind = 8 ) :: pi = 3.141592653589793D+00 real ( kind = 8 ) theta(n) real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) if ( n < 1 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'CLENSHAW_CURTIS_COMPUTE - Fatal error!' write ( *, '(a)' ) ' N < 1.' stop end if if ( n == 1 ) then x(1) = 0.0D+00 w(1) = 2.0D+00 return end if do i = 1, n theta(i) = real ( n - i, kind = 8 ) * pi & / real ( n - 1, kind = 8 ) end do x(1:n) = cos ( theta(1:n) ) do i = 1, n w(i) = 1.0D+00 do j = 1, ( n - 1 ) / 2 if ( 2 * j == ( n - 1 ) ) then b = 1.0D+00 else b = 2.0D+00 end if w(i) = w(i) - b * cos ( 2.0D+00 * real ( j, kind = 8 ) * theta(i) ) & / real ( 4 * j * j - 1, kind = 8 ) end do end do w(1) = w(1) / real ( n - 1, kind = 8 ) w(2:n-1) = 2.0D+00 * w(2:n-1) / real ( n - 1, kind = 8 ) w(n) = w(n) / real ( n - 1, kind = 8 ) return end subroutine clenshaw_curtis_set ( order, x, w ) !*****************************************************************************80 ! !! CLENSHAW_CURTIS_SET sets a Clenshaw-Curtis quadrature rule. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) ) ! ! The abscissas for the rule of order ORDER can be regarded ! as the cosines of equally spaced angles between 180 and 0 degrees: ! ! X(I) = cos ( ( I - 1 ) * PI / ( ORDER - 1 ) ) ! ! except for the basic case ORDER = 1, when ! ! X(1) = 0. ! ! A Clenshaw-Curtis rule that uses ORDER points will integrate ! exactly all polynomials of degrees 0 through ORDER-1. If ORDER ! is odd, then by symmetry the polynomial of degree ORDER will ! also be integrated exactly. ! ! If the value of ORDER is increased in a sensible way, then ! the new set of abscissas will include the old ones. One such ! sequence would be ORDER(K) = 2*K+1 for K = 0, 1, 2, ... ! Thus, in the table below, the abscissas for order 9 include ! those for order 5. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 14 May 2007 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Charles Clenshaw, Alan Curtis, ! A Method for Numerical Integration on an Automatic Computer, ! Numerische Mathematik, ! Volume 2, Number 1, December 1960, pages 197-205. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1 and 17, 33, 65 or 129. ! ! Output, real ( kind = 8 ) X(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! The weights are symmetric and sum to 2. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) w(order) real ( kind = 8 ) x(order) if ( order == 1 ) then x(1) = 0.00000000000000000000D+00 w(1) = 2.00000000000000000000D+00 else if ( order == 2 ) then x(1) = -1.00000000000000000000D+00 x(2) = 1.00000000000000000000D+00 w(1) = 1.00000000000000000000D+00 w(2) = 1.00000000000000000000D+00 else if ( order == 3 ) then x(1) = -1.00000000000000000000D+00 x(2) = 0.00000000000000000000D+00 x(3) = 1.00000000000000000000D+00 w(1) = 0.33333333333333333333D+00 w(2) = 1.33333333333333333333D+00 w(3) = 0.33333333333333333333D+00 else if ( order == 4 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.50000000000000000000D+00 x(3) = 0.50000000000000000000D+00 x(4) = 1.00000000000000000000D+00 w(1) = 0.11111111111111111111D+00 w(2) = 0.88888888888888888889D+00 w(3) = 0.88888888888888888889D+00 w(4) = 0.11111111111111111111D+00 else if ( order == 5 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.70710678118654752440D+00 x(3) = 0.00000000000000000000D+00 x(4) = 0.70710678118654752440D+00 x(5) = 1.00000000000000000000D+00 w(1) = 0.06666666666666666667D+00 w(2) = 0.53333333333333333333D+00 w(3) = 0.80000000000000000000D+00 w(4) = 0.53333333333333333333D+00 w(5) = 0.06666666666666666667D+00 else if ( order == 6 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.80901699437494742410D+00 x(3) = -0.30901699437494742410D+00 x(4) = 0.30901699437494742410D+00 x(5) = 0.80901699437493732410D+00 x(6) = 1.00000000000000000000D+00 w(1) = 0.04000000000000000000D+00 w(2) = 0.36074304120001121619D+00 w(3) = 0.59925695879998878381D+00 w(4) = 0.59925695879998878381D+00 w(5) = 0.36074304120001121619D+00 w(6) = 0.04000000000000000000D+00 else if ( order == 7 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.86602540378443864676D+00 x(3) = -0.50000000000000000000D+00 x(4) = 0.00000000000000000000D+00 x(5) = 0.50000000000000000000D+00 x(6) = 0.86602540378443864676D+00 x(7) = 1.00000000000000000000D+00 w(1) = 0.02857142857142857143D+00 w(2) = 0.25396825396825396825D+00 w(3) = 0.45714285714285714286D+00 w(4) = 0.52063492063492063492D+00 w(5) = 0.45714285714285714286D+00 w(6) = 0.25396825396825396825D+00 w(7) = 0.02857142857142857143D+00 else if ( order == 8 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.90096886790241912624D+00 x(3) = -0.62348980185873353053D+00 x(4) = -0.22252093395631440429D+00 x(5) = 0.22252093395631440429D+00 x(6) = 0.62348980185873353053D+00 x(7) = 0.90096886790241910624D+00 x(8) = 1.00000000000000000000D+00 w(1) = 0.02040816326530612245D+00 w(2) = 0.19014100721820835178D+00 w(3) = 0.35224242371815911533D+00 w(4) = 0.43720840579832641044D+00 w(5) = 0.43720840579832641044D+00 w(6) = 0.35224242371815911533D+00 w(7) = 0.19014100721820835178D+00 w(8) = 0.02040816326530612245D+00 else if ( order == 9 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.92387953251128675613D+00 x(3) = -0.70710678118654752440D+00 x(4) = -0.38268343236508977173D+00 x(5) = 0.00000000000000000000D+00 x(6) = 0.38268343236508977173D+00 x(7) = 0.70710678118654752440D+00 x(8) = 0.92387953251128675613D+00 x(9) = 1.00000000000000000000D+00 w(1) = 0.01587301587301587302D+00 w(2) = 0.14621864921601815501D+00 w(3) = 0.27936507936507936508D+00 w(4) = 0.36171785872048978150D+00 w(5) = 0.39365079365079365079D+00 w(6) = 0.36171785872048978150D+00 w(7) = 0.27936507936507936508D+00 w(8) = 0.14621864921601815501D+00 w(9) = 0.01587301587301587302D+00 else if ( order == 10 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.93969262078590838405D+00 x(3) = -0.76604444311897903520D+00 x(4) = -0.50000000000000000000D+00 x(5) = -0.17364817766693034885D+00 x(6) = 0.17364817766693034885D+00 x(7) = 0.50000000000000000000D+00 x(8) = 0.76604444311897903520D+00 x(9) = 0.93969262078590838405D+00 x(10) = 1.00000000000000000000D+00 w(1) = 0.01234567901234567901D+00 w(2) = 0.11656745657203712296D+00 w(3) = 0.22528432333810440813D+00 w(4) = 0.30194003527336860670D+00 w(5) = 0.34386250580414418320D+00 w(6) = 0.34386250580414418320D+00 w(7) = 0.30194003527336860670D+00 w(8) = 0.22528432333810440813D+00 w(9) = 0.11656745657203712296D+00 w(10) = 0.01234567901234567901D+00 else if ( order == 11 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.95105651629515357212D+00 x(3) = -0.80901699437494742410D+00 x(4) = -0.58778525229247312917D+00 x(5) = -0.30901699437494742410D+00 x(6) = 0.00000000000000000000D+00 x(7) = 0.30901699437494742410D+00 x(8) = 0.58778525229247312917D+00 x(9) = 0.80901699437494742410D+00 x(10) = 0.95105651629515357212D+00 x(11) = 1.00000000000000000000D+00 w(1) = 0.01010101010101010101D+00 w(2) = 0.09457905488370156116D+00 w(3) = 0.18563521442424776529D+00 w(4) = 0.25358833328368660623D+00 w(5) = 0.29921327042423708320D+00 w(6) = 0.31376623376623376623D+00 w(7) = 0.29921327042423708320D+00 w(8) = 0.25358833328368660623D+00 w(9) = 0.18563521442424776529D+00 w(10) = 0.09457905488370156116D+00 w(11) = 0.01010101010101010101D+00 else if ( order == 12 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.95949297361449738989D+00 x(3) = -0.84125353283118116886D+00 x(4) = -0.65486073394528506406D+00 x(5) = -0.41541501300188642553D+00 x(6) = -0.14231483827328514044D+00 x(7) = 0.14231483827328514044D+00 x(8) = 0.41541501300188642553D+00 x(9) = 0.65486073394528506406D+00 x(10) = 0.84125353283118116886D+00 x(11) = 0.95949297361449738989D+00 x(12) = 1.00000000000000000000D+00 w(1) = 0.00826446280991735537D+00 w(2) = 0.07856015374620000543D+00 w(3) = 0.15504045508256136552D+00 w(4) = 0.21556254600086858099D+00 w(5) = 0.25991734106691617602D+00 w(6) = 0.28265504129353651666D+00 w(7) = 0.28265504129353651666D+00 w(8) = 0.25991734106691617602D+00 w(9) = 0.21556254600086858099D+00 w(10) = 0.15504045508256136552D+00 w(11) = 0.07856015374620000543D+00 w(12) = 0.00826446280991735537D+00 else if ( order == 13 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.96592582628906828675D+00 x(3) = -0.86602540378443864676D+00 x(4) = -0.70710678118654752440D+00 x(5) = -0.50000000000000000000D+00 x(6) = -0.25881904510252076235D+00 x(7) = 0.00000000000000000000D+00 x(8) = 0.25881904510252076235D+00 x(9) = 0.50000000000000000000D+00 x(10) = 0.70710678118654752440D+00 x(11) = 0.86602540378443864676D+00 x(12) = 0.96592582628906828675D+00 x(13) = 1.00000000000000000000D+00 w(1) = 0.00699300699300699301D+00 w(2) = 0.06605742495207439452D+00 w(3) = 0.13154253154253154253D+00 w(4) = 0.18476338476338476338D+00 w(5) = 0.22697302697302697303D+00 w(6) = 0.25267569378104433860D+00 w(7) = 0.26198986198986198986D+00 w(8) = 0.25267569378104433860D+00 w(9) = 0.22697302697302697303D+00 w(10) = 0.18476338476338476338D+00 w(11) = 0.13154253154253154253D+00 w(12) = 0.06605742495207439452D+00 w(13) = 0.00699300699300699301D+00 else if ( order == 14 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.97094181742605202716D+00 x(3) = -0.88545602565320989590D+00 x(4) = -0.74851074817110109863D+00 x(5) = -0.56806474673115580251D+00 x(6) = -0.35460488704253562597D+00 x(7) = -0.12053668025532305335D+00 x(8) = 0.12053668025532305335D+00 x(9) = 0.35460488704253562597D+00 x(10) = 0.56806474673115580251D+00 x(11) = 0.74851074817110109863D+00 x(12) = 0.88545602565320989590D+00 x(13) = 0.97094181742605202716D+00 x(14) = 1.00000000000000000000D+00 w(1) = 0.00591715976331360947D+00 w(2) = 0.05646531376341444627D+00 w(3) = 0.11276867248985655881D+00 w(4) = 0.16003802611671868523D+00 w(5) = 0.19899241036578321848D+00 w(6) = 0.22590304977856444935D+00 w(7) = 0.23991536772234903239D+00 w(8) = 0.23991536772234903239D+00 w(9) = 0.22590304977856444935D+00 w(10) = 0.19899241036578321848D+00 w(11) = 0.16003802611671868523D+00 w(12) = 0.11276867248985655881D+00 w(13) = 0.05646531376341444627D+00 w(14) = 0.00591715976331360947D+00 else if ( order == 15 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.97492791218182360702D+00 x(3) = -0.90096886790241912624D+00 x(4) = -0.78183148246802980871D+00 x(5) = -0.62348980185873353053D+00 x(6) = -0.43388373911755812048D+00 x(7) = -0.22252093395631440429D+00 x(8) = 0.00000000000000000000D+00 x(9) = 0.22252093395631440429D+00 x(10) = 0.43388373911755812048D+00 x(11) = 0.62348980185873353053D+00 x(12) = 0.78183148246802980871D+00 x(13) = 0.90096886790241912624D+00 x(14) = 0.97492791218182360702D+00 x(15) = 1.00000000000000000000D+00 w(1) = 0.00512820512820512821D+00 w(2) = 0.04869938729508823855D+00 w(3) = 0.09782039167605215913D+00 w(4) = 0.13966507849560431803D+00 w(5) = 0.17560578900106674677D+00 w(6) = 0.20205146748238357364D+00 w(7) = 0.21888151163057340180D+00 w(8) = 0.22429633858205286777D+00 w(9) = 0.21888151163057340180D+00 w(10) = 0.20205146748238357364D+00 w(11) = 0.17560578900106674677D+00 w(12) = 0.13966507849560431803D+00 w(13) = 0.09782039167605215913D+00 w(14) = 0.04869938729508823855D+00 w(15) = 0.00512820512820512821D+00 else if ( order == 16 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.97814760073380563793D+00 x(3) = -0.91354545764260089550D+00 x(4) = -0.80901699437494742410D+00 x(5) = -0.66913060635885821383D+00 x(6) = -0.50000000000000000000D+00 x(7) = -0.30901699437494742410D+00 x(8) = -0.10452846326765347140D+00 x(9) = 0.10452846326765347140D+00 x(10) = 0.30901699437494742410D+00 x(11) = 0.50000000000000000000D+00 x(12) = 0.66913060635885821383D+00 x(13) = 0.80901699437494742410D+00 x(14) = 0.91354545764260089550D+00 x(15) = 0.97814760073380563793D+00 x(16) = 1.00000000000000000000D+00 w(1) = 0.00444444444444444444D+00 w(2) = 0.04251476624752508988D+00 w(3) = 0.08553884025933288291D+00 w(4) = 0.12294010082849361533D+00 w(5) = 0.15573317603967369176D+00 w(6) = 0.18132978132978132978D+00 w(7) = 0.19921478132638853955D+00 w(8) = 0.20828410952436040635D+00 w(9) = 0.20828410952436040635D+00 w(10) = 0.19921478132638853955D+00 w(11) = 0.18132978132978132978D+00 w(12) = 0.15573317603967369176D+00 w(13) = 0.12294010082849361533D+00 w(14) = 0.08553884025933288291D+00 w(15) = 0.04251476624752508988D+00 w(16) = 0.00444444444444444444D+00 else if ( order == 17 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.98078528040323044913D+00 x(3) = -0.92387953251128675613D+00 x(4) = -0.83146961230254523708D+00 x(5) = -0.70710678118654752440D+00 x(6) = -0.55557023301960222474D+00 x(7) = -0.38268343236508977173D+00 x(8) = -0.19509032201612826785D+00 x(9) = 0.00000000000000000000D+00 x(10) = 0.19509032201612826785D+00 x(11) = 0.38268343236508977173D+00 x(12) = 0.55557023301960222474D+00 x(13) = 0.70710678118654752440D+00 x(14) = 0.83146961230254523708D+00 x(15) = 0.92387953251128675613D+00 x(16) = 0.98078528040323044913D+00 x(17) = 1.00000000000000000000D+00 w(1) = 0.00392156862745098039D+00 w(2) = 0.03736870283720561032D+00 w(3) = 0.07548233154315183441D+00 w(4) = 0.10890555258189093044D+00 w(5) = 0.13895646836823307412D+00 w(6) = 0.16317266428170330256D+00 w(7) = 0.18147378423649335700D+00 w(8) = 0.19251386461292564687D+00 w(9) = 0.19641012582189052777D+00 w(10) = 0.19251386461292564687D+00 w(11) = 0.18147378423649335700D+00 w(12) = 0.16317266428170330256D+00 w(13) = 0.13895646836823307412D+00 w(14) = 0.10890555258189093044D+00 w(15) = 0.07548233154315183441D+00 w(16) = 0.03736870283720561032D+00 w(17) = 0.00392156862745098039D+00 else if ( order == 33 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.99518472667219688624D+00 x(3) = -0.98078528040323044913D+00 x(4) = -0.95694033573220886494D+00 x(5) = -0.92387953251128675613D+00 x(6) = -0.88192126434835502971D+00 x(7) = -0.83146961230254523708D+00 x(8) = -0.77301045336273696081D+00 x(9) = -0.70710678118654752440D+00 x(10) = -0.63439328416364549822D+00 x(11) = -0.55557023301960222474D+00 x(12) = -0.47139673682599764856D+00 x(13) = -0.38268343236508977173D+00 x(14) = -0.29028467725446236764D+00 x(15) = -0.19509032201612826785D+00 x(16) = -0.098017140329560601994D+00 x(17) = 0.000000000000000000000D+00 x(18) = 0.098017140329560601994D+00 x(19) = 0.19509032201612826785D+00 x(20) = 0.29028467725446236764D+00 x(21) = 0.38268343236508977173D+00 x(22) = 0.47139673682599764856D+00 x(23) = 0.55557023301960222474D+00 x(24) = 0.63439328416364549822D+00 x(25) = 0.70710678118654752440D+00 x(26) = 0.77301045336273696081D+00 x(27) = 0.83146961230254523708D+00 x(28) = 0.88192126434835502971D+00 x(29) = 0.92387953251128675613D+00 x(30) = 0.95694033573220886494D+00 x(31) = 0.98078528040323044913D+00 x(32) = 0.99518472667219688624D+00 x(33) = 1.00000000000000000000D+00 w(1) = 0.00097751710654936461D+00 w(2) = 0.00939319796295501470D+00 w(3) = 0.01923424513268114918D+00 w(4) = 0.02845791667723369009D+00 w(5) = 0.03759434191404720602D+00 w(6) = 0.04626276283775174949D+00 w(7) = 0.05455501630398031044D+00 w(8) = 0.06227210954529400455D+00 w(9) = 0.06942757563043545090D+00 w(10) = 0.07588380044138847048D+00 w(11) = 0.08163481765493851023D+00 w(12) = 0.08657753844182743544D+00 w(13) = 0.09070611286772099874D+00 w(14) = 0.09394324443876873573D+00 w(15) = 0.09629232594548817919D+00 w(16) = 0.09769818820805558182D+00 w(17) = 0.09817857778176829677D+00 w(18) = 0.09769818820805558182D+00 w(19) = 0.09629232594548817919D+00 w(20) = 0.09394324443876873573D+00 w(21) = 0.09070611286772099874D+00 w(22) = 0.08657753844182743544D+00 w(23) = 0.08163481765493851023D+00 w(24) = 0.07588380044138847048D+00 w(25) = 0.06942757563043545090D+00 w(26) = 0.06227210954529400455D+00 w(27) = 0.05455501630398031044D+00 w(28) = 0.04626276283775174949D+00 w(29) = 0.03759434191404720602D+00 w(30) = 0.02845791667723369009D+00 w(31) = 0.01923424513268114918D+00 w(32) = 0.00939319796295501470D+00 w(33) = 0.00097751710654936461D+00 else if ( order == 65 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.99879545620517239271D+00 x(3) = -0.99518472667219688624D+00 x(4) = -0.98917650996478097345D+00 x(5) = -0.98078528040323044913D+00 x(6) = -0.97003125319454399260D+00 x(7) = -0.95694033573220886494D+00 x(8) = -0.94154406518302077841D+00 x(9) = -0.92387953251128675613D+00 x(10) = -0.90398929312344333159D+00 x(11) = -0.88192126434835502971D+00 x(12) = -0.85772861000027206990D+00 x(13) = -0.83146961230254523708D+00 x(14) = -0.80320753148064490981D+00 x(15) = -0.77301045336273696081D+00 x(16) = -0.74095112535495909118D+00 x(17) = -0.70710678118654752440D+00 x(18) = -0.67155895484701840063D+00 x(19) = -0.63439328416364549822D+00 x(20) = -0.59569930449243334347D+00 x(21) = -0.55557023301960222474D+00 x(22) = -0.51410274419322172659D+00 x(23) = -0.47139673682599764856D+00 x(24) = -0.42755509343028209432D+00 x(25) = -0.38268343236508977173D+00 x(26) = -0.33688985339222005069D+00 x(27) = -0.29028467725446236764D+00 x(28) = -0.24298017990326388995D+00 x(29) = -0.19509032201612826785D+00 x(30) = -0.14673047445536175166D+00 x(31) = -0.098017140329560601994D+00 x(32) = -0.049067674327418014255D+00 x(33) = 0.000000000000000000000D+00 x(34) = 0.049067674327418014255D+00 x(35) = 0.098017140329560601994D+00 x(36) = 0.14673047445536175166D+00 x(37) = 0.19509032201612826785D+00 x(38) = 0.24298017990326388995D+00 x(39) = 0.29028467725446236764D+00 x(40) = 0.33688985339222005069D+00 x(41) = 0.38268343236508977173D+00 x(42) = 0.42755509343028209432D+00 x(43) = 0.47139673682599764856D+00 x(44) = 0.51410274419322172659D+00 x(45) = 0.55557023301960222474D+00 x(46) = 0.59569930449243334347D+00 x(47) = 0.63439328416364549822D+00 x(48) = 0.67155895484701840063D+00 x(49) = 0.70710678118654752440D+00 x(50) = 0.74095112535495909118D+00 x(51) = 0.77301045336273696081D+00 x(52) = 0.80320753148064490981D+00 x(53) = 0.83146961230254523708D+00 x(54) = 0.85772861000027206990D+00 x(55) = 0.88192126434835502971D+00 x(56) = 0.90398929312344333159D+00 x(57) = 0.92387953251128675613D+00 x(58) = 0.94154406518302077841D+00 x(59) = 0.95694033573220886494D+00 x(60) = 0.97003125319454399260D+00 x(61) = 0.98078528040323044913D+00 x(62) = 0.98917650996478097345D+00 x(63) = 0.99518472667219688624D+00 x(64) = 0.99879545620517239271D+00 x(65) = 1.00000000000000000000D+00 w(1) = 0.00024420024420024420D+00 w(2) = 0.00235149067531170332D+00 w(3) = 0.00483146544879091264D+00 w(4) = 0.00719269316173611402D+00 w(5) = 0.00958233879528379039D+00 w(6) = 0.01192339471421277160D+00 w(7) = 0.01425206043235199679D+00 w(8) = 0.01653498765728958965D+00 w(9) = 0.01878652974179578354D+00 w(10) = 0.02098627442973743378D+00 w(11) = 0.02314069493435819848D+00 w(12) = 0.02523506498175476590D+00 w(13) = 0.02727225714146838686D+00 w(14) = 0.02924065319746833770D+00 w(15) = 0.03114129710406762447D+00 w(16) = 0.03296454656997632997D+00 w(17) = 0.03471049818092511427D+00 w(18) = 0.03637092028663918309D+00 w(19) = 0.03794545992128481711D+00 w(20) = 0.03942698871295609976D+00 w(21) = 0.04081501340035783384D+00 w(22) = 0.04210333111141810203D+00 w(23) = 0.04329151496169082935D+00 w(24) = 0.04437417923925731580D+00 w(25) = 0.04535110955166067221D+00 w(26) = 0.04621766751092557684D+00 w(27) = 0.04697395904661414870D+00 w(28) = 0.04761604458525019296D+00 w(29) = 0.04814443257251220341D+00 w(30) = 0.04855584485714105274D+00 w(31) = 0.04885125664306609371D+00 w(32) = 0.04902801843102555294D+00 w(33) = 0.04908762351494245585D+00 w(34) = 0.04902801843102555294D+00 w(35) = 0.04885125664306609371D+00 w(36) = 0.04855584485714105274D+00 w(37) = 0.04814443257251220341D+00 w(38) = 0.04761604458525019296D+00 w(39) = 0.04697395904661414870D+00 w(40) = 0.04621766751092557684D+00 w(41) = 0.04535110955166067221D+00 w(42) = 0.04437417923925731580D+00 w(43) = 0.04329151496169082935D+00 w(44) = 0.04210333111141810203D+00 w(45) = 0.04081501340035783384D+00 w(46) = 0.03942698871295609976D+00 w(47) = 0.03794545992128481711D+00 w(48) = 0.03637092028663918309D+00 w(49) = 0.03471049818092511427D+00 w(50) = 0.03296454656997632997D+00 w(51) = 0.03114129710406762447D+00 w(52) = 0.02924065319746833770D+00 w(53) = 0.02727225714146838686D+00 w(54) = 0.02523506498175476590D+00 w(55) = 0.02314069493435819848D+00 w(56) = 0.02098627442973743378D+00 w(57) = 0.01878652974179578354D+00 w(58) = 0.01653498765728958965D+00 w(59) = 0.01425206043235199679D+00 w(60) = 0.01192339471421277160D+00 w(61) = 0.00958233879528379039D+00 w(62) = 0.00719269316173611402D+00 w(63) = 0.00483146544879091264D+00 w(64) = 0.00235149067531170332D+00 w(65) = 0.00024420024420024420D+00 else if ( order == 129 ) then x(1) = -1.00000000000000000000D+00 x(2) = -0.99969881869620422012D+00 x(3) = -0.99879545620517239271D+00 x(4) = -0.99729045667869021614D+00 x(5) = -0.99518472667219688624D+00 x(6) = -0.99247953459870999816D+00 x(7) = -0.98917650996478097345D+00 x(8) = -0.98527764238894124477D+00 x(9) = -0.98078528040323044913D+00 x(10) = -0.97570213003852854446D+00 x(11) = -0.97003125319454399260D+00 x(12) = -0.96377606579543986669D+00 x(13) = -0.95694033573220886494D+00 x(14) = -0.94952818059303666720D+00 x(15) = -0.94154406518302077841D+00 x(16) = -0.93299279883473888771D+00 x(17) = -0.92387953251128675613D+00 x(18) = -0.91420975570353065464D+00 x(19) = -0.90398929312344333159D+00 x(20) = -0.89322430119551532034D+00 x(21) = -0.88192126434835502971D+00 x(22) = -0.87008699110871141865D+00 x(23) = -0.85772861000027206990D+00 x(24) = -0.84485356524970707326D+00 x(25) = -0.83146961230254523708D+00 x(26) = -0.81758481315158369650D+00 x(27) = -0.80320753148064490981D+00 x(28) = -0.78834642762660626201D+00 x(29) = -0.77301045336273696081D+00 x(30) = -0.75720884650648454758D+00 x(31) = -0.74095112535495909118D+00 x(32) = -0.72424708295146692094D+00 x(33) = -0.70710678118654752440D+00 x(34) = -0.68954054473706692462D+00 x(35) = -0.67155895484701840063D+00 x(36) = -0.65317284295377676408D+00 x(37) = -0.63439328416364549822D+00 x(38) = -0.61523159058062684548D+00 x(39) = -0.59569930449243334347D+00 x(40) = -0.57580819141784530075D+00 x(41) = -0.55557023301960222474D+00 x(42) = -0.53499761988709721066D+00 x(43) = -0.51410274419322172659D+00 x(44) = -0.49289819222978403687D+00 x(45) = -0.47139673682599764856D+00 x(46) = -0.44961132965460660005D+00 x(47) = -0.42755509343028209432D+00 x(48) = -0.40524131400498987091D+00 x(49) = -0.38268343236508977173D+00 x(50) = -0.35989503653498814878D+00 x(51) = -0.33688985339222005069D+00 x(52) = -0.31368174039889147666D+00 x(53) = -0.29028467725446236764D+00 x(54) = -0.26671275747489838633D+00 x(55) = -0.24298017990326388995D+00 x(56) = -0.21910124015686979723D+00 x(57) = -0.19509032201612826785D+00 x(58) = -0.17096188876030122636D+00 x(59) = -0.14673047445536175166D+00 x(60) = -0.12241067519921619850D+00 x(61) = -0.098017140329560601994D+00 x(62) = -0.073564563599667423529D+00 x(63) = -0.049067674327418014255D+00 x(64) = -0.024541228522912288032D+00 x(65) = 0.00000000000000000000D+00 x(66) = 0.024541228522912288032D+00 x(67) = 0.049067674327418014255D+00 x(68) = 0.073564563599667423529D+00 x(69) = 0.098017140329560601994D+00 x(70) = 0.12241067519921619850D+00 x(71) = 0.14673047445536175166D+00 x(72) = 0.17096188876030122636D+00 x(73) = 0.19509032201612826785D+00 x(74) = 0.21910124015686979723D+00 x(75) = 0.24298017990326388995D+00 x(76) = 0.26671275747489838633D+00 x(77) = 0.29028467725446236764D+00 x(78) = 0.31368174039889147666D+00 x(79) = 0.33688985339222005069D+00 x(80) = 0.35989503653498814878D+00 x(81) = 0.38268343236508977173D+00 x(82) = 0.40524131400498987091D+00 x(83) = 0.42755509343028209432D+00 x(84) = 0.44961132965460660005D+00 x(85) = 0.47139673682599764856D+00 x(86) = 0.49289819222978403687D+00 x(87) = 0.51410274419322172659D+00 x(88) = 0.53499761988709721066D+00 x(89) = 0.55557023301960222474D+00 x(90) = 0.57580819141784530075D+00 x(91) = 0.59569930449243334347D+00 x(92) = 0.61523159058062684548D+00 x(93) = 0.63439328416364549822D+00 x(94) = 0.65317284295377676408D+00 x(95) = 0.67155895484701840063D+00 x(96) = 0.68954054473706692462D+00 x(97) = 0.70710678118654752440D+00 x(98) = 0.72424708295146692094D+00 x(99) = 0.74095112535495909118D+00 x(100) = 0.75720884650648454758D+00 x(101) = 0.77301045336273696081D+00 x(102) = 0.78834642762660626201D+00 x(103) = 0.80320753148064490981D+00 x(104) = 0.81758481315158369650D+00 x(105) = 0.83146961230254523708D+00 x(106) = 0.84485356524970707326D+00 x(107) = 0.85772861000027206990D+00 x(108) = 0.87008699110871141865D+00 x(109) = 0.88192126434835502971D+00 x(110) = 0.89322430119551532034D+00 x(111) = 0.90398929312344333159D+00 x(112) = 0.91420975570353065464D+00 x(113) = 0.92387953251128675613D+00 x(114) = 0.93299279883473888771D+00 x(115) = 0.94154406518302077841D+00 x(116) = 0.94952818059303666720D+00 x(117) = 0.95694033573220886494D+00 x(118) = 0.96377606579543986669D+00 x(119) = 0.97003125319454399260D+00 x(120) = 0.97570213003852854446D+00 x(121) = 0.98078528040323044913D+00 x(122) = 0.98527764238894124477D+00 x(123) = 0.98917650996478097345D+00 x(124) = 0.99247953459870999816D+00 x(125) = 0.99518472667219688624D+00 x(126) = 0.99729045667869021614D+00 x(127) = 0.99879545620517239271D+00 x(128) = 0.99969881869620422012D+00 x(129) = 1.00000000000000000000D+00 w(1) = 0.00006103888176768602D+00 w(2) = 0.00058807215382869754D+00 w(3) = 0.00120930061875273991D+00 w(4) = 0.00180308126695362360D+00 w(5) = 0.00240715327877140915D+00 w(6) = 0.00300345869904497128D+00 w(7) = 0.00360197835812614147D+00 w(8) = 0.00419553798718534675D+00 w(9) = 0.00478862143341336763D+00 w(10) = 0.00537724746840184621D+00 w(11) = 0.00596388034730799521D+00 w(12) = 0.00654590843862298928D+00 w(13) = 0.00712483332325489785D+00 w(14) = 0.00769875778896082811D+00 w(15) = 0.00826865154203087108D+00 w(16) = 0.00883303867470133581D+00 w(17) = 0.00939256583934814871D+00 w(18) = 0.00994602784923457905D+00 w(19) = 0.01049386202576892125D+00 w(20) = 0.01103504877427254184D+00 w(21) = 0.01156988348290849967D+00 w(22) = 0.01209748052807164113D+00 w(23) = 0.01261803597977743271D+00 w(24) = 0.01313076516693974630D+00 w(25) = 0.01363579321293772047D+00 w(26) = 0.01413241437853094133D+00 w(27) = 0.01462070254634350205D+00 w(28) = 0.01510001572479266783D+00 w(29) = 0.01557039073899425960D+00 w(30) = 0.01603123858745057916D+00 w(31) = 0.01648256956220377909D+00 w(32) = 0.01692383985846499368D+00 w(33) = 0.01735504125411394958D+00 w(34) = 0.01777566938875279997D+00 w(35) = 0.01818570377926339481D+00 w(36) = 0.01858467519566908661D+00 w(37) = 0.01897255587067948426D+00 w(38) = 0.01934890842392451844D+00 w(39) = 0.01971370183700155725D+00 w(40) = 0.02006652805198357604D+00 w(41) = 0.02040735612003867863D+00 w(42) = 0.02073580533490147816D+00 w(43) = 0.02105184759002011131D+00 w(44) = 0.02135512797425970725D+00 w(45) = 0.02164562356712882440D+00 w(46) = 0.02192300400598756892D+00 w(47) = 0.02218725355897195088D+00 w(48) = 0.02243806539722630184D+00 w(49) = 0.02267543270456671718D+00 w(50) = 0.02289907134390605882D+00 w(51) = 0.02310898491627407168D+00 w(52) = 0.02330491126131143273D+00 w(53) = 0.02348686571193163505D+00 w(54) = 0.02365460746057766523D+00 w(55) = 0.02380816473024258975D+00 w(56) = 0.02394731750476901502D+00 w(57) = 0.02407210792327850000D+00 w(58) = 0.02418233623893147567D+00 w(59) = 0.02427805942075745923D+00 w(60) = 0.02435909748927643184D+00 w(61) = 0.02442552306156708690D+00 w(62) = 0.02447717542743444284D+00 w(63) = 0.02451414358881568292D+00 w(64) = 0.02453628559651495473D+00 w(65) = 0.02454370750551418263D+00 w(66) = 0.02453628559651495473D+00 w(67) = 0.02451414358881568292D+00 w(68) = 0.02447717542743444284D+00 w(69) = 0.02442552306156708690D+00 w(70) = 0.02435909748927643184D+00 w(71) = 0.02427805942075745923D+00 w(72) = 0.02418233623893147567D+00 w(73) = 0.02407210792327850000D+00 w(74) = 0.02394731750476901502D+00 w(75) = 0.02380816473024258975D+00 w(76) = 0.02365460746057766523D+00 w(77) = 0.02348686571193163505D+00 w(78) = 0.02330491126131143273D+00 w(79) = 0.02310898491627407168D+00 w(80) = 0.02289907134390605882D+00 w(81) = 0.02267543270456671718D+00 w(82) = 0.02243806539722630184D+00 w(83) = 0.02218725355897195088D+00 w(84) = 0.02192300400598756892D+00 w(85) = 0.02164562356712882440D+00 w(86) = 0.02135512797425970725D+00 w(87) = 0.02105184759002011131D+00 w(88) = 0.02073580533490147816D+00 w(89) = 0.02040735612003867863D+00 w(90) = 0.02006652805198357604D+00 w(91) = 0.01971370183700155725D+00 w(92) = 0.01934890842392451844D+00 w(93) = 0.01897255587067948426D+00 w(94) = 0.01858467519566908661D+00 w(95) = 0.01818570377926339481D+00 w(96) = 0.01777566938875279997D+00 w(97) = 0.01735504125411394958D+00 w(98) = 0.01692383985846499368D+00 w(99) = 0.01648256956220377909D+00 w(100) = 0.01603123858745057916D+00 w(101) = 0.01557039073899425960D+00 w(102) = 0.01510001572479266783D+00 w(103) = 0.01462070254634350205D+00 w(104) = 0.01413241437853094133D+00 w(105) = 0.01363579321293772047D+00 w(106) = 0.01313076516693974630D+00 w(107) = 0.01261803597977743271D+00 w(108) = 0.01209748052807164113D+00 w(109) = 0.01156988348290849967D+00 w(110) = 0.01103504877427254184D+00 w(111) = 0.01049386202576892125D+00 w(112) = 0.00994602784923457905D+00 w(113) = 0.00939256583934814871D+00 w(114) = 0.00883303867470133581D+00 w(115) = 0.00826865154203087108D+00 w(116) = 0.00769875778896082811D+00 w(117) = 0.00712483332325489785D+00 w(118) = 0.00654590843862298928D+00 w(119) = 0.00596388034730799521D+00 w(120) = 0.00537724746840184621D+00 w(121) = 0.00478862143341336763D+00 w(122) = 0.00419553798718534675D+00 w(123) = 0.00360197835812614147D+00 w(124) = 0.00300345869904497128D+00 w(125) = 0.00240715327877140915D+00 w(126) = 0.00180308126695362360D+00 w(127) = 0.00120930061875273991D+00 w(128) = 0.00058807215382869754D+00 w(129) = 0.00006103888176768602D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'CLENSHAW_CURTIS_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are 1 to 17, 33, 65 or 129' stop end if return end subroutine fejer1_compute ( n, x, w ) !*****************************************************************************80 ! !! FEJER1_COMPUTE computes a Fejer type 1 quadrature rule. ! ! Discussion: ! ! This method uses a direct approach. The paper by Waldvogel ! exhibits a more efficient approach using Fourier transforms. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 October 2006 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Philip Davis, Philip Rabinowitz, ! Methods of Numerical Integration, ! Second Edition, ! Dover, 2007, ! ISBN: 0486453391, ! LC: QA299.3.D28. ! ! Walter Gautschi, ! Numerical Quadrature in the Presence of a Singularity, ! SIAM Journal on Numerical Analysis, ! Volume 4, Number 3, 1967, pages 357-362. ! ! Joerg Waldvogel, ! Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules, ! BIT Numerical Mathematics, ! Volume 43, Number 1, 2003, pages 1-18. ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. ! ! Output, real ( kind = 8 ) X(N), W(N), the abscissas and weights. ! implicit none integer ( kind = 4 ) n integer ( kind = 4 ) i integer ( kind = 4 ) j real ( kind = 8 ) :: pi = 3.141592653589793D+00 real ( kind = 8 ) theta(n) real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) if ( n < 1 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'FEJER1_COMPUTE - Fatal error!' write ( *, '(a)' ) ' N < 1.' stop end if if ( n == 1 ) then x(1) = 0.0D+00 w(1) = 2.0D+00 return end if do i = 1, n theta(i) = real ( 2 * ( n + 1 - i ) - 1, kind = 8 ) * pi & / real ( 2 * n, kind = 8 ) end do x(1:n) = cos ( theta(1:n) ) do i = 1, n w(i) = 1.0D+00 do j = 1, ( n / 2 ) w(i) = w(i) - 2.0D+00 & * cos ( 2.0D+00 * real ( j, kind = 8 ) * theta(i) ) & / real ( 4 * j * j - 1, kind = 8 ) end do end do w(1:n) = 2.0D+00 * w(1:n) / real ( n, kind = 8 ) return end subroutine fejer1_set ( order, xtab, weight ) !*****************************************************************************80 ! !! FEJER1_SET sets abscissas and weights for Fejer type 1 quadrature. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 03 March 2007 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Philip Davis, Philip Rabinowitz, ! Methods of Numerical Integration, ! Second Edition, ! Dover, 2007, ! ISBN: 0486453391, ! LC: QA299.3.D28. ! ! Walter Gautschi, ! Numerical Quadrature in the Presence of a Singularity, ! SIAM Journal on Numerical Analysis, ! Volume 4, Number 3, 1967, pages 357-362. ! ! Joerg Waldvogel, ! Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules, ! BIT Numerical Mathematics, ! Volume 43, Number 1, 2003, pages 1-18. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ORDER should be ! between 1 and 10. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) if ( order == 1 ) then xtab(1) = 0.000000000000000D+00 weight(1) = 2.000000000000000D+00 else if ( order == 2 ) then xtab(1) = -0.7071067811865475D+00 xtab(2) = 0.7071067811865475D+00 weight(1) = 1.000000000000000D+00 weight(2) = 1.000000000000000D+00 else if ( order == 3 ) then xtab( 1) = -0.8660254037844387D+00 xtab( 2) = 0.0000000000000000D+00 xtab( 3) = 0.8660254037844387D+00 weight(1) = 0.4444444444444444D+00 weight(2) = 1.1111111111111111D+00 weight(3) = 0.4444444444444444D+00 else if ( order == 4 ) then xtab( 1) = -0.9238795325112867D+00 xtab( 2) = -0.3826834323650897D+00 xtab( 3) = 0.3826834323650898D+00 xtab( 4) = 0.9238795325112867D+00 weight( 1) = 0.2642977396044841D+00 weight( 2) = 0.7357022603955158D+00 weight( 3) = 0.7357022603955158D+00 weight( 4) = 0.2642977396044841D+00 else if ( order == 5 ) then xtab( 1) = -0.9510565162951535D+00 xtab( 2) = -0.5877852522924730D+00 xtab( 3) = 0.0000000000000000D+00 xtab( 4) = 0.5877852522924731D+00 xtab( 5) = 0.9510565162951535D+00 weight( 1) = 0.1677812284666835D+00 weight( 2) = 0.5255521048666498D+00 weight( 3) = 0.6133333333333333D+00 weight( 4) = 0.5255521048666498D+00 weight( 5) = 0.1677812284666835D+00 else if ( order == 6 ) then xtab( 1) = -0.9659258262890682D+00 xtab( 2) = -0.7071067811865475D+00 xtab( 3) = -0.2588190451025206D+00 xtab( 4) = 0.2588190451025207D+00 xtab( 5) = 0.7071067811865476D+00 xtab( 6) = 0.9659258262890683D+00 weight( 1) = 0.1186610213812358D+00 weight( 2) = 0.3777777777777778D+00 weight( 3) = 0.5035612008409863D+00 weight( 4) = 0.5035612008409863D+00 weight( 5) = 0.3777777777777778D+00 weight( 6) = 0.1186610213812358D+00 else if ( order == 7 ) then xtab( 1) = -0.9749279121818237D+00 xtab( 2) = -0.7818314824680295D+00 xtab( 3) = -0.4338837391175581D+00 xtab( 4) = 0.0000000000000000D+00 xtab( 5) = 0.4338837391175582D+00 xtab( 6) = 0.7818314824680298D+00 xtab( 7) = 0.9749279121818236D+00 weight( 1) = 0.08671618072672234D+00 weight( 2) = 0.2878313947886919D+00 weight( 3) = 0.3982415401308441D+00 weight( 4) = 0.4544217687074830D+00 weight( 5) = 0.3982415401308441D+00 weight( 6) = 0.2878313947886919D+00 weight( 7) = 0.08671618072672234D+00 else if ( order == 8 ) then xtab( 1) = -0.9807852804032304D+00 xtab( 2) = -0.8314696123025453D+00 xtab( 3) = -0.5555702330196020D+00 xtab( 4) = -0.1950903220161282D+00 xtab( 5) = 0.1950903220161283D+00 xtab( 6) = 0.5555702330196023D+00 xtab( 7) = 0.8314696123025452D+00 xtab( 8) = 0.9807852804032304D+00 weight( 1) = 0.06698294569858981D+00 weight( 2) = 0.2229879330145788D+00 weight( 3) = 0.3241525190645244D+00 weight( 4) = 0.3858766022223071D+00 weight( 5) = 0.3858766022223071D+00 weight( 6) = 0.3241525190645244D+00 weight( 7) = 0.2229879330145788D+00 weight( 8) = 0.06698294569858981D+00 else if ( order == 9 ) then xtab( 1) = -0.9848077530122080D+00 xtab( 2) = -0.8660254037844385D+00 xtab( 3) = -0.6427876096865394D+00 xtab( 4) = -0.3420201433256685D+00 xtab( 5) = 0.0000000000000000D+00 xtab( 6) = 0.3420201433256688D+00 xtab( 7) = 0.6427876096865394D+00 xtab( 8) = 0.8660254037844387D+00 xtab( 9) = 0.9848077530122080D+00 weight( 1) = 0.05273664990990676D+00 weight( 2) = 0.1791887125220458D+00 weight( 3) = 0.2640372225410044D+00 weight( 4) = 0.3308451751681364D+00 weight( 5) = 0.3463844797178130D+00 weight( 6) = 0.3308451751681364D+00 weight( 7) = 0.2640372225410044D+00 weight( 8) = 0.1791887125220458D+00 weight( 9) = 0.05273664990990676D+00 else if ( order == 10 ) then xtab( 1) = -0.9876883405951377D+00 xtab( 2) = -0.8910065241883678D+00 xtab( 3) = -0.7071067811865475D+00 xtab( 4) = -0.4539904997395467D+00 xtab( 5) = -0.1564344650402306D+00 xtab( 6) = 0.1564344650402309D+00 xtab( 7) = 0.4539904997395468D+00 xtab( 8) = 0.7071067811865476D+00 xtab( 9) = 0.8910065241883679D+00 xtab(10) = 0.9876883405951378D+00 weight( 1) = 0.04293911957413078D+00 weight( 2) = 0.1458749193773909D+00 weight( 3) = 0.2203174603174603D+00 weight( 4) = 0.2808792186638755D+00 weight( 5) = 0.3099892820671425D+00 weight( 6) = 0.3099892820671425D+00 weight( 7) = 0.2808792186638755D+00 weight( 8) = 0.2203174603174603D+00 weight( 9) = 0.1458749193773909D+00 weight(10) = 0.04293911957413078D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'FEJER1_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are 1 through 10.' stop end if return end subroutine fejer2_compute ( n, x, w ) !*****************************************************************************80 ! !! FEJER2_COMPUTE computes a Fejer type 2 quadrature rule. ! ! Discussion: ! ! This method uses a direct approach. The paper by Waldvogel ! exhibits a more efficient approach using Fourier transforms. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 03 March 2007 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Philip Davis, Philip Rabinowitz, ! Methods of Numerical Integration, ! Second Edition, ! Dover, 2007, ! ISBN: 0486453391, ! LC: QA299.3.D28. ! ! Walter Gautschi, ! Numerical Quadrature in the Presence of a Singularity, ! SIAM Journal on Numerical Analysis, ! Volume 4, Number 3, 1967, pages 357-362. ! ! Joerg Waldvogel, ! Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules, ! BIT Numerical Mathematics, ! Volume 43, Number 1, 2003, pages 1-18. ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. ! ! Output, real ( kind = 8 ) X(N), W(N), the abscissas and weights. ! implicit none integer ( kind = 4 ) n integer ( kind = 4 ) i integer ( kind = 4 ) j real ( kind = 8 ) p real ( kind = 8 ) :: pi = 3.141592653589793D+00 real ( kind = 8 ) theta(n) real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) if ( n < 1 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'FEJER2_COMPUTE - Fatal error!' write ( *, '(a)' ) ' N < 1.' stop end if if ( n == 1 ) then x(1) = 0.0D+00 w(1) = 2.0D+00 return else if ( n == 2 ) then x(1) = -0.5D+00 x(2) = 0.5D+00 w(1:2) = 1.0D+00 return end if do i = 1, n theta(i) = real ( n + 1 - i, kind = 8 ) * pi & / real ( n + 1, kind = 8 ) end do x(1:n) = cos ( theta(1:n) ) do i = 1, n w(i) = 1.0D+00 do j = 1, ( ( n - 1 ) / 2 ) w(i) = w(i) - 2.0D+00 & * cos ( 2.0D+00 * real ( j, kind = 8 ) * theta(i) ) & / real ( 4 * j * j - 1, kind = 8 ) end do if ( 2 < n ) then p = 2.0D+00 * real ( ( ( n + 1 ) / 2 ), kind = 8 ) - 1.0D+00 w(i) = w(i) - cos ( ( p + 1.0D+00 ) * theta(i) ) / p end if end do w(1:n) = 2.0D+00 * w(1:n) / real ( n + 1, kind = 8 ) return end subroutine fejer2_set ( order, xtab, weight ) !*****************************************************************************80 ! !! FEJER2_SET sets abscissas and weights for Fejer type 2 quadrature. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 03 March 2007 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Philip Davis, Philip Rabinowitz, ! Methods of Numerical Integration, ! Second Edition, ! Dover, 2007, ! ISBN: 0486453391, ! LC: QA299.3.D28. ! ! Walter Gautschi, ! Numerical Quadrature in the Presence of a Singularity, ! SIAM Journal on Numerical Analysis, ! Volume 4, Number 3, 1967, pages 357-362. ! ! Joerg Waldvogel, ! Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules, ! BIT Numerical Mathematics, ! Volume 43, Number 1, 2003, pages 1-18. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ORDER should be ! between 1 and 10. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) if ( order == 1 ) then xtab(1) = 0.000000000000000D+00 weight(1) = 2.000000000000000D+00 else if ( order == 2 ) then xtab(1) = -0.5000000000000000D+00 xtab(2) = 0.5000000000000000D+00 weight(1) = 1.0000000000000000D+00 weight(2) = 1.0000000000000000D+00 else if ( order == 3 ) then xtab( 1) = -0.7071067811865476D+00 xtab( 2) = 0.0000000000000000D+00 xtab( 3) = 0.7071067811865476D+00 weight(1) = 0.6666666666666666D+00 weight(2) = 0.6666666666666666D+00 weight(3) = 0.6666666666666666D+00 else if ( order == 4 ) then xtab( 1) = -0.8090169943749475D+00 xtab( 2) = -0.3090169943749475D+00 xtab( 3) = 0.3090169943749475D+00 xtab( 4) = 0.8090169943749475D+00 weight( 1) = 0.4254644007500070D+00 weight( 2) = 0.5745355992499930D+00 weight( 3) = 0.5745355992499930D+00 weight( 4) = 0.4254644007500070D+00 else if ( order == 5 ) then xtab( 1) = -0.8660254037844387D+00 xtab( 2) = -0.5000000000000000D+00 xtab( 3) = 0.0000000000000000D+00 xtab( 4) = 0.5000000000000000D+00 xtab( 5) = 0.8660254037844387D+00 weight( 1) = 0.3111111111111111D+00 weight( 2) = 0.4000000000000000D+00 weight( 3) = 0.5777777777777777D+00 weight( 4) = 0.4000000000000000D+00 weight( 5) = 0.3111111111111111D+00 else if ( order == 6 ) then xtab( 1) = -0.9009688679024191D+00 xtab( 2) = -0.6234898018587336D+00 xtab( 3) = -0.2225209339563144D+00 xtab( 4) = 0.2225209339563144D+00 xtab( 5) = 0.6234898018587336D+00 xtab( 6) = 0.9009688679024191D+00 weight( 1) = 0.2269152467244296D+00 weight( 2) = 0.3267938603769863D+00 weight( 3) = 0.4462908928985841D+00 weight( 4) = 0.4462908928985841D+00 weight( 5) = 0.3267938603769863D+00 weight( 6) = 0.2269152467244296D+00 else if ( order == 7 ) then xtab( 1) = -0.9238795325112867D+00 xtab( 2) = -0.7071067811865476D+00 xtab( 3) = -0.3826834323650898D+00 xtab( 4) = 0.0000000000000000D+00 xtab( 5) = 0.3826834323650898D+00 xtab( 6) = 0.7071067811865476D+00 xtab( 7) = 0.9238795325112867D+00 weight( 1) = 0.1779646809620499D+00 weight( 2) = 0.2476190476190476D+00 weight( 3) = 0.3934638904665215D+00 weight( 4) = 0.3619047619047619D+00 weight( 5) = 0.3934638904665215D+00 weight( 6) = 0.2476190476190476D+00 weight( 7) = 0.1779646809620499D+00 else if ( order == 8 ) then xtab( 1) = -0.9396926207859084D+00 xtab( 2) = -0.7660444431189780D+00 xtab( 3) = -0.5000000000000000D+00 xtab( 4) = -0.1736481776669304D+00 xtab( 5) = 0.1736481776669304D+00 xtab( 6) = 0.5000000000000000D+00 xtab( 7) = 0.7660444431189780D+00 xtab( 8) = 0.9396926207859084D+00 weight( 1) = 0.1397697435050225D+00 weight( 2) = 0.2063696457302284D+00 weight( 3) = 0.3142857142857143D+00 weight( 4) = 0.3395748964790348D+00 weight( 5) = 0.3395748964790348D+00 weight( 6) = 0.3142857142857143D+00 weight( 7) = 0.2063696457302284D+00 weight( 8) = 0.1397697435050225D+00 else if ( order == 9 ) then xtab( 1) = -0.9510565162951535D+00 xtab( 2) = -0.8090169943749475D+00 xtab( 3) = -0.5877852522924731D+00 xtab( 4) = -0.3090169943749475D+00 xtab( 5) = 0.0000000000000000D+00 xtab( 6) = 0.3090169943749475D+00 xtab( 7) = 0.5877852522924731D+00 xtab( 8) = 0.8090169943749475D+00 xtab( 9) = 0.9510565162951535D+00 weight( 1) = 0.1147810750857217D+00 weight( 2) = 0.1654331942222276D+00 weight( 3) = 0.2737903534857068D+00 weight( 4) = 0.2790112502222170D+00 weight( 5) = 0.3339682539682539D+00 weight( 6) = 0.2790112502222170D+00 weight( 7) = 0.2737903534857068D+00 weight( 8) = 0.1654331942222276D+00 weight( 9) = 0.1147810750857217D+00 else if ( order == 10 ) then xtab( 1) = -0.9594929736144974D+00 xtab( 2) = -0.8412535328311812D+00 xtab( 3) = -0.6548607339452851D+00 xtab( 4) = -0.4154150130018864D+00 xtab( 5) = -0.1423148382732851D+00 xtab( 6) = 0.1423148382732851D+00 xtab( 7) = 0.4154150130018864D+00 xtab( 8) = 0.6548607339452851D+00 xtab( 9) = 0.8412535328311812D+00 xtab(10) = 0.9594929736144974D+00 weight( 1) = 0.09441954173982806D+00 weight( 2) = 0.1411354380109716D+00 weight( 3) = 0.2263866903636005D+00 weight( 4) = 0.2530509772156453D+00 weight( 5) = 0.2850073526699544D+00 weight( 6) = 0.2850073526699544D+00 weight( 7) = 0.2530509772156453D+00 weight( 8) = 0.2263866903636005D+00 weight( 9) = 0.1411354380109716D+00 weight(10) = 0.09441954173982806D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'FEJER2_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are 1 through 10.' stop end if return end subroutine gegenbauer_compute ( order, alpha, xtab, weight ) !*****************************************************************************80 ! !! GEGENBAUER_COMPUTE computes a Gauss-Gegenbauer quadrature rule. ! ! Discussion: ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) (1-X^2)^ALPHA * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Thanks to Janiki Raman for pointing out a problem in an earlier ! version of the code that occurred when ALPHA was -0.5. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 24 June 2008 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order of the quadrature rule. ! ! Input, real ( kind = 8 ) ALPHA, the exponent of (1-X^2) in the weight. ! -1.0 < ALPHA. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha real ( kind = 8 ) an real ( kind = 8 ) bn real ( kind = 8 ) c(order) real ( kind = 8 ) cc real ( kind = 8 ) delta real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p1 real ( kind = 8 ) r1 real ( kind = 8 ) r2 real ( kind = 8 ) r3 real ( kind = 8 ) r8_gamma real ( kind = 8 ) weight(order) real ( kind = 8 ) x real ( kind = 8 ) xtab(order) ! ! Check ORDER. ! if ( order < 1 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'GEGENBAUER_COMPUTE - Fatal error!' write ( *, '(a)' ) ' 1 <= ORDER is required.' stop end if ! ! Check ALPHA. ! if ( alpha <= -1.0D+00 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'GEGENBAUER_COMPUTE - Fatal error!' write ( *, '(a)' ) ' -1.0 < ALPHA is required.' stop end if ! ! Set the recursion coefficients. ! c(1) = 0.0D+00 if ( 2 <= order ) then c(2) = 1.0D+00 / ( 2.0D+00 * alpha + 3.0D+00 ) end if do i = 3, order c(i) = real ( i - 1, kind = 8 ) & * ( alpha + alpha + real ( i - 1, kind = 8 ) ) / & ( ( alpha + alpha + real ( 2 * i - 1, kind = 8 ) ) & * ( alpha + alpha + real ( 2 * i - 3, kind = 8 ) ) ) end do delta = r8_gamma ( alpha + 1.0D+00 ) & * r8_gamma ( alpha + 1.0D+00 ) & / r8_gamma ( alpha + alpha + 2.0D+00 ) cc = delta * 2.0D+00**( 2.0D+00 * alpha + 1.0D+00 ) * product ( c(2:order) ) do i = 1, order if ( i == 1 ) then an = alpha / real ( order, kind = 8 ) r1 = ( 1.0D+00 + alpha ) & * ( 2.78D+00 / ( 4.0D+00 + real ( order * order, kind = 8 ) ) & + 0.768D+00 * an / real ( order, kind = 8 ) ) r2 = 1.0D+00 + 2.44D+00 * an + 1.282D+00 * an * an x = ( r2 - r1 ) / r2 else if ( i == 2 ) then r1 = ( 4.1D+00 + alpha ) / & ( ( 1.0D+00 + alpha ) * ( 1.0D+00 + 0.156D+00 * alpha ) ) r2 = 1.0D+00 + 0.06D+00 * ( real ( order, kind = 8 ) - 8.0D+00 ) * & ( 1.0D+00 + 0.12D+00 * alpha ) / real ( order, kind = 8 ) r3 = 1.0D+00 + 0.012D+00 * alpha * & ( 1.0D+00 + 0.25D+00 * abs ( alpha ) ) / real ( order, kind = 8 ) x = x - r1 * r2 * r3 * ( 1.0D+00 - x ) else if ( i == 3 ) then r1 = ( 1.67D+00 + 0.28D+00 * alpha ) / ( 1.0D+00 + 0.37D+00 * alpha ) r2 = 1.0D+00 + 0.22D+00 * ( real ( order, kind = 8 ) - 8.0D+00 ) & / real ( order, kind = 8 ) r3 = 1.0D+00 + 8.0D+00 * alpha / & ( ( 6.28D+00 + alpha ) * real ( order * order, kind = 8 ) ) x = x - r1 * r2 * r3 * ( xtab(1) - x ) else if ( i < order - 1 ) then x = 3.0D+00 * xtab(i-1) - 3.0D+00 * xtab(i-2) + xtab(i-3) else if ( i == order - 1 ) then r1 = ( 1.0D+00 + 0.235D+00 * alpha ) / ( 0.766D+00 + 0.119D+00 * alpha ) r2 = 1.0D+00 / ( 1.0D+00 + 0.639D+00 & * ( real ( order, kind = 8 ) - 4.0D+00 ) & / ( 1.0D+00 + 0.71D+00 * ( real ( order, kind = 8 ) - 4.0D+00 ) ) ) r3 = 1.0D+00 / ( 1.0D+00 + 20.0D+00 * alpha / ( ( 7.5D+00 + alpha ) * & real ( order**2, kind = 8 ) ) ) x = x + r1 * r2 * r3 * ( x - xtab(i-2) ) else if ( i == order ) then r1 = ( 1.0D+00 + 0.37D+00 * alpha ) / ( 1.67D+00 + 0.28D+00 * alpha ) r2 = 1.0D+00 / & ( 1.0D+00 + 0.22D+00 * ( real ( order, kind = 8 ) - 8.0D+00 ) & / real ( order, kind = 8 ) ) r3 = 1.0D+00 / ( 1.0D+00 + 8.0D+00 * alpha / & ( ( 6.28D+00 + alpha ) * real ( order * order, kind = 8 ) ) ) x = x + r1 * r2 * r3 * ( x - xtab(i-2) ) end if call gegenbauer_root ( x, order, alpha, dp2, p1, c ) xtab(i) = x weight(i) = cc / ( dp2 * p1 ) end do ! ! Reverse the order of the data. ! xtab(1:order) = xtab(order:1:-1) weight(1:order) = weight(order:1:-1) return end subroutine gegenbauer_integral ( expon, alpha, value ) !*****************************************************************************80 ! !! GEGENBAUER_INTEGRAL: integral of a monomial with Gegenbauer weight. ! ! Discussion: ! ! VALUE = Integral ( -1 <= X <= +1 ) x^EXPON (1-x^2)^ALPHA dx ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 25 February 2008 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) EXPON, the exponent. ! ! Input, real ( kind = 8 ) ALPHA, the exponent of (1-X^2) in the weight. ! -1.0 < ALPHA. ! ! Output, real ( kind = 8 ) VALUE, the value of the integral. ! implicit none real ( kind = 8 ) alpha real ( kind = 8 ) arg1 real ( kind = 8 ) arg2 real ( kind = 8 ) arg3 real ( kind = 8 ) arg4 real ( kind = 8 ) c integer ( kind = 4 ) expon real ( kind = 8 ) r8_gamma real ( kind = 8 ) value real ( kind = 8 ) value1 if ( mod ( expon, 2 ) == 1 ) then value = 0.0D+00 return end if c = real ( expon, kind = 8 ) arg1 = - alpha arg2 = 1.0D+00 + c arg3 = 2.0D+00 + alpha + c arg4 = - 1.0D+00 call r8_hyper_2f1 ( arg1, arg2, arg3, arg4, value1 ) value = 2.0D+00 * r8_gamma ( 1.0D+00 + c ) * r8_gamma ( 1.0D+00 + alpha ) & * value1 / r8_gamma ( 2.0D+00 + alpha + c ) return end subroutine gegenbauer_recur ( p2, dp2, p1, x, order, alpha, c ) !*****************************************************************************80 ! !! GEGENBAUER_RECUR finds the value and derivative of a Gegenbauer polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 23 February 2008 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Output, real ( kind = 8 ) P2, the value of J(ORDER)(X). ! ! Output, real ( kind = 8 ) DP2, the value of J'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of J(ORDER-1)(X). ! ! Input, real ( kind = 8 ) X, the point at which polynomials are evaluated. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Input, real ( kind = 8 ) ALPHA, the exponent of (1-X^2) in the weight. ! -1.0 < ALPHA. ! ! Input, real ( kind = 8 ) C(ORDER), the recursion coefficients. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha real ( kind = 8 ) c(order) real ( kind = 8 ) dp0 real ( kind = 8 ) dp1 real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p0 real ( kind = 8 ) p1 real ( kind = 8 ) p2 real ( kind = 8 ) x p1 = 1.0D+00 dp1 = 0.0D+00 p2 = x dp2 = 1.0D+00 do i = 2, order p0 = p1 dp0 = dp1 p1 = p2 dp1 = dp2 p2 = x * p1 - c(i) * p0 dp2 = x * dp1 + p1 - c(i) * dp0 end do return end subroutine gegenbauer_root ( x, order, alpha, dp2, p1, c ) !*****************************************************************************80 ! !! GEGENBAUER_ROOT improves an approximate root of a Gegenbauer polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 23 February 2008 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input/output, real ( kind = 8 ) X, the approximate root, which ! should be improved on output. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Input, real ( kind = 8 ) ALPHA, the exponent of (1-X^2) in the weight. ! -1.0 < ALPHA. ! ! Output, real ( kind = 8 ) DP2, the value of J'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of J(ORDER-1)(X). ! ! Input, real ( kind = 8 ) C(ORDER), the recursion coefficients. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha real ( kind = 8 ) c(order) real ( kind = 8 ) d real ( kind = 8 ) dp2 real ( kind = 8 ) eps real ( kind = 8 ) p1 real ( kind = 8 ) p2 integer ( kind = 4 ) step integer ( kind = 4 ), parameter :: step_max = 10 real ( kind = 8 ) x eps = epsilon ( eps ) do step = 1, step_max call gegenbauer_recur ( p2, dp2, p1, x, order, alpha, c ) d = p2 / dp2 x = x - d if ( abs ( d ) <= eps * ( abs ( x ) + 1.0D+00 ) ) then return end if end do return end subroutine gen_hermite_compute ( order, alpha, x, w ) !*****************************************************************************80 ! !! GEN_HERMITE_COMPUTE computes a generalized Gauss-Hermite rule. ! ! Discussion: ! ! The integral to be approximated has the form: ! ! Integral ( -oo < x < +oo ) x^ALPHA exp(-x^2) f(x) dx ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 02 March 2008 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Philip Davis, Philip Rabinowitz, ! Methods of Numerical Integration, ! Second Edition, ! Dover, 2007, ! ISBN: 0486453391, ! LC: QA299.3.D28. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ! Input, real ( kind = 8 ) ALPHA, the parameter. ! ! Output, real ( kind = 8 ) X(ORDER), W(ORDER), the abscissas and weights ! for the requested generalized Gauss-Hermite rule. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha real ( kind = 8 ) alpha_laguerre real ( kind = 8 ) arg integer ( kind = 4 ) order_laguerre real ( kind = 8 ) r8_gamma real ( kind = 8 ) w(order) real ( kind = 8 ), allocatable, dimension ( : ) :: w_laguerre real ( kind = 8 ) x(order) real ( kind = 8 ), allocatable, dimension ( : ) :: x_laguerre ! ! Generate the related generalized Laguerre rule. ! if ( order == 1 ) then arg = ( alpha + 1.0D+00 ) / 2.0D+00 x(1) = 0.0D+00 w(1) = r8_gamma ( arg ) return end if if ( mod ( order, 2 ) == 0 ) then order_laguerre = order / 2 alpha_laguerre = ( alpha - 1.0D+00 ) / 2.0D+00 else if ( mod ( order, 2 ) == 1 ) then order_laguerre = ( order - 1 ) / 2 alpha_laguerre = ( alpha + 1.0D+00 ) / 2.0D+00 end if allocate ( w_laguerre(order_laguerre) ) allocate ( x_laguerre(order_laguerre) ) call gen_laguerre_compute ( order_laguerre, alpha_laguerre, x_laguerre, & w_laguerre ) if ( mod ( order, 2 ) == 0 ) then x(1:order_laguerre) = - sqrt ( x_laguerre(order_laguerre:1:-1) ) x(order_laguerre+1:order_laguerre+order_laguerre) & = sqrt ( x_laguerre(1:order_laguerre) ) w(1:order_laguerre) = 0.5D+00 * w_laguerre(order_laguerre:1:-1) w(order_laguerre+1:order_laguerre+order_laguerre) & = 0.5D+00 * w_laguerre(1:order_laguerre) else if ( mod ( order, 2 ) == 1 ) then x(1:order_laguerre) = - sqrt ( x_laguerre(order_laguerre:1:-1) ) x(order_laguerre+1) = 0.0D+00 x(order_laguerre+2:order_laguerre+order_laguerre+1) & = sqrt ( x_laguerre(1:order_laguerre) ) w(1:order_laguerre) = 0.5D+00 * w_laguerre(order_laguerre:1:-1) & / x_laguerre(order_laguerre:1:-1) arg = ( alpha + 1.0D+00 ) / 2.0D+00 w(order_laguerre+1) & = r8_gamma ( arg ) & - sum ( w_laguerre(1:order_laguerre) / x_laguerre(1:order_laguerre) ) w(order_laguerre+2:order_laguerre+order_laguerre+1) & = 0.5D+00 * w_laguerre(1:order_laguerre) & / x_laguerre(1:order_laguerre) end if deallocate ( w_laguerre ) deallocate ( x_laguerre ) return end subroutine gen_hermite_integral ( expon, alpha, value ) !*****************************************************************************80 ! !! GEN_HERMITE_INTEGRAL evaluates a monomial generalized Hermite integral. ! ! Discussion: ! ! H(n,alpha) = Integral ( -oo < x < +oo ) x^n |x|^alpha exp(-x^2) dx ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 February 2008 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) EXPON, the exponent of the monomial. ! 0 <= EXPON. ! ! Input, real ( kind = 8 ) ALPHA, the exponent of |X| in the ! weight function. -1.0 < ALPHA. ! ! Output, real ( kind = 8 ) VALUE, the value of the integral. ! implicit none real ( kind = 8 ) a real ( kind = 8 ) alpha integer ( kind = 4 ) expon real ( kind = 8 ) r8_gamma real ( kind = 8 ) value if ( mod ( expon, 2 ) == 1 ) then value = 0.0D+00 else a = alpha + real ( expon, kind = 8 ) if ( a <= -1.0D+00 ) then value = - huge ( value ) else value = r8_gamma ( ( a + 1.0D+00 ) / 2.0D+00 ) end if end if return end subroutine gen_laguerre_compute ( order, alpha, xtab, weight ) !*****************************************************************************80 ! !! GEN_LAGUERRE_COMPUTE computes a generalized Gauss-Laguerre quadrature rule. ! ! Discussion: ! ! The integration interval is [ 0, +oo ). ! ! The weight function is w(x) = exp ( -x ) * x**alpha. ! ! ! If the integral to approximate is: ! ! Integral ( 0 <= X < +oo ) EXP ( - X ) * X**ALPHA * F(X) dX ! ! then the quadrature rule is: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! ! If the integral to approximate is: ! ! Integral ( 0 <= X < +oo ) X**ALPHA * F(X) dX ! ! then the quadrature rule is: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * EXP(XTAB(I)) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 20 February 2008 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order of the quadrature rule ! to be computed. ORDER must be at least 1. ! ! Input, real ( kind = 8 ) ALPHA, the exponent of the X factor. ! ALPHA must be nonnegative. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha real ( kind = 8 ) b(order) real ( kind = 8 ) c(order) real ( kind = 8 ) cc real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p1 real ( kind = 8 ) r1 real ( kind = 8 ) r2 real ( kind = 8 ) r8_gamma real ( kind = 8 ) ratio real ( kind = 8 ) weight(order) real ( kind = 8 ) x real ( kind = 8 ) xtab(order) ! ! Set the recursion coefficients. ! do i = 1, order b(i) = ( alpha + real ( 2 * i - 1, kind = 8 ) ) end do do i = 1, order c(i) = real ( i - 1, kind = 8 ) * ( alpha + real ( i - 1, kind = 8 ) ) end do cc = r8_gamma ( alpha + 1.0D+00 ) * product ( c(2:order) ) do i = 1, order ! ! Compute an estimate for the root. ! if ( i == 1 ) then x = ( 1.0D+00 + alpha ) * ( 3.0D+00 + 0.92 * alpha ) / & ( 1.0D+00 + 2.4D+00 * real ( order, kind = 8 ) + 1.8D+00 * alpha ) else if ( i == 2 ) then x = x + ( 15.0D+00 + 6.25D+00 * alpha ) / & ( 1.0D+00 + 0.9D+00 * alpha + 2.5D+00 * real ( order, kind = 8 ) ) else r1 = ( 1.0D+00 + 2.55D+00 * real ( i - 2, kind = 8 ) ) & / ( 1.9D+00 * real ( i - 2, kind = 8 ) ) r2 = 1.26D+00 * real ( i - 2, kind = 8 ) * alpha / & ( 1.0D+00 + 3.5D+00 * real ( i - 2, kind = 8 ) ) ratio = ( r1 + r2 ) / ( 1.0D+00 + 0.3D+00 * alpha ) x = x + ratio * ( x - xtab(i-2) ) end if ! ! Use iteration to find the root. ! call gen_laguerre_root ( x, order, alpha, dp2, p1, b, c ) ! ! Set the abscissa and weight. ! xtab(i) = x weight(i) = ( cc / dp2 ) / p1 end do return end subroutine gen_laguerre_integral ( expon, alpha, exact ) !*****************************************************************************80 ! !! GEN_LAGUERRE_INTEGRAL evaluates a monomial genearlized Laguerre integral. ! ! Discussion: ! ! The integral being computed is ! ! integral ( 0 <= x < +oo ) x^n * x^alpha * exp ( -x ) dx ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 20 February 2008 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) EXPON, the exponent. ! 0 <= EXPON. ! ! Input, real ( kind = 8 ) ALPHA, the exponent of X in the weight function. ! ! Output, real ( kind = 8 ) EXACT, the value of the integral. ! implicit none real ( kind = 8 ) alpha real ( kind = 8 ) arg real ( kind = 8 ) exact integer ( kind = 4 ) expon real ( kind = 8 ) r8_gamma arg = alpha + real ( expon + 1, kind = 8 ) exact = r8_gamma ( arg ) return end subroutine gen_laguerre_recur ( p2, dp2, p1, x, order, alpha, b, c ) !*****************************************************************************80 ! !! GEN_LAGUERRE_RECUR evaluates a generalized Laguerre polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 September 1998 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Output, real ( kind = 8 ) P2, the value of L(ORDER)(X). ! ! Output, real ( kind = 8 ) DP2, the value of L'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of L(ORDER-1)(X). ! ! Input, real ( kind = 8 ) X, the point at which polynomials are evaluated. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Input, real ( kind = 8 ) ALPHA, the exponent of the X factor in the ! integrand. ! ! Input, real ( kind = 8 ) B(ORDER), C(ORDER), the recursion ! coefficients. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha real ( kind = 8 ) b(order) real ( kind = 8 ) c(order) real ( kind = 8 ) dp0 real ( kind = 8 ) dp1 real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p0 real ( kind = 8 ) p1 real ( kind = 8 ) p2 real ( kind = 8 ) x p1 = 1.0D+00 dp1 = 0.0D+00 p2 = x - alpha - 1.0D+00 dp2 = 1.0D+00 do i = 2, order p0 = p1 dp0 = dp1 p1 = p2 dp1 = dp2 p2 = ( x - b(i) ) * p1 - c(i) * p0 dp2 = ( x - b(i) ) * dp1 + p1 - c(i) * dp0 end do return end subroutine gen_laguerre_root ( x, order, alpha, dp2, p1, b, c ) !*****************************************************************************80 ! !! GEN_LAGUERRE_ROOT seeks roots of a generalized Laguerre polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 20 February 2008 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input/output, real ( kind = 8 ) X, the approximate root, which ! should be improved on output. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Input, real ( kind = 8 ) ALPHA, the exponent of the X factor. ! ! Output, real ( kind = 8 ) DP2, the value of L'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of L(ORDER-1)(X). ! ! Input, real ( kind = 8 ) B(ORDER), C(ORDER), the recursion coefficients. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha real ( kind = 8 ) b(order) real ( kind = 8 ) c(order) real ( kind = 8 ) d real ( kind = 8 ) dp2 real ( kind = 8 ) eps real ( kind = 8 ) p1 real ( kind = 8 ) p2 integer ( kind = 4 ) step integer ( kind = 4 ), parameter :: step_max = 10 real ( kind = 8 ) x eps = epsilon ( eps ) do step = 1, step_max call gen_laguerre_recur ( p2, dp2, p1, x, order, alpha, b, c ) d = p2 / dp2 x = x - d if ( abs ( d ) <= eps * ( abs ( x ) + 1.0D+00 ) ) then return end if end do return end subroutine hermite_compute ( order, xtab, weight ) !*****************************************************************************80 ! !! HERMITE_COMPUTE computes a Gauss-Hermite quadrature rule. ! ! Discussion: ! ! The abscissas are the zeros of the N-th order Hermite polynomial. ! ! The integration interval is ( -oo, +oo ). ! ! The weight function is w(x) = exp ( - x*x ). ! ! The integral to approximate: ! ! Integral ( -oo < X < +oo ) exp ( - X*X ) * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 14 May 2008 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order of the formula ! to be computed. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) cc real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p1 real ( kind = 8 ), parameter :: pi = 3.141592653589793D+00 real ( kind = 8 ) r8_gamma real ( kind = 8 ) s real ( kind = 8 ) temp real ( kind = 8 ) weight(order) real ( kind = 8 ) x real ( kind = 8 ) xtab(order) cc = sqrt ( pi ) * r8_gamma ( real ( order, kind = 8 ) ) & / ( 2.0D+00**( order - 1 ) ) s = ( 2.0D+00 * real ( order, kind = 8 ) + 1.0D+00 )**( 1.0D+00 / 6.0D+00 ) do i = 1, ( order + 1 ) / 2 if ( i == 1 ) then x = s * s * s - 1.85575D+00 / s else if ( i == 2 ) then x = x - 1.14D+00 * ( ( real ( order, kind = 8 ) )**0.426D+00 ) / x else if ( i == 3 ) then x = 1.86D+00 * x - 0.86D+00 * xtab(1) else if ( i == 4 ) then x = 1.91D+00 * x - 0.91D+00 * xtab(2) else x = 2.0D+00 * x - xtab(i-2) end if call hermite_root ( x, order, dp2, p1 ) xtab(i) = x weight(i) = ( cc / dp2 ) / p1 xtab(order-i+1) = - x weight(order-i+1) = weight(i) end do ! ! Reverse the order of the abscissas. ! Because of symmetry, the weights are unchanged, ! and the abscissas simply change sign. ! xtab(1:order) = - xtab(1:order) return end subroutine hermite_integral ( n, value ) !*****************************************************************************80 ! !! HERMITE_INTEGRAL evaluates a monomial Hermite integral. ! ! Discussion: ! ! H(n) = Integral ( -oo < x < +oo ) x^n exp(-x^2) dx ! ! H(n) is 0 for n odd. ! ! H(n) = (n-1)!! * sqrt(pi) / 2^(n/2) for n even. ! ! Note that it is difficult to correctly evaluate the double factorial ! quantity. It "blows up", though somewhat less rapidly than the ! standard factorial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 February 2008 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order of the integral. ! 0 <= N. ! ! Output, real ( kind = 8 ) VALUE, the value of the integral. ! implicit none integer ( kind = 4 ), parameter :: i4_1 = 1 integer ( kind = 4 ), parameter :: i4_2 = 2 integer ( kind = 4 ) n real ( kind = 8 ), parameter :: pi = 3.141592653589793D+00 real ( kind = 8 ) r8_factorial2 real ( kind = 8 ) value if ( n < 0 ) then value = - huge ( value ) else if ( mod ( n, i4_2 ) == 1 ) then value = 0.0D+00 else value = r8_factorial2 ( n - i4_1 ) * sqrt ( pi ) / 2.0D+00**( n / 2 ) end if return end subroutine hermite_recur ( p2, dp2, p1, x, order ) !*****************************************************************************80 ! !! HERMITE_RECUR finds the value and derivative of a Hermite polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 September 1998 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Output, real ( kind = 8 ) P2, the value of H(ORDER)(X). ! ! Output, real ( kind = 8 ) DP2, the value of H'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of H(ORDER-1)(X). ! ! Input, real ( kind = 8 ) X, the point at which polynomials are evaluated. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! implicit none integer ( kind = 4 ) i real ( kind = 8 ) dp0 real ( kind = 8 ) dp1 real ( kind = 8 ) dp2 integer ( kind = 4 ) order real ( kind = 8 ) p0 real ( kind = 8 ) p1 real ( kind = 8 ) p2 real ( kind = 8 ) x p1 = 1.0D+00 dp1 = 0.0D+00 p2 = x dp2 = 1.0D+00 do i = 2, order p0 = p1 dp0 = dp1 p1 = p2 dp1 = dp2 p2 = x * p1 - 0.5D+00 * ( real ( i, kind = 8 ) - 1.0D+00 ) * p0 dp2 = x * dp1 + p1 - 0.5D+00 * ( real ( i, kind = 8 ) - 1.0D+00 ) * dp0 end do return end subroutine hermite_root ( x, order, dp2, p1 ) !*****************************************************************************80 ! !! HERMITE_ROOT improves an approximate root of a Hermite polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 September 1998 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input/output, real ( kind = 8 ) X, the approximate root, which ! should be improved on output. ! ! Input, integer ( kind = 4 ) ORDER, the order of the Hermite polynomial. ! ! Output, real ( kind = 8 ) DP2, the value of H'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of H(ORDER-1)(X). ! implicit none real ( kind = 8 ) d real ( kind = 8 ) dp2 real ( kind = 8 ) eps integer ( kind = 4 ) order real ( kind = 8 ) p1 real ( kind = 8 ) p2 integer ( kind = 4 ) step integer ( kind = 4 ), parameter :: step_max = 10 real ( kind = 8 ) x eps = epsilon ( eps ) do step = 1, step_max call hermite_recur ( p2, dp2, p1, x, order ) d = p2 / dp2 x = x - d if ( abs ( d ) <= eps * ( abs ( x ) + 1.0D+00 ) ) then return end if end do return end subroutine hermite_set ( order, xtab, weight ) !*****************************************************************************80 ! !! HERMITE_SET sets abscissas and weights for Hermite quadrature. ! ! Discussion: ! ! The integration interval is ( -oo, +oo ). ! ! The weight function is w(x) = exp ( - x**2 ). ! ! The integral to approximate: ! ! Integral ( -oo < X < +oo ) exp ( - X**2 ) * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ). ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 27 July 2007 ! ! 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, ! LC: QA311.K713. ! ! 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, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1 and 20, or one of the values ! 30, 31, 32, 40, 50, 60, 63, 64 or 127. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas, ! which are symmetrically placed around 0. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! The weights are positive and symmetric, and should sum ! to SQRT(PI). ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order == 1 ) then xtab(1) = 0.0D+00 weight(1) = 1.77245385090551602729816748334D+00 else if ( order == 2 ) then xtab(1) = - 0.707106781186547524400844362105D+00 xtab(2) = 0.707106781186547524400844362105D+00 weight(1) = 0.886226925452758013649083741671D+00 weight(2) = 0.886226925452758013649083741671D+00 else if ( order == 3 ) then xtab(1) = - 0.122474487139158904909864203735D+01 xtab(2) = 0.0D+00 xtab(3) = 0.122474487139158904909864203735D+01 weight(1) = 0.295408975150919337883027913890D+00 weight(2) = 0.118163590060367735153211165556D+01 weight(3) = 0.295408975150919337883027913890D+00 else if ( order == 4 ) then xtab(1) = - 0.165068012388578455588334111112D+01 xtab(2) = - 0.524647623275290317884060253835D+00 xtab(3) = 0.524647623275290317884060253835D+00 xtab(4) = 0.165068012388578455588334111112D+01 weight(1) = 0.813128354472451771430345571899D-01 weight(2) = 0.804914090005512836506049184481D+00 weight(3) = 0.804914090005512836506049184481D+00 weight(4) = 0.813128354472451771430345571899D-01 else if ( order == 5 ) then xtab(1) = - 0.202018287045608563292872408814D+01 xtab(2) = - 0.958572464613818507112770593893D+00 xtab(3) = 0.0D+00 xtab(4) = 0.958572464613818507112770593893D+00 xtab(5) = 0.202018287045608563292872408814D+01 weight(1) = 0.199532420590459132077434585942D-01 weight(2) = 0.393619323152241159828495620852D+00 weight(3) = 0.945308720482941881225689324449D+00 weight(4) = 0.393619323152241159828495620852D+00 weight(5) = 0.199532420590459132077434585942D-01 else if ( order == 6 ) then xtab(1) = - 0.235060497367449222283392198706D+01 xtab(2) = - 0.133584907401369694971489528297D+01 xtab(3) = - 0.436077411927616508679215948251D+00 xtab(4) = 0.436077411927616508679215948251D+00 xtab(5) = 0.133584907401369694971489528297D+01 xtab(6) = 0.235060497367449222283392198706D+01 weight(1) = 0.453000990550884564085747256463D-02 weight(2) = 0.157067320322856643916311563508D+00 weight(3) = 0.724629595224392524091914705598D+00 weight(4) = 0.724629595224392524091914705598D+00 weight(5) = 0.157067320322856643916311563508D+00 weight(6) = 0.453000990550884564085747256463D-02 else if ( order == 7 ) then xtab(1) = - 0.265196135683523349244708200652D+01 xtab(2) = - 0.167355162876747144503180139830D+01 xtab(3) = - 0.816287882858964663038710959027D+00 xtab(4) = 0.0D+00 xtab(5) = 0.816287882858964663038710959027D+00 xtab(6) = 0.167355162876747144503180139830D+01 xtab(7) = 0.265196135683523349244708200652D+01 weight(1) = 0.971781245099519154149424255939D-03 weight(2) = 0.545155828191270305921785688417D-01 weight(3) = 0.425607252610127800520317466666D+00 weight(4) = 0.810264617556807326764876563813D+00 weight(5) = 0.425607252610127800520317466666D+00 weight(6) = 0.545155828191270305921785688417D-01 weight(7) = 0.971781245099519154149424255939D-03 else if ( order == 8 ) then xtab(1) = - 0.293063742025724401922350270524D+01 xtab(2) = - 0.198165675669584292585463063977D+01 xtab(3) = - 0.115719371244678019472076577906D+01 xtab(4) = - 0.381186990207322116854718885584D+00 xtab(5) = 0.381186990207322116854718885584D+00 xtab(6) = 0.115719371244678019472076577906D+01 xtab(7) = 0.198165675669584292585463063977D+01 xtab(8) = 0.293063742025724401922350270524D+01 weight(1) = 0.199604072211367619206090452544D-03 weight(2) = 0.170779830074134754562030564364D-01 weight(3) = 0.207802325814891879543258620286D+00 weight(4) = 0.661147012558241291030415974496D+00 weight(5) = 0.661147012558241291030415974496D+00 weight(6) = 0.207802325814891879543258620286D+00 weight(7) = 0.170779830074134754562030564364D-01 weight(8) = 0.199604072211367619206090452544D-03 else if ( order == 9 ) then xtab(1) = - 0.319099320178152760723004779538D+01 xtab(2) = - 0.226658058453184311180209693284D+01 xtab(3) = - 0.146855328921666793166701573925D+01 xtab(4) = - 0.723551018752837573322639864579D+00 xtab(5) = 0.0D+00 xtab(6) = 0.723551018752837573322639864579D+00 xtab(7) = 0.146855328921666793166701573925D+01 xtab(8) = 0.226658058453184311180209693284D+01 xtab(9) = 0.319099320178152760723004779538D+01 weight(1) = 0.396069772632643819045862946425D-04 weight(2) = 0.494362427553694721722456597763D-02 weight(3) = 0.884745273943765732879751147476D-01 weight(4) = 0.432651559002555750199812112956D+00 weight(5) = 0.720235215606050957124334723389D+00 weight(6) = 0.432651559002555750199812112956D+00 weight(7) = 0.884745273943765732879751147476D-01 weight(8) = 0.494362427553694721722456597763D-02 weight(9) = 0.396069772632643819045862946425D-04 else if ( order == 10 ) then xtab(1) = - 0.343615911883773760332672549432D+01 xtab(2) = - 0.253273167423278979640896079775D+01 xtab(3) = - 0.175668364929988177345140122011D+01 xtab(4) = - 0.103661082978951365417749191676D+01 xtab(5) = - 0.342901327223704608789165025557D+00 xtab(6) = 0.342901327223704608789165025557D+00 xtab(7) = 0.103661082978951365417749191676D+01 xtab(8) = 0.175668364929988177345140122011D+01 xtab(9) = 0.253273167423278979640896079775D+01 xtab(10) = 0.343615911883773760332672549432D+01 weight(1) = 0.764043285523262062915936785960D-05 weight(2) = 0.134364574678123269220156558585D-02 weight(3) = 0.338743944554810631361647312776D-01 weight(4) = 0.240138611082314686416523295006D+00 weight(5) = 0.610862633735325798783564990433D+00 weight(6) = 0.610862633735325798783564990433D+00 weight(7) = 0.240138611082314686416523295006D+00 weight(8) = 0.338743944554810631361647312776D-01 weight(9) = 0.134364574678123269220156558585D-02 weight(10) = 0.764043285523262062915936785960D-05 else if ( order == 11 ) then xtab(1) = - 0.366847084655958251845837146485D+01 xtab(2) = - 0.278329009978165177083671870152D+01 xtab(3) = - 0.202594801582575533516591283121D+01 xtab(4) = - 0.132655708449493285594973473558D+01 xtab(5) = - 0.656809566882099765024611575383D+00 xtab(6) = 0.0D+00 xtab(7) = 0.656809566882099765024611575383D+00 xtab(8) = 0.132655708449493285594973473558D+01 xtab(9) = 0.202594801582575533516591283121D+01 xtab(10) = 0.278329009978165177083671870152D+01 xtab(11) = 0.366847084655958251845837146485D+01 weight(1) = 0.143956039371425822033088366032D-05 weight(2) = 0.346819466323345510643413772940D-03 weight(3) = 0.119113954449115324503874202916D-01 weight(4) = 0.117227875167708503381788649308D+00 weight(5) = 0.429359752356125028446073598601D+00 weight(6) = 0.654759286914591779203940657627D+00 weight(7) = 0.429359752356125028446073598601D+00 weight(8) = 0.117227875167708503381788649308D+00 weight(9) = 0.119113954449115324503874202916D-01 weight(10) = 0.346819466323345510643413772940D-03 weight(11) = 0.143956039371425822033088366032D-05 else if ( order == 12 ) then xtab(1) = - 0.388972489786978191927164274724D+01 xtab(2) = - 0.302063702512088977171067937518D+01 xtab(3) = - 0.227950708050105990018772856942D+01 xtab(4) = - 0.159768263515260479670966277090D+01 xtab(5) = - 0.947788391240163743704578131060D+00 xtab(6) = - 0.314240376254359111276611634095D+00 xtab(7) = 0.314240376254359111276611634095D+00 xtab(8) = 0.947788391240163743704578131060D+00 xtab(9) = 0.159768263515260479670966277090D+01 xtab(10) = 0.227950708050105990018772856942D+01 xtab(11) = 0.302063702512088977171067937518D+01 xtab(12) = 0.388972489786978191927164274724D+01 weight(1) = 0.265855168435630160602311400877D-06 weight(2) = 0.857368704358785865456906323153D-04 weight(3) = 0.390539058462906185999438432620D-02 weight(4) = 0.516079856158839299918734423606D-01 weight(5) = 0.260492310264161129233396139765D+00 weight(6) = 0.570135236262479578347113482275D+00 weight(7) = 0.570135236262479578347113482275D+00 weight(8) = 0.260492310264161129233396139765D+00 weight(9) = 0.516079856158839299918734423606D-01 weight(10) = 0.390539058462906185999438432620D-02 weight(11) = 0.857368704358785865456906323153D-04 weight(12) = 0.265855168435630160602311400877D-06 else if ( order == 13 ) then xtab(1) = - 0.410133759617863964117891508007D+01 xtab(2) = - 0.324660897837240998812205115236D+01 xtab(3) = - 0.251973568567823788343040913628D+01 xtab(4) = - 0.185310765160151214200350644316D+01 xtab(5) = - 0.122005503659074842622205526637D+01 xtab(6) = - 0.605763879171060113080537108602D+00 xtab(7) = 0.0D+00 xtab(8) = 0.605763879171060113080537108602D+00 xtab(9) = 0.122005503659074842622205526637D+01 xtab(10) = 0.185310765160151214200350644316D+01 xtab(11) = 0.251973568567823788343040913628D+01 xtab(12) = 0.324660897837240998812205115236D+01 xtab(13) = 0.410133759617863964117891508007D+01 weight(1) = 0.482573185007313108834997332342D-07 weight(2) = 0.204303604027070731248669432937D-04 weight(3) = 0.120745999271938594730924899224D-02 weight(4) = 0.208627752961699392166033805050D-01 weight(5) = 0.140323320687023437762792268873D+00 weight(6) = 0.421616296898543221746893558568D+00 weight(7) = 0.604393187921161642342099068579D+00 weight(8) = 0.421616296898543221746893558568D+00 weight(9) = 0.140323320687023437762792268873D+00 weight(10) = 0.208627752961699392166033805050D-01 weight(11) = 0.120745999271938594730924899224D-02 weight(12) = 0.204303604027070731248669432937D-04 weight(13) = 0.482573185007313108834997332342D-07 else if ( order == 14 ) then xtab(1) = - 0.430444857047363181262129810037D+01 xtab(2) = - 0.346265693360227055020891736115D+01 xtab(3) = - 0.274847072498540256862499852415D+01 xtab(4) = - 0.209518325850771681573497272630D+01 xtab(5) = - 0.147668273114114087058350654421D+01 xtab(6) = - 0.878713787329399416114679311861D+00 xtab(7) = - 0.291745510672562078446113075799D+00 xtab(8) = 0.291745510672562078446113075799D+00 xtab(9) = 0.878713787329399416114679311861D+00 xtab(10) = 0.147668273114114087058350654421D+01 xtab(11) = 0.209518325850771681573497272630D+01 xtab(12) = 0.274847072498540256862499852415D+01 xtab(13) = 0.346265693360227055020891736115D+01 xtab(14) = 0.430444857047363181262129810037D+01 weight(1) = 0.862859116812515794532041783429D-08 weight(2) = 0.471648435501891674887688950105D-05 weight(3) = 0.355092613551923610483661076691D-03 weight(4) = 0.785005472645794431048644334608D-02 weight(5) = 0.685055342234652055387163312367D-01 weight(6) = 0.273105609064246603352569187026D+00 weight(7) = 0.536405909712090149794921296776D+00 weight(8) = 0.536405909712090149794921296776D+00 weight(9) = 0.273105609064246603352569187026D+00 weight(10) = 0.685055342234652055387163312367D-01 weight(11) = 0.785005472645794431048644334608D-02 weight(12) = 0.355092613551923610483661076691D-03 weight(13) = 0.471648435501891674887688950105D-05 weight(14) = 0.862859116812515794532041783429D-08 else if ( order == 15 ) then xtab(1) = - 0.449999070730939155366438053053D+01 xtab(2) = - 0.366995037340445253472922383312D+01 xtab(3) = - 0.296716692790560324848896036355D+01 xtab(4) = - 0.232573248617385774545404479449D+01 xtab(5) = - 0.171999257518648893241583152515D+01 xtab(6) = - 0.113611558521092066631913490556D+01 xtab(7) = - 0.565069583255575748526020337198D+00 xtab(8) = 0.0D+00 xtab(9) = 0.565069583255575748526020337198D+00 xtab(10) = 0.113611558521092066631913490556D+01 xtab(11) = 0.171999257518648893241583152515D+01 xtab(12) = 0.232573248617385774545404479449D+01 xtab(13) = 0.296716692790560324848896036355D+01 xtab(14) = 0.366995037340445253472922383312D+01 xtab(15) = 0.449999070730939155366438053053D+01 weight(1) = 0.152247580425351702016062666965D-08 weight(2) = 0.105911554771106663577520791055D-05 weight(3) = 0.100004441232499868127296736177D-03 weight(4) = 0.277806884291277589607887049229D-02 weight(5) = 0.307800338725460822286814158758D-01 weight(6) = 0.158488915795935746883839384960D+00 weight(7) = 0.412028687498898627025891079568D+00 weight(8) = 0.564100308726417532852625797340D+00 weight(9) = 0.412028687498898627025891079568D+00 weight(10) = 0.158488915795935746883839384960D+00 weight(11) = 0.307800338725460822286814158758D-01 weight(12) = 0.277806884291277589607887049229D-02 weight(13) = 0.100004441232499868127296736177D-03 weight(14) = 0.105911554771106663577520791055D-05 weight(15) = 0.152247580425351702016062666965D-08 else if ( order == 16 ) then xtab(1) = - 0.468873893930581836468849864875D+01 xtab(2) = - 0.386944790486012269871942409801D+01 xtab(3) = - 0.317699916197995602681399455926D+01 xtab(4) = - 0.254620215784748136215932870545D+01 xtab(5) = - 0.195178799091625397743465541496D+01 xtab(6) = - 0.138025853919888079637208966969D+01 xtab(7) = - 0.822951449144655892582454496734D+00 xtab(8) = - 0.273481046138152452158280401965D+00 xtab(9) = 0.273481046138152452158280401965D+00 xtab(10) = 0.822951449144655892582454496734D+00 xtab(11) = 0.138025853919888079637208966969D+01 xtab(12) = 0.195178799091625397743465541496D+01 xtab(13) = 0.254620215784748136215932870545D+01 xtab(14) = 0.317699916197995602681399455926D+01 xtab(15) = 0.386944790486012269871942409801D+01 xtab(16) = 0.468873893930581836468849864875D+01 weight(1) = 0.265480747401118224470926366050D-09 weight(2) = 0.232098084486521065338749423185D-06 weight(3) = 0.271186009253788151201891432244D-04 weight(4) = 0.932284008624180529914277305537D-03 weight(5) = 0.128803115355099736834642999312D-01 weight(6) = 0.838100413989858294154207349001D-01 weight(7) = 0.280647458528533675369463335380D+00 weight(8) = 0.507929479016613741913517341791D+00 weight(9) = 0.507929479016613741913517341791D+00 weight(10) = 0.280647458528533675369463335380D+00 weight(11) = 0.838100413989858294154207349001D-01 weight(12) = 0.128803115355099736834642999312D-01 weight(13) = 0.932284008624180529914277305537D-03 weight(14) = 0.271186009253788151201891432244D-04 weight(15) = 0.232098084486521065338749423185D-06 weight(16) = 0.265480747401118224470926366050D-09 else if ( order == 17 ) then xtab(1) = - 0.487134519367440308834927655662D+01 xtab(2) = - 0.406194667587547430689245559698D+01 xtab(3) = - 0.337893209114149408338327069289D+01 xtab(4) = - 0.275776291570388873092640349574D+01 xtab(5) = - 0.217350282666662081927537907149D+01 xtab(6) = - 0.161292431422123133311288254454D+01 xtab(7) = - 0.106764872574345055363045773799D+01 xtab(8) = - 0.531633001342654731349086553718D+00 xtab(9) = 0.0D+00 xtab(10) = 0.531633001342654731349086553718D+00 xtab(11) = 0.106764872574345055363045773799D+01 xtab(12) = 0.161292431422123133311288254454D+01 xtab(13) = 0.217350282666662081927537907149D+01 xtab(14) = 0.275776291570388873092640349574D+01 xtab(15) = 0.337893209114149408338327069289D+01 xtab(16) = 0.406194667587547430689245559698D+01 xtab(17) = 0.487134519367440308834927655662D+01 weight(1) = 0.458057893079863330580889281222D-10 weight(2) = 0.497707898163079405227863353715D-07 weight(3) = 0.711228914002130958353327376218D-05 weight(4) = 0.298643286697753041151336643059D-03 weight(5) = 0.506734995762753791170069495879D-02 weight(6) = 0.409200341495762798094994877854D-01 weight(7) = 0.172648297670097079217645196219D+00 weight(8) = 0.401826469470411956577635085257D+00 weight(9) = 0.530917937624863560331883103379D+00 weight(10) = 0.401826469470411956577635085257D+00 weight(11) = 0.172648297670097079217645196219D+00 weight(12) = 0.409200341495762798094994877854D-01 weight(13) = 0.506734995762753791170069495879D-02 weight(14) = 0.298643286697753041151336643059D-03 weight(15) = 0.711228914002130958353327376218D-05 weight(16) = 0.497707898163079405227863353715D-07 weight(17) = 0.458057893079863330580889281222D-10 else if ( order == 18 ) then xtab(1) = - 0.504836400887446676837203757885D+01 xtab(2) = - 0.424811787356812646302342016090D+01 xtab(3) = - 0.357376906848626607950067599377D+01 xtab(4) = - 0.296137750553160684477863254906D+01 xtab(5) = - 0.238629908916668600026459301424D+01 xtab(6) = - 0.183553160426162889225383944409D+01 xtab(7) = - 0.130092085838961736566626555439D+01 xtab(8) = - 0.776682919267411661316659462284D+00 xtab(9) = - 0.258267750519096759258116098711D+00 xtab(10) = 0.258267750519096759258116098711D+00 xtab(11) = 0.776682919267411661316659462284D+00 xtab(12) = 0.130092085838961736566626555439D+01 xtab(13) = 0.183553160426162889225383944409D+01 xtab(14) = 0.238629908916668600026459301424D+01 xtab(15) = 0.296137750553160684477863254906D+01 xtab(16) = 0.357376906848626607950067599377D+01 xtab(17) = 0.424811787356812646302342016090D+01 xtab(18) = 0.504836400887446676837203757885D+01 weight(1) = 0.782819977211589102925147471012D-11 weight(2) = 0.104672057957920824443559608435D-07 weight(3) = 0.181065448109343040959702385911D-05 weight(4) = 0.918112686792940352914675407371D-04 weight(5) = 0.188852263026841789438175325426D-02 weight(6) = 0.186400423875446519219315221973D-01 weight(7) = 0.973017476413154293308537234155D-01 weight(8) = 0.284807285669979578595606820713D+00 weight(9) = 0.483495694725455552876410522141D+00 weight(10) = 0.483495694725455552876410522141D+00 weight(11) = 0.284807285669979578595606820713D+00 weight(12) = 0.973017476413154293308537234155D-01 weight(13) = 0.186400423875446519219315221973D-01 weight(14) = 0.188852263026841789438175325426D-02 weight(15) = 0.918112686792940352914675407371D-04 weight(16) = 0.181065448109343040959702385911D-05 weight(17) = 0.104672057957920824443559608435D-07 weight(18) = 0.782819977211589102925147471012D-11 else if ( order == 19 ) then xtab(1) = - 0.522027169053748216460967142500D+01 xtab(2) = - 0.442853280660377943723498532226D+01 xtab(3) = - 0.376218735196402009751489394104D+01 xtab(4) = - 0.315784881834760228184318034120D+01 xtab(5) = - 0.259113378979454256492128084112D+01 xtab(6) = - 0.204923170985061937575050838669D+01 xtab(7) = - 0.152417061939353303183354859367D+01 xtab(8) = - 0.101036838713431135136859873726D+01 xtab(9) = - 0.503520163423888209373811765050D+00 xtab(10) = 0.0D+00 xtab(11) = 0.503520163423888209373811765050D+00 xtab(12) = 0.101036838713431135136859873726D+01 xtab(13) = 0.152417061939353303183354859367D+01 xtab(14) = 0.204923170985061937575050838669D+01 xtab(15) = 0.259113378979454256492128084112D+01 xtab(16) = 0.315784881834760228184318034120D+01 xtab(17) = 0.376218735196402009751489394104D+01 xtab(18) = 0.442853280660377943723498532226D+01 xtab(19) = 0.522027169053748216460967142500D+01 weight(1) = 0.132629709449851575185289154385D-11 weight(2) = 0.216305100986355475019693077221D-08 weight(3) = 0.448824314722312295179447915594D-06 weight(4) = 0.272091977631616257711941025214D-04 weight(5) = 0.670877521407181106194696282100D-03 weight(6) = 0.798886677772299020922211491861D-02 weight(7) = 0.508103869090520673569908110358D-01 weight(8) = 0.183632701306997074156148485766D+00 weight(9) = 0.391608988613030244504042313621D+00 weight(10) = 0.502974888276186530840731361096D+00 weight(11) = 0.391608988613030244504042313621D+00 weight(12) = 0.183632701306997074156148485766D+00 weight(13) = 0.508103869090520673569908110358D-01 weight(14) = 0.798886677772299020922211491861D-02 weight(15) = 0.670877521407181106194696282100D-03 weight(16) = 0.272091977631616257711941025214D-04 weight(17) = 0.448824314722312295179447915594D-06 weight(18) = 0.216305100986355475019693077221D-08 weight(19) = 0.132629709449851575185289154385D-11 else if ( order == 20 ) then xtab(1) = - 0.538748089001123286201690041068D+01 xtab(2) = - 0.460368244955074427307767524898D+01 xtab(3) = - 0.394476404011562521037562880052D+01 xtab(4) = - 0.334785456738321632691492452300D+01 xtab(5) = - 0.278880605842813048052503375640D+01 xtab(6) = - 0.225497400208927552308233334473D+01 xtab(7) = - 0.173853771211658620678086566214D+01 xtab(8) = - 0.123407621539532300788581834696D+01 xtab(9) = - 0.737473728545394358705605144252D+00 xtab(10) = - 0.245340708300901249903836530634D+00 xtab(11) = 0.245340708300901249903836530634D+00 xtab(12) = 0.737473728545394358705605144252D+00 xtab(13) = 0.123407621539532300788581834696D+01 xtab(14) = 0.173853771211658620678086566214D+01 xtab(15) = 0.225497400208927552308233334473D+01 xtab(16) = 0.278880605842813048052503375640D+01 xtab(17) = 0.334785456738321632691492452300D+01 xtab(18) = 0.394476404011562521037562880052D+01 xtab(19) = 0.460368244955074427307767524898D+01 xtab(20) = 0.538748089001123286201690041068D+01 weight(1) = 0.222939364553415129252250061603D-12 weight(2) = 0.439934099227318055362885145547D-09 weight(3) = 0.108606937076928169399952456345D-06 weight(4) = 0.780255647853206369414599199965D-05 weight(5) = 0.228338636016353967257145917963D-03 weight(6) = 0.324377334223786183218324713235D-02 weight(7) = 0.248105208874636108821649525589D-01 weight(8) = 0.109017206020023320013755033535D+00 weight(9) = 0.286675505362834129719659706228D+00 weight(10) = 0.462243669600610089650328639861D+00 weight(11) = 0.462243669600610089650328639861D+00 weight(12) = 0.286675505362834129719659706228D+00 weight(13) = 0.109017206020023320013755033535D+00 weight(14) = 0.248105208874636108821649525589D-01 weight(15) = 0.324377334223786183218324713235D-02 weight(16) = 0.228338636016353967257145917963D-03 weight(17) = 0.780255647853206369414599199965D-05 weight(18) = 0.108606937076928169399952456345D-06 weight(19) = 0.439934099227318055362885145547D-09 weight(20) = 0.222939364553415129252250061603D-12 else if ( order == 30 ) then xtab( 1) = -6.86334529352989158106110835756D+00 xtab( 2) = -6.13827922012393462039499237854D+00 xtab( 3) = -5.53314715156749572511833355558D+00 xtab( 4) = -4.98891896858994394448649710633D+00 xtab( 5) = -4.48305535709251834188703761971D+00 xtab( 6) = -4.00390860386122881522787601332D+00 xtab( 7) = -3.54444387315534988692540090217D+00 xtab( 8) = -3.09997052958644174868873332237D+00 xtab( 9) = -2.66713212453561720057110646422D+00 xtab(10) = -2.24339146776150407247297999483D+00 xtab(11) = -1.82674114360368803883588048351D+00 xtab(12) = -1.41552780019818851194072510555D+00 xtab(13) = -1.00833827104672346180498960870D+00 xtab(14) = -0.603921058625552307778155678757D+00 xtab(15) = -0.201128576548871485545763013244D+00 xtab(16) = 0.201128576548871485545763013244D+00 xtab(17) = 0.603921058625552307778155678757D+00 xtab(18) = 1.00833827104672346180498960870D+00 xtab(19) = 1.41552780019818851194072510555D+00 xtab(20) = 1.82674114360368803883588048351D+00 xtab(21) = 2.24339146776150407247297999483D+00 xtab(22) = 2.66713212453561720057110646422D+00 xtab(23) = 3.09997052958644174868873332237D+00 xtab(24) = 3.54444387315534988692540090217D+00 xtab(25) = 4.00390860386122881522787601332D+00 xtab(26) = 4.48305535709251834188703761971D+00 xtab(27) = 4.98891896858994394448649710633D+00 xtab(28) = 5.53314715156749572511833355558D+00 xtab(29) = 6.13827922012393462039499237854D+00 xtab(30) = 6.86334529352989158106110835756D+00 weight( 1) = 0.290825470013122622941102747365D-20 weight( 2) = 0.281033360275090370876277491534D-16 weight( 3) = 0.287860708054870606219239791142D-13 weight( 4) = 0.810618629746304420399344796173D-11 weight( 5) = 0.917858042437852820850075742492D-09 weight( 6) = 0.510852245077594627738963204403D-07 weight( 7) = 0.157909488732471028834638794022D-05 weight( 8) = 0.293872522892298764150118423412D-04 weight( 9) = 0.348310124318685523420995323183D-03 weight(10) = 0.273792247306765846298942568953D-02 weight(11) = 0.147038297048266835152773557787D-01 weight(12) = 0.551441768702342511680754948183D-01 weight(13) = 0.146735847540890099751693643152D+00 weight(14) = 0.280130930839212667413493211293D+00 weight(15) = 0.386394889541813862555601849165D+00 weight(16) = 0.386394889541813862555601849165D+00 weight(17) = 0.280130930839212667413493211293D+00 weight(18) = 0.146735847540890099751693643152D+00 weight(19) = 0.551441768702342511680754948183D-01 weight(20) = 0.147038297048266835152773557787D-01 weight(21) = 0.273792247306765846298942568953D-02 weight(22) = 0.348310124318685523420995323183D-03 weight(23) = 0.293872522892298764150118423412D-04 weight(24) = 0.157909488732471028834638794022D-05 weight(25) = 0.510852245077594627738963204403D-07 weight(26) = 0.917858042437852820850075742492D-09 weight(27) = 0.810618629746304420399344796173D-11 weight(28) = 0.287860708054870606219239791142D-13 weight(29) = 0.281033360275090370876277491534D-16 weight(30) = 0.290825470013122622941102747365D-20 else if ( order == 31 ) then xtab( 1) = -6.9956801237185402753248521473232D+00 xtab( 2) = -6.2750787049428601427036567812530D+00 xtab( 3) = -5.6739614446185883296332558789276D+00 xtab( 4) = -5.1335955771123807045862968913996D+00 xtab( 5) = -4.6315595063128599420667997654336D+00 xtab( 6) = -4.1562717558181451724831352315314D+00 xtab( 7) = -3.7007434032314694224497164589673D+00 xtab( 8) = -3.2603207323135408104645401509648D+00 xtab( 9) = -2.8316804533902054557015640151425D+00 xtab( 10) = -2.4123177054804201051740184582119D+00 xtab( 11) = -2.0002585489356389657975562598571D+00 xtab( 12) = -1.5938858604721398261388419455550D+00 xtab( 13) = -1.1918269983500464260821358649242D+00 xtab( 14) = -0.79287697691530893968593032998830D+00 xtab( 15) = -0.39594273647142311094670041663436D+00 xtab( 16) = 0.0000000000000000000000000000000D+00 xtab( 17) = 0.39594273647142311094670041663436D+00 xtab( 18) = 0.79287697691530893968593032998830D+00 xtab( 19) = 1.1918269983500464260821358649242D+00 xtab( 20) = 1.5938858604721398261388419455550D+00 xtab( 21) = 2.0002585489356389657975562598571D+00 xtab( 22) = 2.4123177054804201051740184582119D+00 xtab( 23) = 2.8316804533902054557015640151425D+00 xtab( 24) = 3.2603207323135408104645401509648D+00 xtab( 25) = 3.7007434032314694224497164589673D+00 xtab( 26) = 4.1562717558181451724831352315314D+00 xtab( 27) = 4.6315595063128599420667997654336D+00 xtab( 28) = 5.1335955771123807045862968913996D+00 xtab( 29) = 5.6739614446185883296332558789276D+00 xtab( 30) = 6.2750787049428601427036567812530D+00 xtab( 31) = 6.9956801237185402753248521473232D+00 weight( 1) = 0.46189683944498305857470556847735D-21 weight( 2) = 0.51106090079112519643027197715274D-17 weight( 3) = 0.58995564987355133075257722133966D-14 weight( 4) = 0.18603735214463569590294465062239D-11 weight( 5) = 0.23524920032013205739850619940094D-09 weight( 6) = 0.14611988344865057576066495091513D-07 weight( 7) = 0.50437125589241034841778074689627D-06 weight( 8) = 0.10498602757642934202945441341697D-04 weight( 9) = 0.13952090395003623854995664958146D-03 weight( 10) = 0.12336833073030489880608311394968D-02 weight( 11) = 0.74827999140119116765002499116934D-02 weight( 12) = 0.31847230731201222775249585776902D-01 weight( 13) = 0.96717948160569462991143316029341D-01 weight( 14) = 0.21213278866810461318136114862419D+00 weight( 15) = 0.33877265789305344906000174083214D+00 weight( 16) = 0.39577855609737786462923720809676D+00 weight( 17) = 0.33877265789305344906000174083214D+00 weight( 18) = 0.21213278866810461318136114862419D+00 weight( 19) = 0.96717948160569462991143316029341D-01 weight( 20) = 0.31847230731201222775249585776902D-01 weight( 21) = 0.74827999140119116765002499116934D-02 weight( 22) = 0.12336833073030489880608311394968D-02 weight( 23) = 0.13952090395003623854995664958146D-03 weight( 24) = 0.10498602757642934202945441341697D-04 weight( 25) = 0.50437125589241034841778074689627E-06 weight( 26) = 0.14611988344865057576066495091513D-07 weight( 27) = 0.23524920032013205739850619940094D-09 weight( 28) = 0.18603735214463569590294465062239D-11 weight( 29) = 0.58995564987355133075257722133966D-14 weight( 30) = 0.51106090079112519643027197715274D-17 weight( 31) = 0.46189683944498305857470556847735D-21 else if ( order == 32 ) then xtab( 1) = -7.12581390983D+00 xtab( 2) = -6.40949814927D+00 xtab( 3) = -5.81222594952D+00 xtab( 4) = -5.27555098652D+00 xtab( 5) = -4.77716450350D+00 xtab( 6) = -4.30554795335D+00 xtab( 7) = -3.85375548547D+00 xtab( 8) = -3.41716749282D+00 xtab( 9) = -2.99249082500D+00 xtab(10) = -2.57724953773D+00 xtab(11) = -2.16949918361D+00 xtab(12) = -1.76765410946D+00 xtab(13) = -1.37037641095D+00 xtab(14) = -0.976500463590D+00 xtab(15) = -0.584978765436D+00 xtab(16) = -0.194840741569D+00 xtab(17) = 0.194840741569D+00 xtab(18) = 0.584978765436D+00 xtab(19) = 0.976500463590D+00 xtab(20) = 1.37037641095D+00 xtab(21) = 1.76765410946D+00 xtab(22) = 2.16949918361D+00 xtab(23) = 2.57724953773D+00 xtab(24) = 2.99249082500D+00 xtab(25) = 3.41716749282D+00 xtab(26) = 3.85375548547D+00 xtab(27) = 4.30554795335D+00 xtab(28) = 4.77716450350D+00 xtab(29) = 5.27555098652D+00 xtab(30) = 5.81222594952D+00 xtab(31) = 6.40949814927D+00 xtab(32) = 7.12581390983D+00 weight( 1) = 0.731067642736D-22 weight( 2) = 0.923173653649D-18 weight( 3) = 0.119734401709D-14 weight( 4) = 0.421501021125D-12 weight( 5) = 0.593329146300D-10 weight( 6) = 0.409883216476D-08 weight( 7) = 0.157416779254D-06 weight( 8) = 0.365058512955D-05 weight( 9) = 0.541658406172D-04 weight(10) = 0.536268365526D-03 weight(11) = 0.365489032664D-02 weight(12) = 0.175534288315D-01 weight(13) = 0.604581309557D-01 weight(14) = 0.151269734076D+00 weight(15) = 0.277458142302D+00 weight(16) = 0.375238352592D+00 weight(17) = 0.375238352592D+00 weight(18) = 0.277458142302D+00 weight(19) = 0.151269734076D+00 weight(20) = 0.604581309557D-01 weight(21) = 0.175534288315D-01 weight(22) = 0.365489032664D-02 weight(23) = 0.536268365526D-03 weight(24) = 0.541658406172D-04 weight(25) = 0.365058512955D-05 weight(26) = 0.157416779254D-06 weight(27) = 0.409883216476D-08 weight(28) = 0.593329146300D-10 weight(29) = 0.421501021125D-12 weight(30) = 0.119734401709D-14 weight(31) = 0.923173653649D-18 weight(32) = 0.731067642736D-22 else if ( order == 40 ) then xtab( 1) = -8.09876113925D+00 xtab( 2) = -7.41158253149D+00 xtab( 3) = -6.84023730525D+00 xtab( 4) = -6.32825535122D+00 xtab( 5) = -5.85409505603D+00 xtab( 6) = -5.40665424797D+00 xtab( 7) = -4.97926097855D+00 xtab( 8) = -4.56750207284D+00 xtab( 9) = -4.16825706683D+00 xtab(10) = -3.77920675344D+00 xtab(11) = -3.39855826586D+00 xtab(12) = -3.02487988390D+00 xtab(13) = -2.65699599844D+00 xtab(14) = -2.29391714188D+00 xtab(15) = -1.93479147228D+00 xtab(16) = -1.57886989493D+00 xtab(17) = -1.22548010905D+00 xtab(18) = -0.874006612357D+00 xtab(19) = -0.523874713832D+00 xtab(20) = -0.174537214598D+00 xtab(21) = 0.174537214598D+00 xtab(22) = 0.523874713832D+00 xtab(23) = 0.874006612357D+00 xtab(24) = 1.22548010905D+00 xtab(25) = 1.57886989493D+00 xtab(26) = 1.93479147228D+00 xtab(27) = 2.29391714188D+00 xtab(28) = 2.65699599844D+00 xtab(29) = 3.02487988390D+00 xtab(30) = 3.39855826586D+00 xtab(31) = 3.77920675344D+00 xtab(32) = 4.16825706683D+00 xtab(33) = 4.56750207284D+00 xtab(34) = 4.97926097855D+00 xtab(35) = 5.40665424797D+00 xtab(36) = 5.85409505603D+00 xtab(37) = 6.32825535122D+00 xtab(38) = 6.84023730525D+00 xtab(39) = 7.41158253149D+00 xtab(40) = 8.09876113925D+00 weight( 1) = 0.259104371384D-28 weight( 2) = 0.854405696375D-24 weight( 3) = 0.256759336540D-20 weight( 4) = 0.198918101211D-17 weight( 5) = 0.600835878947D-15 weight( 6) = 0.880570764518D-13 weight( 7) = 0.715652805267D-11 weight( 8) = 0.352562079135D-09 weight( 9) = 0.112123608322D-07 weight(10) = 0.241114416359D-06 weight(11) = 0.363157615067D-05 weight(12) = 0.393693398108D-04 weight(13) = 0.313853594540D-03 weight(14) = 0.187149682959D-02 weight(15) = 0.846088800823D-02 weight(16) = 0.293125655361D-01 weight(17) = 0.784746058652D-01 weight(18) = 0.163378732713D+00 weight(19) = 0.265728251876D+00 weight(20) = 0.338643277425D+00 weight(21) = 0.338643277425D+00 weight(22) = 0.265728251876D+00 weight(23) = 0.163378732713D+00 weight(24) = 0.784746058652D-01 weight(25) = 0.293125655361D-01 weight(26) = 0.846088800823D-02 weight(27) = 0.187149682959D-02 weight(28) = 0.313853594540D-03 weight(29) = 0.393693398108D-04 weight(30) = 0.363157615067D-05 weight(31) = 0.241114416359D-06 weight(32) = 0.112123608322D-07 weight(33) = 0.352562079135D-09 weight(34) = 0.715652805267D-11 weight(35) = 0.880570764518D-13 weight(36) = 0.600835878947D-15 weight(37) = 0.198918101211D-17 weight(38) = 0.256759336540D-20 weight(39) = 0.854405696375D-24 weight(40) = 0.259104371384D-28 else if ( order == 50 ) then xtab( 1) = -9.18240695813D+00 xtab( 2) = -8.52277103092D+00 xtab( 3) = -7.97562236821D+00 xtab( 4) = -7.48640942986D+00 xtab( 5) = -7.03432350977D+00 xtab( 6) = -6.60864797386D+00 xtab( 7) = -6.20295251927D+00 xtab( 8) = -5.81299467542D+00 xtab( 9) = -5.43578608722D+00 xtab(10) = -5.06911758492D+00 xtab(11) = -4.71129366617D+00 xtab(12) = -4.36097316045D+00 xtab(13) = -4.01706817286D+00 xtab(14) = -3.67867706252D+00 xtab(15) = -3.34503831394D+00 xtab(16) = -3.01549776957D+00 xtab(17) = -2.68948470227D+00 xtab(18) = -2.36649390430D+00 xtab(19) = -2.04607196869D+00 xtab(20) = -1.72780654752D+00 xtab(21) = -1.41131775490D+00 xtab(22) = -1.09625112896D+00 xtab(23) = -0.782271729555D+00 xtab(24) = -0.469059056678D+00 xtab(25) = -0.156302546889D+00 xtab(26) = 0.156302546889D+00 xtab(27) = 0.469059056678D+00 xtab(28) = 0.782271729555D+00 xtab(29) = 1.09625112896D+00 xtab(30) = 1.41131775490D+00 xtab(31) = 1.72780654752D+00 xtab(32) = 2.04607196869D+00 xtab(33) = 2.36649390430D+00 xtab(34) = 2.68948470227D+00 xtab(35) = 3.01549776957D+00 xtab(36) = 3.34503831394D+00 xtab(37) = 3.67867706252D+00 xtab(38) = 4.01706817286D+00 xtab(39) = 4.36097316045D+00 xtab(40) = 4.71129366617D+00 xtab(41) = 5.06911758492D+00 xtab(42) = 5.43578608722D+00 xtab(43) = 5.81299467542D+00 xtab(44) = 6.20295251927D+00 xtab(45) = 6.60864797386D+00 xtab(46) = 7.03432350977D+00 xtab(47) = 7.48640942986D+00 xtab(48) = 7.97562236821D+00 xtab(49) = 8.52277103092D+00 xtab(50) = 9.18240695813D+00 weight( 1) = 0.183379404857D-36 weight( 2) = 0.167380166790D-31 weight( 3) = 0.121524412340D-27 weight( 4) = 0.213765830835D-24 weight( 5) = 0.141709359957D-21 weight( 6) = 0.447098436530D-19 weight( 7) = 0.774238295702D-17 weight( 8) = 0.809426189344D-15 weight( 9) = 0.546594403180D-13 weight(10) = 0.250665552389D-11 weight(11) = 0.811187736448D-10 weight(12) = 0.190904054379D-08 weight(13) = 0.334679340401D-07 weight(14) = 0.445702996680D-06 weight(15) = 0.458168270794D-05 weight(16) = 0.368401905377D-04 weight(17) = 0.234269892109D-03 weight(18) = 0.118901178175D-02 weight(19) = 0.485326382616D-02 weight(20) = 0.160319410684D-01 weight(21) = 0.430791591566D-01 weight(22) = 0.945489354768D-01 weight(23) = 0.170032455676D+00 weight(24) = 0.251130856331D+00 weight(25) = 0.305085129203D+00 weight(26) = 0.305085129203D+00 weight(27) = 0.251130856331D+00 weight(28) = 0.170032455676D+00 weight(29) = 0.945489354768D-01 weight(30) = 0.430791591566D-01 weight(31) = 0.160319410684D-01 weight(32) = 0.485326382616D-02 weight(33) = 0.118901178175D-02 weight(34) = 0.234269892109D-03 weight(35) = 0.368401905377D-04 weight(36) = 0.458168270794D-05 weight(37) = 0.445702996680D-06 weight(38) = 0.334679340401D-07 weight(39) = 0.190904054379D-08 weight(40) = 0.811187736448D-10 weight(41) = 0.250665552389D-11 weight(42) = 0.546594403180D-13 weight(43) = 0.809426189344D-15 weight(44) = 0.774238295702D-17 weight(45) = 0.447098436530D-19 weight(46) = 0.141709359957D-21 weight(47) = 0.213765830835D-24 weight(48) = 0.121524412340D-27 weight(49) = 0.167380166790D-31 weight(50) = 0.183379404857D-36 else if ( order == 60 ) then xtab( 1) = -10.1591092462D+00 xtab( 2) = -9.52090367701D+00 xtab( 3) = -8.99239800140D+00 xtab( 4) = -8.52056928412D+00 xtab( 5) = -8.08518865425D+00 xtab( 6) = -7.67583993750D+00 xtab( 7) = -7.28627659440D+00 xtab( 8) = -6.91238153219D+00 xtab( 9) = -6.55125916706D+00 xtab(10) = -6.20077355799D+00 xtab(11) = -5.85929019639D+00 xtab(12) = -5.52552108614D+00 xtab(13) = -5.19842653458D+00 xtab(14) = -4.87715007747D+00 xtab(15) = -4.56097375794D+00 xtab(16) = -4.24928643596D+00 xtab(17) = -3.94156073393D+00 xtab(18) = -3.63733587617D+00 xtab(19) = -3.33620465355D+00 xtab(20) = -3.03780333823D+00 xtab(21) = -2.74180374807D+00 xtab(22) = -2.44790690231D+00 xtab(23) = -2.15583787123D+00 xtab(24) = -1.86534153123D+00 xtab(25) = -1.57617901198D+00 xtab(26) = -1.28812467487D+00 xtab(27) = -1.00096349956D+00 xtab(28) = -0.714488781673D+00 xtab(29) = -0.428500064221D+00 xtab(30) = -0.142801238703D+00 xtab(31) = 0.142801238703D+00 xtab(32) = 0.428500064221D+00 xtab(33) = 0.714488781673D+00 xtab(34) = 1.00096349956D+00 xtab(35) = 1.28812467487D+00 xtab(36) = 1.57617901198D+00 xtab(37) = 1.86534153123D+00 xtab(38) = 2.15583787123D+00 xtab(39) = 2.44790690231D+00 xtab(40) = 2.74180374807D+00 xtab(41) = 3.03780333823D+00 xtab(42) = 3.33620465355D+00 xtab(43) = 3.63733587617D+00 xtab(44) = 3.94156073393D+00 xtab(45) = 4.24928643596D+00 xtab(46) = 4.56097375794D+00 xtab(47) = 4.87715007747D+00 xtab(48) = 5.19842653458D+00 xtab(49) = 5.52552108614D+00 xtab(50) = 5.85929019639D+00 xtab(51) = 6.20077355799D+00 xtab(52) = 6.55125916706D+00 xtab(53) = 6.91238153219D+00 xtab(54) = 7.28627659440D+00 xtab(55) = 7.67583993750D+00 xtab(56) = 8.08518865425D+00 xtab(57) = 8.52056928412D+00 xtab(58) = 8.99239800140D+00 xtab(59) = 9.52090367701D+00 xtab(60) = 10.1591092462D+00 weight( 1) = 0.110958724796D-44 weight( 2) = 0.243974758810D-39 weight( 3) = 0.377162672698D-35 weight( 4) = 0.133255961176D-31 weight( 5) = 0.171557314767D-28 weight( 6) = 0.102940599693D-25 weight( 7) = 0.334575695574D-23 weight( 8) = 0.651256725748D-21 weight( 9) = 0.815364047300D-19 weight(10) = 0.692324790956D-17 weight(11) = 0.415244410968D-15 weight(12) = 0.181662457614D-13 weight(13) = 0.594843051597D-12 weight(14) = 0.148895734905D-10 weight(15) = 0.289935901280D-09 weight(16) = 0.445682277521D-08 weight(17) = 0.547555461926D-07 weight(18) = 0.543351613419D-06 weight(19) = 0.439428693625D-05 weight(20) = 0.291874190415D-04 weight(21) = 0.160277334681D-03 weight(22) = 0.731773556963D-03 weight(23) = 0.279132482894D-02 weight(24) = 0.893217836028D-02 weight(25) = 0.240612727660D-01 weight(26) = 0.547189709320D-01 weight(27) = 0.105298763697D+00 weight(28) = 0.171776156918D+00 weight(29) = 0.237868904958D+00 weight(30) = 0.279853117522D+00 weight(31) = 0.279853117522D+00 weight(32) = 0.237868904958D+00 weight(33) = 0.171776156918D+00 weight(34) = 0.105298763697D+00 weight(35) = 0.547189709320D-01 weight(36) = 0.240612727660D-01 weight(37) = 0.893217836028D-02 weight(38) = 0.279132482894D-02 weight(39) = 0.731773556963D-03 weight(40) = 0.160277334681D-03 weight(41) = 0.291874190415D-04 weight(42) = 0.439428693625D-05 weight(43) = 0.543351613419D-06 weight(44) = 0.547555461926D-07 weight(45) = 0.445682277521D-08 weight(46) = 0.289935901280D-09 weight(47) = 0.148895734905D-10 weight(48) = 0.594843051597D-12 weight(49) = 0.181662457614D-13 weight(50) = 0.415244410968D-15 weight(51) = 0.692324790956D-17 weight(52) = 0.815364047300D-19 weight(53) = 0.651256725748D-21 weight(54) = 0.334575695574D-23 weight(55) = 0.102940599693D-25 weight(56) = 0.171557314767D-28 weight(57) = 0.133255961176D-31 weight(58) = 0.377162672698D-35 weight(59) = 0.243974758810D-39 weight(60) = 0.110958724796D-44 else if ( order == 63 ) then xtab( 1) = -10.435499877854168053468115427285D+00 xtab( 2) = -9.8028759912974963635223935286507D+00 xtab( 3) = -9.2792019543050391319404745506496D+00 xtab( 4) = -8.8118581437284546442526628275570D+00 xtab( 5) = -8.3807683451863219343010651043788D+00 xtab( 6) = -7.9755950801420373181541806298501D+00 xtab( 7) = -7.5901395198641066762479783194468D+00 xtab( 8) = -7.2203167078889678461161324222529D+00 xtab( 9) = -6.8632544331795368527353285876066D+00 xtab( 10) = -6.5168348106821160605273395854042D+00 xtab( 11) = -6.1794379922705969862418461787263D+00 xtab( 12) = -5.8497884000810673462526582961482D+00 xtab( 13) = -5.5268572526403031425047575122840D+00 xtab( 14) = -5.2097979830408354861575136416263D+00 xtab( 15) = -4.8979018644975742350745099214868D+00 xtab( 16) = -4.5905665744435190229271294569091D+00 xtab( 17) = -4.2872733352824404031727616199454D+00 xtab( 18) = -3.9875699104197157485227052068068D+00 xtab( 19) = -3.6910577000963465117322810559754D+00 xtab( 20) = -3.3973817713303911852755941806287D+00 xtab( 21) = -3.1062230279282566329138616746036D+00 xtab( 22) = -2.8172919672837977750747135657355D+00 xtab( 23) = -2.5303236304712010926855221718499D+00 xtab( 24) = -2.2450734604812066298995918179330D+00 xtab( 25) = -1.9613138583081485293922008411321D+00 xtab( 26) = -1.6788312791720137520802800622638D+00 xtab( 27) = -1.3974237486049625107570752063702D+00 xtab( 28) = -1.1168987050996462690510970277840D+00 xtab( 29) = -0.83707109558947615977737795461293D+00 xtab( 30) = -0.55776166427908221668763665253822D+00 xtab( 31) = -0.27879538567115223986687628627202D+00 xtab( 32) = 0.00000000000000000000000000000000D+00 xtab( 33) = 0.27879538567115223986687628627202D+00 xtab( 34) = 0.55776166427908221668763665253822D+00 xtab( 35) = 0.83707109558947615977737795461293D+00 xtab( 36) = 1.1168987050996462690510970277840D+00 xtab( 37) = 1.3974237486049625107570752063702D+00 xtab( 38) = 1.6788312791720137520802800622638D+00 xtab( 39) = 1.9613138583081485293922008411321D+00 xtab( 40) = 2.2450734604812066298995918179330D+00 xtab( 41) = 2.5303236304712010926855221718499D+00 xtab( 42) = 2.8172919672837977750747135657355D+00 xtab( 43) = 3.1062230279282566329138616746036D+00 xtab( 44) = 3.3973817713303911852755941806287D+00 xtab( 45) = 3.6910577000963465117322810559754D+00 xtab( 46) = 3.9875699104197157485227052068068D+00 xtab( 47) = 4.2872733352824404031727616199454D+00 xtab( 48) = 4.5905665744435190229271294569091D+00 xtab( 49) = 4.8979018644975742350745099214868D+00 xtab( 50) = 5.2097979830408354861575136416263D+00 xtab( 51) = 5.5268572526403031425047575122840D+00 xtab( 52) = 5.8497884000810673462526582961482D+00 xtab( 53) = 6.1794379922705969862418461787263D+00 xtab( 54) = 6.5168348106821160605273395854042D+00 xtab( 55) = 6.8632544331795368527353285876066D+00 xtab( 56) = 7.2203167078889678461161324222529D+00 xtab( 57) = 7.5901395198641066762479783194468D+00 xtab( 58) = 7.9755950801420373181541806298501D+00 xtab( 59) = 8.3807683451863219343010651043788D+00 xtab( 60) = 8.8118581437284546442526628275570D+00 xtab( 61) = 9.2792019543050391319404745506496D+00 xtab( 62) = 9.8028759912974963635223935286507D+00 xtab( 63) = 10.435499877854168053468115427285D+00 weight( 1) = 0.37099206434787551197827130470031D-47 weight( 2) = 0.10400778615192299534481914814892D-41 weight( 3) = 0.19796804708258311251124226474396D-37 weight( 4) = 0.84687478191640015120141181138947D-34 weight( 5) = 0.13071305930779945903630127634063D-30 weight( 6) = 0.93437837175367456929765381518998D-28 weight( 7) = 0.36027426635173044862245783257252D-25 weight( 8) = 0.82963863115951789374753323156164D-23 weight( 9) = 0.12266629909105281472971700203949D-20 weight( 10) = 0.12288435628797061539461585325494D-18 weight( 11) = 0.86925536958188009075932426691516D-17 weight( 12) = 0.44857058689176221240330804981619D-15 weight( 13) = 0.17335817955735154599902643794700D-13 weight( 14) = 0.51265062385038307838565047455223D-12 weight( 15) = 0.11808921844532942490513037158404D-10 weight( 16) = 0.21508698297808025739828859845140D-09 weight( 17) = 0.31371929535285447801497640621672D-08 weight( 18) = 0.37041625984781705796752840204084D-07 weight( 19) = 0.35734732949879669663960738150956D-06 weight( 20) = 0.28393114498380927832990899215541D-05 weight( 21) = 0.18709113003730498008961134765721D-04 weight( 22) = 0.10284880800653635546698378640623D-03 weight( 23) = 0.47411702610173128107201781718693D-03 weight( 24) = 0.18409222622384813438539657470055D-02 weight( 25) = 0.60436044551187631655712178246467D-02 weight( 26) = 0.16829299199599730926458559757600D-01 weight( 27) = 0.39858264027692992170237391875317D-01 weight( 28) = 0.80467087993950415219587554532823D-01 weight( 29) = 0.13871950817615293377792092082674D+00 weight( 30) = 0.20448695346833761570957197160475D+00 weight( 31) = 0.25799889943058042204920467417642D+00 weight( 32) = 0.27876694884838411919175686949858D+00 weight( 33) = 0.25799889943058042204920467417642D+00 weight( 34) = 0.20448695346833761570957197160475D+00 weight( 35) = 0.13871950817615293377792092082674D+00 weight( 36) = 0.80467087993950415219587554532823D-01 weight( 37) = 0.39858264027692992170237391875317D-01 weight( 38) = 0.16829299199599730926458559757600D-01 weight( 39) = 0.60436044551187631655712178246467D-02 weight( 40) = 0.18409222622384813438539657470055D-02 weight( 41) = 0.47411702610173128107201781718693D-03 weight( 42) = 0.10284880800653635546698378640623D-03 weight( 43) = 0.18709113003730498008961134765721D-04 weight( 44) = 0.28393114498380927832990899215541D-05 weight( 45) = 0.35734732949879669663960738150956D-06 weight( 46) = 0.37041625984781705796752840204084D-07 weight( 47) = 0.31371929535285447801497640621672D-08 weight( 48) = 0.21508698297808025739828859845140D-09 weight( 49) = 0.11808921844532942490513037158404D-10 weight( 50) = 0.51265062385038307838565047455223D-12 weight( 51) = 0.17335817955735154599902643794700D-13 weight( 52) = 0.44857058689176221240330804981619D-15 weight( 53) = 0.86925536958188009075932426691516D-17 weight( 54) = 0.12288435628797061539461585325494D-18 weight( 55) = 0.12266629909105281472971700203949D-20 weight( 56) = 0.82963863115951789374753323156164D-23 weight( 57) = 0.36027426635173044862245783257252D-25 weight( 58) = 0.93437837175367456929765381518998D-28 weight( 59) = 0.13071305930779945903630127634063E-30 weight( 60) = 0.84687478191640015120141181138947D-34 weight( 61) = 0.19796804708258311251124226474396D-37 weight( 62) = 0.10400778615192299534481914814892D-41 weight( 63) = 0.37099206434787551197827130470031D-47 else if ( order == 64 ) then xtab( 1) = -10.5261231680D+00 xtab( 2) = -9.89528758683D+00 xtab( 3) = -9.37315954965D+00 xtab( 4) = -8.90724909996D+00 xtab( 5) = -8.47752908338D+00 xtab( 6) = -8.07368728501D+00 xtab( 7) = -7.68954016404D+00 xtab( 8) = -7.32101303278D+00 xtab( 9) = -6.96524112055D+00 xtab(10) = -6.62011226264D+00 xtab(11) = -6.28401122877D+00 xtab(12) = -5.95566632680D+00 xtab(13) = -5.63405216435D+00 xtab(14) = -5.31832522463D+00 xtab(15) = -5.00777960220D+00 xtab(16) = -4.70181564741D+00 xtab(17) = -4.39991716823D+00 xtab(18) = -4.10163447457D+00 xtab(19) = -3.80657151395D+00 xtab(20) = -3.51437593574D+00 xtab(21) = -3.22473129199D+00 xtab(22) = -2.93735082300D+00 xtab(23) = -2.65197243543D+00 xtab(24) = -2.36835458863D+00 xtab(25) = -2.08627287988D+00 xtab(26) = -1.80551717147D+00 xtab(27) = -1.52588914021D+00 xtab(28) = -1.24720015694D+00 xtab(29) = -0.969269423071D+00 xtab(30) = -0.691922305810D+00 xtab(31) = -0.414988824121D+00 xtab(32) = -0.138302244987D+00 xtab(33) = 0.138302244987D+00 xtab(34) = 0.414988824121D+00 xtab(35) = 0.691922305810D+00 xtab(36) = 0.969269423071D+00 xtab(37) = 1.24720015694D+00 xtab(38) = 1.52588914021D+00 xtab(39) = 1.80551717147D+00 xtab(40) = 2.08627287988D+00 xtab(41) = 2.36835458863D+00 xtab(42) = 2.65197243543D+00 xtab(43) = 2.93735082300D+00 xtab(44) = 3.22473129199D+00 xtab(45) = 3.51437593574D+00 xtab(46) = 3.80657151395D+00 xtab(47) = 4.10163447457D+00 xtab(48) = 4.39991716823D+00 xtab(49) = 4.70181564741D+00 xtab(50) = 5.00777960220D+00 xtab(51) = 5.31832522463D+00 xtab(52) = 5.63405216435D+00 xtab(53) = 5.95566632680D+00 xtab(54) = 6.28401122877D+00 xtab(55) = 6.62011226264D+00 xtab(56) = 6.96524112055D+00 xtab(57) = 7.32101303278D+00 xtab(58) = 7.68954016404D+00 xtab(59) = 8.07368728501D+00 xtab(60) = 8.47752908338D+00 xtab(61) = 8.90724909996D+00 xtab(62) = 9.37315954965D+00 xtab(63) = 9.89528758683D+00 xtab(64) = 10.5261231680D+00 weight( 1) = 0.553570653584D-48 weight( 2) = 0.167974799010D-42 weight( 3) = 0.342113801099D-38 weight( 4) = 0.155739062462D-34 weight( 5) = 0.254966089910D-31 weight( 6) = 0.192910359546D-28 weight( 7) = 0.786179778889D-26 weight( 8) = 0.191170688329D-23 weight( 9) = 0.298286278427D-21 weight(10) = 0.315225456649D-19 weight(11) = 0.235188471067D-17 weight(12) = 0.128009339117D-15 weight(13) = 0.521862372645D-14 weight(14) = 0.162834073070D-12 weight(15) = 0.395917776693D-11 weight(16) = 0.761521725012D-10 weight(17) = 0.117361674232D-08 weight(18) = 0.146512531647D-07 weight(19) = 0.149553293672D-06 weight(20) = 0.125834025103D-05 weight(21) = 0.878849923082D-05 weight(22) = 0.512592913577D-04 weight(23) = 0.250983698512D-03 weight(24) = 0.103632909950D-02 weight(25) = 0.362258697852D-02 weight(26) = 0.107560405098D-01 weight(27) = 0.272031289536D-01 weight(28) = 0.587399819634D-01 weight(29) = 0.108498349306D+00 weight(30) = 0.171685842349D+00 weight(31) = 0.232994786062D+00 weight(32) = 0.271377424940D+00 weight(33) = 0.271377424940D+00 weight(34) = 0.232994786062D+00 weight(35) = 0.171685842349D+00 weight(36) = 0.108498349306D+00 weight(37) = 0.587399819634D-01 weight(38) = 0.272031289536D-01 weight(39) = 0.107560405098D-01 weight(40) = 0.362258697852D-02 weight(41) = 0.103632909950D-02 weight(42) = 0.250983698512D-03 weight(43) = 0.512592913577D-04 weight(44) = 0.878849923082D-05 weight(45) = 0.125834025103D-05 weight(46) = 0.149553293672D-06 weight(47) = 0.146512531647D-07 weight(48) = 0.117361674232D-08 weight(49) = 0.761521725012D-10 weight(50) = 0.395917776693D-11 weight(51) = 0.162834073070D-12 weight(52) = 0.521862372645D-14 weight(53) = 0.128009339117D-15 weight(54) = 0.235188471067D-17 weight(55) = 0.315225456649D-19 weight(56) = 0.298286278427D-21 weight(57) = 0.191170688329D-23 weight(58) = 0.786179778889D-26 weight(59) = 0.192910359546D-28 weight(60) = 0.254966089910D-31 weight(61) = 0.155739062462D-34 weight(62) = 0.342113801099D-38 weight(63) = 0.167974799010D-42 weight(64) = 0.553570653584D-48 else if ( order == 127 ) then xtab( 1) = -15.228338148167350978246954433464D+00 xtab( 2) = -14.669595158833972632746354112896D+00 xtab( 3) = -14.209085995284870755168244250887D+00 xtab( 4) = -13.799722290211676634645246746673D+00 xtab( 5) = -13.423518590070950062438258321855D+00 xtab( 6) = -13.071208660474601901583995439649D+00 xtab( 7) = -12.737235652415686338138003924072D+00 xtab( 8) = -12.417939378869715805445879624069D+00 xtab( 9) = -12.110749020947747600132123508132D+00 xtab( 10) = -11.813772198267727195134584136191D+00 xtab( 11) = -11.525565112572696599167888588564D+00 xtab( 12) = -11.244994583785543445194384194300D+00 xtab( 13) = -10.971150569840247423423040263881D+00 xtab( 14) = -10.703288201027481347670940744690D+00 xtab( 15) = -10.440787957772772867742591798027D+00 xtab( 16) = -10.183127473450343888624126450357D+00 xtab( 17) = -9.9298610495114250736847004273684D+00 xtab( 18) = -9.6806044412474728038150712732737D+00 xtab( 19) = -9.4350233389881650135019598506287D+00 xtab( 20) = -9.1928244988460305715774195052527D+00 xtab( 21) = -8.9537488108565404323807890169970D+00 xtab( 22) = -8.7175658087076307363833999548548D+00 xtab( 23) = -8.4840692689832473326097180339984D+00 xtab( 24) = -8.2530736454457156579694124243888D+00 xtab( 25) = -8.0244111514703375578594739796798D+00 xtab( 26) = -7.7979293513870105420829120455591D+00 xtab( 27) = -7.5734891556083454022834960763301D+00 xtab( 28) = -7.3509631392269052701961258043733D+00 xtab( 29) = -7.1302341220350710668064025713431D+00 xtab( 30) = -6.9111939615465713197465633109366D+00 xtab( 31) = -6.6937425208758294190074417381666D+00 xtab( 32) = -6.4777867811645365448144903821487D+00 xtab( 33) = -6.2632400742737354345609723857092D+00 xtab( 34) = -6.0500214161419845694465474482388D+00 xtab( 35) = -5.8380549248774187386601690807757D+00 xtab( 36) = -5.6272693105464816659423455794909D+00 xtab( 37) = -5.4175974259243240722848425872924D+00 xtab( 38) = -5.2089758693153983587570258372239D+00 xtab( 39) = -5.0013446320386360038520809107373D+00 xtab( 40) = -4.7946467843764925009748509930857D+00 xtab( 41) = -4.5888281947698372951606485031212D+00 xtab( 42) = -4.3838372778464736294253744407459D+00 xtab( 43) = -4.1796247675352031349421189892408D+00 xtab( 44) = -3.9761435120673355916035814195920D+00 xtab( 45) = -3.7733482881250526721004678400057D+00 xtab( 46) = -3.5711956317782180447199756485249D+00 xtab( 47) = -3.3696436841717397896643629240035D+00 xtab( 48) = -3.1686520501953630191857798261495D+00 xtab( 49) = -2.9681816685955910267761649521505D+00 xtab( 50) = -2.7681946921824058801226545958892D+00 xtab( 51) = -2.5686543769473501723144013022363D+00 xtab( 52) = -2.3695249790490401080012474645702D+00 xtab( 53) = -2.1707716587411506879498498083695D+00 xtab( 54) = -1.9723603904195020079324743227565D+00 xtab( 55) = -1.7742578780516791584676442103681D+00 xtab( 56) = -1.5764314753267801315519597621879D+00 xtab( 57) = -1.3788491099261778091441557053728D+00 xtab( 58) = -1.1814792113700685848678583598423D+00 xtab( 59) = -0.98429064194027277726568984213773D+00 xtab( 60) = -0.78725263021825034151596831878971D+00 xtab( 61) = -0.59033470680942102142230439346102D+00 xtab( 62) = -0.39350664185130136568037826200185D+00 xtab( 63) = -0.19673838392423251964272239737078D+00 xtab( 64) = 0.0000000000000000000000000000000D+00 xtab( 65) = 0.19673838392423251964272239737078D+00 xtab( 66) = 0.39350664185130136568037826200185D+00 xtab( 67) = 0.59033470680942102142230439346102D+00 xtab( 68) = 0.78725263021825034151596831878971D+00 xtab( 69) = 0.98429064194027277726568984213773D+00 xtab( 70) = 1.1814792113700685848678583598423D+00 xtab( 71) = 1.3788491099261778091441557053728D+00 xtab( 72) = 1.5764314753267801315519597621879D+00 xtab( 73) = 1.7742578780516791584676442103681D+00 xtab( 74) = 1.9723603904195020079324743227565D+00 xtab( 75) = 2.1707716587411506879498498083695D+00 xtab( 76) = 2.3695249790490401080012474645702D+00 xtab( 77) = 2.5686543769473501723144013022363D+00 xtab( 78) = 2.7681946921824058801226545958892D+00 xtab( 79) = 2.9681816685955910267761649521505D+00 xtab( 80) = 3.1686520501953630191857798261495D+00 xtab( 81) = 3.3696436841717397896643629240035D+00 xtab( 82) = 3.5711956317782180447199756485249D+00 xtab( 83) = 3.7733482881250526721004678400057D+00 xtab( 84) = 3.9761435120673355916035814195920D+00 xtab( 85) = 4.1796247675352031349421189892408D+00 xtab( 86) = 4.3838372778464736294253744407459D+00 xtab( 87) = 4.5888281947698372951606485031212D+00 xtab( 88) = 4.7946467843764925009748509930857D+00 xtab( 89) = 5.0013446320386360038520809107373D+00 xtab( 90) = 5.2089758693153983587570258372239D+00 xtab( 91) = 5.4175974259243240722848425872924D+00 xtab( 92) = 5.6272693105464816659423455794909D+00 xtab( 93) = 5.8380549248774187386601690807757D+00 xtab( 94) = 6.0500214161419845694465474482388D+00 xtab( 95) = 6.2632400742737354345609723857092D+00 xtab( 96) = 6.4777867811645365448144903821487D+00 xtab( 97) = 6.6937425208758294190074417381666D+00 xtab( 98) = 6.9111939615465713197465633109366D+00 xtab( 99) = 7.1302341220350710668064025713431D+00 xtab(100) = 7.3509631392269052701961258043733D+00 xtab(101) = 7.5734891556083454022834960763301D+00 xtab(102) = 7.7979293513870105420829120455591D+00 xtab(103) = 8.0244111514703375578594739796798D+00 xtab(104) = 8.2530736454457156579694124243888D+00 xtab(105) = 8.4840692689832473326097180339984D+00 xtab(106) = 8.7175658087076307363833999548548D+00 xtab(107) = 8.9537488108565404323807890169970D+00 xtab(108) = 9.1928244988460305715774195052527D+00 xtab(109) = 9.4350233389881650135019598506287D+00 xtab(110) = 9.6806044412474728038150712732737D+00 xtab(111) = 9.9298610495114250736847004273684D+00 xtab(112) = 10.183127473450343888624126450357D+00 xtab(113) = 10.440787957772772867742591798027D+00 xtab(114) = 10.703288201027481347670940744690D+00 xtab(115) = 10.971150569840247423423040263881D+00 xtab(116) = 11.244994583785543445194384194300D+00 xtab(117) = 11.525565112572696599167888588564D+00 xtab(118) = 11.813772198267727195134584136191D+00 xtab(119) = 12.110749020947747600132123508132D+00 xtab(120) = 12.417939378869715805445879624069D+00 xtab(121) = 12.737235652415686338138003924072D+00 xtab(122) = 13.071208660474601901583995439649D+00 xtab(123) = 13.423518590070950062438258321855D+00 xtab(124) = 13.799722290211676634645246746673D+00 xtab(125) = 14.209085995284870755168244250887D+00 xtab(126) = 14.669595158833972632746354112896D+00 xtab(127) = 15.228338148167350978246954433464D+00 weight( 1) = 0.12504497577050595552677230002883D-100 weight( 2) = 0.17272798059419131415318615789672D-93 weight( 3) = 0.89321681571986548608031150791499D-88 weight( 4) = 0.77306185240893578449625186483810D-83 weight( 5) = 0.20143957652648255497735460506196D-78 weight( 6) = 0.21503714733610239701351039429345D-74 weight( 7) = 0.11341924208594594813715533569504D-70 weight( 8) = 0.33489139011795051950683388483136D-67 weight( 9) = 0.60486548964016681064424451668405D-64 weight( 10) = 0.71375092946352177824971347343892D-61 weight( 11) = 0.57884563374885556636801095624030D-58 weight( 12) = 0.33581166223858230300409326551248D-55 weight( 13) = 0.14394641949253923568603163698953D-52 weight( 14) = 0.46821808383216117724080263903889D-50 weight( 15) = 0.11817054440684264071348471955361D-47 weight( 16) = 0.23581659156008927203181682045005D-45 weight( 17) = 0.37814427940797540210712758405540D-43 weight( 18) = 0.49411031115771638145610738414006D-41 weight( 19) = 0.53255303775425059266087298458297D-39 weight( 20) = 0.47854390680131484999315199332765D-37 weight( 21) = 0.36191883445952356128627543209554D-35 weight( 22) = 0.23232083386343554805352497446119D-33 weight( 23) = 0.12753331411008716683688974281454D-31 weight( 24) = 0.60277753850758742112436095241270D-30 weight( 25) = 0.24679773241777200207460855084439D-28 weight( 26) = 0.88019567691698482573264198727415D-27 weight( 27) = 0.27482489212040561315005725890593D-25 weight( 28) = 0.75468218903085486125222816438456D-24 weight( 29) = 0.18303134636280466270545996891835D-22 weight( 30) = 0.39355990860860813085582448449811D-21 weight( 31) = 0.75293161638581191068419292570042D-20 weight( 32) = 0.12857997786722855037584105682618D-18 weight( 33) = 0.19659326888445857792541925311450D-17 weight( 34) = 0.26986511907214101894995783364250D-16 weight( 35) = 0.33344414303198856330118301113874D-15 weight( 36) = 0.37173303125150639885726463109574D-14 weight( 37) = 0.37473954472839737091885387788983D-13 weight( 38) = 0.34230094493397259538669512076007D-12 weight( 39) = 0.28385303724993373166810860630552D-11 weight( 40) = 0.21406920290454669208938772802828D-10 weight( 41) = 0.14706331273431716244229273183839D-09 weight( 42) = 0.92173940967434659264335883218167D-09 weight( 43) = 0.52781663936972714041837056042506D-08 weight( 44) = 0.27650497044951117835905283127679D-07 weight( 45) = 0.13267855842539464770913063113371D-06 weight( 46) = 0.58380944276113062188573331195042D-06 weight( 47) = 0.23581561724775629112332165335800D-05 weight( 48) = 0.87524468034280444703919485644809D-05 weight( 49) = 0.29876790535909012274846532159647D-04 weight( 50) = 0.93874435720072545206729594267039D-04 weight( 51) = 0.27170762627931172053444716883938D-03 weight( 52) = 0.72493929742498358979684249380921D-03 weight( 53) = 0.17841208326763432884316727108264D-02 weight( 54) = 0.40524855186046131499765636276283D-02 weight( 55) = 0.85000263041544110385806705526917D-02 weight( 56) = 0.16471142241609687824005585301760D-01 weight( 57) = 0.29499296248213632269675010319119D-01 weight( 58) = 0.48847387114300011006959603975676D-01 weight( 59) = 0.74807989768583731416517226905270D-01 weight( 60) = 0.10598520508090929403834368934301D+00 weight( 61) = 0.13893945309051540832066283010510D+00 weight( 62) = 0.16856236074207929740526975049765D+00 weight( 63) = 0.18927849580120432177170145550076D+00 weight( 64) = 0.19673340688823289786163676995151D+00 weight( 65) = 0.18927849580120432177170145550076D+00 weight( 66) = 0.16856236074207929740526975049765D+00 weight( 67) = 0.13893945309051540832066283010510D+00 weight( 68) = 0.10598520508090929403834368934301D+00 weight( 69) = 0.74807989768583731416517226905270D-01 weight( 70) = 0.48847387114300011006959603975676D-01 weight( 71) = 0.29499296248213632269675010319119D-01 weight( 72) = 0.16471142241609687824005585301760D-01 weight( 73) = 0.85000263041544110385806705526917D-02 weight( 74) = 0.40524855186046131499765636276283D-02 weight( 75) = 0.17841208326763432884316727108264D-02 weight( 76) = 0.72493929742498358979684249380921D-03 weight( 77) = 0.27170762627931172053444716883938D-03 weight( 78) = 0.93874435720072545206729594267039D-04 weight( 79) = 0.29876790535909012274846532159647D-04 weight( 80) = 0.87524468034280444703919485644809D-05 weight( 81) = 0.23581561724775629112332165335800D-05 weight( 82) = 0.58380944276113062188573331195042D-06 weight( 83) = 0.13267855842539464770913063113371D-06 weight( 84) = 0.27650497044951117835905283127679D-07 weight( 85) = 0.52781663936972714041837056042506D-08 weight( 86) = 0.92173940967434659264335883218167D-09 weight( 87) = 0.14706331273431716244229273183839D-09 weight( 88) = 0.21406920290454669208938772802828D-10 weight( 89) = 0.28385303724993373166810860630552D-11 weight( 90) = 0.34230094493397259538669512076007D-12 weight( 91) = 0.37473954472839737091885387788983D-13 weight( 92) = 0.37173303125150639885726463109574D-14 weight( 93) = 0.33344414303198856330118301113874D-15 weight( 94) = 0.26986511907214101894995783364250D-16 weight( 95) = 0.19659326888445857792541925311450D-17 weight( 96) = 0.12857997786722855037584105682618D-18 weight( 97) = 0.75293161638581191068419292570042D-20 weight( 98) = 0.39355990860860813085582448449811D-21 weight( 99) = 0.18303134636280466270545996891835D-22 weight(100) = 0.75468218903085486125222816438456D-24 weight(101) = 0.27482489212040561315005725890593D-25 weight(102) = 0.88019567691698482573264198727415D-27 weight(103) = 0.24679773241777200207460855084439D-28 weight(104) = 0.60277753850758742112436095241270D-30 weight(105) = 0.12753331411008716683688974281454D-31 weight(106) = 0.23232083386343554805352497446119D-33 weight(107) = 0.36191883445952356128627543209554D-35 weight(108) = 0.47854390680131484999315199332765D-37 weight(109) = 0.53255303775425059266087298458297D-39 weight(110) = 0.49411031115771638145610738414006D-41 weight(111) = 0.37814427940797540210712758405540D-43 weight(112) = 0.23581659156008927203181682045005D-45 weight(113) = 0.11817054440684264071348471955361D-47 weight(114) = 0.46821808383216117724080263903889D-50 weight(115) = 0.14394641949253923568603163698953D-52 weight(116) = 0.33581166223858230300409326551248D-55 weight(117) = 0.57884563374885556636801095624030D-58 weight(118) = 0.71375092946352177824971347343892D-61 weight(119) = 0.60486548964016681064424451668405D-64 weight(120) = 0.33489139011795051950683388483136D-67 weight(121) = 0.11341924208594594813715533569504D-70 weight(122) = 0.21503714733610239701351039429345D-74 weight(123) = 0.20143957652648255497735460506196D-78 weight(124) = 0.77306185240893578449625186483810D-83 weight(125) = 0.89321681571986548608031150791499D-88 weight(126) = 0.17272798059419131415318615789672D-93 weight(127) = 0.12504497577050595552677230002883D-100 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'HERMITE_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are 1 to 20,' write ( *, '(a)' ) ' 30, 31, 32, 40, 50, 60, 63, 64 and 127.' stop end if return end subroutine imtql2 ( n, d, e, z, ierr ) !*****************************************************************************80 ! !! IMTQL2 computes all eigenvalues/vectors of a symmetric tridiagonal matrix. ! ! Discussion: ! ! This subroutine finds the eigenvalues and eigenvectors ! of a symmetric tridiagonal matrix by the implicit QL method. ! The eigenvectors of a full symmetric matrix can also ! be found if TRED2 has been used to reduce this ! full matrix to tridiagonal form. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 October 2009 ! ! Author: ! ! Original FORTRAN77 version by Smith, Boyle, Dongarra, Garbow, Ikebe, ! Klema, Moler. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! James Wilkinson, Christian Reinsch, ! Handbook for Automatic Computation, ! Volume II, Linear Algebra, Part 2, ! Springer, 1971, ! ISBN: 0387054146, ! LC: QA251.W67. ! ! Brian Smith, James Boyle, Jack Dongarra, Burton Garbow, ! Yasuhiko Ikebe, Virginia Klema, Cleve Moler, ! Matrix Eigensystem Routines, EISPACK Guide, ! Lecture Notes in Computer Science, Volume 6, ! Springer Verlag, 1976, ! ISBN13: 978-3540075462, ! LC: QA193.M37. ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order of the matrix. ! ! Input/output, real ( kind = 8 ) D(N). On input, the diagonal elements of ! the input matrix. On output, the eigenvalues in ascending order. If an ! error exit is made, the eigenvalues are correct but ! unordered for indices 1,2,...,IERR-1. ! ! Input/output, real ( kind = 8 ) E(N). On input, the subdiagonal elements ! of the input matrix in E(2:N). E(1) is arbitrary. On output, E is ! overwritten. ! ! Input/output, real ( kind = 8 ) Z(N,N). On input, the transformation ! matrix produced in the reduction by TRED2, if performed. If the ! eigenvectors of the tridiagonal matrix are desired, Z must contain the ! identity matrix. On output, Z contains orthonormal eigenvectors of the ! symmetric tridiagonal (or full) matrix. If an error exit is made, Z ! contains the eigenvectors associated with the stored eigenvalues. ! ! Output, integer ( kind = 4 ) IERR, error flag. ! 0, for normal return, ! J, if the J-th eigenvalue has not been determined after 30 iterations. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) b real ( kind = 8 ) c real ( kind = 8 ) d(n) real ( kind = 8 ) e(n) real ( kind = 8 ) f real ( kind = 8 ) g integer ( kind = 4 ) i integer ( kind = 4 ) ierr integer ( kind = 4 ) ii integer ( kind = 4 ) j integer ( kind = 4 ) k integer ( kind = 4 ) l integer ( kind = 4 ) m integer ( kind = 4 ) mml real ( kind = 8 ) p real ( kind = 8 ) pythag real ( kind = 8 ) r real ( kind = 8 ) s real ( kind = 8 ) t(n) real ( kind = 8 ) tst1 real ( kind = 8 ) tst2 real ( kind = 8 ) z(n,n) ierr = 0 if ( n == 1 ) then return end if do i = 2, n e(i-1) = e(i) end do e(n) = 0.0D+00 do l = 1, n j = 0 ! ! Look for a small sub-diagonal element. ! 105 continue do m = l, n if ( m == n ) then exit end if tst1 = abs ( d(m) ) + abs ( d(m+1) ) tst2 = tst1 + abs ( e(m) ) if ( tst2 == tst1 ) then exit end if end do p = d(l) if ( m == l ) then cycle end if if ( 30 <= j ) then ierr = l return end if j = j + 1 ! ! Form shift. ! g = ( d(l+1) - p ) / ( 2.0D+00 * e(l) ) r = pythag ( g, 1.0D+00 ) g = d(m) - p + e(l) / ( g + sign ( r, g ) ) s = 1.0D+00 c = 1.0D+00 p = 0.0D+00 mml = m - l do ii = 1, mml i = m - ii f = s * e(i) b = c * e(i) r = pythag ( f, g ) e(i+1) = r ! ! Recover from underflow. ! if ( r == 0.0D+00 ) then d(i+1) = d(i+1) - p e(m) = 0.0D+00 go to 105 end if s = f / r c = g / r g = d(i+1) - p r = ( d(i) - g ) * s + 2.0D+00 * c * b p = s * r d(i+1) = g + p g = c * r - b ! ! Form vector. ! do k = 1, n f = z(k,i+1) z(k,i+1) = s * z(k,i) + c * f z(k,i) = c * z(k,i) - s * f end do end do d(l) = d(l) - p e(l) = g e(m) = 0.0D+00 go to 105 end do ! ! Order eigenvalues and eigenvectors. ! do ii = 2, n i = ii - 1 k = i p = d(i) do j = ii, n if ( d(j) < p ) then k = j p = d(j) end if end do if ( k /= i ) then d(k) = d(i) d(i) = p t(1:n) = z(1:n,i) z(1:n,i) = z(1:n,k) z(1:n,k) = t(1:n) end if end do return end subroutine jacobi_compute ( order, alpha, beta, xtab, weight ) !*****************************************************************************80 ! !! JACOBI_COMPUTE computes a Gauss-Jacobi quadrature rule. ! ! Discussion: ! ! The weight function is w(x) = (1-X)^ALPHA * (1+X)^BETA. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) (1-X)^ALPHA * (1+X)^BETA * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Thanks to Xu Xiang of Fudan University for pointing out that ! an earlier implementation of this routine was incorrect! ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 14 May 2007 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order of the quadrature rule ! to be computed. ! ! Input, real ( kind = 8 ) ALPHA, BETA, the exponents of (1-X) and ! (1+X) in the quadrature rule. For simple Gauss-Legendre quadrature, ! set ALPHA = BETA = 0.0. -1.0 < ALPHA and -1.0 < BETA are required. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha real ( kind = 8 ) an real ( kind = 8 ) b(order) real ( kind = 8 ) beta real ( kind = 8 ) bn real ( kind = 8 ) c(order) real ( kind = 8 ) cc real ( kind = 8 ) delta real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p1 real ( kind = 8 ) r1 real ( kind = 8 ) r2 real ( kind = 8 ) r3 real ( kind = 8 ) r8_gamma real ( kind = 8 ) weight(order) real ( kind = 8 ) x real ( kind = 8 ) xtab(order) ! ! Check ALPHA and BETA. ! if ( alpha <= -1.0D+00 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'JACOBI_COMPUTE - Fatal error!' write ( *, '(a)' ) ' -1.0 < ALPHA is required.' stop end if if ( beta <= -1.0D+00 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'JACOBI_COMPUTE - Fatal error!' write ( *, '(a)' ) ' -1.0 < BETA is required.' stop end if ! ! Set the recursion coefficients. ! do i = 1, order if ( alpha + beta == 0.0D+00 .or. beta - alpha == 0.0D+00 ) then b(i) = 0.0D+00 else b(i) = ( alpha + beta ) * ( beta - alpha ) / & ( ( alpha + beta + real ( 2 * i, kind = 8 ) ) & * ( alpha + beta + real ( 2 * i - 2, kind = 8 ) ) ) end if if ( i == 1 ) then c(i) = 0.0D+00 else c(i) = 4.0D+00 * real ( i - 1, kind = 8 ) & * ( alpha + real ( i - 1, kind = 8 ) ) & * ( beta + real ( i - 1, kind = 8 ) ) & * ( alpha + beta + real ( i - 1, kind = 8 ) ) / & ( ( alpha + beta + real ( 2 * i - 1, kind = 8 ) ) & * ( alpha + beta + real ( 2 * i - 2, kind = 8 ) )**2 & * ( alpha + beta + real ( 2 * i - 3, kind = 8 ) ) ) end if end do delta = r8_gamma ( alpha + 1.0D+00 ) & * r8_gamma ( beta + 1.0D+00 ) & / r8_gamma ( alpha + beta + 2.0D+00 ) cc = delta * 2.0D+00**( alpha + beta + 1.0D+00 ) * product ( c(2:order) ) do i = 1, order if ( i == 1 ) then an = alpha / real ( order, kind = 8 ) bn = beta / real ( order, kind = 8 ) r1 = ( 1.0D+00 + alpha ) & * ( 2.78D+00 / ( 4.0D+00 + real ( order**2, kind = 8 ) ) & + 0.768D+00 * an / real ( order, kind = 8 ) ) r2 = 1.0D+00 + 1.48D+00 * an + 0.96D+00 * bn & + 0.452D+00 * an**2 + 0.83D+00 * an * bn x = ( r2 - r1 ) / r2 else if ( i == 2 ) then r1 = ( 4.1D+00 + alpha ) / & ( ( 1.0D+00 + alpha ) * ( 1.0D+00 + 0.156D+00 * alpha ) ) r2 = 1.0D+00 + 0.06D+00 * ( real ( order, kind = 8 ) - 8.0D+00 ) * & ( 1.0D+00 + 0.12D+00 * alpha ) / real ( order, kind = 8 ) r3 = 1.0D+00 + 0.012D+00 * beta * & ( 1.0D+00 + 0.25D+00 * abs ( alpha ) ) / real ( order, kind = 8 ) x = x - r1 * r2 * r3 * ( 1.0D+00 - x ) else if ( i == 3 ) then r1 = ( 1.67D+00 + 0.28D+00 * alpha ) / ( 1.0D+00 + 0.37D+00 * alpha ) r2 = 1.0D+00 + 0.22D+00 * ( real ( order, kind = 8 ) - 8.0D+00 ) & / real ( order, kind = 8 ) r3 = 1.0D+00 + 8.0D+00 * beta / & ( ( 6.28D+00 + beta ) * real ( order**2, kind = 8 ) ) x = x - r1 * r2 * r3 * ( xtab(1) - x ) else if ( i < order - 1 ) then x = 3.0D+00 * xtab(i-1) - 3.0D+00 * xtab(i-2) + xtab(i-3) else if ( i == order - 1 ) then r1 = ( 1.0D+00 + 0.235D+00 * beta ) / ( 0.766D+00 + 0.119D+00 * beta ) r2 = 1.0D+00 / ( 1.0D+00 + 0.639D+00 & * ( real ( order, kind = 8 ) - 4.0D+00 ) & / ( 1.0D+00 + 0.71D+00 * ( real ( order, kind = 8 ) - 4.0D+00 ) ) ) r3 = 1.0D+00 / ( 1.0D+00 + 20.0D+00 * alpha / ( ( 7.5D+00 + alpha ) * & real ( order**2, kind = 8 ) ) ) x = x + r1 * r2 * r3 * ( x - xtab(i-2) ) else if ( i == order ) then r1 = ( 1.0D+00 + 0.37D+00 * beta ) / ( 1.67D+00 + 0.28D+00 * beta ) r2 = 1.0D+00 / & ( 1.0D+00 + 0.22D+00 * ( real ( order, kind = 8 ) - 8.0D+00 ) & / real ( order, kind = 8 ) ) r3 = 1.0D+00 / ( 1.0D+00 + 8.0D+00 * alpha / & ( ( 6.28D+00 + alpha ) * real ( order**2, kind = 8 ) ) ) x = x + r1 * r2 * r3 * ( x - xtab(i-2) ) end if call jacobi_root ( x, order, alpha, beta, dp2, p1, b, c ) xtab(i) = x weight(i) = cc / ( dp2 * p1 ) end do ! ! Reverse the order of the data. ! xtab(1:order) = xtab(order:1:-1) weight(1:order) = weight(order:1:-1) return end subroutine jacobi_integral ( expon, alpha, beta, value ) !*****************************************************************************80 ! !! JACOBI_INTEGRAL evaluates the integral of a monomial with Jacobi weight. ! ! Discussion: ! ! VALUE = Integral ( -1 <= X <= +1 ) x^EXPON (1-x)^ALPHA (1+x)^BETA dx ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 11 February 2008 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) EXPON, the exponent. ! ! Input, real ( kind = 8 ) ALPHA, the exponent of (1-X) in the weight factor. ! ! Input, real ( kind = 8 ) BETA, the exponent of (1+X) in the weight factor. ! ! Output, real ( kind = 8 ) VALUE, the value of the integral. ! implicit none real ( kind = 8 ) alpha real ( kind = 8 ) arg1 real ( kind = 8 ) arg2 real ( kind = 8 ) arg3 real ( kind = 8 ) arg4 real ( kind = 8 ) beta real ( kind = 8 ) c integer ( kind = 4 ) expon real ( kind = 8 ) r8_gamma real ( kind = 8 ) s real ( kind = 8 ) value real ( kind = 8 ) value1 real ( kind = 8 ) value2 c = real ( expon, kind = 8 ) if ( mod ( expon, 2 ) == 0 ) then s = +1.0D+00 else s = -1.0D+00 end if arg1 = - alpha arg2 = 1.0D+00 + c arg3 = 2.0D+00 + beta + c arg4 = - 1.0D+00 call r8_hyper_2f1 ( arg1, arg2, arg3, arg4, value1 ) arg1 = - beta arg2 = 1.0D+00 + c arg3 = 2.0D+00 + alpha + c arg4 = - 1.0D+00 call r8_hyper_2f1 ( arg1, arg2, arg3, arg4, value2 ) value = r8_gamma ( 1.0D+00 + c ) * ( & s * r8_gamma ( 1.0D+00 + beta ) * value1 & / r8_gamma ( 2.0D+00 + beta + c ) & + r8_gamma ( 1.0D+00 + alpha ) * value2 & / r8_gamma ( 2.0D+00 + alpha + c ) ) return end subroutine jacobi_recur ( p2, dp2, p1, x, order, alpha, beta, b, c ) !*****************************************************************************80 ! !! JACOBI_RECUR finds the value and derivative of a Jacobi polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 September 1998 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Output, real ( kind = 8 ) P2, the value of J(ORDER)(X). ! ! Output, real ( kind = 8 ) DP2, the value of J'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of J(ORDER-1)(X). ! ! Input, real ( kind = 8 ) X, the point at which polynomials are evaluated. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Input, real ( kind = 8 ) ALPHA, BETA, the exponents of (1-X) and ! (1+X) in the quadrature rule. ! ! Input, real ( kind = 8 ) B(ORDER), C(ORDER), the recursion ! coefficients. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha real ( kind = 8 ) b(order) real ( kind = 8 ) beta real ( kind = 8 ) c(order) real ( kind = 8 ) dp0 real ( kind = 8 ) dp1 real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p0 real ( kind = 8 ) p1 real ( kind = 8 ) p2 real ( kind = 8 ) x p1 = 1.0D+00 dp1 = 0.0D+00 p2 = x + ( alpha - beta ) / ( alpha + beta + 2.0D+00 ) dp2 = 1.0D+00 do i = 2, order p0 = p1 dp0 = dp1 p1 = p2 dp1 = dp2 p2 = ( x - b(i) ) * p1 - c(i) * p0 dp2 = ( x - b(i) ) * dp1 + p1 - c(i) * dp0 end do return end subroutine jacobi_root ( x, order, alpha, beta, dp2, p1, b, c ) !*****************************************************************************80 ! !! JACOBI_ROOT improves an approximate root of a Jacobi polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 09 December 2000 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input/output, real ( kind = 8 ) X, the approximate root, which ! should be improved on output. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Input, real ( kind = 8 ) ALPHA, BETA, the exponents of (1-X) and ! (1+X) in the quadrature rule. ! ! Output, real ( kind = 8 ) DP2, the value of J'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of J(ORDER-1)(X). ! ! Input, real ( kind = 8 ) B(ORDER), C(ORDER), the recursion coefficients. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) alpha real ( kind = 8 ) b(order) real ( kind = 8 ) beta real ( kind = 8 ) c(order) real ( kind = 8 ) d real ( kind = 8 ) dp2 real ( kind = 8 ) eps real ( kind = 8 ) p1 real ( kind = 8 ) p2 integer ( kind = 4 ) step integer ( kind = 4 ), parameter :: step_max = 10 real ( kind = 8 ) x eps = epsilon ( eps ) do step = 1, step_max call jacobi_recur ( p2, dp2, p1, x, order, alpha, beta, b, c ) d = p2 / dp2 x = x - d if ( abs ( d ) <= eps * ( abs ( x ) + 1.0D+00 ) ) then return end if end do return end subroutine kronrod_set ( order, xtab, weight ) !*****************************************************************************80 ! !! KRONROD_SET sets abscissas and weights for Gauss-Kronrod quadrature. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1.0. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! A Kronrod rule is used in conjunction with a lower order ! Gauss rule, and provides an efficient error estimation. ! ! The error may be estimated as the difference in the two integral ! approximations. ! ! The efficiency comes about because the Kronrod uses the abscissas ! of the Gauss rule, thus saving on the number of function evaluations ! necessary. If the Kronrod rule were replaced by a Gauss rule of ! the same order, a higher precision integral estimate would be ! made, but the function would have to be evaluated at many more ! points. ! ! The Gauss Kronrod pair of rules involves an ( ORDER + 1 ) / 2 ! point Gauss-Legendre rule and an ORDER point Kronrod rule. ! Thus, the 15 point Kronrod rule should be paired with the ! Gauss-Legendre 7 point rule. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 16 September 1998 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Robert Piessens, Elise deDoncker-Kapenga, ! Christian Ueberhuber, David Kahaner, ! QUADPACK: A Subroutine Package for Automatic Integration, ! Springer, 1983, ! ISBN: 3540125531. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order, which may be ! 15, 21, 31 or 41, corresponding to Gauss-Legendre rules of ! order 7, 10, 15 or 20. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas, which ! are symmetrically places in [-1,1]. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! The weights are positive, symmetric, and should sum to 2. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) if ( order == 15 ) then xtab(1) = - 0.9914553711208126D+00 xtab(2) = - 0.9491079123427585D+00 xtab(3) = - 0.8648644233597691D+00 xtab(4) = - 0.7415311855993944D+00 xtab(5) = - 0.5860872354676911D+00 xtab(6) = - 0.4058451513773972D+00 xtab(7) = - 0.2077849550789850D+00 xtab(8) = 0.0D+00 xtab(9) = 0.2077849550789850D+00 xtab(10) = 0.4058451513773972D+00 xtab(11) = 0.5860872354676911D+00 xtab(12) = 0.7415311855993944D+00 xtab(13) = 0.8648644233597691D+00 xtab(14) = 0.9491079123427585D+00 xtab(15) = 0.9914553711208126D+00 weight(1) = 0.2293532201052922D-01 weight(2) = 0.6309209262997855D-01 weight(3) = 0.1047900103222502D+00 weight(4) = 0.1406532597155259D+00 weight(5) = 0.1690047266392679D+00 weight(6) = 0.1903505780647854D+00 weight(7) = 0.2044329400752989D+00 weight(8) = 0.2094821410847278D+00 weight(9) = 0.2044329400752989D+00 weight(10) = 0.1903505780647854D+00 weight(11) = 0.1690047266392679D+00 weight(12) = 0.1406532597155259D+00 weight(13) = 0.1047900103222502D+00 weight(14) = 0.6309209262997855D-01 weight(15) = 0.2293532201052922D-01 else if ( order == 21 ) then xtab(1) = - 0.9956571630258081D+00 xtab(2) = - 0.9739065285171717D+00 xtab(3) = - 0.9301574913557082D+00 xtab(4) = - 0.8650633666889845D+00 xtab(5) = - 0.7808177265864169D+00 xtab(6) = - 0.6794095682990244D+00 xtab(7) = - 0.5627571346686047D+00 xtab(8) = - 0.4333953941292472D+00 xtab(9) = - 0.2943928627014602D+00 xtab(10) = - 0.1488743389816312D+00 xtab(11) = 0.0D+00 xtab(12) = 0.1488743389816312D+00 xtab(13) = 0.2943928627014602D+00 xtab(14) = 0.4333953941292472D+00 xtab(15) = 0.5627571346686047D+00 xtab(16) = 0.6794095682990244D+00 xtab(17) = 0.7808177265864169D+00 xtab(18) = 0.8650633666889845D+00 xtab(19) = 0.9301574913557082D+00 xtab(20) = 0.9739065285171717D+00 xtab(21) = 0.9956571630258081D+00 weight(1) = 0.1169463886737187D-01 weight(2) = 0.3255816230796473D-01 weight(3) = 0.5475589657435200D-01 weight(4) = 0.7503967481091995D-01 weight(5) = 0.9312545458369761D-01 weight(6) = 0.1093871588022976D+00 weight(7) = 0.1234919762620659D+00 weight(8) = 0.1347092173114733D+00 weight(9) = 0.1427759385770601D+00 weight(10) = 0.1477391049013385D+00 weight(11) = 0.1494455540029169D+00 weight(12) = 0.1477391049013385D+00 weight(13) = 0.1427759385770601D+00 weight(14) = 0.1347092173114733D+00 weight(15) = 0.1234919762620659D+00 weight(16) = 0.1093871588022976D+00 weight(17) = 0.9312545458369761D-01 weight(18) = 0.7503967481091995D-01 weight(19) = 0.5475589657435200D-01 weight(20) = 0.3255816230796473D-01 weight(21) = 0.1169463886737187D-01 else if ( order == 31 ) then xtab(1) = - 0.9980022986933971D+00 xtab(2) = - 0.9879925180204854D+00 xtab(3) = - 0.9677390756791391D+00 xtab(4) = - 0.9372733924007059D+00 xtab(5) = - 0.8972645323440819D+00 xtab(6) = - 0.8482065834104272D+00 xtab(7) = - 0.7904185014424659D+00 xtab(8) = - 0.7244177313601700D+00 xtab(9) = - 0.6509967412974170D+00 xtab(10) = - 0.5709721726085388D+00 xtab(11) = - 0.4850818636402397D+00 xtab(12) = - 0.3941513470775634D+00 xtab(13) = - 0.2991800071531688D+00 xtab(14) = - 0.2011940939974345D+00 xtab(15) = - 0.1011420669187175D+00 xtab(16) = 0.0D+00 xtab(17) = 0.1011420669187175D+00 xtab(18) = 0.2011940939974345D+00 xtab(19) = 0.2991800071531688D+00 xtab(20) = 0.3941513470775634D+00 xtab(21) = 0.4850818636402397D+00 xtab(22) = 0.5709721726085388D+00 xtab(23) = 0.6509967412974170D+00 xtab(24) = 0.7244177313601700D+00 xtab(25) = 0.7904185014424659D+00 xtab(26) = 0.8482065834104272D+00 xtab(27) = 0.8972645323440819D+00 xtab(28) = 0.9372733924007059D+00 xtab(29) = 0.9677390756791391D+00 xtab(30) = 0.9879925180204854D+00 xtab(31) = 0.9980022986933971D+00 weight(1) = 0.5377479872923349D-02 weight(2) = 0.1500794732931612D-01 weight(3) = 0.2546084732671532D-01 weight(4) = 0.3534636079137585D-01 weight(5) = 0.4458975132476488D-01 weight(6) = 0.5348152469092809D-01 weight(7) = 0.6200956780067064D-01 weight(8) = 0.6985412131872826D-01 weight(9) = 0.7684968075772038D-01 weight(10) = 0.8308050282313302D-01 weight(11) = 0.8856444305621177D-01 weight(12) = 0.9312659817082532D-01 weight(13) = 0.9664272698362368D-01 weight(14) = 0.9917359872179196D-01 weight(15) = 0.1007698455238756D+00 weight(16) = 0.1013300070147915D+00 weight(17) = 0.1007698455238756D+00 weight(18) = 0.9917359872179196D-01 weight(19) = 0.9664272698362368D-01 weight(20) = 0.9312659817082532D-01 weight(21) = 0.8856444305621177D-01 weight(22) = 0.8308050282313302D-01 weight(23) = 0.7684968075772038D-01 weight(24) = 0.6985412131872826D-01 weight(25) = 0.6200956780067064D-01 weight(26) = 0.5348152469092809D-01 weight(27) = 0.4458975132476488D-01 weight(28) = 0.3534636079137585D-01 weight(29) = 0.2546084732671532D-01 weight(30) = 0.1500794732931612D-01 weight(31) = 0.5377479872923349D-02 else if ( order == 41 ) then xtab(1) = - 0.9988590315882777D+00 xtab(2) = - 0.9931285991850949D+00 xtab(3) = - 0.9815078774502503D+00 xtab(4) = - 0.9639719272779138D+00 xtab(5) = - 0.9408226338317548D+00 xtab(6) = - 0.9122344282513259D+00 xtab(7) = - 0.8782768112522820D+00 xtab(8) = - 0.8391169718222188D+00 xtab(9) = - 0.7950414288375512D+00 xtab(10) = - 0.7463319064601508D+00 xtab(11) = - 0.6932376563347514D+00 xtab(12) = - 0.6360536807265150D+00 xtab(13) = - 0.5751404468197103D+00 xtab(14) = - 0.5108670019508271D+00 xtab(15) = - 0.4435931752387251D+00 xtab(16) = - 0.3737060887154196D+00 xtab(17) = - 0.3016278681149130D+00 xtab(18) = - 0.2277858511416451D+00 xtab(19) = - 0.1526054652409227D+00 xtab(20) = - 0.7652652113349733D-01 xtab(21) = 0.0D+00 xtab(22) = 0.7652652113349733D-01 xtab(23) = 0.1526054652409227D+00 xtab(24) = 0.2277858511416451D+00 xtab(25) = 0.3016278681149130D+00 xtab(26) = 0.3737060887154196D+00 xtab(27) = 0.4435931752387251D+00 xtab(28) = 0.5108670019508271D+00 xtab(29) = 0.5751404468197103D+00 xtab(30) = 0.6360536807265150D+00 xtab(31) = 0.6932376563347514D+00 xtab(32) = 0.7463319064601508D+00 xtab(33) = 0.7950414288375512D+00 xtab(34) = 0.8391169718222188D+00 xtab(35) = 0.8782768112522820D+00 xtab(36) = 0.9122344282513259D+00 xtab(37) = 0.9408226338317548D+00 xtab(38) = 0.9639719272779138D+00 xtab(39) = 0.9815078774502503D+00 xtab(40) = 0.9931285991850949D+00 xtab(41) = 0.9988590315882777D+00 weight(1) = 0.3073583718520532D-02 weight(2) = 0.8600269855642942D-02 weight(3) = 0.1462616925697125D-01 weight(4) = 0.2038837346126652D-01 weight(5) = 0.2588213360495116D-01 weight(6) = 0.3128730677703280D-01 weight(7) = 0.3660016975820080D-01 weight(8) = 0.4166887332797369D-01 weight(9) = 0.4643482186749767D-01 weight(10) = 0.5094457392372869D-01 weight(11) = 0.5519510534828599D-01 weight(12) = 0.5911140088063957D-01 weight(13) = 0.6265323755478117D-01 weight(14) = 0.6583459713361842D-01 weight(15) = 0.6864867292852162D-01 weight(16) = 0.7105442355344407D-01 weight(17) = 0.7303069033278667D-01 weight(18) = 0.7458287540049919D-01 weight(19) = 0.7570449768455667D-01 weight(20) = 0.7637786767208074D-01 weight(21) = 0.7660071191799966D-01 weight(22) = 0.7637786767208074D-01 weight(23) = 0.7570449768455667D-01 weight(24) = 0.7458287540049919D-01 weight(25) = 0.7303069033278667D-01 weight(26) = 0.7105442355344407D-01 weight(27) = 0.6864867292852162D-01 weight(28) = 0.6583459713361842D-01 weight(29) = 0.6265323755478117D-01 weight(30) = 0.5911140088063957D-01 weight(31) = 0.5519510534828599D-01 weight(32) = 0.5094457392372869D-01 weight(33) = 0.4643482186749767D-01 weight(34) = 0.4166887332797369D-01 weight(35) = 0.3660016975820080D-01 weight(36) = 0.3128730677703280D-01 weight(37) = 0.2588213360495116D-01 weight(38) = 0.2038837346126652D-01 weight(39) = 0.1462616925697125D-01 weight(40) = 0.8600269855642942D-02 weight(41) = 0.3073583718520532D-02 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'KRONROD_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are 15, 21, 31 or 41.' stop end if return end subroutine laguerre_compute ( order, xtab, weight ) !*****************************************************************************80 ! !! LAGUERRE_COMPUTE computes a Gauss-Laguerre quadrature rule. ! ! Discussion: ! ! The integration interval is [ 0, +oo ). ! ! The weight function is w(x) = exp ( -x ). ! ! ! If the integral to approximate is: ! ! Integral ( 0 <= X < +oo ) EXP ( - X ) * F(X) dX ! ! then the quadrature rule is: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! ! If the integral to approximate is: ! ! Integral ( 0 <= X < +oo ) F(X) dX ! ! then the quadrature rule is: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * EXP(XTAB(I)) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 February 2008 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order of the quadrature rule ! to be computed. ORDER must be at least 1. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) b(order) real ( kind = 8 ) c(order) real ( kind = 8 ) cc real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p1 real ( kind = 8 ) r1 real ( kind = 8 ) r2 real ( kind = 8 ) r8_gamma real ( kind = 8 ) ratio real ( kind = 8 ) weight(order) real ( kind = 8 ) x real ( kind = 8 ) xtab(order) ! ! Set the recursion coefficients. ! do i = 1, order b(i) = ( real ( 2 * i - 1, kind = 8 ) ) end do do i = 1, order c(i) = real ( i - 1, kind = 8 ) * ( real ( i - 1, kind = 8 ) ) end do cc = product ( c(2:order) ) do i = 1, order ! ! Compute an estimate for the root. ! if ( i == 1 ) then x = 3.0D+00 / ( 1.0D+00 + 2.4D+00 * real ( order, kind = 8 ) ) else if ( i == 2 ) then x = x + 15.0D+00 / ( 1.0D+00 + 2.5D+00 * real ( order, kind = 8 ) ) else r1 = ( 1.0D+00 + 2.55D+00 * real ( i - 2, kind = 8 ) ) & / ( 1.9D+00 * real ( i - 2, kind = 8 ) ) x = x + r1 * ( x - xtab(i-2) ) end if ! ! Use iteration to find the root. ! call laguerre_root ( x, order, dp2, p1, b, c ) ! ! Set the abscissa and weight. ! xtab(i) = x weight(i) = ( cc / dp2 ) / p1 end do return end subroutine laguerre_integral ( expon, exact ) !*****************************************************************************80 ! !! LAGUERRE_INTEGRAL evaluates a monomial Laguerre integral. ! ! Discussion: ! ! The integral being computed is ! ! integral ( 0 <= x < +oo ) x^n * exp ( -x ) dx ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 February 2008 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) EXPON, the exponent. ! 0 <= EXPON. ! ! Output, real ( kind = 8 ) EXACT, the value of the integral. ! implicit none real ( kind = 8 ) exact integer ( kind = 4 ) expon real ( kind = 8 ) r8_factorial exact = r8_factorial ( expon ) return end subroutine laguerre_recur ( p2, dp2, p1, x, order, b, c ) !*****************************************************************************80 ! !! LAGUERRE_RECUR finds the value and derivative of a Laguerre polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 20 February 2008 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Output, real ( kind = 8 ) P2, the value of L(ORDER)(X). ! ! Output, real ( kind = 8 ) DP2, the value of L'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of L(ORDER-1)(X). ! ! Input, real ( kind = 8 ) X, the point at which polynomials are evaluated. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Input, real ( kind = 8 ) B(ORDER), C(ORDER), the recursion ! coefficients. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) b(order) real ( kind = 8 ) c(order) real ( kind = 8 ) dp0 real ( kind = 8 ) dp1 real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p0 real ( kind = 8 ) p1 real ( kind = 8 ) p2 real ( kind = 8 ) x p1 = 1.0D+00 dp1 = 0.0D+00 p2 = x - 1.0D+00 dp2 = 1.0D+00 do i = 2, order p0 = p1 dp0 = dp1 p1 = p2 dp1 = dp2 p2 = ( x - b(i) ) * p1 - c(i) * p0 dp2 = ( x - b(i) ) * dp1 + p1 - c(i) * dp0 end do return end subroutine laguerre_root ( x, order, dp2, p1, b, c ) !*****************************************************************************80 ! !! LAGUERRE_ROOT improves an approximate root of a Laguerre polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 20 February 2008 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input/output, real ( kind = 8 ) X, the approximate root, which ! should be improved on output. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Output, real ( kind = 8 ) DP2, the value of L'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of L(ORDER-1)(X). ! ! Input, real ( kind = 8 ) B(ORDER), C(ORDER), the recursion coefficients. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) b(order) real ( kind = 8 ) c(order) real ( kind = 8 ) d real ( kind = 8 ) dp2 real ( kind = 8 ) eps real ( kind = 8 ) p1 real ( kind = 8 ) p2 integer ( kind = 4 ) step integer ( kind = 4 ), parameter :: step_max = 10 real ( kind = 8 ) x eps = epsilon ( eps ) do step = 1, step_max call laguerre_recur ( p2, dp2, p1, x, order, b, c ) d = p2 / dp2 x = x - d if ( abs ( d ) <= eps * ( abs ( x ) + 1.0D+00 ) ) then return end if end do return end subroutine laguerre_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LAGUERRE_SET sets abscissas and weights for Laguerre quadrature. ! ! Discussion: ! ! The integration interval is [ 0, +oo ). ! ! The weight function is w(X) = exp ( -X ). ! ! The abscissas are the zeroes of the Laguerre polynomial L(ORDER)(X). ! ! ! If the integral to approximate is: ! ! Integral ( 0 <= X < +oo ) exp ( -X ) * F(X) dX ! ! then the quadrature rule is: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * f ( XTAB(I) ) ! ! If the integral to approximate is: ! ! Integral ( 0 <= X < +oo ) F(X) dX ! ! then the quadrature rule is: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * exp ( XTAB(I) ) * f ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 05 October 2007 ! ! 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, ! LC: QA311.K713. ! ! 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, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1 and 20, 31, 32, 63, 64 or 127. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! The weights are positive, and should add to 1. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) if ( order == 1 ) then xtab(1) = 1.0D+00 weight(1) = 1.0D+00 else if ( order == 2 ) then xtab(1) = 0.585786437626904951198311275790D+00 xtab(2) = 0.341421356237309504880168872421D+01 weight(1) = 0.853553390593273762200422181052D+00 weight(2) = 0.146446609406726237799577818948D+00 else if ( order == 3 ) then xtab(1) = 0.415774556783479083311533873128D+00 xtab(2) = 0.229428036027904171982205036136D+01 xtab(3) = 0.628994508293747919686641576551D+01 weight(1) = 0.711093009929173015449590191143D+00 weight(2) = 0.278517733569240848801444888457D+00 weight(3) = 0.103892565015861357489649204007D-01 else if ( order == 4 ) then xtab(1) = 0.322547689619392311800361943361D+00 xtab(2) = 0.174576110115834657568681671252D+01 xtab(3) = 0.453662029692112798327928538496D+01 xtab(4) = 0.939507091230113312923353644342D+01 weight(1) = 0.603154104341633601635966023818D+00 weight(2) = 0.357418692437799686641492017458D+00 weight(3) = 0.388879085150053842724381681562D-01 weight(4) = 0.539294705561327450103790567621D-03 else if ( order == 5 ) then xtab(1) = 0.263560319718140910203061943361D+00 xtab(2) = 0.141340305910651679221840798019D+01 xtab(3) = 0.359642577104072208122318658878D+01 xtab(4) = 0.708581000585883755692212418111D+01 xtab(5) = 0.126408008442757826594332193066D+02 weight(1) = 0.521755610582808652475860928792D+00 weight(2) = 0.398666811083175927454133348144D+00 weight(3) = 0.759424496817075953876533114055D-01 weight(4) = 0.361175867992204845446126257304D-02 weight(5) = 0.233699723857762278911490845516D-04 else if ( order == 6 ) then xtab(1) = 0.222846604179260689464354826787D+00 xtab(2) = 0.118893210167262303074315092194D+01 xtab(3) = 0.299273632605931407769132528451D+01 xtab(4) = 0.577514356910451050183983036943D+01 xtab(5) = 0.983746741838258991771554702994D+01 xtab(6) = 0.159828739806017017825457915674D+02 weight(1) = 0.458964673949963593568284877709D+00 weight(2) = 0.417000830772120994113377566193D+00 weight(3) = 0.113373382074044975738706185098D+00 weight(4) = 0.103991974531490748989133028469D-01 weight(5) = 0.261017202814932059479242860001D-03 weight(6) = 0.898547906429621238825292052825D-06 else if ( order == 7 ) then xtab(1) = 0.193043676560362413838247885004D+00 xtab(2) = 0.102666489533919195034519944317D+01 xtab(3) = 0.256787674495074620690778622666D+01 xtab(4) = 0.490035308452648456810171437810D+01 xtab(5) = 0.818215344456286079108182755123D+01 xtab(6) = 0.127341802917978137580126424582D+02 xtab(7) = 0.193957278622625403117125820576D+02 weight(1) = 0.409318951701273902130432880018D+00 weight(2) = 0.421831277861719779929281005417D+00 weight(3) = 0.147126348657505278395374184637D+00 weight(4) = 0.206335144687169398657056149642D-01 weight(5) = 0.107401014328074552213195962843D-02 weight(6) = 0.158654643485642012687326223234D-04 weight(7) = 0.317031547899558056227132215385D-07 else if ( order == 8 ) then xtab(1) = 0.170279632305100999788861856608D+00 xtab(2) = 0.903701776799379912186020223555D+00 xtab(3) = 0.225108662986613068930711836697D+01 xtab(4) = 0.426670017028765879364942182690D+01 xtab(5) = 0.704590540239346569727932548212D+01 xtab(6) = 0.107585160101809952240599567880D+02 xtab(7) = 0.157406786412780045780287611584D+02 xtab(8) = 0.228631317368892641057005342974D+02 weight(1) = 0.369188589341637529920582839376D+00 weight(2) = 0.418786780814342956076978581333D+00 weight(3) = 0.175794986637171805699659866777D+00 weight(4) = 0.333434922612156515221325349344D-01 weight(5) = 0.279453623522567252493892414793D-02 weight(6) = 0.907650877335821310423850149336D-04 weight(7) = 0.848574671627253154486801830893D-06 weight(8) = 0.104800117487151038161508853552D-08 else if ( order == 9 ) then xtab(1) = 0.152322227731808247428107073127D+00 xtab(2) = 0.807220022742255847741419210952D+00 xtab(3) = 0.200513515561934712298303324701D+01 xtab(4) = 0.378347397333123299167540609364D+01 xtab(5) = 0.620495677787661260697353521006D+01 xtab(6) = 0.937298525168757620180971073215D+01 xtab(7) = 0.134662369110920935710978818397D+02 xtab(8) = 0.188335977889916966141498992996D+02 xtab(9) = 0.263740718909273767961410072937D+02 weight(1) = 0.336126421797962519673467717606D+00 weight(2) = 0.411213980423984387309146942793D+00 weight(3) = 0.199287525370885580860575607212D+00 weight(4) = 0.474605627656515992621163600479D-01 weight(5) = 0.559962661079458317700419900556D-02 weight(6) = 0.305249767093210566305412824291D-03 weight(7) = 0.659212302607535239225572284875D-05 weight(8) = 0.411076933034954844290241040330D-07 weight(9) = 0.329087403035070757646681380323D-10 else if ( order == 10 ) then xtab(1) = 0.137793470540492430830772505653D+00 xtab(2) = 0.729454549503170498160373121676D+00 xtab(3) = 0.180834290174031604823292007575D+01 xtab(4) = 0.340143369785489951448253222141D+01 xtab(5) = 0.555249614006380363241755848687D+01 xtab(6) = 0.833015274676449670023876719727D+01 xtab(7) = 0.118437858379000655649185389191D+02 xtab(8) = 0.162792578313781020995326539358D+02 xtab(9) = 0.219965858119807619512770901956D+02 xtab(10) = 0.299206970122738915599087933408D+02 weight(1) = 0.308441115765020141547470834678D+00 weight(2) = 0.401119929155273551515780309913D+00 weight(3) = 0.218068287611809421588648523475D+00 weight(4) = 0.620874560986777473929021293135D-01 weight(5) = 0.950151697518110055383907219417D-02 weight(6) = 0.753008388587538775455964353676D-03 weight(7) = 0.282592334959956556742256382685D-04 weight(8) = 0.424931398496268637258657665975D-06 weight(9) = 0.183956482397963078092153522436D-08 weight(10) = 0.991182721960900855837754728324D-12 else if ( order == 11 ) then xtab(1) = 0.125796442187967522675794577516D+00 xtab(2) = 0.665418255839227841678127839420D+00 xtab(3) = 0.164715054587216930958700321365D+01 xtab(4) = 0.309113814303525495330195934259D+01 xtab(5) = 0.502928440157983321236999508366D+01 xtab(6) = 0.750988786380661681941099714450D+01 xtab(7) = 0.106059509995469677805559216457D+02 xtab(8) = 0.144316137580641855353200450349D+02 xtab(9) = 0.191788574032146786478174853989D+02 xtab(10) = 0.252177093396775611040909447797D+02 xtab(11) = 0.334971928471755372731917259395D+02 weight(1) = 0.284933212894200605056051024724D+00 weight(2) = 0.389720889527849377937553508048D+00 weight(3) = 0.232781831848991333940223795543D+00 weight(4) = 0.765644535461966864008541790132D-01 weight(5) = 0.143932827673506950918639187409D-01 weight(6) = 0.151888084648487306984777640042D-02 weight(7) = 0.851312243547192259720424170600D-04 weight(8) = 0.229240387957450407857683270709D-05 weight(9) = 0.248635370276779587373391491114D-07 weight(10) = 0.771262693369132047028152590222D-10 weight(11) = 0.288377586832362386159777761217D-13 else if ( order == 12 ) then xtab(1) = 0.115722117358020675267196428240D+00 xtab(2) = 0.611757484515130665391630053042D+00 xtab(3) = 0.151261026977641878678173792687D+01 xtab(4) = 0.283375133774350722862747177657D+01 xtab(5) = 0.459922763941834848460572922485D+01 xtab(6) = 0.684452545311517734775433041849D+01 xtab(7) = 0.962131684245686704391238234923D+01 xtab(8) = 0.130060549933063477203460524294D+02 xtab(9) = 0.171168551874622557281840528008D+02 xtab(10) = 0.221510903793970056699218950837D+02 xtab(11) = 0.284879672509840003125686072325D+02 xtab(12) = 0.370991210444669203366389142764D+02 weight(1) = 0.264731371055443190349738892056D+00 weight(2) = 0.377759275873137982024490556707D+00 weight(3) = 0.244082011319877564254870818274D+00 weight(4) = 0.904492222116809307275054934667D-01 weight(5) = 0.201023811546340965226612867827D-01 weight(6) = 0.266397354186531588105415760678D-02 weight(7) = 0.203231592662999392121432860438D-03 weight(8) = 0.836505585681979874533632766396D-05 weight(9) = 0.166849387654091026116989532619D-06 weight(10) = 0.134239103051500414552392025055D-08 weight(11) = 0.306160163503502078142407718971D-11 weight(12) = 0.814807746742624168247311868103D-15 else if ( order == 13 ) then xtab(1) = 0.107142388472252310648493376977D+00 xtab(2) = 0.566131899040401853406036347177D+00 xtab(3) = 0.139856433645101971792750259921D+01 xtab(4) = 0.261659710840641129808364008472D+01 xtab(5) = 0.423884592901703327937303389926D+01 xtab(6) = 0.629225627114007378039376523025D+01 xtab(7) = 0.881500194118697804733348868036D+01 xtab(8) = 0.118614035888112425762212021880D+02 xtab(9) = 0.155107620377037527818478532958D+02 xtab(10) = 0.198846356638802283332036594634D+02 xtab(11) = 0.251852638646777580842970297823D+02 xtab(12) = 0.318003863019472683713663283526D+02 xtab(13) = 0.407230086692655795658979667001D+02 weight(1) = 0.247188708429962621346249185964D+00 weight(2) = 0.365688822900521945306717530893D+00 weight(3) = 0.252562420057658502356824288815D+00 weight(4) = 0.103470758024183705114218631672D+00 weight(5) = 0.264327544155616157781587735702D-01 weight(6) = 0.422039604025475276555209292644D-02 weight(7) = 0.411881770472734774892472527082D-03 weight(8) = 0.235154739815532386882897300772D-04 weight(9) = 0.731731162024909910401047197761D-06 weight(10) = 0.110884162570398067979150974759D-07 weight(11) = 0.677082669220589884064621459082D-10 weight(12) = 0.115997995990507606094507145382D-12 weight(13) = 0.224509320389275841599187226865D-16 else if ( order == 14 ) then xtab(1) = 0.997475070325975745736829452514D-01 xtab(2) = 0.526857648851902896404583451502D+00 xtab(3) = 0.130062912125149648170842022116D+01 xtab(4) = 0.243080107873084463616999751038D+01 xtab(5) = 0.393210282229321888213134366778D+01 xtab(6) = 0.582553621830170841933899983898D+01 xtab(7) = 0.814024014156514503005978046052D+01 xtab(8) = 0.109164995073660188408130510904D+02 xtab(9) = 0.142108050111612886831059780825D+02 xtab(10) = 0.181048922202180984125546272083D+02 xtab(11) = 0.227233816282696248232280886985D+02 xtab(12) = 0.282729817232482056954158923218D+02 xtab(13) = 0.351494436605924265828643121364D+02 xtab(14) = 0.443660817111174230416312423666D+02 weight(1) = 0.231815577144864977840774861104D+00 weight(2) = 0.353784691597543151802331301273D+00 weight(3) = 0.258734610245428085987320561144D+00 weight(4) = 0.115482893556923210087304988673D+00 weight(5) = 0.331920921593373600387499587137D-01 weight(6) = 0.619286943700661021678785967675D-02 weight(7) = 0.739890377867385942425890907080D-03 weight(8) = 0.549071946684169837857331777667D-04 weight(9) = 0.240958576408537749675775256553D-05 weight(10) = 0.580154398167649518088619303904D-07 weight(11) = 0.681931469248497411961562387084D-09 weight(12) = 0.322120775189484793980885399656D-11 weight(13) = 0.422135244051658735159797335643D-14 weight(14) = 0.605237502228918880839870806281D-18 else if ( order == 15 ) then xtab(1) = 0.933078120172818047629030383672D-01 xtab(2) = 0.492691740301883908960101791412D+00 xtab(3) = 0.121559541207094946372992716488D+01 xtab(4) = 0.226994952620374320247421741375D+01 xtab(5) = 0.366762272175143727724905959436D+01 xtab(6) = 0.542533662741355316534358132596D+01 xtab(7) = 0.756591622661306786049739555812D+01 xtab(8) = 0.101202285680191127347927394568D+02 xtab(9) = 0.131302824821757235640991204176D+02 xtab(10) = 0.166544077083299578225202408430D+02 xtab(11) = 0.207764788994487667729157175676D+02 xtab(12) = 0.256238942267287801445868285977D+02 xtab(13) = 0.314075191697539385152432196202D+02 xtab(14) = 0.385306833064860094162515167595D+02 xtab(15) = 0.480260855726857943465734308508D+02 weight(1) = 0.218234885940086889856413236448D+00 weight(2) = 0.342210177922883329638948956807D+00 weight(3) = 0.263027577941680097414812275022D+00 weight(4) = 0.126425818105930535843030549378D+00 weight(5) = 0.402068649210009148415854789871D-01 weight(6) = 0.856387780361183836391575987649D-02 weight(7) = 0.121243614721425207621920522467D-02 weight(8) = 0.111674392344251941992578595518D-03 weight(9) = 0.645992676202290092465319025312D-05 weight(10) = 0.222631690709627263033182809179D-06 weight(11) = 0.422743038497936500735127949331D-08 weight(12) = 0.392189726704108929038460981949D-10 weight(13) = 0.145651526407312640633273963455D-12 weight(14) = 0.148302705111330133546164737187D-15 weight(15) = 0.160059490621113323104997812370D-19 else if ( order == 16 ) then xtab(1) = 0.876494104789278403601980973401D-01 xtab(2) = 0.462696328915080831880838260664D+00 xtab(3) = 0.114105777483122685687794501811D+01 xtab(4) = 0.212928364509838061632615907066D+01 xtab(5) = 0.343708663389320664523510701675D+01 xtab(6) = 0.507801861454976791292305830814D+01 xtab(7) = 0.707033853504823413039598947080D+01 xtab(8) = 0.943831433639193878394724672911D+01 xtab(9) = 0.122142233688661587369391246088D+02 xtab(10) = 0.154415273687816170767647741622D+02 xtab(11) = 0.191801568567531348546631409497D+02 xtab(12) = 0.235159056939919085318231872752D+02 xtab(13) = 0.285787297428821403675206137099D+02 xtab(14) = 0.345833987022866258145276871778D+02 xtab(15) = 0.419404526476883326354722330252D+02 xtab(16) = 0.517011603395433183643426971197D+02 weight(1) = 0.206151714957800994334273636741D+00 weight(2) = 0.331057854950884165992983098710D+00 weight(3) = 0.265795777644214152599502020650D+00 weight(4) = 0.136296934296377539975547513526D+00 weight(5) = 0.473289286941252189780623392781D-01 weight(6) = 0.112999000803394532312490459701D-01 weight(7) = 0.184907094352631086429176783252D-02 weight(8) = 0.204271915308278460126018338421D-03 weight(9) = 0.148445868739812987713515067551D-04 weight(10) = 0.682831933087119956439559590327D-06 weight(11) = 0.188102484107967321388159920418D-07 weight(12) = 0.286235024297388161963062629156D-09 weight(13) = 0.212707903322410296739033610978D-11 weight(14) = 0.629796700251786778717446214552D-14 weight(15) = 0.505047370003551282040213233303D-17 weight(16) = 0.416146237037285519042648356116D-21 else if ( order == 17 ) then xtab(1) = 0.826382147089476690543986151980D-01 xtab(2) = 0.436150323558710436375959029847D+00 xtab(3) = 0.107517657751142857732980316755D+01 xtab(4) = 0.200519353164923224070293371933D+01 xtab(5) = 0.323425612404744376157380120696D+01 xtab(6) = 0.477351351370019726480932076262D+01 xtab(7) = 0.663782920536495266541643929703D+01 xtab(8) = 0.884668551116980005369470571184D+01 xtab(9) = 0.114255293193733525869726151469D+02 xtab(10) = 0.144078230374813180021982874959D+02 xtab(11) = 0.178382847307011409290658752412D+02 xtab(12) = 0.217782682577222653261749080522D+02 xtab(13) = 0.263153178112487997766149598369D+02 xtab(14) = 0.315817716804567331343908517497D+02 xtab(15) = 0.377960938374771007286092846663D+02 xtab(16) = 0.453757165339889661829258363215D+02 xtab(17) = 0.553897517898396106640900199790D+02 weight(1) = 0.195332205251770832145927297697D+00 weight(2) = 0.320375357274540281336625631970D+00 weight(3) = 0.267329726357171097238809604160D+00 weight(4) = 0.145129854358758625407426447473D+00 weight(5) = 0.544369432453384577793805803066D-01 weight(6) = 0.143572977660618672917767247431D-01 weight(7) = 0.266282473557277256843236250006D-02 weight(8) = 0.343679727156299920611775097985D-03 weight(9) = 0.302755178378287010943703641131D-04 weight(10) = 0.176851505323167689538081156159D-05 weight(11) = 0.657627288681043332199222748162D-07 weight(12) = 0.146973093215954679034375821888D-08 weight(13) = 0.181691036255544979555476861323D-10 weight(14) = 0.109540138892868740297645078918D-12 weight(15) = 0.261737388222337042155132062413D-15 weight(16) = 0.167293569314615469085022374652D-18 weight(17) = 0.106562631627404278815253271162D-22 else if ( order == 18 ) then xtab(1) = 0.781691666697054712986747615334D-01 xtab(2) = 0.412490085259129291039101536536D+00 xtab(3) = 0.101652017962353968919093686187D+01 xtab(4) = 0.189488850996976091426727831954D+01 xtab(5) = 0.305435311320265975115241130719D+01 xtab(6) = 0.450420553888989282633795571455D+01 xtab(7) = 0.625672507394911145274209116326D+01 xtab(8) = 0.832782515660563002170470261564D+01 xtab(9) = 0.107379900477576093352179033397D+02 xtab(10) = 0.135136562075550898190863812108D+02 xtab(11) = 0.166893062819301059378183984163D+02 xtab(12) = 0.203107676262677428561313764553D+02 xtab(13) = 0.244406813592837027656442257980D+02 xtab(14) = 0.291682086625796161312980677805D+02 xtab(15) = 0.346279270656601721454012429438D+02 xtab(16) = 0.410418167728087581392948614284D+02 xtab(17) = 0.488339227160865227486586093290D+02 xtab(18) = 0.590905464359012507037157810181D+02 weight(1) = 0.185588603146918805623337752284D+00 weight(2) = 0.310181766370225293649597595713D+00 weight(3) = 0.267866567148536354820854394783D+00 weight(4) = 0.152979747468074906553843082053D+00 weight(5) = 0.614349178609616527076780103487D-01 weight(6) = 0.176872130807729312772600233761D-01 weight(7) = 0.366017976775991779802657207890D-02 weight(8) = 0.540622787007735323128416319257D-03 weight(9) = 0.561696505121423113817929049294D-04 weight(10) = 0.401530788370115755858883625279D-05 weight(11) = 0.191466985667567497969210011321D-06 weight(12) = 0.583609526863159412918086289717D-08 weight(13) = 0.107171126695539012772851317562D-09 weight(14) = 0.108909871388883385562011298291D-11 weight(15) = 0.538666474837830887608094323164D-14 weight(16) = 0.104986597803570340877859934846D-16 weight(17) = 0.540539845163105364356554467358D-20 weight(18) = 0.269165326920102862708377715980D-24 else if ( order == 19 ) then xtab(1) = 0.741587837572050877131369916024D-01 xtab(2) = 0.391268613319994607337648350299D+00 xtab(3) = 0.963957343997958058624879377130D+00 xtab(4) = 0.179617558206832812557725825252D+01 xtab(5) = 0.289365138187378399116494713237D+01 xtab(6) = 0.426421553962776647436040018167D+01 xtab(7) = 0.591814156164404855815360191408D+01 xtab(8) = 0.786861891533473373105668358176D+01 xtab(9) = 0.101324237168152659251627415800D+02 xtab(10) = 0.127308814638423980045092979656D+02 xtab(11) = 0.156912783398358885454136069861D+02 xtab(12) = 0.190489932098235501532136429732D+02 xtab(13) = 0.228508497608294829323930586693D+02 xtab(14) = 0.271606693274114488789963947149D+02 xtab(15) = 0.320691222518622423224362865906D+02 xtab(16) = 0.377129058012196494770647508283D+02 xtab(17) = 0.443173627958314961196067736013D+02 xtab(18) = 0.523129024574043831658644222420D+02 xtab(19) = 0.628024231535003758413504690673D+02 weight(1) = 0.176768474915912502251035479815D+00 weight(2) = 0.300478143607254379482156807712D+00 weight(3) = 0.267599547038175030772695440648D+00 weight(4) = 0.159913372135580216785512147895D+00 weight(5) = 0.682493799761491134552355368344D-01 weight(6) = 0.212393076065443249244062193091D-01 weight(7) = 0.484162735114839596725013121019D-02 weight(8) = 0.804912747381366766594647138204D-03 weight(9) = 0.965247209315350170843161738801D-04 weight(10) = 0.820730525805103054408982992869D-05 weight(11) = 0.483056672473077253944806671560D-06 weight(12) = 0.190499136112328569993615674552D-07 weight(13) = 0.481668463092806155766936380273D-09 weight(14) = 0.734825883955114437684376840171D-11 weight(15) = 0.620227538757261639893719012423D-13 weight(16) = 0.254143084301542272371866857954D-15 weight(17) = 0.407886129682571235007187465134D-18 weight(18) = 0.170775018759383706100412325084D-21 weight(19) = 0.671506464990818995998969111749D-26 else if ( order == 20 ) then xtab(1) = 0.705398896919887533666890045842D-01 xtab(2) = 0.372126818001611443794241388761D+00 xtab(3) = 0.916582102483273564667716277074D+00 xtab(4) = 0.170730653102834388068768966741D+01 xtab(5) = 0.274919925530943212964503046049D+01 xtab(6) = 0.404892531385088692237495336913D+01 xtab(7) = 0.561517497086161651410453988565D+01 xtab(8) = 0.745901745367106330976886021837D+01 xtab(9) = 0.959439286958109677247367273428D+01 xtab(10) = 0.120388025469643163096234092989D+02 xtab(11) = 0.148142934426307399785126797100D+02 xtab(12) = 0.179488955205193760173657909926D+02 xtab(13) = 0.214787882402850109757351703696D+02 xtab(14) = 0.254517027931869055035186774846D+02 xtab(15) = 0.299325546317006120067136561352D+02 xtab(16) = 0.350134342404790000062849359067D+02 xtab(17) = 0.408330570567285710620295677078D+02 xtab(18) = 0.476199940473465021399416271529D+02 xtab(19) = 0.558107957500638988907507734445D+02 xtab(20) = 0.665244165256157538186403187915D+02 weight(1) = 0.168746801851113862149223899689D+00 weight(2) = 0.291254362006068281716795323812D+00 weight(3) = 0.266686102867001288549520868998D+00 weight(4) = 0.166002453269506840031469127816D+00 weight(5) = 0.748260646687923705400624639615D-01 weight(6) = 0.249644173092832210728227383234D-01 weight(7) = 0.620255084457223684744754785395D-02 weight(8) = 0.114496238647690824203955356969D-02 weight(9) = 0.155741773027811974779809513214D-03 weight(10) = 0.154014408652249156893806714048D-04 weight(11) = 0.108648636651798235147970004439D-05 weight(12) = 0.533012090955671475092780244305D-07 weight(13) = 0.175798117905058200357787637840D-08 weight(14) = 0.372550240251232087262924585338D-10 weight(15) = 0.476752925157819052449488071613D-12 weight(16) = 0.337284424336243841236506064991D-14 weight(17) = 0.115501433950039883096396247181D-16 weight(18) = 0.153952214058234355346383319667D-19 weight(19) = 0.528644272556915782880273587683D-23 weight(20) = 0.165645661249902329590781908529D-27 else if ( order == 31 ) then xtab( 1) = 0.45901947621108290743496080275224D-01 xtab( 2) = 0.24198016382477204890408974151714D+00 xtab( 3) = 0.59525389422235073707330165005414D+00 xtab( 4) = 1.1066894995329987162111308789792D+00 xtab( 5) = 1.7775956928747727211593727482675D+00 xtab( 6) = 2.6097034152566806503893375925315D+00 xtab( 7) = 3.6051968023400442698805817554243D+00 xtab( 8) = 4.7667470844717611313629127271123D+00 xtab( 9) = 6.0975545671817409269925429328463D+00 xtab( 10) = 7.6014009492331374229360106942867D+00 xtab( 11) = 9.2827143134708894182536695297710D+00 xtab( 12) = 11.146649755619291358993815629587D+00 xtab( 13) = 13.199189576244998522464925028637D+00 xtab( 14) = 15.447268315549310075809325891801D+00 xtab( 15) = 17.898929826644757646725793817752D+00 xtab( 16) = 20.563526336715822170743048968779D+00 xtab( 17) = 23.451973482011858591050255575933D+00 xtab( 18) = 26.577081352118260459975876986478D+00 xtab( 19) = 29.953990872346445506951917840024D+00 xtab( 20) = 33.600759532902202735410313885784D+00 xtab( 21) = 37.539164407330440882887902558001D+00 xtab( 22) = 41.795830870182219981347945853330D+00 xtab( 23) = 46.403866806411123136029227604386D+00 xtab( 24) = 51.405314476797755161861461088395D+00 xtab( 25) = 56.854992868715843620511922055660D+00 xtab( 26) = 62.826855908786321453677523304806D+00 xtab( 27) = 69.425277191080345623322251656443D+00 xtab( 28) = 76.807047763862732837609972285484D+00 xtab( 29) = 85.230358607545669169387065607043D+00 xtab( 30) = 95.188939891525629981308606853957D+00 xtab( 31) = 107.95224382757871475002440117666D+00 weight( 1) = 0.11252789550372583820847728082801D+00 weight( 2) = 0.21552760818089123795222505285045D+00 weight( 3) = 0.23830825164569654731905788089234D+00 weight( 4) = 0.19538830929790229249915303390711D+00 weight( 5) = 0.12698283289306190143635272904602D+00 weight( 6) = 0.67186168923899300670929441993508D-01 weight( 7) = 0.29303224993879487404888669311974D-01 weight( 8) = 0.10597569915295736089529380314433D-01 weight( 9) = 0.31851272582386980320974842433019D-02 weight( 10) = 0.79549548307940382922092149012477D-03 weight( 11) = 0.16480052126636687317862967116412D-03 weight( 12) = 0.28229237864310816393860971468993D-04 weight( 13) = 0.39802902551008580387116174900106D-05 weight( 14) = 0.45931839841801061673729694510289D-06 weight( 15) = 0.43075545187731100930131457465897D-07 weight( 16) = 0.32551249938271570855175749257884D-08 weight( 17) = 0.19620246675410594996247151593142D-09 weight( 18) = 0.93190499086617587129534716431331D-11 weight( 19) = 0.34377541819411620520312597898311D-12 weight( 20) = 0.96795247130446716997405035776206D-14 weight( 21) = 0.20368066110115247398010624219291D-15 weight( 22) = 0.31212687280713526831765358632585D-17 weight( 23) = 0.33729581704161052453395678308350D-19 weight( 24) = 0.24672796386616696011038363242541D-21 weight( 25) = 0.11582201904525643634834564576593D-23 weight( 26) = 0.32472922591425422434798022809020D-26 weight( 27) = 0.49143017308057432740820076259666D-29 weight( 28) = 0.34500071104808394132223135953806D-32 weight( 29) = 0.87663710117162041472932760732881D-36 weight( 30) = 0.50363643921161490411297172316582D-40 weight( 31) = 0.19909984582531456482439549080330D-45 else if ( order == 32 ) then xtab( 1) = 0.04448936583326720D+00 xtab( 2) = 0.2345261095196173D+00 xtab( 3) = 0.5768846293018861D+00 xtab( 4) = 1.072448753817818D+00 xtab( 5) = 1.722408776444646D+00 xtab( 6) = 2.528336706425794D+00 xtab( 7) = 3.492213273021993D+00 xtab( 8) = 4.616456769749767D+00 xtab( 9) = 5.903958504174245D+00 xtab(10) = 7.358126733186242D+00 xtab(11) = 8.982940924212595D+00 xtab(12) = 10.78301863253997D+00 xtab(13) = 12.76369798674272D+00 xtab(14) = 14.93113975552256D+00 xtab(15) = 17.29245433671532D+00 xtab(16) = 19.85586094033605D+00 xtab(17) = 22.63088901319678D+00 xtab(18) = 25.62863602245925D+00 xtab(19) = 28.86210181632347D+00 xtab(20) = 32.34662915396473D+00 xtab(21) = 36.10049480575197D+00 xtab(22) = 40.14571977153944D+00 xtab(23) = 44.50920799575494D+00 xtab(24) = 49.22439498730864D+00 xtab(25) = 54.33372133339691D+00 xtab(26) = 59.89250916213402D+00 xtab(27) = 65.97537728793505D+00 xtab(28) = 72.68762809066271D+00 xtab(29) = 80.18744697791352D+00 xtab(30) = 88.73534041789240D+00 xtab(31) = 98.82954286828397D+00 xtab(32) = 111.7513980979377D+00 weight( 1) = 0.1092183419523677D+00 weight( 2) = 0.2104431079388168D+00 weight( 3) = 0.2352132296698471D+00 weight( 4) = 0.1959033359728783D+00 weight( 5) = 0.1299837862860714D+00 weight( 6) = 0.7057862386571766D-01 weight( 7) = 0.3176091250917535D-01 weight( 8) = 0.1191821483483859D-01 weight( 9) = 0.3738816294611523D-02 weight(10) = 0.9808033066149506D-03 weight(11) = 0.2148649188013644D-03 weight(12) = 0.3920341967987944D-04 weight(13) = 0.5934541612868650D-05 weight(14) = 0.7416404578667550D-06 weight(15) = 0.7604567879120788D-07 weight(16) = 0.6350602226625806D-08 weight(17) = 0.4281382971040924D-09 weight(18) = 0.2305899491891338D-10 weight(19) = 0.9799379288727102D-12 weight(20) = 0.3237801657729275D-13 weight(21) = 0.8171823443420754D-15 weight(22) = 0.1542133833393825D-16 weight(23) = 0.2119792290163629D-18 weight(24) = 0.2054429673788038D-20 weight(25) = 0.1346982586637393D-22 weight(26) = 0.5661294130397363D-25 weight(27) = 0.1418560545463052D-27 weight(28) = 0.1913375494454211D-30 weight(29) = 0.1192248760098218D-33 weight(30) = 0.2671511219240120D-37 weight(31) = 0.1338616942106269D-41 weight(32) = 0.4510536193898970D-47 else if ( order == 63 ) then xtab( 1) = 0.22768893732576153785994330248562D-01 xtab( 2) = 0.11998325242727824715771416426383D+00 xtab( 3) = 0.29494185444770149577427738517405D+00 xtab( 4) = 0.54779087896237725363865073775856D+00 xtab( 5) = 0.87869061179931901673895567052285D+00 xtab( 6) = 1.2878464335919706302309207788611D+00 xtab( 7) = 1.7755123815388553763979463268728D+00 xtab( 8) = 2.3419925567085989256055628337716D+00 xtab( 9) = 2.9876423223246473939976731053629D+00 xtab( 10) = 3.7128695992018000346299637413422D+00 xtab( 11) = 4.5181363349503584391105568561550D+00 xtab( 12) = 5.4039601781825946286902599782736D+00 xtab( 13) = 6.3709163787865330220392250891777D+00 xtab( 14) = 7.4196399339311711154888493199004D+00 xtab( 15) = 8.5508280008403328312589048722235D+00 xtab( 16) = 9.7652425999245366807004592977996D+00 xtab( 17) = 11.063713635140661736220550410604D+00 xtab( 18) = 12.447142262356492749798687569289D+00 xtab( 19) = 13.916504641057818562912967008183D+00 xtab( 20) = 15.472856110036296424777143607779D+00 xtab( 21) = 17.117335833863588753116900303886D+00 xtab( 22) = 18.851171974154856850873483787506D+00 xtab( 23) = 20.675687448056515660377265667433D+00 xtab( 24) = 22.592306346311528381292277759986D+00 xtab( 25) = 24.602561094972638883700642760037D+00 xtab( 26) = 26.708100458737343969779087998829D+00 xtab( 27) = 28.910698500451382640177718103234D+00 xtab( 28) = 31.212264631175912885477773820802D+00 xtab( 29) = 33.614854909101154836598842888345D+00 xtab( 30) = 36.120684774484823056306328740825D+00 xtab( 31) = 38.732143442933582145626041607663D+00 xtab( 32) = 41.451810222318741191114726181363D+00 xtab( 33) = 44.282473071479233839358857134636D+00 xtab( 34) = 47.227149784295686898935095231536D+00 xtab( 35) = 50.289112264240695761749021839419D+00 xtab( 36) = 53.471914456788652808348280619542D+00 xtab( 37) = 56.779424636342062213099781057119D+00 xtab( 38) = 60.215862909019862886417550114424D+00 xtab( 39) = 63.785845004235974631701139601836D+00 xtab( 40) = 67.494433702293885830374325695045D+00 xtab( 41) = 71.347199604295266286654803376075D+00 xtab( 42) = 75.350293425653234254290504744279D+00 xtab( 43) = 79.510532629986309149555391354778D+00 xtab( 44) = 83.835506080872257843339817658508D+00 xtab( 45) = 88.333701570354369086112766326498D+00 xtab( 46) = 93.014662728558547405303399037100D+00 xtab( 47) = 97.889184147578140043386727677112D+00 xtab( 48) = 102.96955690741381650783952746778D+00 xtab( 49) = 108.26988161961595392226350967206D+00 xtab( 50) = 113.80647350287462738934485955901D+00 xtab( 51) = 119.59839538830458666962452963285D+00 xtab( 52) = 125.66817255856119431291196303280D+00 xtab( 53) = 132.04277272091165746585590583045D+00 xtab( 54) = 138.75498418103789078167590567526D+00 xtab( 55) = 145.84541318313540358283994248439D+00 xtab( 56) = 153.36548459497863623710815962660D+00 xtab( 57) = 161.38215194813761243562172669592D+00 xtab( 58) = 169.98570600665839438795175301156D+00 xtab( 59) = 179.30366247401580910251827858515D+00 xtab( 60) = 189.52789596532475473668721332981D+00 xtab( 61) = 200.97521159924656741628671841018D+00 xtab( 62) = 214.25368536638788642698056296400D+00 xtab( 63) = 230.93465747089703971246562985079D+00 weight( 1) = 0.57118633213868979811587283390476D-01 weight( 2) = 0.12067476090640395283319932036351D+00 weight( 3) = 0.15925001096581873723870561096472D+00 weight( 4) = 0.16875178327560799234596192963585D+00 weight( 5) = 0.15366641977668956696193711310131D+00 weight( 6) = 0.12368770614716481641086652261948D+00 weight( 7) = 0.89275098854848671545279150057422D-01 weight( 8) = 0.58258485446105944957571825725160D-01 weight( 9) = 0.34546657545992580874717085812508D-01 weight( 10) = 0.18675685985714656798286552591203D-01 weight( 11) = 0.92233449044093536528490075241649D-02 weight( 12) = 0.41671250684839592762582663470209D-02 weight( 13) = 0.17238120299900582715386728541955D-02 weight( 14) = 0.65320845029716311169340559359043D-03 weight( 15) = 0.22677644670909586952405173207471D-03 weight( 16) = 0.72127674154810668410750270234861D-04 weight( 17) = 0.21011261180466484598811536851241D-04 weight( 18) = 0.56035500893357212749181536071292D-05 weight( 19) = 0.13673642785604888017836641282292D-05 weight( 20) = 0.30507263930195817240736097189550D-06 weight( 21) = 0.62180061839309763559981775409241D-07 weight( 22) = 0.11566529551931711260022448996296D-07 weight( 23) = 0.19614588267565478081534781863335D-08 weight( 24) = 0.30286171195709411244334756404054D-09 weight( 25) = 0.42521344539400686769012963452599D-10 weight( 26) = 0.54202220578073819334698791381873D-11 weight( 27) = 0.62627306838597672554166850420603D-12 weight( 28) = 0.65474443156573322992307089591924D-13 weight( 29) = 0.61815575808729181846302500000047D-14 weight( 30) = 0.52592721363507381404263991342633D-15 weight( 31) = 0.40230920092646484015391506025408D-16 weight( 32) = 0.27600740511819536505013824207729D-17 weight( 33) = 0.16936946756968296053322009855265D-18 weight( 34) = 0.92689146872177087314963772462726D-20 weight( 35) = 0.45093739060365632939780140603959D-21 weight( 36) = 0.19435162876132376573629962695374D-22 weight( 37) = 0.73926270895169207037999639194513D-24 weight( 38) = 0.24714364154434632615980126000066D-25 weight( 39) = 0.72288649446741597655145390616476D-27 weight( 40) = 0.18407617292614039362985209905608D-28 weight( 41) = 0.40583498566841960105759537058880D-30 weight( 42) = 0.77000496416438368114463925286343D-32 weight( 43) = 0.12488505764999334328843314866038D-33 weight( 44) = 0.17185000226767010697663950619912D-35 weight( 45) = 0.19896372636672396938013975755522D-37 weight( 46) = 0.19199671378804058267713164416870D-39 weight( 47) = 0.15278588285522166920459714708240D-41 weight( 48) = 0.99054752688842142955854138884590D-44 weight( 49) = 0.51597523673029211884228858692990D-46 weight( 50) = 0.21249846664084111245693912887783D-48 weight( 51) = 0.67903852766852910591172042494884D-51 weight( 52) = 0.16466654148296177467908300517887D-53 weight( 53) = 0.29509065402691055027053659375033D-56 weight( 54) = 0.37838420647571051984882241014675D-59 weight( 55) = 0.33358130068542431878174667995217D-62 weight( 56) = 0.19223461022273880981363303073329D-65 weight( 57) = 0.67812696961083016872779388922288D-69 weight( 58) = 0.13404752802440604607620468935693D-72 weight( 59) = 0.13109745101805029757648048223928D-76 weight( 60) = 0.52624863881401787388694579143866D-81 weight( 61) = 0.63780013856587414257760666006511D-86 weight( 62) = 0.12997078942372924566347473916943D-91 weight( 63) = 0.10008511496968754063443740168421D-98 else if ( order == 64 ) then xtab( 1) = 0.02241587414670647D+00 xtab( 2) = 0.1181225120967683D+00 xtab( 3) = 0.2903657440180379D+00 xtab( 4) = 0.5392862212279776D+00 xtab( 5) = 0.8650370046481133D+00 xtab( 6) = 1.267814040775243D+00 xtab( 7) = 1.747859626059437D+00 xtab( 8) = 2.305463739307508D+00 xtab( 9) = 2.940965156725251D+00 xtab(10) = 3.654752650207290D+00 xtab(11) = 4.447266343313095D+00 xtab(12) = 5.318999254496392D+00 xtab(13) = 6.270499046923656D+00 xtab(14) = 7.302370002587396D+00 xtab(15) = 8.415275239483025D+00 xtab(16) = 9.609939192796110D+00 xtab(17) = 10.88715038388637D+00 xtab(18) = 12.24776450424430D+00 xtab(19) = 13.69270784554751D+00 xtab(20) = 15.22298111152473D+00 xtab(21) = 16.83966365264874D+00 xtab(22) = 18.54391817085919D+00 xtab(23) = 20.33699594873024D+00 xtab(24) = 22.22024266595088D+00 xtab(25) = 24.19510487593326D+00 xtab(26) = 26.26313722711849D+00 xtab(27) = 28.42601052750102D+00 xtab(28) = 30.68552076752597D+00 xtab(29) = 33.04359923643783D+00 xtab(30) = 35.50232389114121D+00 xtab(31) = 38.06393216564647D+00 xtab(32) = 40.73083544445863D+00 xtab(33) = 43.50563546642153D+00 xtab(34) = 46.39114297861619D+00 xtab(35) = 49.39039902562469D+00 xtab(36) = 52.50669934134631D+00 xtab(37) = 55.74362241327838D+00 xtab(38) = 59.10506191901710D+00 xtab(39) = 62.59526440015139D+00 xtab(40) = 66.21887325124756D+00 xtab(41) = 69.98098037714684D+00 xtab(42) = 73.88718723248296D+00 xtab(43) = 77.94367743446313D+00 xtab(44) = 82.15730377831930D+00 xtab(45) = 86.53569334945652D+00 xtab(46) = 91.08737561313309D+00 xtab(47) = 95.82194001552074D+00 xtab(48) = 100.7502319695140D+00 xtab(49) = 105.8845994687999D+00 xtab(50) = 111.2392075244396D+00 xtab(51) = 116.8304450513065D+00 xtab(52) = 122.6774602685386D+00 xtab(53) = 128.8028787692377D+00 xtab(54) = 135.2337879495258D+00 xtab(55) = 142.0031214899315D+00 xtab(56) = 149.1516659000494D+00 xtab(57) = 156.7310751326712D+00 xtab(58) = 164.8086026551505D+00 xtab(59) = 173.4749468364243D+00 xtab(60) = 182.8582046914315D+00 xtab(61) = 193.1511360370729D+00 xtab(62) = 204.6720284850595D+00 xtab(63) = 218.0318519353285D+00 xtab(64) = 234.8095791713262D+00 weight( 1) = 0.05625284233891167D+00 weight( 2) = 0.1190239873124324D+00 weight( 3) = 0.1574964038621455D+00 weight( 4) = 0.1675470504157663D+00 weight( 5) = 0.1533528557792350D+00 weight( 6) = 0.1242210536093002D+00 weight( 7) = 0.9034230098648614D-01 weight( 8) = 0.5947775576835436D-01 weight( 9) = 0.3562751890403622D-01 weight(10) = 0.1948041043116633D-01 weight(11) = 0.9743594899381976D-02 weight(12) = 0.4464310364166273D-02 weight(13) = 0.1875359581323072D-02 weight(14) = 0.7226469815750038D-03 weight(15) = 0.2554875328334950D-03 weight(16) = 0.8287143534396861D-04 weight(17) = 0.2465686396788580D-04 weight(18) = 0.6726713878829671D-05 weight(19) = 0.1681785369964099D-05 weight(20) = 0.3850812981546702D-06 weight(21) = 0.8068728040990521D-07 weight(22) = 0.1545723706757701D-07 weight(23) = 0.2704480147617480D-08 weight(24) = 0.4316775475427202D-09 weight(25) = 0.6277752541761450D-10 weight(26) = 0.8306317376288941D-11 weight(27) = 0.9984031787220194D-12 weight(28) = 0.1088353887116663D-12 weight(29) = 0.1074017403441591D-13 weight(30) = 0.9575737231574444D-15 weight(31) = 0.7697028023648578D-16 weight(32) = 0.5564881137454025D-17 weight(33) = 0.3609756409010444D-18 weight(34) = 0.2095095369548946D-19 weight(35) = 0.1084793301097549D-20 weight(36) = 0.4994699486363812D-22 weight(37) = 0.2037836974598821D-23 weight(38) = 0.7339537564278870D-25 weight(39) = 0.2323783082198704D-26 weight(40) = 0.6438234706908816D-28 weight(41) = 0.1553121095788267D-29 weight(42) = 0.3244250092019555D-31 weight(43) = 0.5832386267836164D-33 weight(44) = 0.8963254833102871D-35 weight(45) = 0.1168703989550731D-36 weight(46) = 0.1282055984359980D-38 weight(47) = 0.1172094937404993D-40 weight(48) = 0.8835339672328639D-43 weight(49) = 0.5424955590306203D-45 weight(50) = 0.2675542666678911D-47 weight(51) = 0.1042917031411369D-49 weight(52) = 0.3152902351957753D-52 weight(53) = 0.7229541910647446D-55 weight(54) = 0.1224235301230072D-57 weight(55) = 0.1482168504901918D-60 weight(56) = 0.1232519348814539D-63 weight(57) = 0.6691499004571088D-67 weight(58) = 0.2220465941850503D-70 weight(59) = 0.4120946094738935D-74 weight(60) = 0.3774399061896465D-78 weight(61) = 0.1414115052917608D-82 weight(62) = 0.1591833064041367D-87 weight(63) = 0.2989484348860626D-93 weight(64) = 0.02089063508436960D-99 else if ( order == 127 ) then xtab( 1) = 0.11339635298518611691893169631306D-01 xtab( 2) = 0.59749753435726620281348237057387D-01 xtab( 3) = 0.14685098690746167612388223687431D+00 xtab( 4) = 0.27267590735859553131378008278900D+00 xtab( 5) = 0.43724600644192665554577035869932D+00 xtab( 6) = 0.64058688222566929533576416399983D+00 xtab( 7) = 0.88272968639058364481487653650042D+00 xtab( 8) = 1.1637114160166537661560584700951D+00 xtab( 9) = 1.4835750152834613891313584861012D+00 xtab( 10) = 1.8423694351613565380686320809853D+00 xtab( 11) = 2.2401496839579024244513315656522D+00 xtab( 12) = 2.6769768780141303692167869961238D+00 xtab( 13) = 3.1529182957082825565771508308846D+00 xtab( 14) = 3.6680474360304752540226339926515D+00 xtab( 15) = 4.2224440823301888455977876667425D+00 xtab( 16) = 4.8161943715870502475665535087286D+00 xtab( 17) = 5.4493908694559416755862178908416D+00 xtab( 18) = 6.1221326512997254193944584763155D+00 xtab( 19) = 6.8345253894122668112237994973336D+00 xtab( 20) = 7.5866814466367472174205986836847D+00 xtab( 21) = 8.3787199765932725254842120659452D+00 xtab( 22) = 9.2107670307426558777922506102445D+00 xtab( 23) = 10.082955672528643809166439353647D+00 xtab( 24) = 10.995426098858125429803147358780D+00 xtab( 25) = 11.948325769197725997610605127857D+00 xtab( 26) = 12.941809542585531053723381098192D+00 xtab( 27) = 13.976039822878506520014405668679D+00 xtab( 28) = 15.051186712579523631574796365435D+00 xtab( 29) = 16.167428175612852922977395051768D+00 xtab( 30) = 17.324950209443673446561163712616D+00 xtab( 31) = 18.523947026965688560811711309349D+00 xtab( 32) = 19.764621248611504104071669386884D+00 xtab( 33) = 21.047184105173183606877044020054D+00 xtab( 34) = 22.371855651855542817648123918101D+00 xtab( 35) = 23.738864994122497183652313788712D+00 xtab( 36) = 25.148450525937368234077278385644D+00 xtab( 37) = 26.600860181041749607253384279755D+00 xtab( 38) = 28.096351697964619201753961292129D+00 xtab( 39) = 29.635192899504178910610227138642D+00 xtab( 40) = 31.217661987479759144214467152615D+00 xtab( 41) = 32.844047853610430460522951341338D+00 xtab( 42) = 34.514650407441149149105635947422D+00 xtab( 43) = 36.229780922306804019615388508885D+00 xtab( 44) = 37.989762400399956435968780140278D+00 xtab( 45) = 39.794929958089961778396437141707D+00 xtab( 46) = 41.645631232730180705153990897484D+00 xtab( 47) = 43.542226812286859549950892993822D+00 xtab( 48) = 45.485090689228791137996151336673D+00 xtab( 49) = 47.474610740231964719468766599146D+00 xtab( 50) = 49.511189233379087716728884584381D+00 xtab( 51) = 51.595243364671244443182771266934D+00 xtab( 52) = 53.727205825819316758288140069145D+00 xtab( 53) = 55.907525405447553305830605991732D+00 xtab( 54) = 58.136667626022439197077526025660D+00 xtab( 55) = 60.415115419018590295707192053805D+00 xtab( 56) = 62.743369841051809700207126742685D+00 xtab( 57) = 65.121950833949996311956025417139D+00 xtab( 58) = 67.551398031997886314411872443149D+00 xtab( 59) = 70.032271619884584511229871192030D+00 xtab( 60) = 72.565153245206849090888669416801D+00 xtab( 61) = 75.150646989739935299354362325096D+00 xtab( 62) = 77.789380404085816000647405462136D+00 xtab( 63) = 80.482005610750729205803962926758D+00 xtab( 64) = 83.229200481195914886796120019048D+00 xtab( 65) = 86.031669892953582966798238732643D+00 xtab( 66) = 88.890147073512051099652518544282D+00 xtab( 67) = 91.805395038358177994971250170499D+00 xtab( 68) = 94.778208131331583205387031034825D+00 xtab( 69) = 97.809413676305116411054110115424D+00 xtab( 70) = 100.89987375017285940371939762172D+00 xtab( 71) = 104.05048708821598934704076845022D+00 xtab( 72) = 107.26219113414600428423116401414D+00 xtab( 73) = 110.53596424851500530602771351277D+00 xtab( 74) = 113.87282809075839485348376187652D+00 xtab( 75) = 117.27385019192517774095477886379D+00 xtab( 76) = 120.74014673718880106173978002719D+00 xtab( 77) = 124.27288557955698354259506446928D+00 xtab( 78) = 127.87328950885942645093841745425D+00 xtab( 79) = 131.54263980314366921809377742137D+00 xtab( 80) = 135.28228009311836970132738106369D+00 xtab( 81) = 139.09362057432970013964422086977D+00 xtab( 82) = 142.97814260643601776808227753574D+00 xtab( 83) = 146.93740374437366549441080969072D+00 xtab( 84) = 150.97304325252187127492511437460D+00 xtab( 85) = 155.08678816034612572229641420609D+00 xtab( 86) = 159.28045992663288235401956989889D+00 xtab( 87) = 163.55598178957571104015967182053D+00 xtab( 88) = 167.91538689194360134245547184721D+00 xtab( 89) = 172.36082728473812536838156191681D+00 xtab( 90) = 176.89458392960192176311674993508D+00 xtab( 91) = 181.51907784036813069227528834025D+00 xtab( 92) = 186.23688252828112373861202530357D+00 xtab( 93) = 191.05073794450929196790836610789D+00 xtab( 94) = 195.96356614879879837839002542988D+00 xtab( 95) = 200.97848897600025153696475526130D+00 xtab( 96) = 206.09884802468871112127283042753D+00 xtab( 97) = 211.32822735671655260572377256981D+00 xtab( 98) = 216.67047937658230323477089465777D+00 xtab( 99) = 222.12975445929687246267304963754D+00 xtab(100) = 227.71053502072232419089132431317D+00 xtab(101) = 233.41767488282602453367775322563D+00 xtab(102) = 239.25644498830308620018749667089D+00 xtab(103) = 245.23258677871567172531254018984D+00 xtab(104) = 251.35237488718128030005500991754D+00 xtab(105) = 257.62269123792061413076191882313D+00 xtab(106) = 264.05111322908240551754377241831D+00 xtab(107) = 270.64601945722796749299111718606D+00 xtab(108) = 277.41671750163651071798388218104D+00 xtab(109) = 284.37359974220870326674402873120D+00 xtab(110) = 291.52833521346495719581282021650D+00 xtab(111) = 298.89410837028248600878895615414D+00 xtab(112) = 306.48591978262611320418112423947D+00 xtab(113) = 314.32096986471177487400007507615D+00 xtab(114) = 322.41915589128679683349440361344D+00 xtab(115) = 330.80372663802405651933847334878D+00 xtab(116) = 339.50216127832433747735367595958D+00 xtab(117) = 348.54737559472697355480761787441D+00 xtab(118) = 357.97942028029845454049007443090D+00 xtab(119) = 367.84794520076004578858341422871D+00 xtab(120) = 378.21590623135532818332979188889D+00 xtab(121) = 389.16539141251004101579475325153D+00 xtab(122) = 400.80729331451702589996361286427D+00 xtab(123) = 413.29853681779384418008260081859D+00 xtab(124) = 426.87579153663675538288509017051D+00 xtab(125) = 441.93085485310841412460309271842D+00 xtab(126) = 459.21804639888429981971267313224D+00 xtab(127) = 480.69378263388373859704269229304D+00 weight( 1) = 0.28773246692000124355770010301506D-01 weight( 2) = 0.63817468175134649363480949265236D-01 weight( 3) = 0.91919669721570571389864194652717D-01 weight( 4) = 0.11054167914413766381245463002967D+00 weight( 5) = 0.11879771633375850188328329422643D+00 weight( 6) = 0.11737818530052695148804451630074D+00 weight( 7) = 0.10819305984180551488335145581193D+00 weight( 8) = 0.93827075290489628080377261401107D-01 weight( 9) = 0.76966450960588843995822485928431D-01 weight( 10) = 0.59934903912939714332570730063476D-01 weight( 11) = 0.44417742073889001371708316272923D-01 weight( 12) = 0.31385080966252320983009372215062D-01 weight( 13) = 0.21172316041924506411370709025015D-01 weight( 14) = 0.13650145364230541652171185564626D-01 weight( 15) = 0.84172852710599172279366657385445D-02 weight( 16) = 0.49674990059882760515912858620175D-02 weight( 17) = 0.28069903895001884631961957446400D-02 weight( 18) = 0.15192951003941952460445341057817D-02 weight( 19) = 0.78789028751796084086217287140548D-03 weight( 20) = 0.39156751064868450584507324648999D-03 weight( 21) = 0.18652434268825860550093566260060D-03 weight( 22) = 0.85173160415576621908809828160247D-04 weight( 23) = 0.37285639197853037712145321577724D-04 weight( 24) = 0.15648416791712993947447805296768D-04 weight( 25) = 0.62964340695224829035692735524979D-05 weight( 26) = 0.24288929711328724574541379938222D-05 weight( 27) = 0.89824607890051007201922871545035D-06 weight( 28) = 0.31844174740760353710742966328091D-06 weight( 29) = 0.10821272905566839211861807542741D-06 weight( 30) = 0.35245076750635536015902779085340D-07 weight( 31) = 0.11001224365719347407063839761738D-07 weight( 32) = 0.32904079616717932125329343003261D-08 weight( 33) = 0.94289145237889976419772700772988D-09 weight( 34) = 0.25882578904668318184050195309296D-09 weight( 35) = 0.68047437103370762630942259017560D-10 weight( 36) = 0.17131398805120837835399564475632D-10 weight( 37) = 0.41291744524052865469443922304935D-11 weight( 38) = 0.95264189718807273220707664873469D-12 weight( 39) = 0.21032604432442425932962942047474D-12 weight( 40) = 0.44427151938729352860940434285789D-13 weight( 41) = 0.89760500362833703323319846405449D-14 weight( 42) = 0.17341511407769287074627948346848D-14 weight( 43) = 0.32028099548988356631494379835210D-15 weight( 44) = 0.56531388950793682022660742095189D-16 weight( 45) = 0.95329672799026591234588044025896D-17 weight( 46) = 0.15353453477310142565288509437552D-17 weight( 47) = 0.23608962179467365686057842132176D-18 weight( 48) = 0.34648742794456611332193876653230D-19 weight( 49) = 0.48515241897086461320126957663545D-20 weight( 50) = 0.64786228633519813428137373790678D-21 weight( 51) = 0.82476020965403242936448553126316D-22 weight( 52) = 0.10005361880214719793491658282977D-22 weight( 53) = 0.11561395116207304954233181263632D-23 weight( 54) = 0.12719342731167922655612134264961D-24 weight( 55) = 0.13316584714165372967340004160814D-25 weight( 56) = 0.13261218454678944033646108509198D-26 weight( 57) = 0.12554995447643949807286074138324D-27 weight( 58) = 0.11294412178579462703240913107219D-28 weight( 59) = 0.96491020279562119228500608131696D-30 weight( 60) = 0.78241846768302099396733076955632D-31 weight( 61) = 0.60181503542219626658249939076636D-32 weight( 62) = 0.43882482704961741551510518054138D-33 weight( 63) = 0.30314137647517256304035802501863D-34 weight( 64) = 0.19826016543944539545224676057020D-35 weight( 65) = 0.12267623373665926559013654872402D-36 weight( 66) = 0.71763931692508888943812834967620D-38 weight( 67) = 0.39659378833836963584113716149270D-39 weight( 68) = 0.20688970553868040099581951696677D-40 weight( 69) = 0.10179587017979517245268418427523D-41 weight( 70) = 0.47200827745986374625714293679649D-43 weight( 71) = 0.20606828985553374825744353490744D-44 weight( 72) = 0.84627575907305987245899032156188D-46 weight( 73) = 0.32661123687088798658026998931647D-47 weight( 74) = 0.11833939207883162380564134612682D-48 weight( 75) = 0.40211209123895013807243250164050D-50 weight( 76) = 0.12799824394111125389430292847476D-51 weight( 77) = 0.38123877747548846504399051365162D-53 weight( 78) = 0.10612057542701156767898551949650D-54 weight( 79) = 0.27571446947200403594113572720812D-56 weight( 80) = 0.66772544240928492881306904862856D-58 weight( 81) = 0.15052438383868234954068178600268D-59 weight( 82) = 0.31538986800113758526689068500772D-61 weight( 83) = 0.61326614299483180785237418887960D-63 weight( 84) = 0.11048510030324810567549119229368D-64 weight( 85) = 0.18410563538091348076979665543900D-66 weight( 86) = 0.28323926570052832195543883237652D-68 weight( 87) = 0.40154409843763655508670978777418D-70 weight( 88) = 0.52351530215683708779772201956106D-72 weight( 89) = 0.62634476665005100555787696642851D-74 weight( 90) = 0.68612210535666530365348093803922D-76 weight( 91) = 0.68651298840956019297134099761855D-78 weight( 92) = 0.62581388433728084867318704240915D-80 weight( 93) = 0.51833271237514904046803469968027D-82 weight( 94) = 0.38893621571918443533108973497673D-84 weight( 95) = 0.26357711379476932781525533730623D-86 weight( 96) = 0.16078851293917979699005509638883D-88 weight( 97) = 0.87978042070968939637972577886624D-91 weight( 98) = 0.43013405077495109903408697802188D-93 weight( 99) = 0.18713435881342838527144321803729D-95 weight(100) = 0.72125744708060471675805761366523D-98 weight(101) = 0.24508746062177874383231742333023D-100 weight(102) = 0.73042094619470875777647865078327D-103 weight(103) = 0.18983290818383463537886818579820D-105 weight(104) = 0.42757400244246684123093264825902D-108 weight(105) = 0.82894681420515755691423485228897D-111 weight(106) = 0.13729432219324400013067050156048D-113 weight(107) = 0.19265464126404973222043166489406D-116 weight(108) = 0.22693344503301354826140809941334D-119 weight(109) = 0.22209290603717355061909071271535D-122 weight(110) = 0.17851087685544512662856555121755D-125 weight(111) = 0.11630931990387164467431190485525D-128 weight(112) = 0.60524443584652392290952805077893D-132 weight(113) = 0.24729569115063528647628375096400D-135 weight(114) = 0.77789065006489410364997205809045D-139 weight(115) = 0.18409738662712607039570678274636D-142 weight(116) = 0.31900921131079114970179071968597D-146 weight(117) = 0.39179487139174199737617666077555D-150 weight(118) = 0.32782158394188697053774429820559D-154 weight(119) = 0.17793590713138888062819640128739D-158 weight(120) = 0.58882353408932623157467835381214D-163 weight(121) = 0.10957236509071169877747203273886D-167 weight(122) = 0.10281621114867000898285076975760D-172 weight(123) = 0.41704725557697758145816510853967D-178 weight(124) = 0.58002877720316101774638319601971D-184 weight(125) = 0.18873507745825517106171619101120D-190 weight(126) = 0.69106601826730911682786705950895D-198 weight(127) = 0.43506813201105855628383313334402D-207 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LAGUERRE_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are 1 to 20, 31, 32, 63, 64 or 127.' stop end if return end subroutine laguerre_sum ( func, a, order, xtab, weight, result ) !*****************************************************************************80 ! !! LAGUERRE_SUM carries out Laguerre quadrature over [ A, +oo ). ! ! Discussion: ! ! The simplest Laguerre integral to approximate is the ! integral from 0 to +oo of EXP(-X) * F(X). When this is so, ! it is easy to modify the rule to approximate the integral from ! A to +oo as well. ! ! Another common Laguerre integral to approximate is the ! integral from 0 to +oo of EXP(-X) * X**ALPHA * F(X). ! This routine may be used to sum up the terms of the Laguerre ! rule for such an integral as well. However, if ALPHA is nonzero, ! then there is no simple way to extend the rule to approximate the ! integral from A to +oo. The simplest procedures would be ! to approximate the integral from 0 to A. ! ! The integration interval is [ A, +oo ) or [ 0, +oo ). ! ! The weight function is w(x) = exp ( -x ) or exp ( -x ) * x**alpha. ! ! The integral to approximate: ! ! Integral ( A <= X <= +oo ) EXP ( -X ) * F(X) dX ! or ! Integral ( 0 <= X <= +oo ) EXP ( -X ) * X**ALPHA * F(X) dX ! ! The quadrature rule: ! ! EXP ( - A ) * Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) + A ) ! or ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 15 March 2000 ! ! 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. ! ! Daniel Zwillinger, editor, ! CRC Standard Mathematical Tables and Formulae, ! 30th Edition, ! CRC Press, 1996, ! ISBN: 0-8493-2479-3, ! LC: QA47.M315. ! ! Parameters: ! ! Input, external FUNC, the name of the FORTRAN function which ! evaluates the integrand. The function must have the form ! function func ( x ). ! ! Input, real ( kind = 8 ) A, the beginning of the integration interval. ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ! Input, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Input, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! ! Output, real ( kind = 8 ) RESULT, the approximate value of the integral. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) a real ( kind = 8 ), external :: func integer ( kind = 4 ) i real ( kind = 8 ) result real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order < 1 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LAGUERRE_SUM - Fatal error!' write ( *, '(a,i8)' ) ' Nonpositive ORDER = ', order stop end if result = 0.0D+00 do i = 1, order result = result + weight(i) * func ( xtab(i) + a ) end do result = exp ( - a ) * result return end subroutine legendre_compute_dr ( n, x, w ) !*****************************************************************************80 ! !! LEGENDRE_COMPUTE_DR: Gauss-Legendre quadrature by Davis-Rabinowitz method. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1.0. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= N ) W(I) * F ( X(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 16 September 1998 ! ! Author: ! ! Original FORTRAN77 version by Philip Davis, Philip Rabinowitz. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Philip Davis, Philip Rabinowitz, ! Methods of Numerical Integration, ! Second Edition, ! Dover, 2007, ! ISBN: 0486453391, ! LC: QA299.3.D28. ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. ! N must be greater than 0. ! ! Output, real ( kind = 8 ) X(N), the abscissas. ! ! Output, real ( kind = 8 ) W(N), the weights. ! The weights are positive, symmetric, and should sum to 2. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) d1 real ( kind = 8 ) d2pn real ( kind = 8 ) d3pn real ( kind = 8 ) d4pn real ( kind = 8 ) dp real ( kind = 8 ) dpn real ( kind = 8 ) e1 real ( kind = 8 ) fx real ( kind = 8 ) h integer ( kind = 4 ) i integer ( kind = 4 ) iback integer ( kind = 4 ) k integer ( kind = 4 ) m integer ( kind = 4 ) mp1mi integer ( kind = 4 ) ncopy integer ( kind = 4 ) nmove real ( kind = 8 ) p real ( kind = 8 ) :: pi = 3.141592653589793D+00 real ( kind = 8 ) pk real ( kind = 8 ) pkm1 real ( kind = 8 ) pkp1 real ( kind = 8 ) t real ( kind = 8 ) u real ( kind = 8 ) v real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) real ( kind = 8 ) x0 real ( kind = 8 ) xtemp if ( n < 1 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LEGENDRE_COMPUTE_DR - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', n stop end if e1 = real ( n * ( n + 1 ), kind = 8 ) m = ( n + 1 ) / 2 do i = 1, m mp1mi = m + 1 - i t = real ( 4 * i - 1, kind = 8 ) * pi & / real ( 4 * n + 2, kind = 8 ) x0 = cos ( t ) * ( 1.0D+00 - ( 1.0D+00 - 1.0D+00 & / real ( n, kind = 8 ) ) & / real ( 8 * n * n, kind = 8 ) ) pkm1 = 1.0D+00 pk = x0 do k = 2, n pkp1 = 2.0D+00 * x0 * pk - pkm1 - ( x0 * pk - pkm1 ) & / real ( k, kind = 8 ) pkm1 = pk pk = pkp1 end do d1 = real ( n, kind = 8 ) * ( pkm1 - x0 * pk ) dpn = d1 / ( 1.0D+00 - x0 ) / ( 1.0D+00 + x0 ) d2pn = ( 2.0D+00 * x0 * dpn - e1 * pk ) / ( 1.0D+00 - x0 ) & / ( 1.0D+00 + x0 ) d3pn = ( 4.0D+00 * x0 * d2pn + ( 2.0D+00 - e1 ) * dpn ) & / ( 1.0D+00 - x0 ) / ( 1.0D+00 + x0 ) d4pn = ( 6.0D+00 * x0 * d3pn + ( 6.0D+00 - e1 ) * d2pn ) & / ( 1.0D+00 - x0 ) / ( 1.0D+00 + x0 ) u = pk / dpn v = d2pn / dpn ! ! Initial approximation H: ! h = - u * ( 1.0D+00 + 0.5D+00 * u * ( v + u * ( v * v - d3pn / & ( 3.0D+00 * dpn ) ) ) ) ! ! Refine H using one step of Newton's method: ! p = pk + h * ( dpn + 0.5D+00 * h * ( d2pn + h / 3.0D+00 & * ( d3pn + 0.25D+00 * h * d4pn ) ) ) dp = dpn + h * ( d2pn + 0.5D+00 * h * ( d3pn + h * d4pn / 3.0D+00 ) ) h = h - p / dp xtemp = x0 + h x(mp1mi) = xtemp fx = d1 - h * e1 * ( pk + 0.5D+00 * h * ( dpn + h / 3.0D+00 & * ( d2pn + 0.25D+00 * h * ( d3pn + 0.2D+00 * h * d4pn ) ) ) ) w(mp1mi) = 2.0D+00 * ( 1.0D+00 - xtemp ) * ( 1.0D+00 + xtemp ) / ( fx * fx ) end do if ( mod ( n, 2 ) == 1 ) then x(1) = 0.0D+00 end if ! ! Shift the data up. ! nmove = ( n + 1 ) / 2 ncopy = n - nmove do i = 1, nmove iback = n + 1 - i x(iback) = x(iback-ncopy) w(iback) = w(iback-ncopy) end do ! ! Reflect values for the negative abscissas. ! do i = 1, n - nmove x(i) = - x(n+1-i) w(i) = w(n+1-i) end do return end subroutine legendre_compute_gw ( n, x, w ) !*****************************************************************************80 ! !! LEGENDRE_COMPUTE_GW: Legendre quadrature rule by the Golub-Welsch method. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 October 2009 ! ! Author: ! ! Original MATLAB version by Nick Hale. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Gene Golub, John Welsch, ! Calculation of Gaussian Quadrature Rules, ! Mathematics of Computation, ! Volume 23, Number 106, April 1969, pages 221-230. ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. ! ! Output, real ( kind = 8 ) X(N), the abscissas. ! ! Output, real ( kind = 8 ) W(N), the weights. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) beta(n) real ( kind = 8 ) d(n) integer ( kind = 4 ) i integer ( kind = 4 ) ierr real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) real ( kind = 8 ) z(n,n) do i = 1, n - 1 beta(i) = 1.0D+00 / real ( 2 * i, kind = 8 ) end do beta(1:n-1) = 0.5D+00 & / sqrt ( ( 1.0D+00 - beta(1:n-1) ) * ( 1.0D+00 + beta(1:n-1) ) ) ! ! Compute eigenvalues and eigenvectors. ! d(1:n) = 0.0D+00 beta(2:n) = beta(1:n-1) beta(1) = 0.0D+00 z(1:n,1:n) = 0.0D+00 do i = 1, n z(i,i) = 1.0D+00 end do call imtql2 ( n, d, beta, z, ierr ) ! ! X values are eigenvalues. ! do i = 1, n x(i) = d(i) end do ! ! W is related to first eigenvector. ! w(1:n) = 2.0D+00 * z(1,1:n)**2 w(1:n) = 2.0D+00 * w(1:n) / sum ( w(1:n) ) return end subroutine legendre_compute_ss ( n, x, w ) !*****************************************************************************80 ! !! LEGENDRE_COMPUTE_SS: Gauss-Legendre quadrature by Stroud-Secrest method. ! ! Discussion: ! ! The Stroud and Secrest reference did not print a specific computer program ! for the Gauss-Legendre case. Therefore, this code is based on the ! printed code for the Gauss-Jacobi case, with ALPHA and BETA set to 0. ! This means that the LEGENDRE_ROOT_SS and LEGENDRE_RECUR_SS routines, ! while appropriate for this computation, do not use the standard ! normalization for the Legendre polynomials in which Pn(1) = 1. ! The unusual scaling does not, however, affect the location of the ! roots, which is the primary thing of interest. ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1.0. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= N ) W(I) * F ( X(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 02 November 2009 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order of the quadrature rule ! to be computed. ! ! Output, real ( kind = 8 ) X(N), the abscissas. ! ! Output, real ( kind = 8 ) W(N), the weights. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) c(n) real ( kind = 8 ) cc real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p1 real ( kind = 8 ) r real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) real ( kind = 8 ) xtemp ! ! Set the recursion coefficients. ! do i = 1, n c(i) = real ( ( i - 1 ) * ( i - 1 ), kind = 8 ) / & real ( ( 2 * i - 1 ) * ( 2 * i - 3 ), kind = 8 ) end do cc = 2.0D+00 * product ( c(2:n) ) do i = 1, n if ( i == 1 ) then r = 2.78D+00 / ( 4.0D+00 + real ( n * n, kind = 8 ) ) xtemp = 1.0D+00 - r else if ( i == 2 ) then r = 1.0D+00 + 0.06D+00 * real ( n - 8, kind = 8 ) & / real ( n, kind = 8 ) xtemp = xtemp - 4.1D+00 * r * ( 1.0D+00 - xtemp ) else if ( i == 3 ) then r = 1.0D+00 + 0.22D+00 * real ( n - 8, kind = 8 ) & / real ( n, kind = 8 ) xtemp = xtemp - 1.67D+00 * r * ( x(1) - xtemp ) else if ( i < n - 1 ) then xtemp = 3.0D+00 * x(i-1) - 3.0D+00 * x(i-2) + x(i-3) else if ( i == n - 1 ) then r = 1.0D+00 / ( 1.0D+00 + 0.639D+00 * real ( n - 4, kind = 8 ) & / ( 1.0D+00 + 0.71D+00 * real ( n - 4, kind = 8 ) ) ) xtemp = xtemp + r * ( xtemp - x(i-2) ) / 0.766D+00 else if ( i == n ) then r = 1.0D+00 / ( 1.0D+00 + 0.22D+00 * real ( n - 8, kind = 8 ) & / real ( n, kind = 8 ) ) xtemp = xtemp + r * ( xtemp - x(i-2) ) / 1.67D+00 end if call legendre_root_ss ( xtemp, n, dp2, p1, c ) x(i) = xtemp w(i) = cc / dp2 / p1 end do ! ! Reverse the order of the data. ! x(1:n) = x(n:1:-1) w(1:n) = w(n:1:-1) return end subroutine legendre_integral ( expon, exact ) !*****************************************************************************80 ! !! LEGENDRE_INTEGRAL evaluates a monomial Legendre integral. ! ! Discussion: ! ! To test a Legendre quadrature rule, we use it to approximate the ! integral of a monomial: ! ! integral ( -1 <= x <= +1 ) x^n dx ! ! This routine is given the value of the exponent, and returns the ! exact value of the integral. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 February 2008 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) EXPON, the exponent. ! ! Output, real ( kind = 8 ) EXACT, the value of the exact integral. ! implicit none real ( kind = 8 ) exact integer ( kind = 4 ) expon ! ! Get the exact value of the integral. ! if ( mod ( expon, 2 ) == 0 ) then exact = 2.0D+00 / real ( expon + 1, kind = 8 ) else exact = 0.0D+00 end if return end subroutine legendre_polynomial_value ( m, n, x, p ) !*****************************************************************************80 ! !! LEGENDRE_POLYNOMIAL_VALUE evaluates a Legendre polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 October 2009 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, integer ( kind = 4 ) M, the number of values. ! ! Input, integer ( kind = 4 ) N, the order of the polynomial. ! ! Input, real ( kind = 8 ) X(M), the evaluation points. ! ! Output, real ( kind = 8 ) P(M), the value of P(N)(X(1:M)). ! implicit none integer ( kind = 4 ) m real ( kind = 8 ) dp0(m) real ( kind = 8 ) dp1(m) real ( kind = 8 ) dp2(m) integer ( kind = 4 ) i integer ( kind = 4 ) n real ( kind = 8 ) p(m) real ( kind = 8 ) p0(m) real ( kind = 8 ) p1(m) real ( kind = 8 ) p2(m) real ( kind = 8 ) x(m) if ( n < 0 ) then p(1:m) = 0.0D+00 return end if p1(1:m) = 1.0D+00 dp1(1:m) = 0.0D+00 if ( n == 0 ) then p(1:m) = p1(1:m) return end if p2(1:m) = x(1:m) dp2(1:m) = 1.0D+00 if ( n == 1 ) then p(1:m) = p2(1:m) return end if do i = 2, n p0(1:m) = p1(1:m) dp0(1:m) = dp1(1:m) p1(1:m) = p2(1:m) dp1(1:m) = dp2(1:m) p2(1:m) = ( real ( 2 * i - 1, kind = 8 ) * x(1:m) * p1(1:m) & + real ( - i + 1, kind = 8 ) * p0(1:m) ) & / real ( i, kind = 8 ) dp2(1:m) = & ( real ( 2 * i - 1, kind = 8 ) * ( p1(1:m) + x(1:m) * dp1(1:m) ) & - real ( i - 1, kind = 8 ) * dp0(1:m) ) & / real ( i, kind = 8 ) end do p(1:m) = p2(1:m) return end subroutine legendre_recur ( p2, dp2, p1, x, order ) !*****************************************************************************80 ! !! LEGENDRE_RECUR finds the value and derivative of a Legendre polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 September 1998 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Output, real ( kind = 8 ) P2, the value of P(ORDER)(X). ! ! Output, real ( kind = 8 ) DP2, the value of P'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of P(ORDER-1)(X). ! ! Input, real ( kind = 8 ) X, the point at which polynomials are evaluated. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) dp0 real ( kind = 8 ) dp1 real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p0 real ( kind = 8 ) p1 real ( kind = 8 ) p2 real ( kind = 8 ) x p1 = 1.0D+00 dp1 = 0.0D+00 p2 = x dp2 = 1.0D+00 do i = 2, order p0 = p1 dp0 = dp1 p1 = p2 dp1 = dp2 p2 = ( real ( 2 * i - 1, kind = 8 ) * x * p1 & + real ( - i + 1, kind = 8 ) * p0 ) & / real ( i, kind = 8 ) dp2 = ( real ( 2 * i - 1, kind = 8 ) * ( p1 + x * dp1 ) & - real ( i - 1, kind = 8 ) * dp0 ) & / real ( i, kind = 8 ) end do return end subroutine legendre_recur_ss ( p2, dp2, p1, x, order, c ) !*****************************************************************************80 ! !! LEGENDRE_RECUR_SS: value and derivative of a scaled Legendre polynomial. ! ! Discussion: ! ! The Stroud and Secrest reference did not print a specific computer program ! for the Gauss-Legendre case. Therefore, this code is based on the ! printed code for the Gauss-Jacobi case, with ALPHA and BETA set to 0. ! This means that the LEGENDRE_ROOT_SS and LEGENDRE_RECUR_SS routines, ! while appropriate for this computation, do not use the standard ! normalization for the Legendre polynomials in which Pn(1) = 1. ! The unusual scaling does not, however, affect the location of the ! roots, which is the primary thing of interest. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 02 November 2009 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Output, real ( kind = 8 ) P2, the value of L(ORDER)(X). ! ! Output, real ( kind = 8 ) DP2, the value of L'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of L(ORDER-1)(X). ! ! Input, real ( kind = 8 ) X, the point at which polynomials are evaluated. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Input, real ( kind = 8 ) C(ORDER), the recursion ! coefficients. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) c(order) real ( kind = 8 ) dp0 real ( kind = 8 ) dp1 real ( kind = 8 ) dp2 integer ( kind = 4 ) i real ( kind = 8 ) p0 real ( kind = 8 ) p1 real ( kind = 8 ) p2 real ( kind = 8 ) x p1 = 1.0D+00 dp1 = 0.0D+00 p2 = x dp2 = 1.0D+00 do i = 2, order p0 = p1 dp0 = dp1 p1 = p2 dp1 = dp2 p2 = x * p1 - c(i) * p0 dp2 = x * dp1 + p1 - c(i) * dp0 end do return end subroutine legendre_root ( x, order, dp2, p1 ) !*****************************************************************************80 ! !! LEGENDRE_ROOT improves an approximate root of a Legendre polynomial. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 October 2009 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input/output, real ( kind = 8 ) X, the approximate root, which ! should be improved on output. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Output, real ( kind = 8 ) DP2, the value of L'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of L(ORDER-1)(X). ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) d real ( kind = 8 ) dp2 real ( kind = 8 ) eps real ( kind = 8 ) p1 real ( kind = 8 ) p2 integer ( kind = 4 ) step integer ( kind = 4 ), parameter :: step_max = 10 real ( kind = 8 ) x eps = epsilon ( eps ) do step = 1, step_max call legendre_recur ( p2, dp2, p1, x, order ) d = p2 / dp2 x = x - d if ( abs ( d ) <= eps * ( abs ( x ) + 1.0D+00 ) ) then return end if end do return end subroutine legendre_root_ss ( x, order, dp2, p1, c ) !*****************************************************************************80 ! !! LEGENDRE_ROOT_SS: improve approximate root of scaled Legendre polynomial. ! ! Discussion: ! ! The Stroud and Secrest reference did not print a specific computer program ! for the Gauss-Legendre case. Therefore, this code is based on the ! printed code for the Gauss-Jacobi case, with ALPHA and BETA set to 0. ! This means that the LEGENDRE_ROOT_SS and LEGENDRE_RECUR_SS routines, ! while appropriate for this computation, do not use the standard ! normalization for the Legendre polynomials in which Pn(1) = 1. ! The unusual scaling does not, however, affect the location of the ! roots, which is the primary thing of interest. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 02 November 2009 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input/output, real ( kind = 8 ) X, the approximate root, which ! should be improved on output. ! ! Input, integer ( kind = 4 ) ORDER, the order of the polynomial ! to be computed. ! ! Output, real ( kind = 8 ) DP2, the value of L'(ORDER)(X). ! ! Output, real ( kind = 8 ) P1, the value of L(ORDER-1)(X). ! ! Input, real ( kind = 8 ) C(ORDER), the recursion coefficients. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) c(order) real ( kind = 8 ) d real ( kind = 8 ) dp2 real ( kind = 8 ) eps real ( kind = 8 ) p1 real ( kind = 8 ) p2 integer ( kind = 4 ) step integer ( kind = 4 ), parameter :: step_max = 10 real ( kind = 8 ) x eps = epsilon ( eps ) do step = 1, step_max call legendre_recur_ss ( p2, dp2, p1, x, order, c ) d = p2 / dp2 x = x - d if ( abs ( d ) <= eps * ( abs ( x ) + 1.0D+00 ) ) then return end if end do return end subroutine legendre_set ( n, x, w ) !*****************************************************************************80 ! !! LEGENDRE_SET sets abscissas and weights for Gauss-Legendre quadrature. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1.0. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) dX ! ! The 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 ORDER abscissas of the rule. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 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, ! LC: QA311.K713. ! ! 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, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. ! N must be between 1 and 33 or 63, 64, 65, 127 or 255. ! ! Output, real ( kind = 8 ) X(N), the abscissas. ! ! Output, real ( kind = 8 ) WN), the weights. ! The weights are positive, symmetric and should sum to 2. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) if ( n == 1 ) then x(1) = 0.0D+00 w(1) = 2.0D+00 else if ( n == 2 ) then x(1) = -0.577350269189625764509148780502D+00 x(2) = 0.577350269189625764509148780502D+00 w(1) = 1.0D+00 w(2) = 1.0D+00 else if ( n == 3 ) then x(1) = -0.774596669241483377035853079956D+00 x(2) = 0.000000000000000000000000000000D+00 x(3) = 0.774596669241483377035853079956D+00 w(1) = 5.0D+00 / 9.0D+00 w(2) = 8.0D+00 / 9.0D+00 w(3) = 5.0D+00 / 9.0D+00 else if ( n == 4 ) then x(1) = -0.861136311594052575223946488893D+00 x(2) = -0.339981043584856264802665759103D+00 x(3) = 0.339981043584856264802665759103D+00 x(4) = 0.861136311594052575223946488893D+00 w(1) = 0.347854845137453857373063949222D+00 w(2) = 0.652145154862546142626936050778D+00 w(3) = 0.652145154862546142626936050778D+00 w(4) = 0.347854845137453857373063949222D+00 else if ( n == 5 ) then x(1) = -0.906179845938663992797626878299D+00 x(2) = -0.538469310105683091036314420700D+00 x(3) = 0.000000000000000000000000000000D+00 x(4) = 0.538469310105683091036314420700D+00 x(5) = 0.906179845938663992797626878299D+00 w(1) = 0.236926885056189087514264040720D+00 w(2) = 0.478628670499366468041291514836D+00 w(3) = 0.568888888888888888888888888889D+00 w(4) = 0.478628670499366468041291514836D+00 w(5) = 0.236926885056189087514264040720D+00 else if ( n == 6 ) then x(1) = - 0.932469514203152027812301554494D+00 x(2) = - 0.661209386466264513661399595020D+00 x(3) = - 0.238619186083196908630501721681D+00 x(4) = 0.238619186083196908630501721681D+00 x(5) = 0.661209386466264513661399595020D+00 x(6) = 0.932469514203152027812301554494D+00 w(1) = 0.171324492379170345040296142173D+00 w(2) = 0.360761573048138607569833513838D+00 w(3) = 0.467913934572691047389870343990D+00 w(4) = 0.467913934572691047389870343990D+00 w(5) = 0.360761573048138607569833513838D+00 w(6) = 0.171324492379170345040296142173D+00 else if ( n == 7 ) then x(1) = - 0.949107912342758524526189684048D+00 x(2) = - 0.741531185599394439863864773281D+00 x(3) = - 0.405845151377397166906606412077D+00 x(4) = 0.0D+00 x(5) = 0.405845151377397166906606412077D+00 x(6) = 0.741531185599394439863864773281D+00 x(7) = 0.949107912342758524526189684048D+00 w(1) = 0.129484966168869693270611432679D+00 w(2) = 0.279705391489276667901467771424D+00 w(3) = 0.381830050505118944950369775489D+00 w(4) = 0.417959183673469387755102040816D+00 w(5) = 0.381830050505118944950369775489D+00 w(6) = 0.279705391489276667901467771424D+00 w(7) = 0.129484966168869693270611432679D+00 else if ( n == 8 ) then x(1) = - 0.960289856497536231683560868569D+00 x(2) = - 0.796666477413626739591553936476D+00 x(3) = - 0.525532409916328985817739049189D+00 x(4) = - 0.183434642495649804939476142360D+00 x(5) = 0.183434642495649804939476142360D+00 x(6) = 0.525532409916328985817739049189D+00 x(7) = 0.796666477413626739591553936476D+00 x(8) = 0.960289856497536231683560868569D+00 w(1) = 0.101228536290376259152531354310D+00 w(2) = 0.222381034453374470544355994426D+00 w(3) = 0.313706645877887287337962201987D+00 w(4) = 0.362683783378361982965150449277D+00 w(5) = 0.362683783378361982965150449277D+00 w(6) = 0.313706645877887287337962201987D+00 w(7) = 0.222381034453374470544355994426D+00 w(8) = 0.101228536290376259152531354310D+00 else if ( n == 9 ) then x(1) = - 0.968160239507626089835576202904D+00 x(2) = - 0.836031107326635794299429788070D+00 x(3) = - 0.613371432700590397308702039341D+00 x(4) = - 0.324253423403808929038538014643D+00 x(5) = 0.0D+00 x(6) = 0.324253423403808929038538014643D+00 x(7) = 0.613371432700590397308702039341D+00 x(8) = 0.836031107326635794299429788070D+00 x(9) = 0.968160239507626089835576202904D+00 w(1) = 0.812743883615744119718921581105D-01 w(2) = 0.180648160694857404058472031243D+00 w(3) = 0.260610696402935462318742869419D+00 w(4) = 0.312347077040002840068630406584D+00 w(5) = 0.330239355001259763164525069287D+00 w(6) = 0.312347077040002840068630406584D+00 w(7) = 0.260610696402935462318742869419D+00 w(8) = 0.180648160694857404058472031243D+00 w(9) = 0.812743883615744119718921581105D-01 else if ( n == 10 ) then x(1) = - 0.973906528517171720077964012084D+00 x(2) = - 0.865063366688984510732096688423D+00 x(3) = - 0.679409568299024406234327365115D+00 x(4) = - 0.433395394129247190799265943166D+00 x(5) = - 0.148874338981631210884826001130D+00 x(6) = 0.148874338981631210884826001130D+00 x(7) = 0.433395394129247190799265943166D+00 x(8) = 0.679409568299024406234327365115D+00 x(9) = 0.865063366688984510732096688423D+00 x(10) = 0.973906528517171720077964012084D+00 w(1) = 0.666713443086881375935688098933D-01 w(2) = 0.149451349150580593145776339658D+00 w(3) = 0.219086362515982043995534934228D+00 w(4) = 0.269266719309996355091226921569D+00 w(5) = 0.295524224714752870173892994651D+00 w(6) = 0.295524224714752870173892994651D+00 w(7) = 0.269266719309996355091226921569D+00 w(8) = 0.219086362515982043995534934228D+00 w(9) = 0.149451349150580593145776339658D+00 w(10) = 0.666713443086881375935688098933D-01 else if ( n == 11 ) then x(1) = - 0.978228658146056992803938001123D+00 x(2) = - 0.887062599768095299075157769304D+00 x(3) = - 0.730152005574049324093416252031D+00 x(4) = - 0.519096129206811815925725669459D+00 x(5) = - 0.269543155952344972331531985401D+00 x(6) = 0.0D+00 x(7) = 0.269543155952344972331531985401D+00 x(8) = 0.519096129206811815925725669459D+00 x(9) = 0.730152005574049324093416252031D+00 x(10) = 0.887062599768095299075157769304D+00 x(11) = 0.978228658146056992803938001123D+00 w(1) = 0.556685671161736664827537204425D-01 w(2) = 0.125580369464904624634694299224D+00 w(3) = 0.186290210927734251426097641432D+00 w(4) = 0.233193764591990479918523704843D+00 w(5) = 0.262804544510246662180688869891D+00 w(6) = 0.272925086777900630714483528336D+00 w(7) = 0.262804544510246662180688869891D+00 w(8) = 0.233193764591990479918523704843D+00 w(9) = 0.186290210927734251426097641432D+00 w(10) = 0.125580369464904624634694299224D+00 w(11) = 0.556685671161736664827537204425D-01 else if ( n == 12 ) then x(1) = - 0.981560634246719250690549090149D+00 x(2) = - 0.904117256370474856678465866119D+00 x(3) = - 0.769902674194304687036893833213D+00 x(4) = - 0.587317954286617447296702418941D+00 x(5) = - 0.367831498998180193752691536644D+00 x(6) = - 0.125233408511468915472441369464D+00 x(7) = 0.125233408511468915472441369464D+00 x(8) = 0.367831498998180193752691536644D+00 x(9) = 0.587317954286617447296702418941D+00 x(10) = 0.769902674194304687036893833213D+00 x(11) = 0.904117256370474856678465866119D+00 x(12) = 0.981560634246719250690549090149D+00 w(1) = 0.471753363865118271946159614850D-01 w(2) = 0.106939325995318430960254718194D+00 w(3) = 0.160078328543346226334652529543D+00 w(4) = 0.203167426723065921749064455810D+00 w(5) = 0.233492536538354808760849898925D+00 w(6) = 0.249147045813402785000562436043D+00 w(7) = 0.249147045813402785000562436043D+00 w(8) = 0.233492536538354808760849898925D+00 w(9) = 0.203167426723065921749064455810D+00 w(10) = 0.160078328543346226334652529543D+00 w(11) = 0.106939325995318430960254718194D+00 w(12) = 0.471753363865118271946159614850D-01 else if ( n == 13 ) then x(1) = - 0.984183054718588149472829448807D+00 x(2) = - 0.917598399222977965206547836501D+00 x(3) = - 0.801578090733309912794206489583D+00 x(4) = - 0.642349339440340220643984606996D+00 x(5) = - 0.448492751036446852877912852128D+00 x(6) = - 0.230458315955134794065528121098D+00 x(7) = 0.0D+00 x(8) = 0.230458315955134794065528121098D+00 x(9) = 0.448492751036446852877912852128D+00 x(10) = 0.642349339440340220643984606996D+00 x(11) = 0.801578090733309912794206489583D+00 x(12) = 0.917598399222977965206547836501D+00 x(13) = 0.984183054718588149472829448807D+00 w(1) = 0.404840047653158795200215922010D-01 w(2) = 0.921214998377284479144217759538D-01 w(3) = 0.138873510219787238463601776869D+00 w(4) = 0.178145980761945738280046691996D+00 w(5) = 0.207816047536888502312523219306D+00 w(6) = 0.226283180262897238412090186040D+00 w(7) = 0.232551553230873910194589515269D+00 w(8) = 0.226283180262897238412090186040D+00 w(9) = 0.207816047536888502312523219306D+00 w(10) = 0.178145980761945738280046691996D+00 w(11) = 0.138873510219787238463601776869D+00 w(12) = 0.921214998377284479144217759538D-01 w(13) = 0.404840047653158795200215922010D-01 else if ( n == 14 ) then x(1) = - 0.986283808696812338841597266704D+00 x(2) = - 0.928434883663573517336391139378D+00 x(3) = - 0.827201315069764993189794742650D+00 x(4) = - 0.687292904811685470148019803019D+00 x(5) = - 0.515248636358154091965290718551D+00 x(6) = - 0.319112368927889760435671824168D+00 x(7) = - 0.108054948707343662066244650220D+00 x(8) = 0.108054948707343662066244650220D+00 x(9) = 0.319112368927889760435671824168D+00 x(10) = 0.515248636358154091965290718551D+00 x(11) = 0.687292904811685470148019803019D+00 x(12) = 0.827201315069764993189794742650D+00 x(13) = 0.928434883663573517336391139378D+00 x(14) = 0.986283808696812338841597266704D+00 w(1) = 0.351194603317518630318328761382D-01 w(2) = 0.801580871597602098056332770629D-01 w(3) = 0.121518570687903184689414809072D+00 w(4) = 0.157203167158193534569601938624D+00 w(5) = 0.185538397477937813741716590125D+00 w(6) = 0.205198463721295603965924065661D+00 w(7) = 0.215263853463157790195876443316D+00 w(8) = 0.215263853463157790195876443316D+00 w(9) = 0.205198463721295603965924065661D+00 w(10) = 0.185538397477937813741716590125D+00 w(11) = 0.157203167158193534569601938624D+00 w(12) = 0.121518570687903184689414809072D+00 w(13) = 0.801580871597602098056332770629D-01 w(14) = 0.351194603317518630318328761382D-01 else if ( n == 15 ) then x(1) = - 0.987992518020485428489565718587D+00 x(2) = - 0.937273392400705904307758947710D+00 x(3) = - 0.848206583410427216200648320774D+00 x(4) = - 0.724417731360170047416186054614D+00 x(5) = - 0.570972172608538847537226737254D+00 x(6) = - 0.394151347077563369897207370981D+00 x(7) = - 0.201194093997434522300628303395D+00 x(8) = 0.0D+00 x(9) = 0.201194093997434522300628303395D+00 x(10) = 0.394151347077563369897207370981D+00 x(11) = 0.570972172608538847537226737254D+00 x(12) = 0.724417731360170047416186054614D+00 x(13) = 0.848206583410427216200648320774D+00 x(14) = 0.937273392400705904307758947710D+00 x(15) = 0.987992518020485428489565718587D+00 w(1) = 0.307532419961172683546283935772D-01 w(2) = 0.703660474881081247092674164507D-01 w(3) = 0.107159220467171935011869546686D+00 w(4) = 0.139570677926154314447804794511D+00 w(5) = 0.166269205816993933553200860481D+00 w(6) = 0.186161000015562211026800561866D+00 w(7) = 0.198431485327111576456118326444D+00 w(8) = 0.202578241925561272880620199968D+00 w(9) = 0.198431485327111576456118326444D+00 w(10) = 0.186161000015562211026800561866D+00 w(11) = 0.166269205816993933553200860481D+00 w(12) = 0.139570677926154314447804794511D+00 w(13) = 0.107159220467171935011869546686D+00 w(14) = 0.703660474881081247092674164507D-01 w(15) = 0.307532419961172683546283935772D-01 else if ( n == 16 ) then x(1) = - 0.989400934991649932596154173450D+00 x(2) = - 0.944575023073232576077988415535D+00 x(3) = - 0.865631202387831743880467897712D+00 x(4) = - 0.755404408355003033895101194847D+00 x(5) = - 0.617876244402643748446671764049D+00 x(6) = - 0.458016777657227386342419442984D+00 x(7) = - 0.281603550779258913230460501460D+00 x(8) = - 0.950125098376374401853193354250D-01 x(9) = 0.950125098376374401853193354250D-01 x(10) = 0.281603550779258913230460501460D+00 x(11) = 0.458016777657227386342419442984D+00 x(12) = 0.617876244402643748446671764049D+00 x(13) = 0.755404408355003033895101194847D+00 x(14) = 0.865631202387831743880467897712D+00 x(15) = 0.944575023073232576077988415535D+00 x(16) = 0.989400934991649932596154173450D+00 w(1) = 0.271524594117540948517805724560D-01 w(2) = 0.622535239386478928628438369944D-01 w(3) = 0.951585116824927848099251076022D-01 w(4) = 0.124628971255533872052476282192D+00 w(5) = 0.149595988816576732081501730547D+00 w(6) = 0.169156519395002538189312079030D+00 w(7) = 0.182603415044923588866763667969D+00 w(8) = 0.189450610455068496285396723208D+00 w(9) = 0.189450610455068496285396723208D+00 w(10) = 0.182603415044923588866763667969D+00 w(11) = 0.169156519395002538189312079030D+00 w(12) = 0.149595988816576732081501730547D+00 w(13) = 0.124628971255533872052476282192D+00 w(14) = 0.951585116824927848099251076022D-01 w(15) = 0.622535239386478928628438369944D-01 w(16) = 0.271524594117540948517805724560D-01 else if ( n == 17 ) then x(1) = - 0.990575475314417335675434019941D+00 x(2) = - 0.950675521768767761222716957896D+00 x(3) = - 0.880239153726985902122955694488D+00 x(4) = - 0.781514003896801406925230055520D+00 x(5) = - 0.657671159216690765850302216643D+00 x(6) = - 0.512690537086476967886246568630D+00 x(7) = - 0.351231763453876315297185517095D+00 x(8) = - 0.178484181495847855850677493654D+00 x(9) = 0.0D+00 x(10) = 0.178484181495847855850677493654D+00 x(11) = 0.351231763453876315297185517095D+00 x(12) = 0.512690537086476967886246568630D+00 x(13) = 0.657671159216690765850302216643D+00 x(14) = 0.781514003896801406925230055520D+00 x(15) = 0.880239153726985902122955694488D+00 x(16) = 0.950675521768767761222716957896D+00 x(17) = 0.990575475314417335675434019941D+00 w(1) = 0.241483028685479319601100262876D-01 w(2) = 0.554595293739872011294401653582D-01 w(3) = 0.850361483171791808835353701911D-01 w(4) = 0.111883847193403971094788385626D+00 w(5) = 0.135136368468525473286319981702D+00 w(6) = 0.154045761076810288081431594802D+00 w(7) = 0.168004102156450044509970663788D+00 w(8) = 0.176562705366992646325270990113D+00 w(9) = 0.179446470356206525458265644262D+00 w(10) = 0.176562705366992646325270990113D+00 w(11) = 0.168004102156450044509970663788D+00 w(12) = 0.154045761076810288081431594802D+00 w(13) = 0.135136368468525473286319981702D+00 w(14) = 0.111883847193403971094788385626D+00 w(15) = 0.850361483171791808835353701911D-01 w(16) = 0.554595293739872011294401653582D-01 w(17) = 0.241483028685479319601100262876D-01 else if ( n == 18 ) then x(1) = - 0.991565168420930946730016004706D+00 x(2) = - 0.955823949571397755181195892930D+00 x(3) = - 0.892602466497555739206060591127D+00 x(4) = - 0.803704958972523115682417455015D+00 x(5) = - 0.691687043060353207874891081289D+00 x(6) = - 0.559770831073947534607871548525D+00 x(7) = - 0.411751161462842646035931793833D+00 x(8) = - 0.251886225691505509588972854878D+00 x(9) = - 0.847750130417353012422618529358D-01 x(10) = 0.847750130417353012422618529358D-01 x(11) = 0.251886225691505509588972854878D+00 x(12) = 0.411751161462842646035931793833D+00 x(13) = 0.559770831073947534607871548525D+00 x(14) = 0.691687043060353207874891081289D+00 x(15) = 0.803704958972523115682417455015D+00 x(16) = 0.892602466497555739206060591127D+00 x(17) = 0.955823949571397755181195892930D+00 x(18) = 0.991565168420930946730016004706D+00 w(1) = 0.216160135264833103133427102665D-01 w(2) = 0.497145488949697964533349462026D-01 w(3) = 0.764257302548890565291296776166D-01 w(4) = 0.100942044106287165562813984925D+00 w(5) = 0.122555206711478460184519126800D+00 w(6) = 0.140642914670650651204731303752D+00 w(7) = 0.154684675126265244925418003836D+00 w(8) = 0.164276483745832722986053776466D+00 w(9) = 0.169142382963143591840656470135D+00 w(10) = 0.169142382963143591840656470135D+00 w(11) = 0.164276483745832722986053776466D+00 w(12) = 0.154684675126265244925418003836D+00 w(13) = 0.140642914670650651204731303752D+00 w(14) = 0.122555206711478460184519126800D+00 w(15) = 0.100942044106287165562813984925D+00 w(16) = 0.764257302548890565291296776166D-01 w(17) = 0.497145488949697964533349462026D-01 w(18) = 0.216160135264833103133427102665D-01 else if ( n == 19 ) then x(1) = - 0.992406843843584403189017670253D+00 x(2) = - 0.960208152134830030852778840688D+00 x(3) = - 0.903155903614817901642660928532D+00 x(4) = - 0.822714656537142824978922486713D+00 x(5) = - 0.720966177335229378617095860824D+00 x(6) = - 0.600545304661681023469638164946D+00 x(7) = - 0.464570741375960945717267148104D+00 x(8) = - 0.316564099963629831990117328850D+00 x(9) = - 0.160358645640225375868096115741D+00 x(10) = 0.0D+00 x(11) = 0.160358645640225375868096115741D+00 x(12) = 0.316564099963629831990117328850D+00 x(13) = 0.464570741375960945717267148104D+00 x(14) = 0.600545304661681023469638164946D+00 x(15) = 0.720966177335229378617095860824D+00 x(16) = 0.822714656537142824978922486713D+00 x(17) = 0.903155903614817901642660928532D+00 x(18) = 0.960208152134830030852778840688D+00 x(19) = 0.992406843843584403189017670253D+00 w(1) = 0.194617882297264770363120414644D-01 w(2) = 0.448142267656996003328381574020D-01 w(3) = 0.690445427376412265807082580060D-01 w(4) = 0.914900216224499994644620941238D-01 w(5) = 0.111566645547333994716023901682D+00 w(6) = 0.128753962539336227675515784857D+00 w(7) = 0.142606702173606611775746109442D+00 w(8) = 0.152766042065859666778855400898D+00 w(9) = 0.158968843393954347649956439465D+00 w(10) = 0.161054449848783695979163625321D+00 w(11) = 0.158968843393954347649956439465D+00 w(12) = 0.152766042065859666778855400898D+00 w(13) = 0.142606702173606611775746109442D+00 w(14) = 0.128753962539336227675515784857D+00 w(15) = 0.111566645547333994716023901682D+00 w(16) = 0.914900216224499994644620941238D-01 w(17) = 0.690445427376412265807082580060D-01 w(18) = 0.448142267656996003328381574020D-01 w(19) = 0.194617882297264770363120414644D-01 else if ( n == 20 ) then x(1) = - 0.993128599185094924786122388471D+00 x(2) = - 0.963971927277913791267666131197D+00 x(3) = - 0.912234428251325905867752441203D+00 x(4) = - 0.839116971822218823394529061702D+00 x(5) = - 0.746331906460150792614305070356D+00 x(6) = - 0.636053680726515025452836696226D+00 x(7) = - 0.510867001950827098004364050955D+00 x(8) = - 0.373706088715419560672548177025D+00 x(9) = - 0.227785851141645078080496195369D+00 x(10) = - 0.765265211334973337546404093988D-01 x(11) = 0.765265211334973337546404093988D-01 x(12) = 0.227785851141645078080496195369D+00 x(13) = 0.373706088715419560672548177025D+00 x(14) = 0.510867001950827098004364050955D+00 x(15) = 0.636053680726515025452836696226D+00 x(16) = 0.746331906460150792614305070356D+00 x(17) = 0.839116971822218823394529061702D+00 x(18) = 0.912234428251325905867752441203D+00 x(19) = 0.963971927277913791267666131197D+00 x(20) = 0.993128599185094924786122388471D+00 w(1) = 0.176140071391521183118619623519D-01 w(2) = 0.406014298003869413310399522749D-01 w(3) = 0.626720483341090635695065351870D-01 w(4) = 0.832767415767047487247581432220D-01 w(5) = 0.101930119817240435036750135480D+00 w(6) = 0.118194531961518417312377377711D+00 w(7) = 0.131688638449176626898494499748D+00 w(8) = 0.142096109318382051329298325067D+00 w(9) = 0.149172986472603746787828737002D+00 w(10) = 0.152753387130725850698084331955D+00 w(11) = 0.152753387130725850698084331955D+00 w(12) = 0.149172986472603746787828737002D+00 w(13) = 0.142096109318382051329298325067D+00 w(14) = 0.131688638449176626898494499748D+00 w(15) = 0.118194531961518417312377377711D+00 w(16) = 0.101930119817240435036750135480D+00 w(17) = 0.832767415767047487247581432220D-01 w(18) = 0.626720483341090635695065351870D-01 w(19) = 0.406014298003869413310399522749D-01 w(20) = 0.176140071391521183118619623519D-01 else if ( n == 21 ) then x( 1) = -0.9937521706203896D+00 x( 2) = -0.9672268385663063D+00 x( 3) = -0.9200993341504008D+00 x( 4) = -0.8533633645833173D+00 x( 5) = -0.7684399634756779D+00 x( 6) = -0.6671388041974123D+00 x( 7) = -0.5516188358872198D+00 x( 8) = -0.4243421202074388D+00 x( 9) = -0.2880213168024011D+00 x(10) = -0.1455618541608951D+00 x(11) = 0.0000000000000000D+00 x(12) = 0.1455618541608951D+00 x(13) = 0.2880213168024011D+00 x(14) = 0.4243421202074388D+00 x(15) = 0.5516188358872198D+00 x(16) = 0.6671388041974123D+00 x(17) = 0.7684399634756779D+00 x(18) = 0.8533633645833173D+00 x(19) = 0.9200993341504008D+00 x(20) = 0.9672268385663063D+00 x(21) = 0.9937521706203896D+00 w( 1) = 0.1601722825777420D-01 w( 2) = 0.3695378977085242D-01 w( 3) = 0.5713442542685715D-01 w( 4) = 0.7610011362837928D-01 w( 5) = 0.9344442345603393D-01 w( 6) = 0.1087972991671484D+00 w( 7) = 0.1218314160537285D+00 w( 8) = 0.1322689386333373D+00 w( 9) = 0.1398873947910731D+00 w(10) = 0.1445244039899700D+00 w(11) = 0.1460811336496904D+00 w(12) = 0.1445244039899700D+00 w(13) = 0.1398873947910731D+00 w(14) = 0.1322689386333373D+00 w(15) = 0.1218314160537285D+00 w(16) = 0.1087972991671484D+00 w(17) = 0.9344442345603393D-01 w(18) = 0.7610011362837928D-01 w(19) = 0.5713442542685715D-01 w(20) = 0.3695378977085242D-01 w(21) = 0.1601722825777420D-01 else if ( n == 22 ) then x( 1) = -0.9942945854823994D+00 x( 2) = -0.9700604978354287D+00 x( 3) = -0.9269567721871740D+00 x( 4) = -0.8658125777203002D+00 x( 5) = -0.7878168059792081D+00 x( 6) = -0.6944872631866827D+00 x( 7) = -0.5876404035069116D+00 x( 8) = -0.4693558379867570D+00 x( 9) = -0.3419358208920842D+00 x(10) = -0.2078604266882213D+00 x(11) = -0.6973927331972223D-01 x(12) = 0.6973927331972223D-01 x(13) = 0.2078604266882213D+00 x(14) = 0.3419358208920842D+00 x(15) = 0.4693558379867570D+00 x(16) = 0.5876404035069116D+00 x(17) = 0.6944872631866827D+00 x(18) = 0.7878168059792081D+00 x(19) = 0.8658125777203002D+00 x(20) = 0.9269567721871740D+00 x(21) = 0.9700604978354287D+00 x(22) = 0.9942945854823994D+00 w( 1) = 0.1462799529827203D-01 w( 2) = 0.3377490158481413D-01 w( 3) = 0.5229333515268327D-01 w( 4) = 0.6979646842452038D-01 w( 5) = 0.8594160621706777D-01 w( 6) = 0.1004141444428809D+00 w( 7) = 0.1129322960805392D+00 w( 8) = 0.1232523768105124D+00 w( 9) = 0.1311735047870623D+00 w(10) = 0.1365414983460152D+00 w(11) = 0.1392518728556321D+00 w(12) = 0.1392518728556321D+00 w(13) = 0.1365414983460152D+00 w(14) = 0.1311735047870623D+00 w(15) = 0.1232523768105124D+00 w(16) = 0.1129322960805392D+00 w(17) = 0.1004141444428809D+00 w(18) = 0.8594160621706777D-01 w(19) = 0.6979646842452038D-01 w(20) = 0.5229333515268327D-01 w(21) = 0.3377490158481413D-01 w(22) = 0.1462799529827203D-01 else if ( n == 23 ) then x( 1) = -0.9947693349975522D+00 x( 2) = -0.9725424712181152D+00 x( 3) = -0.9329710868260161D+00 x( 4) = -0.8767523582704416D+00 x( 5) = -0.8048884016188399D+00 x( 6) = -0.7186613631319502D+00 x( 7) = -0.6196098757636461D+00 x( 8) = -0.5095014778460075D+00 x( 9) = -0.3903010380302908D+00 x(10) = -0.2641356809703449D+00 x(11) = -0.1332568242984661D+00 x(12) = 0.0000000000000000D+00 x(13) = 0.1332568242984661D+00 x(14) = 0.2641356809703449D+00 x(15) = 0.3903010380302908D+00 x(16) = 0.5095014778460075D+00 x(17) = 0.6196098757636461D+00 x(18) = 0.7186613631319502D+00 x(19) = 0.8048884016188399D+00 x(20) = 0.8767523582704416D+00 x(21) = 0.9329710868260161D+00 x(22) = 0.9725424712181152D+00 x(23) = 0.9947693349975522D+00 w( 1) = 0.1341185948714167D-01 w( 2) = 0.3098800585697944D-01 w( 3) = 0.4803767173108464D-01 w( 4) = 0.6423242140852586D-01 w( 5) = 0.7928141177671895D-01 w( 6) = 0.9291576606003514D-01 w( 7) = 0.1048920914645414D+00 w( 8) = 0.1149966402224114D+00 w( 9) = 0.1230490843067295D+00 w(10) = 0.1289057221880822D+00 w(11) = 0.1324620394046967D+00 w(12) = 0.1336545721861062D+00 w(13) = 0.1324620394046967D+00 w(14) = 0.1289057221880822D+00 w(15) = 0.1230490843067295D+00 w(16) = 0.1149966402224114D+00 w(17) = 0.1048920914645414D+00 w(18) = 0.9291576606003514D-01 w(19) = 0.7928141177671895D-01 w(20) = 0.6423242140852586D-01 w(21) = 0.4803767173108464D-01 w(22) = 0.3098800585697944D-01 w(23) = 0.1341185948714167D-01 else if ( n == 24 ) then x( 1) = -0.9951872199970213D+00 x( 2) = -0.9747285559713095D+00 x( 3) = -0.9382745520027327D+00 x( 4) = -0.8864155270044011D+00 x( 5) = -0.8200019859739029D+00 x( 6) = -0.7401241915785544D+00 x( 7) = -0.6480936519369755D+00 x( 8) = -0.5454214713888396D+00 x( 9) = -0.4337935076260451D+00 x(10) = -0.3150426796961634D+00 x(11) = -0.1911188674736163D+00 x(12) = -0.6405689286260562D-01 x(13) = 0.6405689286260562D-01 x(14) = 0.1911188674736163D+00 x(15) = 0.3150426796961634D+00 x(16) = 0.4337935076260451D+00 x(17) = 0.5454214713888396D+00 x(18) = 0.6480936519369755D+00 x(19) = 0.7401241915785544D+00 x(20) = 0.8200019859739029D+00 x(21) = 0.8864155270044011D+00 x(22) = 0.9382745520027327D+00 x(23) = 0.9747285559713095D+00 x(24) = 0.9951872199970213D+00 w( 1) = 0.1234122979998730D-01 w( 2) = 0.2853138862893375D-01 w( 3) = 0.4427743881741982D-01 w( 4) = 0.5929858491543672D-01 w( 5) = 0.7334648141108031D-01 w( 6) = 0.8619016153195320D-01 w( 7) = 0.9761865210411380D-01 w( 8) = 0.1074442701159656D+00 w( 9) = 0.1155056680537256D+00 w(10) = 0.1216704729278035D+00 w(11) = 0.1258374563468283D+00 w(12) = 0.1279381953467521D+00 w(13) = 0.1279381953467521D+00 w(14) = 0.1258374563468283D+00 w(15) = 0.1216704729278035D+00 w(16) = 0.1155056680537256D+00 w(17) = 0.1074442701159656D+00 w(18) = 0.9761865210411380D-01 w(19) = 0.8619016153195320D-01 w(20) = 0.7334648141108031D-01 w(21) = 0.5929858491543672D-01 w(22) = 0.4427743881741982D-01 w(23) = 0.2853138862893375D-01 w(24) = 0.1234122979998730D-01 else if ( n == 25 ) then x( 1) = -0.9955569697904981D+00 x( 2) = -0.9766639214595175D+00 x( 3) = -0.9429745712289743D+00 x( 4) = -0.8949919978782754D+00 x( 5) = -0.8334426287608340D+00 x( 6) = -0.7592592630373577D+00 x( 7) = -0.6735663684734684D+00 x( 8) = -0.5776629302412229D+00 x( 9) = -0.4730027314457150D+00 x(10) = -0.3611723058093879D+00 x(11) = -0.2438668837209884D+00 x(12) = -0.1228646926107104D+00 x(13) = 0.0000000000000000D+00 x(14) = 0.1228646926107104D+00 x(15) = 0.2438668837209884D+00 x(16) = 0.3611723058093879D+00 x(17) = 0.4730027314457150D+00 x(18) = 0.5776629302412229D+00 x(19) = 0.6735663684734684D+00 x(20) = 0.7592592630373577D+00 x(21) = 0.8334426287608340D+00 x(22) = 0.8949919978782754D+00 x(23) = 0.9429745712289743D+00 x(24) = 0.9766639214595175D+00 x(25) = 0.9955569697904981D+00 w( 1) = 0.1139379850102617D-01 w( 2) = 0.2635498661503214D-01 w( 3) = 0.4093915670130639D-01 w( 4) = 0.5490469597583517D-01 w( 5) = 0.6803833381235694D-01 w( 6) = 0.8014070033500101D-01 w( 7) = 0.9102826198296370D-01 w( 8) = 0.1005359490670506D+00 w( 9) = 0.1085196244742637D+00 w(10) = 0.1148582591457116D+00 w(11) = 0.1194557635357847D+00 w(12) = 0.1222424429903101D+00 w(13) = 0.1231760537267154D+00 w(14) = 0.1222424429903101D+00 w(15) = 0.1194557635357847D+00 w(16) = 0.1148582591457116D+00 w(17) = 0.1085196244742637D+00 w(18) = 0.1005359490670506D+00 w(19) = 0.9102826198296370D-01 w(20) = 0.8014070033500101D-01 w(21) = 0.6803833381235694D-01 w(22) = 0.5490469597583517D-01 w(23) = 0.4093915670130639D-01 w(24) = 0.2635498661503214D-01 w(25) = 0.1139379850102617D-01 else if ( n == 26 ) then x( 1) = -0.9958857011456169D+00 x( 2) = -0.9783854459564710D+00 x( 3) = -0.9471590666617142D+00 x( 4) = -0.9026378619843071D+00 x( 5) = -0.8454459427884981D+00 x( 6) = -0.7763859488206789D+00 x( 7) = -0.6964272604199573D+00 x( 8) = -0.6066922930176181D+00 x( 9) = -0.5084407148245057D+00 x(10) = -0.4030517551234863D+00 x(11) = -0.2920048394859569D+00 x(12) = -0.1768588203568902D+00 x(13) = -0.5923009342931320D-01 x(14) = 0.5923009342931320D-01 x(15) = 0.1768588203568902D+00 x(16) = 0.2920048394859569D+00 x(17) = 0.4030517551234863D+00 x(18) = 0.5084407148245057D+00 x(19) = 0.6066922930176181D+00 x(20) = 0.6964272604199573D+00 x(21) = 0.7763859488206789D+00 x(22) = 0.8454459427884981D+00 x(23) = 0.9026378619843071D+00 x(24) = 0.9471590666617142D+00 x(25) = 0.9783854459564710D+00 x(26) = 0.9958857011456169D+00 w( 1) = 0.1055137261734304D-01 w( 2) = 0.2441785109263173D-01 w( 3) = 0.3796238329436282D-01 w( 4) = 0.5097582529714782D-01 w( 5) = 0.6327404632957484D-01 w( 6) = 0.7468414976565967D-01 w( 7) = 0.8504589431348521D-01 w( 8) = 0.9421380035591416D-01 w( 9) = 0.1020591610944255D+00 w(10) = 0.1084718405285765D+00 w(11) = 0.1133618165463197D+00 w(12) = 0.1166604434852967D+00 w(13) = 0.1183214152792622D+00 w(14) = 0.1183214152792622D+00 w(15) = 0.1166604434852967D+00 w(16) = 0.1133618165463197D+00 w(17) = 0.1084718405285765D+00 w(18) = 0.1020591610944255D+00 w(19) = 0.9421380035591416D-01 w(20) = 0.8504589431348521D-01 w(21) = 0.7468414976565967D-01 w(22) = 0.6327404632957484D-01 w(23) = 0.5097582529714782D-01 w(24) = 0.3796238329436282D-01 w(25) = 0.2441785109263173D-01 w(26) = 0.1055137261734304D-01 else if ( n == 27 ) then x( 1) = -0.9961792628889886D+00 x( 2) = -0.9799234759615012D+00 x( 3) = -0.9509005578147051D+00 x( 4) = -0.9094823206774911D+00 x( 5) = -0.8562079080182945D+00 x( 6) = -0.7917716390705082D+00 x( 7) = -0.7170134737394237D+00 x( 8) = -0.6329079719464952D+00 x( 9) = -0.5405515645794569D+00 x(10) = -0.4411482517500269D+00 x(11) = -0.3359939036385089D+00 x(12) = -0.2264593654395369D+00 x(13) = -0.1139725856095300D+00 x(14) = 0.0000000000000000D+00 x(15) = 0.1139725856095300D+00 x(16) = 0.2264593654395369D+00 x(17) = 0.3359939036385089D+00 x(18) = 0.4411482517500269D+00 x(19) = 0.5405515645794569D+00 x(20) = 0.6329079719464952D+00 x(21) = 0.7170134737394237D+00 x(22) = 0.7917716390705082D+00 x(23) = 0.8562079080182945D+00 x(24) = 0.9094823206774911D+00 x(25) = 0.9509005578147051D+00 x(26) = 0.9799234759615012D+00 x(27) = 0.9961792628889886D+00 w( 1) = 0.9798996051294232D-02 w( 2) = 0.2268623159618062D-01 w( 3) = 0.3529705375741969D-01 w( 4) = 0.4744941252061504D-01 w( 5) = 0.5898353685983366D-01 w( 6) = 0.6974882376624561D-01 w( 7) = 0.7960486777305781D-01 w( 8) = 0.8842315854375689D-01 w( 9) = 0.9608872737002842D-01 w(10) = 0.1025016378177459D+00 w(11) = 0.1075782857885332D+00 w(12) = 0.1112524883568452D+00 w(13) = 0.1134763461089651D+00 w(14) = 0.1142208673789570D+00 w(15) = 0.1134763461089651D+00 w(16) = 0.1112524883568452D+00 w(17) = 0.1075782857885332D+00 w(18) = 0.1025016378177459D+00 w(19) = 0.9608872737002842D-01 w(20) = 0.8842315854375689D-01 w(21) = 0.7960486777305781D-01 w(22) = 0.6974882376624561D-01 w(23) = 0.5898353685983366D-01 w(24) = 0.4744941252061504D-01 w(25) = 0.3529705375741969D-01 w(26) = 0.2268623159618062D-01 w(27) = 0.9798996051294232D-02 else if ( n == 28 ) then x( 1) = -0.9964424975739544D+00 x( 2) = -0.9813031653708728D+00 x( 3) = -0.9542592806289382D+00 x( 4) = -0.9156330263921321D+00 x( 5) = -0.8658925225743951D+00 x( 6) = -0.8056413709171791D+00 x( 7) = -0.7356108780136318D+00 x( 8) = -0.6566510940388650D+00 x( 9) = -0.5697204718114017D+00 x(10) = -0.4758742249551183D+00 x(11) = -0.3762515160890787D+00 x(12) = -0.2720616276351780D+00 x(13) = -0.1645692821333808D+00 x(14) = -0.5507928988403427D-01 x(15) = 0.5507928988403427D-01 x(16) = 0.1645692821333808D+00 x(17) = 0.2720616276351780D+00 x(18) = 0.3762515160890787D+00 x(19) = 0.4758742249551183D+00 x(20) = 0.5697204718114017D+00 x(21) = 0.6566510940388650D+00 x(22) = 0.7356108780136318D+00 x(23) = 0.8056413709171791D+00 x(24) = 0.8658925225743951D+00 x(25) = 0.9156330263921321D+00 x(26) = 0.9542592806289382D+00 x(27) = 0.9813031653708728D+00 x(28) = 0.9964424975739544D+00 w( 1) = 0.9124282593094672D-02 w( 2) = 0.2113211259277118D-01 w( 3) = 0.3290142778230441D-01 w( 4) = 0.4427293475900429D-01 w( 5) = 0.5510734567571667D-01 w( 6) = 0.6527292396699959D-01 w( 7) = 0.7464621423456877D-01 w( 8) = 0.8311341722890127D-01 w( 9) = 0.9057174439303289D-01 w(10) = 0.9693065799792999D-01 w(11) = 0.1021129675780608D+00 w(12) = 0.1060557659228464D+00 w(13) = 0.1087111922582942D+00 w(14) = 0.1100470130164752D+00 w(15) = 0.1100470130164752D+00 w(16) = 0.1087111922582942D+00 w(17) = 0.1060557659228464D+00 w(18) = 0.1021129675780608D+00 w(19) = 0.9693065799792999D-01 w(20) = 0.9057174439303289D-01 w(21) = 0.8311341722890127D-01 w(22) = 0.7464621423456877D-01 w(23) = 0.6527292396699959D-01 w(24) = 0.5510734567571667D-01 w(25) = 0.4427293475900429D-01 w(26) = 0.3290142778230441D-01 w(27) = 0.2113211259277118D-01 w(28) = 0.9124282593094672D-02 else if ( n == 29 ) then x( 1) = -0.9966794422605966D+00 x( 2) = -0.9825455052614132D+00 x( 3) = -0.9572855957780877D+00 x( 4) = -0.9211802329530588D+00 x( 5) = -0.8746378049201028D+00 x( 6) = -0.8181854876152524D+00 x( 7) = -0.7524628517344771D+00 x( 8) = -0.6782145376026865D+00 x( 9) = -0.5962817971382278D+00 x(10) = -0.5075929551242276D+00 x(11) = -0.4131528881740087D+00 x(12) = -0.3140316378676399D+00 x(13) = -0.2113522861660011D+00 x(14) = -0.1062782301326792D+00 x(15) = 0.0000000000000000D+00 x(16) = 0.1062782301326792D+00 x(17) = 0.2113522861660011D+00 x(18) = 0.3140316378676399D+00 x(19) = 0.4131528881740087D+00 x(20) = 0.5075929551242276D+00 x(21) = 0.5962817971382278D+00 x(22) = 0.6782145376026865D+00 x(23) = 0.7524628517344771D+00 x(24) = 0.8181854876152524D+00 x(25) = 0.8746378049201028D+00 x(26) = 0.9211802329530588D+00 x(27) = 0.9572855957780877D+00 x(28) = 0.9825455052614132D+00 x(29) = 0.9966794422605966D+00 w( 1) = 0.8516903878746365D-02 w( 2) = 0.1973208505612276D-01 w( 3) = 0.3074049220209360D-01 w( 4) = 0.4140206251868281D-01 w( 5) = 0.5159482690249799D-01 w( 6) = 0.6120309065707916D-01 w( 7) = 0.7011793325505125D-01 w( 8) = 0.7823832713576385D-01 w( 9) = 0.8547225736617248D-01 w(10) = 0.9173775713925882D-01 w(11) = 0.9696383409440862D-01 w(12) = 0.1010912737599150D+00 w(13) = 0.1040733100777293D+00 w(14) = 0.1058761550973210D+00 w(15) = 0.1064793817183143D+00 w(16) = 0.1058761550973210D+00 w(17) = 0.1040733100777293D+00 w(18) = 0.1010912737599150D+00 w(19) = 0.9696383409440862D-01 w(20) = 0.9173775713925882D-01 w(21) = 0.8547225736617248D-01 w(22) = 0.7823832713576385D-01 w(23) = 0.7011793325505125D-01 w(24) = 0.6120309065707916D-01 w(25) = 0.5159482690249799D-01 w(26) = 0.4140206251868281D-01 w(27) = 0.3074049220209360D-01 w(28) = 0.1973208505612276D-01 w(29) = 0.8516903878746365D-02 else if ( n == 30 ) then x( 1) = -0.9968934840746495D+00 x( 2) = -0.9836681232797472D+00 x( 3) = -0.9600218649683075D+00 x( 4) = -0.9262000474292743D+00 x( 5) = -0.8825605357920526D+00 x( 6) = -0.8295657623827684D+00 x( 7) = -0.7677774321048262D+00 x( 8) = -0.6978504947933158D+00 x( 9) = -0.6205261829892429D+00 x(10) = -0.5366241481420199D+00 x(11) = -0.4470337695380892D+00 x(12) = -0.3527047255308781D+00 x(13) = -0.2546369261678899D+00 x(14) = -0.1538699136085835D+00 x(15) = -0.5147184255531770D-01 x(16) = 0.5147184255531770D-01 x(17) = 0.1538699136085835D+00 x(18) = 0.2546369261678899D+00 x(19) = 0.3527047255308781D+00 x(20) = 0.4470337695380892D+00 x(21) = 0.5366241481420199D+00 x(22) = 0.6205261829892429D+00 x(23) = 0.6978504947933158D+00 x(24) = 0.7677774321048262D+00 x(25) = 0.8295657623827684D+00 x(26) = 0.8825605357920526D+00 x(27) = 0.9262000474292743D+00 x(28) = 0.9600218649683075D+00 x(29) = 0.9836681232797472D+00 x(30) = 0.9968934840746495D+00 w( 1) = 0.7968192496166648D-02 w( 2) = 0.1846646831109099D-01 w( 3) = 0.2878470788332330D-01 w( 4) = 0.3879919256962704D-01 w( 5) = 0.4840267283059405D-01 w( 6) = 0.5749315621761905D-01 w( 7) = 0.6597422988218052D-01 w( 8) = 0.7375597473770516D-01 w( 9) = 0.8075589522942023D-01 w(10) = 0.8689978720108314D-01 w(11) = 0.9212252223778619D-01 w(12) = 0.9636873717464424D-01 w(13) = 0.9959342058679524D-01 w(14) = 0.1017623897484056D+00 w(15) = 0.1028526528935587D+00 w(16) = 0.1028526528935587D+00 w(17) = 0.1017623897484056D+00 w(18) = 0.9959342058679524D-01 w(19) = 0.9636873717464424D-01 w(20) = 0.9212252223778619D-01 w(21) = 0.8689978720108314D-01 w(22) = 0.8075589522942023D-01 w(23) = 0.7375597473770516D-01 w(24) = 0.6597422988218052D-01 w(25) = 0.5749315621761905D-01 w(26) = 0.4840267283059405D-01 w(27) = 0.3879919256962704D-01 w(28) = 0.2878470788332330D-01 w(29) = 0.1846646831109099D-01 w(30) = 0.7968192496166648D-02 else if ( n == 31 ) then x( 1) = -0.99708748181947707454263838179654D+00 x( 2) = -0.98468590966515248400211329970113D+00 x( 3) = -0.96250392509294966178905249675943D+00 x( 4) = -0.93075699789664816495694576311725D+00 x( 5) = -0.88976002994827104337419200908023D+00 x( 6) = -0.83992032014626734008690453594388D+00 x( 7) = -0.78173314841662494040636002019484D+00 x( 8) = -0.71577678458685328390597086536649D+00 x( 9) = -0.64270672292426034618441820323250D+00 x(10) = -0.56324916140714926272094492359516D+00 x(11) = -0.47819378204490248044059403935649D+00 x(12) = -0.38838590160823294306135146128752D+00 x(13) = -0.29471806998170161661790389767170D+00 x(14) = -0.19812119933557062877241299603283D+00 x(15) = -0.99555312152341520325174790118941D-01 x(16) = 0.00000000000000000000000000000000D+00 x(17) = 0.99555312152341520325174790118941D-01 x(18) = 0.19812119933557062877241299603283D+00 x(19) = 0.29471806998170161661790389767170D+00 x(20) = 0.38838590160823294306135146128752D+00 x(21) = 0.47819378204490248044059403935649D+00 x(22) = 0.56324916140714926272094492359516D+00 x(23) = 0.64270672292426034618441820323250D+00 x(24) = 0.71577678458685328390597086536649D+00 x(25) = 0.78173314841662494040636002019484D+00 x(26) = 0.83992032014626734008690453594388D+00 x(27) = 0.88976002994827104337419200908023D+00 x(28) = 0.93075699789664816495694576311725D+00 x(29) = 0.96250392509294966178905249675943D+00 x(30) = 0.98468590966515248400211329970113D+00 x(31) = 0.99708748181947707454263838179654D+00 w( 1) = 0.74708315792487746093913218970494D-02 w( 2) = 0.17318620790310582463552990782414D-01 w( 3) = 0.27009019184979421800608642617676D-01 w( 4) = 0.36432273912385464024392008749009D-01 w( 5) = 0.45493707527201102902315857856518D-01 w( 6) = 0.54103082424916853711666259085477D-01 w( 7) = 0.62174786561028426910343543686657D-01 w( 8) = 0.69628583235410366167756126255124D-01 w( 9) = 0.76390386598776616426357674901331D-01 w(10) = 0.82392991761589263903823367431962D-01 w(11) = 0.87576740608477876126198069695333D-01 w(12) = 0.91890113893641478215362871607150D-01 w(13) = 0.95290242912319512807204197487597D-01 w(14) = 0.97743335386328725093474010978997D-01 w(15) = 0.99225011226672307874875514428615D-01 w(16) = 0.99720544793426451427533833734349D-01 w(17) = 0.99225011226672307874875514428615D-01 w(18) = 0.97743335386328725093474010978997D-01 w(19) = 0.95290242912319512807204197487597D-01 w(20) = 0.91890113893641478215362871607150D-01 w(21) = 0.87576740608477876126198069695333D-01 w(22) = 0.82392991761589263903823367431962D-01 w(23) = 0.76390386598776616426357674901331D-01 w(24) = 0.69628583235410366167756126255124D-01 w(25) = 0.62174786561028426910343543686657D-01 w(26) = 0.54103082424916853711666259085477D-01 w(27) = 0.45493707527201102902315857856518D-01 w(28) = 0.36432273912385464024392008749009D-01 w(29) = 0.27009019184979421800608642617676D-01 w(30) = 0.17318620790310582463552990782414D-01 w(31) = 0.74708315792487746093913218970494D-02 else if ( n == 32 ) then x(1) = - 0.997263861849481563544981128665D+00 x(2) = - 0.985611511545268335400175044631D+00 x(3) = - 0.964762255587506430773811928118D+00 x(4) = - 0.934906075937739689170919134835D+00 x(5) = - 0.896321155766052123965307243719D+00 x(6) = - 0.849367613732569970133693004968D+00 x(7) = - 0.794483795967942406963097298970D+00 x(8) = - 0.732182118740289680387426665091D+00 x(9) = - 0.663044266930215200975115168663D+00 x(10) = - 0.587715757240762329040745476402D+00 x(11) = - 0.506899908932229390023747474378D+00 x(12) = - 0.421351276130635345364119436172D+00 x(13) = - 0.331868602282127649779916805730D+00 x(14) = - 0.239287362252137074544603209166D+00 x(15) = - 0.144471961582796493485186373599D+00 x(16) = - 0.483076656877383162348125704405D-01 x(17) = 0.483076656877383162348125704405D-01 x(18) = 0.144471961582796493485186373599D+00 x(19) = 0.239287362252137074544603209166D+00 x(20) = 0.331868602282127649779916805730D+00 x(21) = 0.421351276130635345364119436172D+00 x(22) = 0.506899908932229390023747474378D+00 x(23) = 0.587715757240762329040745476402D+00 x(24) = 0.663044266930215200975115168663D+00 x(25) = 0.732182118740289680387426665091D+00 x(26) = 0.794483795967942406963097298970D+00 x(27) = 0.849367613732569970133693004968D+00 x(28) = 0.896321155766052123965307243719D+00 x(29) = 0.934906075937739689170919134835D+00 x(30) = 0.964762255587506430773811928118D+00 x(31) = 0.985611511545268335400175044631D+00 x(32) = 0.997263861849481563544981128665D+00 w(1) = 0.701861000947009660040706373885D-02 w(2) = 0.162743947309056706051705622064D-01 w(3) = 0.253920653092620594557525897892D-01 w(4) = 0.342738629130214331026877322524D-01 w(5) = 0.428358980222266806568786466061D-01 w(6) = 0.509980592623761761961632446895D-01 w(7) = 0.586840934785355471452836373002D-01 w(8) = 0.658222227763618468376500637069D-01 w(9) = 0.723457941088485062253993564785D-01 w(10) = 0.781938957870703064717409188283D-01 w(11) = 0.833119242269467552221990746043D-01 w(12) = 0.876520930044038111427714627518D-01 w(13) = 0.911738786957638847128685771116D-01 w(14) = 0.938443990808045656391802376681D-01 w(15) = 0.956387200792748594190820022041D-01 w(16) = 0.965400885147278005667648300636D-01 w(17) = 0.965400885147278005667648300636D-01 w(18) = 0.956387200792748594190820022041D-01 w(19) = 0.938443990808045656391802376681D-01 w(20) = 0.911738786957638847128685771116D-01 w(21) = 0.876520930044038111427714627518D-01 w(22) = 0.833119242269467552221990746043D-01 w(23) = 0.781938957870703064717409188283D-01 w(24) = 0.723457941088485062253993564785D-01 w(25) = 0.658222227763618468376500637069D-01 w(26) = 0.586840934785355471452836373002D-01 w(27) = 0.509980592623761761961632446895D-01 w(28) = 0.428358980222266806568786466061D-01 w(29) = 0.342738629130214331026877322524D-01 w(30) = 0.253920653092620594557525897892D-01 w(31) = 0.162743947309056706051705622064D-01 w(32) = 0.701861000947009660040706373885D-02 else if ( n == 33 ) then x( 1) = -0.9974246942464552D+00 x( 2) = -0.9864557262306425D+00 x( 3) = -0.9668229096899927D+00 x( 4) = -0.9386943726111684D+00 x( 5) = -0.9023167677434336D+00 x( 6) = -0.8580096526765041D+00 x( 7) = -0.8061623562741665D+00 x( 8) = -0.7472304964495622D+00 x( 9) = -0.6817319599697428D+00 x(10) = -0.6102423458363790D+00 x(11) = -0.5333899047863476D+00 x(12) = -0.4518500172724507D+00 x(13) = -0.3663392577480734D+00 x(14) = -0.2776090971524970D+00 x(15) = -0.1864392988279916D+00 x(16) = -0.09363106585473338D+00 x(17) = 0.000000000000000D+00 x(18) = 0.09363106585473338D+00 x(19) = 0.1864392988279916D+00 x(20) = 0.2776090971524970D+00 x(21) = 0.3663392577480734D+00 x(22) = 0.4518500172724507D+00 x(23) = 0.5333899047863476D+00 x(24) = 0.6102423458363790D+00 x(25) = 0.6817319599697428D+00 x(26) = 0.7472304964495622D+00 x(27) = 0.8061623562741665D+00 x(28) = 0.8580096526765041D+00 x(29) = 0.9023167677434336D+00 x(30) = 0.9386943726111684D+00 x(31) = 0.9668229096899927D+00 x(32) = 0.9864557262306425D+00 x(33) = 0.9974246942464552D+00 w( 1) = 0.6606227847587558D-02 w( 2) = 0.1532170151293465D-01 w( 3) = 0.2391554810174960D-01 w( 4) = 0.3230035863232891D-01 w( 5) = 0.4040154133166965D-01 w( 6) = 0.4814774281871162D-01 w( 7) = 0.5547084663166357D-01 w( 8) = 0.6230648253031755D-01 w( 9) = 0.6859457281865676D-01 w(10) = 0.7427985484395420D-01 w(11) = 0.7931236479488685D-01 w(12) = 0.8364787606703869D-01 w(13) = 0.8724828761884425D-01 w(14) = 0.9008195866063859D-01 w(15) = 0.9212398664331678D-01 w(16) = 0.9335642606559612D-01 w(17) = 0.9376844616020999D-01 w(18) = 0.9335642606559612D-01 w(19) = 0.9212398664331678D-01 w(20) = 0.9008195866063859D-01 w(21) = 0.8724828761884425D-01 w(22) = 0.8364787606703869D-01 w(23) = 0.7931236479488685D-01 w(24) = 0.7427985484395420D-01 w(25) = 0.6859457281865676D-01 w(26) = 0.6230648253031755D-01 w(27) = 0.5547084663166357D-01 w(28) = 0.4814774281871162D-01 w(29) = 0.4040154133166965D-01 w(30) = 0.3230035863232891D-01 w(31) = 0.2391554810174960D-01 w(32) = 0.1532170151293465D-01 w(33) = 0.6606227847587558D-02 else if ( n == 63 ) then x( 1) = -0.99928298402912378050701628988630D+00 x( 2) = -0.99622401277797010860209018267357D+00 x( 3) = -0.99072854689218946681089469460884D+00 x( 4) = -0.98280881059372723486251140727639D+00 x( 5) = -0.97248403469757002280196067864927D+00 x( 6) = -0.95977944975894192707035416626398D+00 x( 7) = -0.94472613404100980296637531962798D+00 x( 8) = -0.92736092062184320544703138132518D+00 x( 9) = -0.90772630277853155803695313291596D+00 x(10) = -0.88587032850785342629029845731337D+00 x(11) = -0.86184648236412371953961183943106D+00 x(12) = -0.83571355431950284347180776961571D+00 x(13) = -0.80753549577345676005146598636324D+00 x(14) = -0.77738126299037233556333018991104D+00 x(15) = -0.74532464831784741782932166103759D+00 x(16) = -0.71144409958484580785143153770401D+00 x(17) = -0.67582252811498609013110331596954D+00 x(18) = -0.63854710582136538500030695387338D+00 x(19) = -0.59970905187762523573900892686880D+00 x(20) = -0.55940340948628501326769780007005D+00 x(21) = -0.51772881329003324812447758452632D+00 x(22) = -0.47478724799480439992221230985149D+00 x(23) = -0.43068379879511160066208893391863D+00 x(24) = -0.38552639421224789247761502227440D+00 x(25) = -0.33942554197458440246883443159432D+00 x(26) = -0.29249405858625144003615715555067D+00 x(27) = -0.24484679324595336274840459392483D+00 x(28) = -0.19660034679150668455762745706572D+00 x(29) = -0.14787278635787196856983909655297D+00 x(30) = -0.98783356446945279529703669453922D-01 x(31) = -0.49452187116159627234233818051808D-01 x(32) = 0.0000000000000000000000000000000D+00 x(33) = 0.49452187116159627234233818051808D-01 x(34) = 0.98783356446945279529703669453922D-01 x(35) = 0.14787278635787196856983909655297D+00 x(36) = 0.19660034679150668455762745706572D+00 x(37) = 0.24484679324595336274840459392483D+00 x(38) = 0.29249405858625144003615715555067D+00 x(39) = 0.33942554197458440246883443159432D+00 x(40) = 0.38552639421224789247761502227440D+00 x(41) = 0.43068379879511160066208893391863D+00 x(42) = 0.47478724799480439992221230985149D+00 x(43) = 0.51772881329003324812447758452632D+00 x(44) = 0.55940340948628501326769780007005D+00 x(45) = 0.59970905187762523573900892686880D+00 x(46) = 0.63854710582136538500030695387338D+00 x(47) = 0.67582252811498609013110331596954D+00 x(48) = 0.71144409958484580785143153770401D+00 x(49) = 0.74532464831784741782932166103759D+00 x(50) = 0.77738126299037233556333018991104D+00 x(51) = 0.80753549577345676005146598636324D+00 x(52) = 0.83571355431950284347180776961571D+00 x(53) = 0.86184648236412371953961183943106D+00 x(54) = 0.88587032850785342629029845731337D+00 x(55) = 0.90772630277853155803695313291596D+00 x(56) = 0.92736092062184320544703138132518D+00 x(57) = 0.94472613404100980296637531962798D+00 x(58) = 0.95977944975894192707035416626398D+00 x(59) = 0.97248403469757002280196067864927D+00 x(60) = 0.98280881059372723486251140727639D+00 x(61) = 0.99072854689218946681089469460884D+00 x(62) = 0.99622401277797010860209018267357D+00 x(63) = 0.99928298402912378050701628988630D+00 w( 1) = 0.18398745955770837880499331680577D-02 w( 2) = 0.42785083468637618661951422543371D-02 w( 3) = 0.67102917659601362519069109850892D-02 w( 4) = 0.91259686763266563540586445877022D-02 w( 5) = 0.11519376076880041750750606118707D-01 w( 6) = 0.13884612616115610824866086365937D-01 w( 7) = 0.16215878410338338882283672974995D-01 w( 8) = 0.18507464460161270409260545805144D-01 w( 9) = 0.20753761258039090775341953421471D-01 w(10) = 0.22949271004889933148942319561770D-01 w(11) = 0.25088620553344986618630138068443D-01 w(12) = 0.27166574359097933225189839439413D-01 w(13) = 0.29178047208280526945551502154029D-01 w(14) = 0.31118116622219817508215988557189D-01 w(15) = 0.32982034883779341765683179672459D-01 w(16) = 0.34765240645355877697180504642788D-01 w(17) = 0.36463370085457289630452409787542D-01 w(18) = 0.38072267584349556763638324927889D-01 w(19) = 0.39587995891544093984807928149202D-01 w(20) = 0.41006845759666398635110037009072D-01 w(21) = 0.42325345020815822982505485403028D-01 w(22) = 0.43540267083027590798964315704401D-01 w(23) = 0.44648638825941395370332669516813D-01 w(24) = 0.45647747876292608685885992608542D-01 w(25) = 0.46535149245383696510395418746953D-01 w(26) = 0.47308671312268919080604988338844D-01 w(27) = 0.47966421137995131411052756195132D-01 w(28) = 0.48506789097883847864090099145802D-01 w(29) = 0.48928452820511989944709361549215D-01 w(30) = 0.49230380423747560785043116988145D-01 w(31) = 0.49411833039918178967039646116705D-01 w(32) = 0.49472366623931020888669360420926D-01 w(33) = 0.49411833039918178967039646116705D-01 w(34) = 0.49230380423747560785043116988145D-01 w(35) = 0.48928452820511989944709361549215D-01 w(36) = 0.48506789097883847864090099145802D-01 w(37) = 0.47966421137995131411052756195132D-01 w(38) = 0.47308671312268919080604988338844D-01 w(39) = 0.46535149245383696510395418746953D-01 w(40) = 0.45647747876292608685885992608542D-01 w(41) = 0.44648638825941395370332669516813D-01 w(42) = 0.43540267083027590798964315704401D-01 w(43) = 0.42325345020815822982505485403028D-01 w(44) = 0.41006845759666398635110037009072D-01 w(45) = 0.39587995891544093984807928149202D-01 w(46) = 0.38072267584349556763638324927889D-01 w(47) = 0.36463370085457289630452409787542D-01 w(48) = 0.34765240645355877697180504642788D-01 w(49) = 0.32982034883779341765683179672459D-01 w(50) = 0.31118116622219817508215988557189D-01 w(51) = 0.29178047208280526945551502154029D-01 w(52) = 0.27166574359097933225189839439413D-01 w(53) = 0.25088620553344986618630138068443D-01 w(54) = 0.22949271004889933148942319561770D-01 w(55) = 0.20753761258039090775341953421471D-01 w(56) = 0.18507464460161270409260545805144D-01 w(57) = 0.16215878410338338882283672974995D-01 w(58) = 0.13884612616115610824866086365937D-01 w(59) = 0.11519376076880041750750606118707D-01 w(60) = 0.91259686763266563540586445877022D-02 w(61) = 0.67102917659601362519069109850892D-02 w(62) = 0.42785083468637618661951422543371D-02 w(63) = 0.18398745955770837880499331680577D-02 else if ( n == 64 ) then x(1) = - 0.999305041735772139456905624346D+00 x(2) = - 0.996340116771955279346924500676D+00 x(3) = - 0.991013371476744320739382383443D+00 x(4) = - 0.983336253884625956931299302157D+00 x(5) = - 0.973326827789910963741853507352D+00 x(6) = - 0.961008799652053718918614121897D+00 x(7) = - 0.946411374858402816062481491347D+00 x(8) = - 0.929569172131939575821490154559D+00 x(9) = - 0.910522137078502805756380668008D+00 x(10) = - 0.889315445995114105853404038273D+00 x(11) = - 0.865999398154092819760783385070D+00 x(12) = - 0.840629296252580362751691544696D+00 x(13) = - 0.813265315122797559741923338086D+00 x(14) = - 0.783972358943341407610220525214D+00 x(15) = - 0.752819907260531896611863774886D+00 x(16) = - 0.719881850171610826848940217832D+00 x(17) = - 0.685236313054233242563558371031D+00 x(18) = - 0.648965471254657339857761231993D+00 x(19) = - 0.611155355172393250248852971019D+00 x(20) = - 0.571895646202634034283878116659D+00 x(21) = - 0.531279464019894545658013903544D+00 x(22) = - 0.489403145707052957478526307022D+00 x(23) = - 0.446366017253464087984947714759D+00 x(24) = - 0.402270157963991603695766771260D+00 x(25) = - 0.357220158337668115950442615046D+00 x(26) = - 0.311322871990210956157512698560D+00 x(27) = - 0.264687162208767416373964172510D+00 x(28) = - 0.217423643740007084149648748989D+00 x(29) = - 0.169644420423992818037313629748D+00 x(30) = - 0.121462819296120554470376463492D+00 x(31) = - 0.729931217877990394495429419403D-01 x(32) = - 0.243502926634244325089558428537D-01 x(33) = 0.243502926634244325089558428537D-01 x(34) = 0.729931217877990394495429419403D-01 x(35) = 0.121462819296120554470376463492D+00 x(36) = 0.169644420423992818037313629748D+00 x(37) = 0.217423643740007084149648748989D+00 x(38) = 0.264687162208767416373964172510D+00 x(39) = 0.311322871990210956157512698560D+00 x(40) = 0.357220158337668115950442615046D+00 x(41) = 0.402270157963991603695766771260D+00 x(42) = 0.446366017253464087984947714759D+00 x(43) = 0.489403145707052957478526307022D+00 x(44) = 0.531279464019894545658013903544D+00 x(45) = 0.571895646202634034283878116659D+00 x(46) = 0.611155355172393250248852971019D+00 x(47) = 0.648965471254657339857761231993D+00 x(48) = 0.685236313054233242563558371031D+00 x(49) = 0.719881850171610826848940217832D+00 x(50) = 0.752819907260531896611863774886D+00 x(51) = 0.783972358943341407610220525214D+00 x(52) = 0.813265315122797559741923338086D+00 x(53) = 0.840629296252580362751691544696D+00 x(54) = 0.865999398154092819760783385070D+00 x(55) = 0.889315445995114105853404038273D+00 x(56) = 0.910522137078502805756380668008D+00 x(57) = 0.929569172131939575821490154559D+00 x(58) = 0.946411374858402816062481491347D+00 x(59) = 0.961008799652053718918614121897D+00 x(60) = 0.973326827789910963741853507352D+00 x(61) = 0.983336253884625956931299302157D+00 x(62) = 0.991013371476744320739382383443D+00 x(63) = 0.996340116771955279346924500676D+00 x(64) = 0.999305041735772139456905624346D+00 w(1) = 0.178328072169643294729607914497D-02 w(2) = 0.414703326056246763528753572855D-02 w(3) = 0.650445796897836285611736039998D-02 w(4) = 0.884675982636394772303091465973D-02 w(5) = 0.111681394601311288185904930192D-01 w(6) = 0.134630478967186425980607666860D-01 w(7) = 0.157260304760247193219659952975D-01 w(8) = 0.179517157756973430850453020011D-01 w(9) = 0.201348231535302093723403167285D-01 w(10) = 0.222701738083832541592983303842D-01 w(11) = 0.243527025687108733381775504091D-01 w(12) = 0.263774697150546586716917926252D-01 w(13) = 0.283396726142594832275113052002D-01 w(14) = 0.302346570724024788679740598195D-01 w(15) = 0.320579283548515535854675043479D-01 w(16) = 0.338051618371416093915654821107D-01 w(17) = 0.354722132568823838106931467152D-01 w(18) = 0.370551285402400460404151018096D-01 w(19) = 0.385501531786156291289624969468D-01 w(20) = 0.399537411327203413866569261283D-01 w(21) = 0.412625632426235286101562974736D-01 w(22) = 0.424735151236535890073397679088D-01 w(23) = 0.435837245293234533768278609737D-01 w(24) = 0.445905581637565630601347100309D-01 w(25) = 0.454916279274181444797709969713D-01 w(26) = 0.462847965813144172959532492323D-01 w(27) = 0.469681828162100173253262857546D-01 w(28) = 0.475401657148303086622822069442D-01 w(29) = 0.479993885964583077281261798713D-01 w(30) = 0.483447622348029571697695271580D-01 w(31) = 0.485754674415034269347990667840D-01 w(32) = 0.486909570091397203833653907347D-01 w(33) = 0.486909570091397203833653907347D-01 w(34) = 0.485754674415034269347990667840D-01 w(35) = 0.483447622348029571697695271580D-01 w(36) = 0.479993885964583077281261798713D-01 w(37) = 0.475401657148303086622822069442D-01 w(38) = 0.469681828162100173253262857546D-01 w(39) = 0.462847965813144172959532492323D-01 w(40) = 0.454916279274181444797709969713D-01 w(41) = 0.445905581637565630601347100309D-01 w(42) = 0.435837245293234533768278609737D-01 w(43) = 0.424735151236535890073397679088D-01 w(44) = 0.412625632426235286101562974736D-01 w(45) = 0.399537411327203413866569261283D-01 w(46) = 0.385501531786156291289624969468D-01 w(47) = 0.370551285402400460404151018096D-01 w(48) = 0.354722132568823838106931467152D-01 w(49) = 0.338051618371416093915654821107D-01 w(50) = 0.320579283548515535854675043479D-01 w(51) = 0.302346570724024788679740598195D-01 w(52) = 0.283396726142594832275113052002D-01 w(53) = 0.263774697150546586716917926252D-01 w(54) = 0.243527025687108733381775504091D-01 w(55) = 0.222701738083832541592983303842D-01 w(56) = 0.201348231535302093723403167285D-01 w(57) = 0.179517157756973430850453020011D-01 w(58) = 0.157260304760247193219659952975D-01 w(59) = 0.134630478967186425980607666860D-01 w(60) = 0.111681394601311288185904930192D-01 w(61) = 0.884675982636394772303091465973D-02 w(62) = 0.650445796897836285611736039998D-02 w(63) = 0.414703326056246763528753572855D-02 w(64) = 0.178328072169643294729607914497D-02 else if ( n == 65 ) then x( 1) = -0.9993260970754129D+00 x( 2) = -0.9964509480618492D+00 x( 3) = -0.9912852761768016D+00 x( 4) = -0.9838398121870350D+00 x( 5) = -0.9741315398335512D+00 x( 6) = -0.9621827547180553D+00 x( 7) = -0.9480209281684076D+00 x( 8) = -0.9316786282287494D+00 x( 9) = -0.9131934405428462D+00 x(10) = -0.8926078805047389D+00 x(11) = -0.8699692949264071D+00 x(12) = -0.8453297528999303D+00 x(13) = -0.8187459259226514D+00 x(14) = -0.7902789574921218D+00 x(15) = -0.7599943224419998D+00 x(16) = -0.7279616763294247D+00 x(17) = -0.6942546952139916D+00 x(18) = -0.6589509061936252D+00 x(19) = -0.6221315090854003D+00 x(20) = -0.5838811896604873D+00 x(21) = -0.5442879248622271D+00 x(22) = -0.5034427804550069D+00 x(23) = -0.4614397015691450D+00 x(24) = -0.4183752966234090D+00 x(25) = -0.3743486151220660D+00 x(26) = -0.3294609198374864D+00 x(27) = -0.2838154539022487D+00 x(28) = -0.2375172033464168D+00 x(29) = -0.1906726556261428D+00 x(30) = -0.1433895546989752D+00 x(31) = -0.9577665320919751D-01 x(32) = -0.4794346235317186D-01 x(33) = 0.000000000000000D+00 x(34) = 0.4794346235317186D-01 x(35) = 0.9577665320919751D-01 x(36) = 0.1433895546989752D+00 x(37) = 0.1906726556261428D+00 x(38) = 0.2375172033464168D+00 x(39) = 0.2838154539022487D+00 x(40) = 0.3294609198374864D+00 x(41) = 0.3743486151220660D+00 x(42) = 0.4183752966234090D+00 x(43) = 0.4614397015691450D+00 x(44) = 0.5034427804550069D+00 x(45) = 0.5442879248622271D+00 x(46) = 0.5838811896604873D+00 x(47) = 0.6221315090854003D+00 x(48) = 0.6589509061936252D+00 x(49) = 0.6942546952139916D+00 x(50) = 0.7279616763294247D+00 x(51) = 0.7599943224419998D+00 x(52) = 0.7902789574921218D+00 x(53) = 0.8187459259226514D+00 x(54) = 0.8453297528999303D+00 x(55) = 0.8699692949264071D+00 x(56) = 0.8926078805047389D+00 x(57) = 0.9131934405428462D+00 x(58) = 0.9316786282287494D+00 x(59) = 0.9480209281684076D+00 x(60) = 0.9621827547180553D+00 x(61) = 0.9741315398335512D+00 x(62) = 0.9838398121870350D+00 x(63) = 0.9912852761768016D+00 x(64) = 0.9964509480618492D+00 x(65) = 0.9993260970754129D+00 w( 1) = 0.1729258251300218D-02 w( 2) = 0.4021524172003703D-02 w( 3) = 0.6307942578971821D-02 w( 4) = 0.8580148266881443D-02 w( 5) = 0.1083267878959798D-01 w( 6) = 0.1306031163999490D-01 w( 7) = 0.1525791214644825D-01 w( 8) = 0.1742042199767025D-01 w( 9) = 0.1954286583675005D-01 w(10) = 0.2162036128493408D-01 w(11) = 0.2364812969128723D-01 w(12) = 0.2562150693803776D-01 w(13) = 0.2753595408845034D-01 w(14) = 0.2938706778931066D-01 w(15) = 0.3117059038018911D-01 w(16) = 0.3288241967636860D-01 w(17) = 0.3451861839854901D-01 w(18) = 0.3607542322556527D-01 w(19) = 0.3754925344825770D-01 w(20) = 0.3893671920405121D-01 w(21) = 0.4023462927300549D-01 w(22) = 0.4143999841724028D-01 w(23) = 0.4255005424675579D-01 w(24) = 0.4356224359580051D-01 w(25) = 0.4447423839508296D-01 w(26) = 0.4528394102630023D-01 w(27) = 0.4598948914665173D-01 w(28) = 0.4658925997223349D-01 w(29) = 0.4708187401045461D-01 w(30) = 0.4746619823288551D-01 w(31) = 0.4774134868124067D-01 w(32) = 0.4790669250049590D-01 w(33) = 0.4796184939446662D-01 w(34) = 0.4790669250049590D-01 w(35) = 0.4774134868124067D-01 w(36) = 0.4746619823288551D-01 w(37) = 0.4708187401045461D-01 w(38) = 0.4658925997223349D-01 w(39) = 0.4598948914665173D-01 w(40) = 0.4528394102630023D-01 w(41) = 0.4447423839508296D-01 w(42) = 0.4356224359580051D-01 w(43) = 0.4255005424675579D-01 w(44) = 0.4143999841724028D-01 w(45) = 0.4023462927300549D-01 w(46) = 0.3893671920405121D-01 w(47) = 0.3754925344825770D-01 w(48) = 0.3607542322556527D-01 w(49) = 0.3451861839854901D-01 w(50) = 0.3288241967636860D-01 w(51) = 0.3117059038018911D-01 w(52) = 0.2938706778931066D-01 w(53) = 0.2753595408845034D-01 w(54) = 0.2562150693803776D-01 w(55) = 0.2364812969128723D-01 w(56) = 0.2162036128493408D-01 w(57) = 0.1954286583675005D-01 w(58) = 0.1742042199767025D-01 w(59) = 0.1525791214644825D-01 w(60) = 0.1306031163999490D-01 w(61) = 0.1083267878959798D-01 w(62) = 0.8580148266881443D-02 w(63) = 0.6307942578971821D-02 w(64) = 0.4021524172003703D-02 w(65) = 0.1729258251300218D-02 else if ( n == 127 ) then x( 1) = -0.99982213041530614629963254927125D+00 x( 2) = -0.99906293435531189513828920479421D+00 x( 3) = -0.99769756618980462107441703193392D+00 x( 4) = -0.99572655135202722663543337085008D+00 x( 5) = -0.99315104925451714736113079489080D+00 x( 6) = -0.98997261459148415760778669967548D+00 x( 7) = -0.98619317401693166671043833175407D+00 x( 8) = -0.98181502080381411003346312451200D+00 x( 9) = -0.97684081234307032681744391886221D+00 x( 10) = -0.97127356816152919228894689830512D+00 x( 11) = -0.96511666794529212109082507703391D+00 x( 12) = -0.95837384942523877114910286998060D+00 x( 13) = -0.95104920607788031054790764659636D+00 x( 14) = -0.94314718462481482734544963026201D+00 x( 15) = -0.93467258232473796857363487794906D+00 x( 16) = -0.92563054405623384912746466814259D+00 x( 17) = -0.91602655919146580931308861741716D+00 x( 18) = -0.90586645826182138280246131760282D+00 x( 19) = -0.89515640941708370896904382642451D+00 x( 20) = -0.88390291468002656994525794802849D+00 x( 21) = -0.87211280599856071141963753428864D+00 x( 22) = -0.85979324109774080981203134414483D+00 x( 23) = -0.84695169913409759845333931085437D+00 x( 24) = -0.83359597615489951437955716480123D+00 x( 25) = -0.81973418036507867415511910167470D+00 x( 26) = -0.80537472720468021466656079404644D+00 x( 27) = -0.79052633423981379994544995252740D+00 x( 28) = -0.77519801587020238244496276354566D+00 x( 29) = -0.75939907785653667155666366659810D+00 x( 30) = -0.74313911167095451292056688997595D+00 x( 31) = -0.72642798867407268553569290153270D+00 x( 32) = -0.70927585412210456099944463906757D+00 x( 33) = -0.69169312100770067015644143286666D+00 x( 34) = -0.67369046373825048534668253831602D+00 x( 35) = -0.65527881165548263027676505156852D+00 x( 36) = -0.63646934240029724134760815684175D+00 x( 37) = -0.61727347512685828385763916340822D+00 x( 38) = -0.59770286357006522938441201887478D+00 x( 39) = -0.57776938897061258000325165713764D+00 x( 40) = -0.55748515286193223292186190687872D+00 x( 41) = -0.53686246972339756745816636353452D+00 x( 42) = -0.51591385950424935727727729906662D+00 x( 43) = -0.49465204002278211739494017368636D+00 x( 44) = -0.47308991924540524164509989939699D+00 x( 45) = -0.45124058745026622733189858020729D+00 x( 46) = -0.42911730928019337626254405355418D+00 x( 47) = -0.40673351568978256340867288124339D+00 x( 48) = -0.38410279579151693577907781452239D+00 x( 49) = -0.36123888860586970607092484346723D+00 x( 50) = -0.33815567472039850137600027657095D+00 x( 51) = -0.31486716786289498148601475374890D+00 x( 52) = -0.29138750639370562079451875284568D+00 x( 53) = -0.26773094472238862088834352027938D+00 x( 54) = -0.24391184465391785797071324453138D+00 x( 55) = -0.21994466666968754245452337866940D+00 x( 56) = -0.19584396114861085150428162519610D+00 x( 57) = -0.17162435953364216500834492248954D+00 x( 58) = -0.14730056544908566938932929319807D+00 x( 59) = -0.12288734577408297172603365288567D+00 x( 60) = -0.98399521677698970751091751509101D-01 x( 61) = -0.73851959621048545273440409360569D-01 x( 62) = -0.49259562331926630315379321821927D-01 x( 63) = -0.24637259757420944614897071846088D-01 x( 64) = 0.00000000000000000000000000000000D+00 x( 65) = 0.24637259757420944614897071846088D-01 x( 66) = 0.49259562331926630315379321821927D-01 x( 67) = 0.73851959621048545273440409360569D-01 x( 68) = 0.98399521677698970751091751509101D-01 x( 69) = 0.12288734577408297172603365288567D+00 x( 70) = 0.14730056544908566938932929319807D+00 x( 71) = 0.17162435953364216500834492248954D+00 x( 72) = 0.19584396114861085150428162519610D+00 x( 73) = 0.21994466666968754245452337866940D+00 x( 74) = 0.24391184465391785797071324453138D+00 x( 75) = 0.26773094472238862088834352027938D+00 x( 76) = 0.29138750639370562079451875284568D+00 x( 77) = 0.31486716786289498148601475374890D+00 x( 78) = 0.33815567472039850137600027657095D+00 x( 79) = 0.36123888860586970607092484346723D+00 x( 80) = 0.38410279579151693577907781452239D+00 x( 81) = 0.40673351568978256340867288124339D+00 x( 82) = 0.42911730928019337626254405355418D+00 x( 83) = 0.45124058745026622733189858020729D+00 x( 84) = 0.47308991924540524164509989939699D+00 x( 85) = 0.49465204002278211739494017368636D+00 x( 86) = 0.51591385950424935727727729906662D+00 x( 87) = 0.53686246972339756745816636353452D+00 x( 88) = 0.55748515286193223292186190687872D+00 x( 89) = 0.57776938897061258000325165713764D+00 x( 90) = 0.59770286357006522938441201887478D+00 x( 91) = 0.61727347512685828385763916340822D+00 x( 92) = 0.63646934240029724134760815684175D+00 x( 93) = 0.65527881165548263027676505156852D+00 x( 94) = 0.67369046373825048534668253831602D+00 x( 95) = 0.69169312100770067015644143286666D+00 x( 96) = 0.70927585412210456099944463906757D+00 x( 97) = 0.72642798867407268553569290153270D+00 x( 98) = 0.74313911167095451292056688997595D+00 x( 99) = 0.75939907785653667155666366659810D+00 x(100) = 0.77519801587020238244496276354566D+00 x(101) = 0.79052633423981379994544995252740D+00 x(102) = 0.80537472720468021466656079404644D+00 x(103) = 0.81973418036507867415511910167470D+00 x(104) = 0.83359597615489951437955716480123D+00 x(105) = 0.84695169913409759845333931085437D+00 x(106) = 0.85979324109774080981203134414483D+00 x(107) = 0.87211280599856071141963753428864D+00 x(108) = 0.88390291468002656994525794802849D+00 x(109) = 0.89515640941708370896904382642451D+00 x(110) = 0.90586645826182138280246131760282D+00 x(111) = 0.91602655919146580931308861741716D+00 x(112) = 0.92563054405623384912746466814259D+00 x(113) = 0.93467258232473796857363487794906D+00 x(114) = 0.94314718462481482734544963026201D+00 x(115) = 0.95104920607788031054790764659636D+00 x(116) = 0.95837384942523877114910286998060D+00 x(117) = 0.96511666794529212109082507703391D+00 x(118) = 0.97127356816152919228894689830512D+00 x(119) = 0.97684081234307032681744391886221D+00 x(120) = 0.98181502080381411003346312451200D+00 x(121) = 0.98619317401693166671043833175407D+00 x(122) = 0.98997261459148415760778669967548D+00 x(123) = 0.99315104925451714736113079489080D+00 x(124) = 0.99572655135202722663543337085008D+00 x(125) = 0.99769756618980462107441703193392D+00 x(126) = 0.99906293435531189513828920479421D+00 x(127) = 0.99982213041530614629963254927125D+00 w( 1) = 0.45645726109586654495731936146574D-03 w( 2) = 0.10622766869538486959954760554099D-02 w( 3) = 0.16683488125171936761028811985672D-02 w( 4) = 0.22734860707492547802810838362671D-02 w( 5) = 0.28772587656289004082883197417581D-02 w( 6) = 0.34792893810051465908910894094105D-02 w( 7) = 0.40792095178254605327114733456293D-02 w( 8) = 0.46766539777779034772638165662478D-02 w( 9) = 0.52712596565634400891303815906251D-02 w( 10) = 0.58626653903523901033648343751367D-02 w( 11) = 0.64505120486899171845442463868748D-02 w( 12) = 0.70344427036681608755685893032552D-02 w( 13) = 0.76141028256526859356393930849227D-02 w( 14) = 0.81891404887415730817235884718726D-02 w( 15) = 0.87592065795403145773316804234385D-02 w( 16) = 0.93239550065309714787536985834029D-02 w( 17) = 0.98830429087554914716648010899606D-02 w( 18) = 0.10436130863141005225673171997668D-01 w( 19) = 0.10982883090068975788799657376065D-01 w( 20) = 0.11522967656921087154811609734510D-01 w( 21) = 0.12056056679400848183529562144697D-01 w( 22) = 0.12581826520465013101514365424172D-01 w( 23) = 0.13099957986718627426172681912499D-01 w( 24) = 0.13610136522139249906034237533759D-01 w( 25) = 0.14112052399003395774044161633613D-01 w( 26) = 0.14605400905893418351737288078952D-01 w( 27) = 0.15089882532666922992635733981431D-01 w( 28) = 0.15565203152273955098532590262975D-01 w( 29) = 0.16031074199309941802254151842763D-01 w( 30) = 0.16487212845194879399346060358146D-01 w( 31) = 0.16933342169871654545878815295200D-01 w( 32) = 0.17369191329918731922164721250350D-01 w( 33) = 0.17794495722974774231027912900351D-01 w( 34) = 0.18208997148375106468721469154479D-01 w( 35) = 0.18612443963902310429440419898958D-01 w( 36) = 0.19004591238555646611148901044533D-01 w( 37) = 0.19385200901246454628112623489471D-01 w( 38) = 0.19754041885329183081815217323169D-01 w( 39) = 0.20110890268880247225644623956287D-01 w( 40) = 0.20455529410639508279497065713301D-01 w( 41) = 0.20787750081531811812652137291250D-01 w( 42) = 0.21107350591688713643523847921658D-01 w( 43) = 0.21414136912893259295449693233545D-01 w( 44) = 0.21707922796373466052301324695331D-01 w( 45) = 0.21988529885872983756478409758807D-01 w( 46) = 0.22255787825930280235631416460158D-01 w( 47) = 0.22509534365300608085694429903050D-01 w( 48) = 0.22749615455457959852242553240982D-01 w( 49) = 0.22975885344117206754377437838947D-01 w( 50) = 0.23188206663719640249922582981729D-01 w( 51) = 0.23386450514828194170722043496950D-01 w( 52) = 0.23570496544381716050033676844306D-01 w( 53) = 0.23740233018760777777714726703424D-01 w( 54) = 0.23895556891620665983864481754172D-01 w( 55) = 0.24036373866450369675132086026456D-01 w( 56) = 0.24162598453819584716522917710986D-01 w( 57) = 0.24274154023278979833195063936748D-01 w( 58) = 0.24370972849882214952813561907241D-01 w( 59) = 0.24452996155301467956140198471529D-01 w( 60) = 0.24520174143511508275183033290175D-01 w( 61) = 0.24572466031020653286354137335186D-01 w( 62) = 0.24609840071630254092545634003360D-01 w( 63) = 0.24632273575707679066033370218017D-01 w( 64) = 0.24639752923961094419579417477503D-01 w( 65) = 0.24632273575707679066033370218017D-01 w( 66) = 0.24609840071630254092545634003360D-01 w( 67) = 0.24572466031020653286354137335186D-01 w( 68) = 0.24520174143511508275183033290175D-01 w( 69) = 0.24452996155301467956140198471529D-01 w( 70) = 0.24370972849882214952813561907241D-01 w( 71) = 0.24274154023278979833195063936748D-01 w( 72) = 0.24162598453819584716522917710986D-01 w( 73) = 0.24036373866450369675132086026456D-01 w( 74) = 0.23895556891620665983864481754172D-01 w( 75) = 0.23740233018760777777714726703424D-01 w( 76) = 0.23570496544381716050033676844306D-01 w( 77) = 0.23386450514828194170722043496950D-01 w( 78) = 0.23188206663719640249922582981729D-01 w( 79) = 0.22975885344117206754377437838947D-01 w( 80) = 0.22749615455457959852242553240982D-01 w( 81) = 0.22509534365300608085694429903050D-01 w( 82) = 0.22255787825930280235631416460158D-01 w( 83) = 0.21988529885872983756478409758807D-01 w( 84) = 0.21707922796373466052301324695331D-01 w( 85) = 0.21414136912893259295449693233545D-01 w( 86) = 0.21107350591688713643523847921658D-01 w( 87) = 0.20787750081531811812652137291250D-01 w( 88) = 0.20455529410639508279497065713301D-01 w( 89) = 0.20110890268880247225644623956287D-01 w( 90) = 0.19754041885329183081815217323169D-01 w( 91) = 0.19385200901246454628112623489471D-01 w( 92) = 0.19004591238555646611148901044533D-01 w( 93) = 0.18612443963902310429440419898958D-01 w( 94) = 0.18208997148375106468721469154479D-01 w( 95) = 0.17794495722974774231027912900351D-01 w( 96) = 0.17369191329918731922164721250350D-01 w( 97) = 0.16933342169871654545878815295200D-01 w( 98) = 0.16487212845194879399346060358146D-01 w( 99) = 0.16031074199309941802254151842763D-01 w(100) = 0.15565203152273955098532590262975D-01 w(101) = 0.15089882532666922992635733981431D-01 w(102) = 0.14605400905893418351737288078952D-01 w(103) = 0.14112052399003395774044161633613D-01 w(104) = 0.13610136522139249906034237533759D-01 w(105) = 0.13099957986718627426172681912499D-01 w(106) = 0.12581826520465013101514365424172D-01 w(107) = 0.12056056679400848183529562144697D-01 w(108) = 0.11522967656921087154811609734510D-01 w(109) = 0.10982883090068975788799657376065D-01 w(110) = 0.10436130863141005225673171997668D-01 w(111) = 0.98830429087554914716648010899606D-02 w(112) = 0.93239550065309714787536985834029D-02 w(113) = 0.87592065795403145773316804234385D-02 w(114) = 0.81891404887415730817235884718726D-02 w(115) = 0.76141028256526859356393930849227D-02 w(116) = 0.70344427036681608755685893032552D-02 w(117) = 0.64505120486899171845442463868748D-02 w(118) = 0.58626653903523901033648343751367D-02 w(119) = 0.52712596565634400891303815906251D-02 w(120) = 0.46766539777779034772638165662478D-02 w(121) = 0.40792095178254605327114733456293D-02 w(122) = 0.34792893810051465908910894094105D-02 w(123) = 0.28772587656289004082883197417581D-02 w(124) = 0.22734860707492547802810838362671D-02 w(125) = 0.16683488125171936761028811985672D-02 w(126) = 0.10622766869538486959954760554099D-02 w(127) = 0.45645726109586654495731936146574D-03 else if ( n == 255 ) then x( 1) = -0.9999557053175637D+00 x( 2) = -0.9997666213120006D+00 x( 3) = -0.9994264746801700D+00 x( 4) = -0.9989352412846546D+00 x( 5) = -0.9982929861369679D+00 x( 6) = -0.9974998041266158D+00 x( 7) = -0.9965558144351986D+00 x( 8) = -0.9954611594800263D+00 x( 9) = -0.9942160046166302D+00 x( 10) = -0.9928205380219891D+00 x( 11) = -0.9912749706303856D+00 x( 12) = -0.9895795360859201D+00 x( 13) = -0.9877344906997324D+00 x( 14) = -0.9857401134074193D+00 x( 15) = -0.9835967057247763D+00 x( 16) = -0.9813045917010171D+00 x( 17) = -0.9788641178690681D+00 x( 18) = -0.9762756531927360D+00 x( 19) = -0.9735395890106436D+00 x( 20) = -0.9706563389768804D+00 x( 21) = -0.9676263389983388D+00 x( 22) = -0.9644500471687263D+00 x( 23) = -0.9611279436992478D+00 x( 24) = -0.9576605308459620D+00 x( 25) = -0.9540483328338163D+00 x( 26) = -0.9502918957773683D+00 x( 27) = -0.9463917875982043D+00 x( 28) = -0.9423485979390644D+00 x( 29) = -0.9381629380746873D+00 x( 30) = -0.9338354408193861D+00 x( 31) = -0.9293667604313699D+00 x( 32) = -0.9247575725138244D+00 x( 33) = -0.9200085739127664D+00 x( 34) = -0.9151204826116870D+00 x( 35) = -0.9100940376230008D+00 x( 36) = -0.9049299988763150D+00 x( 37) = -0.8996291471035368D+00 x( 38) = -0.8941922837208367D+00 x( 39) = -0.8886202307074841D+00 x( 40) = -0.8829138304815741D+00 x( 41) = -0.8770739457726654D+00 x( 42) = -0.8711014594913465D+00 x( 43) = -0.8649972745957512D+00 x( 44) = -0.8587623139550430D+00 x( 45) = -0.8523975202098902D+00 x( 46) = -0.8459038556299511D+00 x( 47) = -0.8392823019683910D+00 x( 48) = -0.8325338603134556D+00 x( 49) = -0.8256595509371186D+00 x( 50) = -0.8186604131408319D+00 x( 51) = -0.8115375050983958D+00 x( 52) = -0.8042919036959787D+00 x( 53) = -0.7969247043693057D+00 x( 54) = -0.7894370209380444D+00 x( 55) = -0.7818299854374094D+00 x( 56) = -0.7741047479470157D+00 x( 57) = -0.7662624764170006D+00 x( 58) = -0.7583043564914468D+00 x( 59) = -0.7502315913291283D+00 x( 60) = -0.7420454014216102D+00 x( 61) = -0.7337470244087263D+00 x( 62) = -0.7253377148914649D+00 x( 63) = -0.7168187442422908D+00 x( 64) = -0.7081914004129306D+00 x( 65) = -0.6994569877396524D+00 x( 66) = -0.6906168267460676D+00 x( 67) = -0.6816722539434864D+00 x( 68) = -0.6726246216288551D+00 x( 69) = -0.6634752976803070D+00 x( 70) = -0.6542256653503588D+00 x( 71) = -0.6448771230567811D+00 x( 72) = -0.6354310841711771D+00 x( 73) = -0.6258889768052999D+00 x( 74) = -0.6162522435951415D+00 x( 75) = -0.6065223414828266D+00 x( 76) = -0.5967007414963417D+00 x( 77) = -0.5867889285271373D+00 x( 78) = -0.5767884011056313D+00 x( 79) = -0.5667006711746527D+00 x( 80) = -0.5565272638608558D+00 x( 81) = -0.5462697172441424D+00 x( 82) = -0.5359295821251249D+00 x( 83) = -0.5255084217906666D+00 x( 84) = -0.5150078117775342D+00 x( 85) = -0.5044293396341982D+00 x( 86) = -0.4937746046808170D+00 x( 87) = -0.4830452177674420D+00 x( 88) = -0.4722428010304787D+00 x( 89) = -0.4613689876474424D+00 x( 90) = -0.4504254215900437D+00 x( 91) = -0.4394137573756426D+00 x( 92) = -0.4283356598171081D+00 x( 93) = -0.4171928037711214D+00 x( 94) = -0.4059868738849605D+00 x( 95) = -0.3947195643418044D+00 x( 96) = -0.3833925786045958D+00 x( 97) = -0.3720076291585012D+00 x( 98) = -0.3605664372520062D+00 x( 99) = -0.3490707326366864D+00 x(100) = -0.3375222533056927D+00 x(101) = -0.3259227452309905D+00 x(102) = -0.3142739620993925D+00 x(103) = -0.3025776650474256D+00 x(104) = -0.2908356223950708D+00 x(105) = -0.2790496093784178D+00 x(106) = -0.2672214078812731D+00 x(107) = -0.2553528061657641D+00 x(108) = -0.2434455986019780D+00 x(109) = -0.2315015853966777D+00 x(110) = -0.2195225723211354D+00 x(111) = -0.2075103704381242D+00 x(112) = -0.1954667958281108D+00 x(113) = -0.1833936693146885D+00 x(114) = -0.1712928161892939D+00 x(115) = -0.1591660659352477D+00 x(116) = -0.1470152519511620D+00 x(117) = -0.1348422112737553D+00 x(118) = -0.1226487843001178D+00 x(119) = -0.1104368145094688D+00 x(120) = -0.9820814818444755D-01 x(121) = -0.8596463413198061D-01 x(122) = -0.7370812340376778D-01 x(123) = -0.6144046901642827D-01 x(124) = -0.4916352567134998D-01 x(125) = -0.3687914947428402D-01 x(126) = -0.2458919765472701D-01 x(127) = -0.1229552828513332D-01 x(128) = 0.000000000000000D+00 x(129) = 0.1229552828513332D-01 x(130) = 0.2458919765472701D-01 x(131) = 0.3687914947428402D-01 x(132) = 0.4916352567134998D-01 x(133) = 0.6144046901642827D-01 x(134) = 0.7370812340376778D-01 x(135) = 0.8596463413198061D-01 x(136) = 0.9820814818444755D-01 x(137) = 0.1104368145094688D+00 x(138) = 0.1226487843001178D+00 x(139) = 0.1348422112737553D+00 x(140) = 0.1470152519511620D+00 x(141) = 0.1591660659352477D+00 x(142) = 0.1712928161892939D+00 x(143) = 0.1833936693146885D+00 x(144) = 0.1954667958281108D+00 x(145) = 0.2075103704381242D+00 x(146) = 0.2195225723211354D+00 x(147) = 0.2315015853966777D+00 x(148) = 0.2434455986019780D+00 x(149) = 0.2553528061657641D+00 x(150) = 0.2672214078812731D+00 x(151) = 0.2790496093784178D+00 x(152) = 0.2908356223950708D+00 x(153) = 0.3025776650474256D+00 x(154) = 0.3142739620993925D+00 x(155) = 0.3259227452309905D+00 x(156) = 0.3375222533056927D+00 x(157) = 0.3490707326366864D+00 x(158) = 0.3605664372520062D+00 x(159) = 0.3720076291585012D+00 x(160) = 0.3833925786045958D+00 x(161) = 0.3947195643418044D+00 x(162) = 0.4059868738849605D+00 x(163) = 0.4171928037711214D+00 x(164) = 0.4283356598171081D+00 x(165) = 0.4394137573756426D+00 x(166) = 0.4504254215900437D+00 x(167) = 0.4613689876474424D+00 x(168) = 0.4722428010304787D+00 x(169) = 0.4830452177674420D+00 x(170) = 0.4937746046808170D+00 x(171) = 0.5044293396341982D+00 x(172) = 0.5150078117775342D+00 x(173) = 0.5255084217906666D+00 x(174) = 0.5359295821251249D+00 x(175) = 0.5462697172441424D+00 x(176) = 0.5565272638608558D+00 x(177) = 0.5667006711746527D+00 x(178) = 0.5767884011056313D+00 x(179) = 0.5867889285271373D+00 x(180) = 0.5967007414963417D+00 x(181) = 0.6065223414828266D+00 x(182) = 0.6162522435951415D+00 x(183) = 0.6258889768052999D+00 x(184) = 0.6354310841711771D+00 x(185) = 0.6448771230567811D+00 x(186) = 0.6542256653503588D+00 x(187) = 0.6634752976803070D+00 x(188) = 0.6726246216288551D+00 x(189) = 0.6816722539434864D+00 x(190) = 0.6906168267460676D+00 x(191) = 0.6994569877396524D+00 x(192) = 0.7081914004129306D+00 x(193) = 0.7168187442422908D+00 x(194) = 0.7253377148914649D+00 x(195) = 0.7337470244087263D+00 x(196) = 0.7420454014216102D+00 x(197) = 0.7502315913291283D+00 x(198) = 0.7583043564914468D+00 x(199) = 0.7662624764170006D+00 x(200) = 0.7741047479470157D+00 x(201) = 0.7818299854374094D+00 x(202) = 0.7894370209380444D+00 x(203) = 0.7969247043693057D+00 x(204) = 0.8042919036959787D+00 x(205) = 0.8115375050983958D+00 x(206) = 0.8186604131408319D+00 x(207) = 0.8256595509371186D+00 x(208) = 0.8325338603134556D+00 x(209) = 0.8392823019683910D+00 x(210) = 0.8459038556299511D+00 x(211) = 0.8523975202098902D+00 x(212) = 0.8587623139550430D+00 x(213) = 0.8649972745957512D+00 x(214) = 0.8711014594913465D+00 x(215) = 0.8770739457726654D+00 x(216) = 0.8829138304815741D+00 x(217) = 0.8886202307074841D+00 x(218) = 0.8941922837208367D+00 x(219) = 0.8996291471035368D+00 x(220) = 0.9049299988763150D+00 x(221) = 0.9100940376230008D+00 x(222) = 0.9151204826116870D+00 x(223) = 0.9200085739127664D+00 x(224) = 0.9247575725138244D+00 x(225) = 0.9293667604313699D+00 x(226) = 0.9338354408193861D+00 x(227) = 0.9381629380746873D+00 x(228) = 0.9423485979390644D+00 x(229) = 0.9463917875982043D+00 x(230) = 0.9502918957773683D+00 x(231) = 0.9540483328338163D+00 x(232) = 0.9576605308459620D+00 x(233) = 0.9611279436992478D+00 x(234) = 0.9644500471687263D+00 x(235) = 0.9676263389983388D+00 x(236) = 0.9706563389768804D+00 x(237) = 0.9735395890106436D+00 x(238) = 0.9762756531927360D+00 x(239) = 0.9788641178690681D+00 x(240) = 0.9813045917010171D+00 x(241) = 0.9835967057247763D+00 x(242) = 0.9857401134074193D+00 x(243) = 0.9877344906997324D+00 x(244) = 0.9895795360859201D+00 x(245) = 0.9912749706303856D+00 x(246) = 0.9928205380219891D+00 x(247) = 0.9942160046166302D+00 x(248) = 0.9954611594800263D+00 x(249) = 0.9965558144351986D+00 x(250) = 0.9974998041266158D+00 x(251) = 0.9982929861369679D+00 x(252) = 0.9989352412846546D+00 x(253) = 0.9994264746801700D+00 x(254) = 0.9997666213120006D+00 x(255) = 0.9999557053175637D+00 w( 1) = 0.1136736199914808D-03 w( 2) = 0.2645938711908564D-03 w( 3) = 0.4156976252681932D-03 w( 4) = 0.5667579456482639D-03 w( 5) = 0.7177364780061286D-03 w( 6) = 0.8686076661194581D-03 w( 7) = 0.1019347976427318D-02 w( 8) = 0.1169934372938800D-02 w( 9) = 0.1320343990022177D-02 w( 10) = 0.1470554042778403D-02 w( 11) = 0.1620541799041545D-02 w( 12) = 0.1770284570660304D-02 w( 13) = 0.1919759711713187D-02 w( 14) = 0.2068944619501569D-02 w( 15) = 0.2217816736754017D-02 w( 16) = 0.2366353554396287D-02 w( 17) = 0.2514532614599710D-02 w( 18) = 0.2662331513971696D-02 w( 19) = 0.2809727906820460D-02 w( 20) = 0.2956699508457498D-02 w( 21) = 0.3103224098519095D-02 w( 22) = 0.3249279524294296D-02 w( 23) = 0.3394843704053401D-02 w( 24) = 0.3539894630372244D-02 w( 25) = 0.3684410373449933D-02 w( 26) = 0.3828369084417135D-02 w( 27) = 0.3971748998634907D-02 w( 28) = 0.4114528438981242D-02 w( 29) = 0.4256685819126112D-02 w( 30) = 0.4398199646792759D-02 w( 31) = 0.4539048527006180D-02 w( 32) = 0.4679211165326077D-02 w( 33) = 0.4818666371065699D-02 w( 34) = 0.4957393060495050D-02 w( 35) = 0.5095370260027839D-02 w( 36) = 0.5232577109391968D-02 w( 37) = 0.5368992864783177D-02 w( 38) = 0.5504596902000804D-02 w( 39) = 0.5639368719565862D-02 w( 40) = 0.5773287941820301D-02 w( 41) = 0.5906334322007422D-02 w( 42) = 0.6038487745332765D-02 w( 43) = 0.6169728232005295D-02 w( 44) = 0.6300035940257733D-02 w( 45) = 0.6429391169346602D-02 w( 46) = 0.6557774362530328D-02 w( 47) = 0.6685166110026254D-02 w( 48) = 0.6811547151944815D-02 w( 49) = 0.6936898381201466D-02 w( 50) = 0.7061200846405536D-02 w( 51) = 0.7184435754724984D-02 w( 52) = 0.7306584474728122D-02 w( 53) = 0.7427628539199977D-02 w( 54) = 0.7547549647934514D-02 w( 55) = 0.7666329670501377D-02 w( 56) = 0.7783950648986801D-02 w( 57) = 0.7900394800708624D-02 w( 58) = 0.8015644520904983D-02 w( 59) = 0.8129682385395602D-02 w( 60) = 0.8242491153216323D-02 w( 61) = 0.8354053769225508D-02 w( 62) = 0.8464353366682819D-02 w( 63) = 0.8573373269798925D-02 w( 64) = 0.8681096996256795D-02 w( 65) = 0.8787508259703609D-02 w( 66) = 0.8892590972213036D-02 w( 67) = 0.8996329246717397D-02 w( 68) = 0.9098707399409718D-02 w( 69) = 0.9199709952114802D-02 w( 70) = 0.9299321634629343D-02 w( 71) = 0.9397527387030594D-02 w( 72) = 0.9494312361953241D-02 w( 73) = 0.9589661926834022D-02 w( 74) = 0.9683561666124043D-02 w( 75) = 0.9775997383468165D-02 w( 76) = 0.9866955103851452D-02 w( 77) = 0.9956421075711706D-02 w( 78) = 0.1004438177301882D-01 w( 79) = 0.1013082389731963D-01 w( 80) = 0.1021573437974821D-01 w( 81) = 0.1029910038300220D-01 w( 82) = 0.1038090930328312D-01 w( 83) = 0.1046114877220228D-01 w( 84) = 0.1053980665865038D-01 w( 85) = 0.1061687107063194D-01 w( 86) = 0.1069233035706287D-01 w( 87) = 0.1076617310953212D-01 w( 88) = 0.1083838816402652D-01 w( 89) = 0.1090896460261843D-01 w( 90) = 0.1097789175511656D-01 w( 91) = 0.1104515920067912D-01 w( 92) = 0.1111075676938929D-01 w( 93) = 0.1117467454379268D-01 w( 94) = 0.1123690286039691D-01 w( 95) = 0.1129743231113249D-01 w( 96) = 0.1135625374477508D-01 w( 97) = 0.1141335826832922D-01 w( 98) = 0.1146873724837283D-01 w( 99) = 0.1152238231236217D-01 w(100) = 0.1157428534989815D-01 w(101) = 0.1162443851395193D-01 w(102) = 0.1167283422205182D-01 w(103) = 0.1171946515742932D-01 w(104) = 0.1176432427012535D-01 w(105) = 0.1180740477805627D-01 w(106) = 0.1184870016803913D-01 w(107) = 0.1188820419677619D-01 w(108) = 0.1192591089179929D-01 w(109) = 0.1196181455237226D-01 w(110) = 0.1199590975035326D-01 w(111) = 0.1202819133101508D-01 w(112) = 0.1205865441382472D-01 w(113) = 0.1208729439318107D-01 w(114) = 0.1211410693911137D-01 w(115) = 0.1213908799792579D-01 w(116) = 0.1216223379283022D-01 w(117) = 0.1218354082449738D-01 w(118) = 0.1220300587159574D-01 w(119) = 0.1222062599127671D-01 w(120) = 0.1223639851961942D-01 w(121) = 0.1225032107203351D-01 w(122) = 0.1226239154361966D-01 w(123) = 0.1227260810948789D-01 w(124) = 0.1228096922503318D-01 w(125) = 0.1228747362616942D-01 w(126) = 0.1229212032952021D-01 w(127) = 0.1229490863256759D-01 w(128) = 0.1229583811375833D-01 w(129) = 0.1229490863256759D-01 w(130) = 0.1229212032952021D-01 w(131) = 0.1228747362616942D-01 w(132) = 0.1228096922503318D-01 w(133) = 0.1227260810948789D-01 w(134) = 0.1226239154361966D-01 w(135) = 0.1225032107203351D-01 w(136) = 0.1223639851961942D-01 w(137) = 0.1222062599127671D-01 w(138) = 0.1220300587159574D-01 w(139) = 0.1218354082449738D-01 w(140) = 0.1216223379283022D-01 w(141) = 0.1213908799792579D-01 w(142) = 0.1211410693911137D-01 w(143) = 0.1208729439318107D-01 w(144) = 0.1205865441382472D-01 w(145) = 0.1202819133101508D-01 w(146) = 0.1199590975035326D-01 w(147) = 0.1196181455237226D-01 w(148) = 0.1192591089179929D-01 w(149) = 0.1188820419677619D-01 w(150) = 0.1184870016803913D-01 w(151) = 0.1180740477805627D-01 w(152) = 0.1176432427012535D-01 w(153) = 0.1171946515742932D-01 w(154) = 0.1167283422205182D-01 w(155) = 0.1162443851395193D-01 w(156) = 0.1157428534989815D-01 w(157) = 0.1152238231236217D-01 w(158) = 0.1146873724837283D-01 w(159) = 0.1141335826832922D-01 w(160) = 0.1135625374477508D-01 w(161) = 0.1129743231113249D-01 w(162) = 0.1123690286039691D-01 w(163) = 0.1117467454379268D-01 w(164) = 0.1111075676938929D-01 w(165) = 0.1104515920067912D-01 w(166) = 0.1097789175511656D-01 w(167) = 0.1090896460261843D-01 w(168) = 0.1083838816402652D-01 w(169) = 0.1076617310953212D-01 w(170) = 0.1069233035706287D-01 w(171) = 0.1061687107063194D-01 w(172) = 0.1053980665865038D-01 w(173) = 0.1046114877220228D-01 w(174) = 0.1038090930328312D-01 w(175) = 0.1029910038300220D-01 w(176) = 0.1021573437974821D-01 w(177) = 0.1013082389731963D-01 w(178) = 0.1004438177301882D-01 w(179) = 0.9956421075711706D-02 w(180) = 0.9866955103851452D-02 w(181) = 0.9775997383468165D-02 w(182) = 0.9683561666124043D-02 w(183) = 0.9589661926834022D-02 w(184) = 0.9494312361953241D-02 w(185) = 0.9397527387030594D-02 w(186) = 0.9299321634629343D-02 w(187) = 0.9199709952114802D-02 w(188) = 0.9098707399409718D-02 w(189) = 0.8996329246717397D-02 w(190) = 0.8892590972213036D-02 w(191) = 0.8787508259703609D-02 w(192) = 0.8681096996256795D-02 w(193) = 0.8573373269798925D-02 w(194) = 0.8464353366682819D-02 w(195) = 0.8354053769225508D-02 w(196) = 0.8242491153216323D-02 w(197) = 0.8129682385395602D-02 w(198) = 0.8015644520904983D-02 w(199) = 0.7900394800708624D-02 w(200) = 0.7783950648986801D-02 w(201) = 0.7666329670501377D-02 w(202) = 0.7547549647934514D-02 w(203) = 0.7427628539199977D-02 w(204) = 0.7306584474728122D-02 w(205) = 0.7184435754724984D-02 w(206) = 0.7061200846405536D-02 w(207) = 0.6936898381201466D-02 w(208) = 0.6811547151944815D-02 w(209) = 0.6685166110026254D-02 w(210) = 0.6557774362530328D-02 w(211) = 0.6429391169346602D-02 w(212) = 0.6300035940257733D-02 w(213) = 0.6169728232005295D-02 w(214) = 0.6038487745332765D-02 w(215) = 0.5906334322007422D-02 w(216) = 0.5773287941820301D-02 w(217) = 0.5639368719565862D-02 w(218) = 0.5504596902000804D-02 w(219) = 0.5368992864783177D-02 w(220) = 0.5232577109391968D-02 w(221) = 0.5095370260027839D-02 w(222) = 0.4957393060495050D-02 w(223) = 0.4818666371065699D-02 w(224) = 0.4679211165326077D-02 w(225) = 0.4539048527006180D-02 w(226) = 0.4398199646792759D-02 w(227) = 0.4256685819126112D-02 w(228) = 0.4114528438981242D-02 w(229) = 0.3971748998634907D-02 w(230) = 0.3828369084417135D-02 w(231) = 0.3684410373449933D-02 w(232) = 0.3539894630372244D-02 w(233) = 0.3394843704053401D-02 w(234) = 0.3249279524294296D-02 w(235) = 0.3103224098519095D-02 w(236) = 0.2956699508457498D-02 w(237) = 0.2809727906820460D-02 w(238) = 0.2662331513971696D-02 w(239) = 0.2514532614599710D-02 w(240) = 0.2366353554396287D-02 w(241) = 0.2217816736754017D-02 w(242) = 0.2068944619501569D-02 w(243) = 0.1919759711713187D-02 w(244) = 0.1770284570660304D-02 w(245) = 0.1620541799041545D-02 w(246) = 0.1470554042778403D-02 w(247) = 0.1320343990022177D-02 w(248) = 0.1169934372938800D-02 w(249) = 0.1019347976427318D-02 w(250) = 0.8686076661194581D-03 w(251) = 0.7177364780061286D-03 w(252) = 0.5667579456482639D-03 w(253) = 0.4156976252681932D-03 w(254) = 0.2645938711908564D-03 w(255) = 0.1136736199914808D-03 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LEGENDRE_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of N = ', n write ( *, '(a)' ) & ' Legal values are 1 through 33, 63, 64, 65, 127 and 255.' stop end if return end subroutine legendre_cos_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_COS_SET: Gauss-Legendre rule for COS(X) * F(X) on [-PI/2,PI/2]. ! ! Discussion: ! ! The integration interval is [ -PI/2, PI/2 ]. ! ! The weight function is w(x) = cos(x). ! ! The integral to approximate: ! ! Integral ( -PI/2 <= X <= PI/2 ) COS(X) * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Discussion: ! ! The same rule can be used to approximate ! ! Integral ( 0 <= X <= PI ) SIN(X) * F(X) dX ! ! as ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) + PI/2 ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 23 November 2000 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Gwynne Evans, ! Practical Numerical Integration, ! Wiley, 1993, ! ISBN: 047193898X, ! LC: QA299.3E93. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1, 2, 4, 8 or 16. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order == 1 ) then xtab(1) = 0.0D+00 weight(1) = 2.0D+00 else if ( order == 2 ) then xtab(1) = - 0.68366739008990304094D+00 xtab(2) = 0.68366739008990304094D+00 weight(1) = 1.0D+00 weight(2) = 1.0D+00 else if ( order == 4 ) then xtab(1) = - 1.1906765638948557415D+00 xtab(2) = - 0.43928746686001514756D+00 xtab(3) = 0.43928746686001514756D+00 xtab(4) = 1.1906765638948557415D+00 weight(1) = 0.22407061812762016065D+00 weight(2) = 0.77592938187237983935D+00 weight(3) = 0.77592938187237983935D+00 weight(4) = 0.22407061812762016065D+00 else if ( order == 8 ) then xtab(1) = - 1.4414905401823575701D+00 xtab(2) = - 1.1537256454567275850D+00 xtab(3) = - 0.74346864787549244989D+00 xtab(4) = - 0.25649650741623123020D+00 xtab(5) = 0.25649650741623123020D+00 xtab(6) = 0.74346864787549244989D+00 xtab(7) = 1.1537256454567275850D+00 xtab(8) = 1.4414905401823575701D+00 weight(1) = 0.027535633513767011149D+00 weight(2) = 0.14420409203022750950D+00 weight(3) = 0.33626447785280459621D+00 weight(4) = 0.49199579660320088314D+00 weight(5) = 0.49199579660320088314D+00 weight(6) = 0.33626447785280459621D+00 weight(7) = 0.14420409203022750950D+00 weight(8) = 0.027535633513767011149D+00 else if ( order == 16 ) then xtab( 1) = - 1.5327507132362304779D+00 xtab( 2) = - 1.4446014873666514608D+00 xtab( 3) = - 1.3097818904452936698D+00 xtab( 4) = - 1.1330068786005003695D+00 xtab( 5) = - 0.92027786206637096497D+00 xtab( 6) = - 0.67861108097560545347D+00 xtab( 7) = - 0.41577197673418943962D+00 xtab( 8) = - 0.14003444424696773778D+00 xtab( 9) = 0.14003444424696773778D+00 xtab(10) = 0.41577197673418943962D+00 xtab(11) = 0.67861108097560545347D+00 xtab(12) = 0.92027786206637096497D+00 xtab(13) = 1.1330068786005003695D+00 xtab(14) = 1.3097818904452936698D+00 xtab(15) = 1.4446014873666514608D+00 xtab(16) = 1.5327507132362304779D+00 weight( 1) = 0.0024194677567615628193D+00 weight( 2) = 0.014115268156854008264D+00 weight( 3) = 0.040437893946503669410D+00 weight( 4) = 0.083026647573217742131D+00 weight( 5) = 0.13834195526951273359D+00 weight( 6) = 0.19741148870253455567D+00 weight( 7) = 0.24763632094635522403D+00 weight( 8) = 0.27661095764826050408D+00 weight( 9) = 0.27661095764826050408D+00 weight(10) = 0.24763632094635522403D+00 weight(11) = 0.19741148870253455567D+00 weight(12) = 0.13834195526951273359D+00 weight(13) = 0.083026647573217742131D+00 weight(14) = 0.040437893946503669410D+00 weight(15) = 0.014115268156854008264D+00 weight(16) = 0.0024194677567615628193D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LEGENDRE_COS_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order stop end if return end subroutine legendre_cos2_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_COS2_SET sets a Gauss-Legendre rule for COS(X) * F(X) on [0,PI/2]. ! ! Discussion: ! ! The integration interval is [ 0, PI/2 ]. ! ! The weight function is w(x) = cos ( x ). ! ! The integral to approximate: ! ! Integral ( 0 <= X <= PI/2 ) COS(X) * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! The same rule can be used to approximate ! ! Integral ( 0 <= X <= PI/2 ) SIN(X) * F(X) dX ! ! as ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( PI/2 - XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 24 November 2000 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Gwynne Evans, ! Practical Numerical Integration, ! Wiley, 1993, ! ISBN: 047193898X, ! LC: QA299.3E93. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 2, 4, 8 or 16. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order == 2 ) then xtab(1) = 0.26587388056307823382D+00 xtab(2) = 1.0351526093171315182D+00 weight(1) = 0.60362553280827113087D+00 weight(2) = 0.39637446719172886913D+00 else if ( order == 4 ) then xtab(1) = 0.095669389196858636773D+00 xtab(2) = 0.45240902327067096554D+00 xtab(3) = 0.93185057672024082424D+00 xtab(4) = 1.3564439599666466230D+00 weight( 1) = 0.23783071419515504517D+00 weight( 2) = 0.40265695523581253512D+00 weight( 3) = 0.28681737948564715225D+00 weight( 4) = 0.072694951083385267446D+00 else if ( order == 8 ) then xtab(1) = 0.029023729768913933432D+00 xtab(2) = 0.14828524404581819442D+00 xtab(3) = 0.34531111151664787488D+00 xtab(4) = 0.59447696797658360178D+00 xtab(5) = 0.86538380686123504827D+00 xtab(6) = 1.1263076093187456632D+00 xtab(7) = 1.3470150460281258016D+00 xtab(8) = 1.5015603622059195568D+00 weight( 1) = 0.073908998095117384985D+00 weight( 2) = 0.16002993702338006099D+00 weight( 3) = 0.21444434341803549108D+00 weight( 4) = 0.21979581268851903339D+00 weight( 5) = 0.17581164478209568886D+00 weight( 6) = 0.10560448025308322171D+00 weight( 7) = 0.042485497299217201089D+00 weight( 8) = 0.0079192864405519178899D+00 else if ( order == 16 ) then xtab( 1) = 0.0080145034906295973494D+00 xtab( 2) = 0.041893031354246254797D+00 xtab( 3) = 0.10149954486757579459D+00 xtab( 4) = 0.18463185923836617507D+00 xtab( 5) = 0.28826388487760574589D+00 xtab( 6) = 0.40870579076464794191D+00 xtab( 7) = 0.54176054986913847463D+00 xtab( 8) = 0.68287636658719416893D+00 xtab( 9) = 0.82729287620416833520D+00 xtab(10) = 0.97018212594829367065D+00 xtab(11) = 1.1067865150286247873D+00 xtab(12) = 1.2325555697227748824D+00 xtab(13) = 1.3432821921580721861D+00 xtab(14) = 1.4352370549295032923D+00 xtab(15) = 1.5052970876794669248D+00 xtab(16) = 1.5510586944086135769D+00 weight( 1) = 0.020528714977215248902D+00 weight( 2) = 0.046990919853597958123D+00 weight( 3) = 0.071441021312218541698D+00 weight( 4) = 0.092350338329243052271D+00 weight( 5) = 0.10804928026816236935D+00 weight( 6) = 0.11698241243306261791D+00 weight( 7) = 0.11812395361762037649D+00 weight( 8) = 0.11137584940420091049D+00 weight( 9) = 0.097778236145946543110D+00 weight(10) = 0.079418758985944482077D+00 weight(11) = 0.059039620053768691402D+00 weight(12) = 0.039458876783728165671D+00 weight(13) = 0.022987785677206847531D+00 weight(14) = 0.011010405600421536861D+00 weight(15) = 0.0038123928030499915653D+00 weight(16) = 0.00065143375461266656171D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LEGENDRE_COS2_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order stop end if return end subroutine legendre_log_compute ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_LOG_COMPUTE: Gauss-Legendre rules for - LOG(X) * F(X) on [0,1]. ! ! Discussion: ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = -log(x); ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) - LOG(X) * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Note that this rule is reasonably accurate for values of ORDER up to 13. ! However, for larger values of ORDER, the weight calculation loses so much ! accuracy that the formula is not reliable. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 15 December 2007 ! ! Author: ! ! Federico Paris, Jose Canas ! FORTRAN90 version by John Burkardt ! ! Reference: ! ! Donald Anderson, ! Gaussian Quadrature Formulae for the integral from 0 to 1 of ! -ln(X) f(X) dx, ! Mathematics of Computation, ! Volume 19, Number 91, July 1965, pages 477-481. ! ! Federico Paris, Jose Canas, ! Boundary Element Method: Fundamentals and Applications, ! Oxford, 1997, ! ISBN: 0-19-856543-7 ! LC: TA347.B69.P34. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) coef(-1:order,3) integer ( kind = 4 ) i integer ( kind = 4 ) i0 integer ( kind = 4 ) i1 integer ( kind = 4 ) i2 integer ( kind = 4 ) ii integer ( kind = 4 ) ir0 integer ( kind = 4 ) ir1 integer ( kind = 4 ) j integer ( kind = 4 ) k real ( kind = 8 ) rk real ( kind = 8 ) root(0:order+1,2) real ( kind = 8 ) sk real ( kind = 8 ) tk real ( kind = 8 ) tk1 real ( kind = 8 ) tol real ( kind = 8 ) uk real ( kind = 8 ) v1 real ( kind = 8 ) v2 real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order == 1 ) then xtab(1) = 0.25D+00 weight(1) = 1.0D+00 return end if coef(-1:order,1:3) = 0.0D+00 root(0:order,1:2) = 0.0D+00 coef(-1,1) = 0.0D+00 coef( 0,1) = 1.0D+00 coef(-1,2) = 0.0D+00 coef( 0,2) = -0.5D+00 coef( 1,2) = 2.0D+00 tk1 = 1.0D+00 tol = 1.0D-12 ! tol = 1.0D-10 i0 = 3 i1 = 2 i2 = 1 ir1 = 1 ir0 = 2 root(0,1) = 0.0D+00 root(1,1) = 0.25D+00 root(2,1) = 1.0D+00 ! ! Computation of polynomial coefficients and roots. ! do k = 2, order tk = 0.0D+00 uk = 0.0D+00 do i = 0, k - 1 do j = 0, k - 1 tk = tk + coef(i,i1) * coef(j,i1) / ( i + j + 1 )**2 uk = uk + coef(i,i1) * coef(j,i1) / ( i + j + 2 )**2 end do end do rk = uk / tk sk = tk / tk1 do i = 0, k - 1 coef(i,i0) = 2.0D+00 & * ( coef(i-1,i1) - rk * coef(i,i1) ) - sk * coef(i,i2) end do coef(k,i0) = 2.0D+00**k do i = 1, k call legendre_log_roots ( k, coef(0:k,i0), root(i-1,ir1), root(i,ir1), & tol, root(i,ir0) ) end do root( 0,ir0) = 0.0D+00 root(k+1,ir0) = 1.0D+00 ii = i0 i0 = i2 i2 = i1 i1 = ii ii = ir0 ir0 = ir1 ir1 = ii tk1 = tk end do ! ! Compute the abscissas and weights. ! do i = 1, order xtab(i) = root(i,ir1) end do do i = 1, order j = 0 v1 = coef(j+1,i1) v2 = coef(j, i2) do j = 1, order - 1 v1 = v1 + real ( j + 1, kind = 8 ) * coef(j+1,i1) * xtab(i)**j v2 = v2 + coef(j, i2) * xtab(i)**j end do weight(i) = 2.0D+00 * tk / ( v1 * v2 ) end do return end subroutine legendre_log_roots ( n, coef, x00, xff, tol, xi ) !*****************************************************************************80 ! !! LEGENDRE_LOG_ROOTS is a root finder for LEGENDRE_LOG_COMPUTE. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 14 December 2007 ! ! Author: ! ! Federico Paris, Jose Canas ! FORTRAN90 version by John Burkardt ! ! Reference: ! ! Federico Paris, Jose Canas, ! Boundary Element Method: Fundamentals and Applications, ! Oxford, 1997, ! ISBN: 0-19-856543-7 ! LC: TA347.B69.P34. ! ! Parameters: ! ! Input, integer N, the degree of the polynomial. ! ! Input, real ( kind = 8 ) COEF(N+1), the coefficients of the polynomial. ! ! Input, real ( kind = 8 ) X00, XFF, two points at which the polynomial ! has opposite sign. ! ! Input, real ( kind = 8 ) TOL, a tolerance for the size of the ! uncertainty interval in the value of XI. ! ! Output, real ( kind = 8 ) XI, the approximate root. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) coef(n+1) real ( kind = 8 ) errac real ( kind = 8 ) tol real ( kind = 8 ) v0 real ( kind = 8 ) vf real ( kind = 8 ) vi real ( kind = 8 ) x0 real ( kind = 8 ) x00 real ( kind = 8 ) xf real ( kind = 8 ) xff real ( kind = 8 ) xi x0 = x00 call legendre_log_value ( n, coef, x0, v0 ) xf = xff call legendre_log_value ( n, coef, xf, vf ) errac = abs ( xf - x0 ) do while ( tol .lt. errac ) xi = 0.5D+00 * ( x0 + xf ) call legendre_log_value ( n, coef, xi, vi ) if ( abs ( vi ) .lt. tol ) then return end if if ( vi * v0 .lt. 0.0D+00 ) then xf = xi vf = vi else x0 = xi v0 = vi end if errac = abs ( xf - x0 ) end do return end subroutine legendre_log_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_LOG_SET sets a Gauss-Legendre rule for - LOG(X) * F(X) on [0,1]. ! ! Discussion: ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = -log(x); ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) - LOG(X) * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 05 December 2000 ! ! 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. ! ! Gwynne Evans, ! Practical Numerical Integration, ! Wiley, 1993, ! ISBN: 047193898X, ! LC: QA299.3E93. ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1 through 8, or 16. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order == 1 ) then xtab(1) = 0.25D+00 weight(1) = 1.0D+00 else if ( order == 2 ) then xtab(1) = 0.112008806166976182957205488948D+00 xtab(2) = 0.602276908118738102757080225338D+00 weight(1) = 0.718539319030384440665510200891D+00 weight(2) = 0.281460680969615559334489799109D+00 else if ( order == 3 ) then xtab(1) = 0.0638907930873254049961166031363D+00 xtab(2) = 0.368997063715618765546197645857D+00 xtab(3) = 0.766880303938941455423682659817D+00 weight(1) = 0.513404552232363325129300497567D+00 weight(2) = 0.391980041201487554806287180966D+00 weight(3) = 0.0946154065661491200644123214672D+00 else if ( order == 4 ) then xtab(1) = 0.0414484801993832208033213101564D+00 xtab(2) = 0.245274914320602251939675759523D+00 xtab(3) = 0.556165453560275837180184354376D+00 xtab(4) = 0.848982394532985174647849188085D+00 weight(1) = 0.383464068145135124850046522343D+00 weight(2) = 0.386875317774762627336008234554D+00 weight(3) = 0.190435126950142415361360014547D+00 weight(4) = 0.0392254871299598324525852285552D+00 else if ( order == 5 ) then xtab(1) = 0.0291344721519720533037267621154D+00 xtab(2) = 0.173977213320897628701139710829D+00 xtab(3) = 0.411702520284902043174931924646D+00 xtab(4) = 0.677314174582820380701802667998D+00 xtab(5) = 0.894771361031008283638886204455D+00 weight(1) = 0.297893471782894457272257877888D+00 weight(2) = 0.349776226513224180375071870307D+00 weight(3) = 0.234488290044052418886906857943D+00 weight(4) = 0.0989304595166331469761807114404D+00 weight(5) = 0.0189115521431957964895826824218D+00 else if ( order == 6 ) then xtab(1) = 0.0216340058441169489956958558537D+00 xtab(2) = 0.129583391154950796131158505009D+00 xtab(3) = 0.314020449914765508798248188420D+00 xtab(4) = 0.538657217351802144548941893993D+00 xtab(5) = 0.756915337377402852164544156139D+00 xtab(6) = 0.922668851372120237333873231507D+00 weight(1) = 0.238763662578547569722268303330D+00 weight(2) = 0.308286573273946792969383109211D+00 weight(3) = 0.245317426563210385984932540188D+00 weight(4) = 0.142008756566476685421345576030D+00 weight(5) = 0.0554546223248862900151353549662D+00 weight(6) = 0.0101689586929322758869351162755D+00 else if ( order == 7 ) then xtab(1) = 0.0167193554082585159416673609320D+00 xtab(2) = 0.100185677915675121586885031757D+00 xtab(3) = 0.246294246207930599046668547239D+00 xtab(4) = 0.433463493257033105832882482601D+00 xtab(5) = 0.632350988047766088461805812245D+00 xtab(6) = 0.811118626740105576526226796782D+00 xtab(7) = 0.940848166743347721760134113379D+00 weight(1) = 0.196169389425248207525427377585D+00 weight(2) = 0.270302644247272982145271719533D+00 weight(3) = 0.239681873007690948308072785252D+00 weight(4) = 0.165775774810432906560869687736D+00 weight(5) = 0.0889432271376579644357238403458D+00 weight(6) = 0.0331943043565710670254494111034D+00 weight(7) = 0.00593278701512592399918517844468D+00 else if ( order == 8 ) then xtab(1) = 0.0133202441608924650122526725243D+00 xtab(2) = 0.0797504290138949384098277291424D+00 xtab(3) = 0.197871029326188053794476159516D+00 xtab(4) = 0.354153994351909419671463603538D+00 xtab(5) = 0.529458575234917277706149699996D+00 xtab(6) = 0.701814529939099963837152670310D+00 xtab(7) = 0.849379320441106676048309202301D+00 xtab(8) = 0.953326450056359788767379678514D+00 weight(1) = 0.164416604728002886831472568326D+00 weight(2) = 0.237525610023306020501348561960D+00 weight(3) = 0.226841984431919126368780402936D+00 weight(4) = 0.175754079006070244988056212006D+00 weight(5) = 0.112924030246759051855000442086D+00 weight(6) = 0.0578722107177820723985279672940D+00 weight(7) = 0.0209790737421329780434615241150D+00 weight(8) = 0.00368640710402761901335232127647D+00 else if ( order == 16 ) then xtab( 1) = 0.00389783448711591592405360527037D+00 xtab( 2) = 0.0230289456168732398203176309848D+00 xtab( 3) = 0.0582803983062404123483532298394D+00 xtab( 4) = 0.108678365091054036487713613051D+00 xtab( 5) = 0.172609454909843937760843776232D+00 xtab( 6) = 0.247937054470578495147671753047D+00 xtab( 7) = 0.332094549129917155984755859320D+00 xtab( 8) = 0.422183910581948600115088366745D+00 xtab( 9) = 0.515082473381462603476277704052D+00 xtab(10) = 0.607556120447728724086384921709D+00 xtab(11) = 0.696375653228214061156318166581D+00 xtab(12) = 0.778432565873265405203868167732D+00 xtab(13) = 0.850850269715391083233822761319D+00 xtab(14) = 0.911086857222271905418818994060D+00 xtab(15) = 0.957025571703542157591520509383D+00 xtab(16) = 0.987047800247984476758697436516D+00 weight( 1) = 0.0607917100435912328511733871235D+00 weight( 2) = 0.102915677517582144387691736210D+00 weight( 3) = 0.122355662046009193557547513197D+00 weight( 4) = 0.127569246937015988717042209239D+00 weight( 5) = 0.123013574600070915423123365137D+00 weight( 6) = 0.111847244855485722621848903429D+00 weight( 7) = 0.0965963851521243412529681650802D+00 weight( 8) = 0.0793566643514731387824416770520D+00 weight( 9) = 0.0618504945819652070951360853113D+00 weight(10) = 0.0454352465077266686288299526509D+00 weight(11) = 0.0310989747515818064092528627927D+00 weight(12) = 0.0194597659273608420780860268669D+00 weight(13) = 0.0107762549632055256455393162159D+00 weight(14) = 0.00497254289008764171250524951646D+00 weight(15) = 0.00167820111005119451503546419059D+00 weight(16) = 0.000282353764668436321778085987413D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LEGENDRE_LOG_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are 1 through 8 and 16.' stop end if return end subroutine legendre_log_value ( n, coef, x, value ) !*****************************************************************************80 ! !! LEGENDRE_LOG_VALUE evaluates a polynomial for LEGENDRE_LOG_ROOT. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 14 December 2007 ! ! Author: ! ! Federico Paris, Jose Canas ! FORTRAN90 version by John Burkardt ! ! Reference: ! ! Federico Paris, Jose Canas, ! Boundary Element Method: Fundamentals and Applications, ! Oxford, 1997, ! ISBN: 0-19-856543-7 ! LC: TA347.B69.P34. ! ! Parameters: ! ! Input, integer N, the degree of the polynomial. ! ! Input, real ( kind = 8 ) COEF(N+1), the polynomial coefficients. ! ! Input, real ( kind = 8 ) X, the evaluation point. ! ! Output, real ( kind = 8 ) V, the value of the polynomial at X. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) coef(n+1) integer ( kind = 4 ) k real ( kind = 8 ) value real ( kind = 8 ) x value = coef(n+1) do k = n, 1, -1 value = value * x + coef(k) end do return end subroutine legendre_sqrtx_01_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_SQRTX_01_SET sets a Gauss-Legendre rule for SQRT(X) * F(X) on [0,1]. ! ! Discussion: ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = sqrt ( x ). ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) SQRT ( X ) * F(X) dX = ! Integral ( 0 <= Y <= 1 ) 2 * Y**2 * F(Y**2) dY. ! (using Y = SQRT(X) ) ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 23 January 2001 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Daniel Zwillinger, editor, ! CRC Standard Mathematical Tables and Formulae, ! 30th Edition, ! CRC Press, 1996, ! ISBN: 0-8493-2479-3, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order integer ( kind = 4 ) order2 real ( kind = 8 ) xtab(order) real ( kind = 8 ) xtab2(2*order+1) real ( kind = 8 ) weight(order) real ( kind = 8 ) weight2(2*order+1) order2 = 2 * order + 1 call legendre_set ( order2, xtab2, weight2 ) xtab(1:order) = xtab2(order+2:2*order+1)**2 weight(1:order) = 2.0D+00 * weight2(order+2:2*order+1) * xtab(1:order) return end subroutine legendre_sqrtx2_01_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_SQRTX2_01_SET: Gauss-Legendre rule for F(X) / SQRT(X) on [0,1]. ! ! Discussion: ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = 1 / sqrt ( x ). ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) F(X) / SQRT ( X ) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 21 January 2001 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Daniel Zwillinger, editor, ! CRC Standard Mathematical Tables and Formulae, ! 30th Edition, ! CRC Press, 1996, ! ISBN: 0-8493-2479-3, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order integer ( kind = 4 ) order2 real ( kind = 8 ) xtab(order) real ( kind = 8 ) xtab2(2*order+1) real ( kind = 8 ) weight(order) real ( kind = 8 ) weight2(2*order+1) order2 = 2 * order + 1 call legendre_set ( order2, xtab2, weight2 ) xtab(1:order) = xtab2(order+2:2*order+1)**2 weight(1:order) = 2.0D+00 * weight2(order+2:2*order+1) return end subroutine legendre_x0_01_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_X0_01_SET sets a Gauss-Legendre rule for F(X) on [0,1]. ! ! Discussion: ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = 1.0. ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 November 2000 ! ! 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. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1 and 8. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order == 1 ) then xtab(1) = 0.5D+00 weight(1) = 1.0D+00 else if ( order == 2 ) then xtab(1) = 0.2113248654D+00 xtab(2) = 0.7886751346D+00 weight(1) = 0.5D+00 weight(2) = 0.5D+00 else if ( order == 3 ) then xtab(1) = 0.1127016654D+00 xtab(2) = 0.5000000000D+00 xtab(3) = 0.8872983346D+00 weight(1) = 5.0D+00 / 18.0D+00 weight(2) = 8.0D+00 / 18.0D+00 weight(3) = 5.0D+00 / 18.0D+00 else if ( order == 4 ) then xtab(1) = 0.0694318442D+00 xtab(2) = 0.3300094782D+00 xtab(3) = 0.6699905218D+00 xtab(4) = 0.9305681558D+00 weight(1) = 0.1739274226D+00 weight(2) = 0.3260725774D+00 weight(3) = 0.3260725774D+00 weight(4) = 0.1739274226D+00 else if ( order == 5 ) then xtab(1) = 0.0469100770D+00 xtab(2) = 0.2307653449D+00 xtab(3) = 0.5000000000D+00 xtab(4) = 0.7692346551D+00 xtab(5) = 0.9530899230D+00 weight(1) = 0.1184634425D+00 weight(2) = 0.2393143352D+00 weight(3) = 0.2844444444D+00 weight(4) = 0.2393143352D+00 weight(5) = 0.1184634425D+00 else if ( order == 6 ) then xtab(1) = 0.0337652429D+00 xtab(2) = 0.1693953068D+00 xtab(3) = 0.3806904070D+00 xtab(4) = 0.6193095930D+00 xtab(5) = 0.8306046932D+00 xtab(6) = 0.9662347571D+00 weight(1) = 0.0856622462D+00 weight(2) = 0.1803807865D+00 weight(3) = 0.2339569673D+00 weight(4) = 0.2339569673D+00 weight(5) = 0.1803807865D+00 weight(6) = 0.0856622462D+00 else if ( order == 7 ) then xtab(1) = 0.0254460438D+00 xtab(2) = 0.1292344072D+00 xtab(3) = 0.2970774243D+00 xtab(4) = 0.5000000000D+00 xtab(5) = 0.7029225757D+00 xtab(6) = 0.8707655928D+00 xtab(7) = 0.9745539562D+00 weight(1) = 0.0647424831D+00 weight(2) = 0.1398526957D+00 weight(3) = 0.1909150253D+00 weight(4) = 0.2089795918D+00 weight(5) = 0.1909150253D+00 weight(6) = 0.1398526957D+00 weight(7) = 0.0647424831D+00 else if ( order == 8 ) then xtab(1) = 0.0198550718D+00 xtab(2) = 0.1016667613D+00 xtab(3) = 0.2372337950D+00 xtab(4) = 0.4082826788D+00 xtab(5) = 0.5917173212D+00 xtab(6) = 0.7627662050D+00 xtab(7) = 0.8983332387D+00 xtab(8) = 0.9801449282D+00 weight(1) = 0.0506142681D+00 weight(2) = 0.1111905172D+00 weight(3) = 0.1568533229D+00 weight(4) = 0.1813418917D+00 weight(5) = 0.1813418917D+00 weight(6) = 0.1568533229D+00 weight(7) = 0.1111905172D+00 weight(8) = 0.0506142681D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LEGENDRE_X0_01_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order stop end if return end subroutine legendre_x1_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_X1_SET sets a Gauss-Legendre rule for ( 1 + X ) * F(X) on [-1,1]. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1 + x. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) ( 1 + X ) * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 December 2000 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1 and 9. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order == 1 ) then xtab(1) = 0.333333333333333333333333333333D+00 weight(1) = 2.0D+00 else if ( order == 2 ) then xtab(1) = -0.289897948556635619639456814941D+00 xtab(2) = 0.689897948556635619639456814941D+00 weight(1) = 0.727834473024091322422523991699D+00 weight(2) = 1.27216552697590867757747600830D+00 else if ( order == 3 ) then xtab(1) = -0.575318923521694112050483779752D+00 xtab(2) = 0.181066271118530578270147495862D+00 xtab(3) = 0.822824080974592105208907712461D+00 weight(1) = 0.279307919605816490135525088716D+00 weight(2) = 0.916964425438344986775682378225D+00 weight(3) = 0.803727654955838523088792533058D+00 else if ( order == 4 ) then xtab(1) = -0.720480271312438895695825837750D+00 xtab(2) = -0.167180864737833640113395337326D+00 xtab(3) = 0.446313972723752344639908004629D+00 xtab(4) = 0.885791607770964635613757614892D+00 weight(1) = 0.124723883800032328695500588386D+00 weight(2) = 0.519390190432929763305824811559D+00 weight(3) = 0.813858272041085443165617903743D+00 weight(4) = 0.542027653725952464833056696312D+00 else if ( order == 5 ) then xtab(1) = -0.802929828402347147753002204224D+00 xtab(2) = -0.390928546707272189029229647442D+00 xtab(3) = 0.124050379505227711989974959990D+00 xtab(4) = 0.603973164252783654928415726409D+00 xtab(5) = 0.920380285897062515318386619813D+00 weight(1) = 0.0629916580867691047411692662740D+00 weight(2) = 0.295635480290466681402532877367D+00 weight(3) = 0.585547948338679234792151477424D+00 weight(4) = 0.668698552377478261966702492391D+00 weight(5) = 0.387126360906606717097443886545D+00 else if ( order == 6 ) then xtab(1) = -0.853891342639482229703747931639D+00 xtab(2) = -0.538467724060109001833766720231D+00 xtab(3) = -0.117343037543100264162786683611D+00 xtab(4) = 0.326030619437691401805894055838D+00 xtab(5) = 0.703842800663031416300046295008D+00 xtab(6) = 0.941367145680430216055899446174D+00 weight(1) = 0.0349532072544381270240692132496D+00 weight(2) = 0.175820662202035902032706497222D+00 weight(3) = 0.394644603562621056482338042193D+00 weight(4) = 0.563170215152795712476307356284D+00 weight(5) = 0.542169988926074467362761586552D+00 weight(6) = 0.289241322902034734621817304499D+00 else if ( order == 7 ) then xtab(1) = -0.887474878926155707068695617935D+00 xtab(2) = -0.639518616526215270024840114382D+00 xtab(3) = -0.294750565773660725252184459658D+00 xtab(4) = 0.0943072526611107660028971153047D+00 xtab(5) = 0.468420354430821063046421216613D+00 xtab(6) = 0.770641893678191536180719525865D+00 xtab(7) = 0.955041227122575003782349000858D+00 weight(1) = 0.0208574488112296163587654972151D+00 weight(2) = 0.109633426887493901777324193433D+00 weight(3) = 0.265538785861965879934591955055D+00 weight(4) = 0.428500262783494679963649011999D+00 weight(5) = 0.509563589198353307674937943100D+00 weight(6) = 0.442037032763498409684482945478D+00 weight(7) = 0.223869453693964204606248453720D+00 else if ( order == 8 ) then xtab(1) = -0.910732089420060298533757956283D+00 xtab(2) = -0.711267485915708857029562959544D+00 xtab(3) = -0.426350485711138962102627520502D+00 xtab(4) = -0.0903733696068532980645444599064D+00 xtab(5) = 0.256135670833455395138292079035D+00 xtab(6) = 0.571383041208738483284917464837D+00 xtab(7) = 0.817352784200412087992517083851D+00 xtab(8) = 0.964440169705273096373589797925D+00 weight(1) = 0.0131807657689951954189692640444D+00 weight(2) = 0.0713716106239448335742111888042D+00 weight(3) = 0.181757278018795592332221684383D+00 weight(4) = 0.316798397969276640481632757440D+00 weight(5) = 0.424189437743720042818124385645D+00 weight(6) = 0.450023197883549464687088394417D+00 weight(7) = 0.364476094545494505382889847132D+00 weight(8) = 0.178203217446223725304862478136D+00 else if ( order == 9 ) then xtab(1) = -0.927484374233581078117671398464D+00 xtab(2) = -0.763842042420002599615429776011D+00 xtab(3) = -0.525646030370079229365386614293D+00 xtab(4) = -0.236234469390588049278459503207D+00 xtab(5) = 0.0760591978379781302337137826389D+00 xtab(6) = 0.380664840144724365880759065541D+00 xtab(7) = 0.647766687674009436273648507855D+00 xtab(8) = 0.851225220581607910728163628088D+00 xtab(9) = 0.971175180702246902734346518378D+00 weight(1) = 0.00872338834309252349019620448007D+00 weight(2) = 0.0482400171391415162069086091476D+00 weight(3) = 0.127219285964216005046760427743D+00 weight(4) = 0.233604781180660442262926091607D+00 weight(5) = 0.337433287379681397577000079834D+00 weight(6) = 0.401235236773473158616600898930D+00 weight(7) = 0.394134968689382820640692081477D+00 weight(8) = 0.304297020437232650320317215016D+00 weight(9) = 0.145112014093119485838598391765D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LEGENDRE_X1_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal input value of ORDER = ', order stop end if return end subroutine legendre_x1_01_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_X1_01_SET sets a Gauss-Legendre rule for X * F(X) on [0,1]. ! ! Discussion: ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = x. ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) X * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 10 May 2006 ! ! 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. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1 and 8. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order == 1 ) then xtab(1) = 0.6666666667D+00 weight(1) = 0.5000000000D+00 else if ( order == 2 ) then xtab(1) = 0.3550510257D+00 xtab(2) = 0.8449489743D+00 weight(1) = 0.1819586183D+00 weight(2) = 0.3180413817D+00 else if ( order == 3 ) then xtab(1) = 0.2123405382D+00 xtab(2) = 0.5905331356D+00 xtab(3) = 0.9114120405D+00 weight(1) = 0.0698269799D+00 weight(2) = 0.2292411064D+00 weight(3) = 0.2009319137D+00 else if ( order == 4 ) then xtab(1) = 0.1397598643D+00 xtab(2) = 0.4164095676D+00 xtab(3) = 0.7231569864D+00 xtab(4) = 0.9428958039D+00 weight(1) = 0.0311809710D+00 weight(2) = 0.1298475476D+00 weight(3) = 0.2034645680D+00 weight(4) = 0.1355069134D+00 else if ( order == 5 ) then xtab(1) = 0.0985350858D+00 xtab(2) = 0.3045357266D+00 xtab(3) = 0.5620251898D+00 xtab(4) = 0.8019865821D+00 xtab(5) = 0.9601901429D+00 weight(1) = 0.0157479145D+00 weight(2) = 0.0739088701D+00 weight(3) = 0.1463869871D+00 weight(4) = 0.1671746381D+00 weight(5) = 0.0967815902D+00 else if ( order == 6 ) then xtab(1) = 0.0730543287D+00 xtab(2) = 0.2307661380D+00 xtab(3) = 0.4413284812D+00 xtab(4) = 0.6630153097D+00 xtab(5) = 0.8519214003D+00 xtab(6) = 0.9706835728D+00 weight(1) = 0.0087383108D+00 weight(2) = 0.0439551656D+00 weight(3) = 0.0986611509D+00 weight(4) = 0.1407925538D+00 weight(5) = 0.1355424972D+00 weight(6) = 0.0723103307D+00 else if ( order == 7 ) then xtab(1) = 0.0562625605D+00 xtab(2) = 0.1802406917D+00 xtab(3) = 0.3526247171D+00 xtab(4) = 0.5471536263D+00 xtab(5) = 0.7342101772D+00 xtab(6) = 0.8853209468D+00 xtab(7) = 0.9775206136D+00 weight(1) = 0.0052143622D+00 weight(2) = 0.0274083567D+00 weight(3) = 0.0663846965D+00 weight(4) = 0.1071250657D+00 weight(5) = 0.1273908973D+00 weight(6) = 0.1105092582D+00 weight(7) = 0.0559673634D+00 else if ( order == 8 ) then xtab(1) = 0.0446339553D+00 xtab(2) = 0.1443662570D+00 xtab(3) = 0.2868247571D+00 xtab(4) = 0.4548133152D+00 xtab(5) = 0.6280678354D+00 xtab(6) = 0.7856915206D+00 xtab(7) = 0.9086763921D+00 xtab(8) = 0.9822200849D+00 weight(1) = 0.0032951914D+00 weight(2) = 0.0178429027D+00 weight(3) = 0.0454393195D+00 weight(4) = 0.0791995995D+00 weight(5) = 0.1060473594D+00 weight(6) = 0.1125057995D+00 weight(7) = 0.0911190236D+00 weight(8) = 0.0445508044D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LEGENDRE_X1_01_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order stop end if return end subroutine legendre_x2_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_X2_SET sets a Gauss-Legendre rule for ( 1 + X )**2 * F(X) on [-1,1]. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = ( 1 + x )**2. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) ( 1 + X )**2 * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 December 2000 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1 and 9. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order == 1 ) then xtab(1) = 0.5D+00 weight(1) = 2.66666666666666666666666666666D+00 else if ( order == 2 ) then xtab(1) = -0.0883036880224505775998524725910D+00 xtab(2) = 0.754970354689117244266519139258D+00 weight(1) = 0.806287056638603444666851075928D+00 weight(2) = 1.86037961002806322199981559074D+00 else if ( order == 3 ) then xtab(1) = -0.410004419776996766244796955168D+00 xtab(2) = 0.305992467923296230556472913192D+00 xtab(3) = 0.854011951853700535688324041976D+00 weight(1) = 0.239605624068645584091811926047D+00 weight(2) = 1.16997015407892817602809616291D+00 weight(3) = 1.25709088851909290654675857771D+00 else if ( order == 4 ) then xtab(1) = -0.591702835793545726606755921586D+00 xtab(2) = -0.0340945902087350046811467387661D+00 xtab(3) = 0.522798524896275389882037174551D+00 xtab(4) = 0.902998901106005341405865485802D+00 weight(1) = 0.0828179259993445222751812523731D+00 weight(2) = 0.549071097383384602539010760334D+00 weight(3) = 1.14767031839371367238662411421D+00 weight(4) = 0.887107324890223869465850539752D+00 else if ( order == 5 ) then xtab(1) = -0.702108425894032836232448374820D+00 xtab(2) = -0.268666945261773544694327777841D+00 xtab(3) = 0.220227225868961343518209179230D+00 xtab(4) = 0.653039358456608553790815164028D+00 xtab(5) = 0.930842120163569816951085142737D+00 weight(1) = 0.0329106016247920636689299329544D+00 weight(2) = 0.256444805783695354037991444453D+00 weight(3) = 0.713601289772720001490035944563D+00 weight(4) = 1.00959169519929190423066348132D+00 weight(5) = 0.654118274286167343239045863379D+00 else if ( order == 6 ) then xtab(1) = -0.773611232355123732602532012021D+00 xtab(2) = -0.431362254623427837535325249187D+00 xtab(3) = -0.0180728263295041680220798103354D+00 xtab(4) = 0.395126163954217534500188844163D+00 xtab(5) = 0.736872116684029732026178298518D+00 xtab(6) = 0.948190889812665614490712786006D+00 weight(1) = 0.0146486064549543818622276447204D+00 weight(2) = 0.125762377479560410622810097040D+00 weight(3) = 0.410316569036929681761034600615D+00 weight(4) = 0.756617493988329628546336413760D+00 weight(5) = 0.859011997894245060846045458784D+00 weight(6) = 0.500309621812647503028212451747D+00 else if ( order == 7 ) then xtab(1) = -0.822366333126005527278634734418D+00 xtab(2) = -0.547034493182875002223997992852D+00 xtab(3) = -0.200043026557985860387937545780D+00 xtab(4) = 0.171995710805880507163425502299D+00 xtab(5) = 0.518891747903884926692601716998D+00 xtab(6) = 0.793821941703901970495546427988D+00 xtab(7) = 0.959734452453198985538996625765D+00 weight(1) = 0.00714150426951365443207221475404D+00 weight(2) = 0.0653034050584375560578544725498D+00 weight(3) = 0.235377690316228918725962815880D+00 weight(4) = 0.505171029671130381676271523850D+00 weight(5) = 0.733870426238362032891332767175D+00 weight(6) = 0.725590596901489156295739839779D+00 weight(7) = 0.394212014211504966587433032679D+00 else if ( order == 8 ) then xtab(1) = -0.857017929919813794402037235698D+00 xtab(2) = -0.631543407166567521509503573952D+00 xtab(3) = -0.339104543648722903660229021109D+00 xtab(4) = -0.0111941563689783438801237300122D+00 xtab(5) = 0.316696017045595559454075475675D+00 xtab(6) = 0.609049663022520165351466780939D+00 xtab(7) = 0.834198765028697794599267293239D+00 xtab(8) = 0.967804480896157932935972899807D+00 weight(1) = 0.00374814227227757804631954025851D+00 weight(2) = 0.0357961737041152639660521680263D+00 weight(3) = 0.137974910241879862433949246199D+00 weight(4) = 0.326515411108352185491692769217D+00 weight(5) = 0.547577467373226177976217604887D+00 weight(6) = 0.682278153375510121675529810121D+00 weight(7) = 0.614544746137780998436053880546D+00 weight(8) = 0.318231662453524478640851647411D+00 else if ( order == 9 ) then xtab(1) = -0.882491728426548422828684254270D+00 xtab(2) = -0.694873684026474640346360850039D+00 xtab(3) = -0.446537143480670863635920316400D+00 xtab(4) = -0.159388112702326252531544826624D+00 xtab(5) = 0.141092709224374414981503995427D+00 xtab(6) = 0.428217823321559204544020866175D+00 xtab(7) = 0.676480966471850715860378175342D+00 xtab(8) = 0.863830940812464825046988286026D+00 xtab(9) = 0.973668228805771018909618924364D+00 weight(1) = 0.00209009877215570354392734918986D+00 weight(2) = 0.0205951891648697848186537272448D+00 weight(3) = 0.0832489326348178964194106978875D+00 weight(4) = 0.210746247220398685903797568021D+00 weight(5) = 0.388325022916052063676224499399D+00 weight(6) = 0.554275165518437673725822282791D+00 weight(7) = 0.621388553284444032628761363828D+00 weight(8) = 0.523916296267173054255512857631D+00 weight(9) = 0.262081160888317771694556320674D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LEGENDRE_X2_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal input value of ORDER = ', order stop end if return end subroutine legendre_x2_01_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LEGENDRE_X2_01_SET sets a Gauss-Legendre rule for X**2 * F(X) on [0,1]. ! ! Discussion: ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = x**2. ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) X*X * F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 18 November 2000 ! ! 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. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1 and 8. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order == 1 ) then xtab(1) = 0.75D+00 weight(1) = 1.0D+00 / 3.0D+00 else if ( order == 2 ) then xtab(1) = 0.4558481560D+00 xtab(2) = 0.8774851773D+00 weight(1) = 0.1007858821D+00 weight(2) = 0.2325474513D+00 else if ( order == 3 ) then xtab(1) = 0.2949977901D+00 xtab(2) = 0.6529962340D+00 xtab(3) = 0.9270059759D+00 weight(1) = 0.0299507030D+00 weight(2) = 0.1462462693D+00 weight(3) = 0.1571363611D+00 else if ( order == 4 ) then xtab(1) = 0.2041485821D+00 xtab(2) = 0.4829527049D+00 xtab(3) = 0.7613992624D+00 xtab(4) = 0.9514994506D+00 weight(1) = 0.0103522408D+00 weight(2) = 0.0686338872D+00 weight(3) = 0.1434587898D+00 weight(4) = 0.1108884156D+00 else if ( order == 5 ) then xtab(1) = 0.1489457871D+00 xtab(2) = 0.3656665274D+00 xtab(3) = 0.6101136129D+00 xtab(4) = 0.8265196792D+00 xtab(5) = 0.9654210601D+00 weight(1) = 0.0041138252D+00 weight(2) = 0.0320556007D+00 weight(3) = 0.0892001612D+00 weight(4) = 0.1261989619D+00 weight(5) = 0.0817647843D+00 else if ( order == 6 ) then xtab(1) = 0.1131943838D+00 xtab(2) = 0.2843188727D+00 xtab(3) = 0.4909635868D+00 xtab(4) = 0.6975630820D+00 xtab(5) = 0.8684360583D+00 xtab(6) = 0.9740954449D+00 weight(1) = 0.0018310758D+00 weight(2) = 0.0157202972D+00 weight(3) = 0.0512895711D+00 weight(4) = 0.0945771867D+00 weight(5) = 0.1073764997D+00 weight(6) = 0.0625387027D+00 else if ( order == 7 ) then xtab(1) = 0.0888168334D+00 xtab(2) = 0.2264827534D+00 xtab(3) = 0.3999784867D+00 xtab(4) = 0.5859978554D+00 xtab(5) = 0.7594458740D+00 xtab(6) = 0.8969109709D+00 xtab(7) = 0.9798672262D+00 weight(1) = 0.0008926880D+00 weight(2) = 0.0081629256D+00 weight(3) = 0.0294222113D+00 weight(4) = 0.0631463787D+00 weight(5) = 0.0917338033D+00 weight(6) = 0.0906988246D+00 weight(7) = 0.0492765018D+00 else if ( order == 8 ) then xtab(1) = 0.0714910350D+00 xtab(2) = 0.1842282964D+00 xtab(3) = 0.3304477282D+00 xtab(4) = 0.4944029218D+00 xtab(5) = 0.6583480085D+00 xtab(6) = 0.8045248315D+00 xtab(7) = 0.9170993825D+00 xtab(8) = 0.9839022404D+00 weight(1) = 0.0004685178D+00 weight(2) = 0.0044745217D+00 weight(3) = 0.0172468638D+00 weight(4) = 0.0408144264D+00 weight(5) = 0.0684471834D+00 weight(6) = 0.0852847692D+00 weight(7) = 0.0768180933D+00 weight(8) = 0.0397789578D+00 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LEGENDRE_X2_01_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order stop end if return end subroutine lobatto_compute ( n, x, w ) !*****************************************************************************80 ! !! LOBATTO_COMPUTE computes a Lobatto quadrature rule. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1.0. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= N ) WEIGHT(I) * F ( XTAB(I) ) ! ! The quadrature rule will integrate exactly all polynomials up to ! X**(2*N-3). ! ! The Lobatto rule is distinguished by the fact that both endpoints ! (-1 and 1) are always abscissas of the rule. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 04 February 2007 ! ! Author: ! ! Original MATLAB version by Greg von Winckel. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Milton Abramowitz, Irene Stegun, ! Handbook of Mathematical Functions, ! National Bureau of Standards, 1964, ! ISBN: 0-486-61272-4, ! LC: QA47.A34. ! ! Claudio Canuto, Yousuff Hussaini, Alfio Quarteroni, Thomas Zang, ! Spectral Methods in Fluid Dynamics, ! Springer, 1993, ! ISNB13: 978-3540522058, ! LC: QA377.S676. ! ! 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, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. N must be ! at least 2. ! ! Output, real ( kind = 8 ) X(N), W(N), the abscissas and weights. ! implicit none integer ( kind = 4 ) n integer ( kind = 4 ) i integer ( kind = 4 ) j real ( kind = 8 ) p(n,n) real ( kind = 8 ), parameter :: pi = 3.141592653589793D+00 real ( kind = 8 ) tolerance real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) real ( kind = 8 ) xold(n) if ( n < 2 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LOBATTO_COMPUTE - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', n write ( *, '(a)' ) ' ORDER must be at least 2.' stop end if tolerance = 100.0D+00 * epsilon ( tolerance ) ! ! Initial estimate for the abscissas is the Chebyshev-Gauss-Lobatto nodes. ! do i = 1, n x(i) = cos ( pi * real ( i - 1, kind = 8 ) / real ( n - 1, kind = 8 ) ) end do xold(1:n) = 2.0D+00 do while ( tolerance < maxval ( abs ( x(1:n) - xold(1:n) ) ) ) xold(1:n) = x(1:n) p(1:n,1) = 1.0D+00 p(1:n,2) = x(1:n) do j = 2, n-1 p(1:n,j+1) = ( real ( 2 * j - 1, kind = 8 ) * x(1:n) * p(1:n,j) & + real ( - j + 1, kind = 8 ) * p(1:n,j-1) ) & / real ( j, kind = 8 ) end do x(1:n) = xold(1:n) - ( x(1:n) * p(1:n,n) - p(1:n,n-1) ) & / ( real ( n, kind = 8 ) * p(1:n,n) ) end do x(1:n) = x(n:1:-1) w(1:n) = 2.0D+00 / ( real ( ( n - 1 ) * n, kind = 8 ) * p(1:n,n)**2 ) return end subroutine lobatto_set ( order, xtab, weight ) !*****************************************************************************80 ! !! LOBATTO_SET sets abscissas and weights for Lobatto quadrature. ! ! Discussion: ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1.0. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) ) ! ! The quadrature rule will integrate exactly all polynomials up to ! X**(2*ORDER-3). ! ! The Lobatto rule is distinguished by the fact that both endpoints ! (-1 and 1) are always abscissas of the rule. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 20 September 1998 ! ! 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. ! ! 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, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 2 and 20. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! The weights are positive, symmetric and should sum to 2. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) xtab(order) real ( kind = 8 ) weight(order) if ( order < 2 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LOBATTO_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are between 2 and 20.' stop else if ( order == 2 ) then xtab(1) = - 1.0D+00 xtab(2) = 1.0D+00 weight(1) = 1.0D+00 weight(2) = 1.0D+00 else if ( order == 3 ) then xtab(1) = - 1.0D+00 xtab(2) = 0.0D+00 xtab(3) = 1.0D+00 weight(1) = 1.0D+00 / 3.0D+00 weight(2) = 4.0D+00 / 3.0D+00 weight(3) = 1.0D+00 / 3.0D+00 else if ( order == 4 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.447213595499957939281834733746D+00 xtab(3) = 0.447213595499957939281834733746D+00 xtab(4) = 1.0D+00 weight(1) = 1.0D+00 / 6.0D+00 weight(2) = 5.0D+00 / 6.0D+00 weight(3) = 5.0D+00 / 6.0D+00 weight(4) = 1.0D+00 / 6.0D+00 else if ( order == 5 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.654653670707977143798292456247D+00 xtab(3) = 0.0D+00 xtab(4) = 0.654653670707977143798292456247D+00 xtab(5) = 1.0D+00 weight(1) = 9.0D+00 / 90.0D+00 weight(2) = 49.0D+00 / 90.0D+00 weight(3) = 64.0D+00 / 90.0D+00 weight(4) = 49.0D+00 / 90.0D+00 weight(5) = 9.0D+00 / 90.0D+00 else if ( order == 6 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.765055323929464692851002973959D+00 xtab(3) = - 0.285231516480645096314150994041D+00 xtab(4) = 0.285231516480645096314150994041D+00 xtab(5) = 0.765055323929464692851002973959D+00 xtab(6) = 1.0D+00 weight(1) = 0.066666666666666666666666666667D+00 weight(2) = 0.378474956297846980316612808212D+00 weight(3) = 0.554858377035486353016720525121D+00 weight(4) = 0.554858377035486353016720525121D+00 weight(5) = 0.378474956297846980316612808212D+00 weight(6) = 0.066666666666666666666666666667D+00 else if ( order == 7 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.830223896278566929872032213967D+00 xtab(3) = - 0.468848793470714213803771881909D+00 xtab(4) = 0.0D+00 xtab(5) = 0.468848793470714213803771881909D+00 xtab(6) = 0.830223896278566929872032213967D+00 xtab(7) = 1.0D+00 weight(1) = 0.476190476190476190476190476190D-01 weight(2) = 0.276826047361565948010700406290D+00 weight(3) = 0.431745381209862623417871022281D+00 weight(4) = 0.487619047619047619047619047619D+00 weight(5) = 0.431745381209862623417871022281D+00 weight(6) = 0.276826047361565948010700406290D+00 weight(7) = 0.476190476190476190476190476190D-01 else if ( order == 8 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.871740148509606615337445761221D+00 xtab(3) = - 0.591700181433142302144510731398D+00 xtab(4) = - 0.209299217902478868768657260345D+00 xtab(5) = 0.209299217902478868768657260345D+00 xtab(6) = 0.591700181433142302144510731398D+00 xtab(7) = 0.871740148509606615337445761221D+00 xtab(8) = 1.0D+00 weight(1) = 0.357142857142857142857142857143D-01 weight(2) = 0.210704227143506039382991065776D+00 weight(3) = 0.341122692483504364764240677108D+00 weight(4) = 0.412458794658703881567052971402D+00 weight(5) = 0.412458794658703881567052971402D+00 weight(6) = 0.341122692483504364764240677108D+00 weight(7) = 0.210704227143506039382991065776D+00 weight(8) = 0.357142857142857142857142857143D-01 else if ( order == 9 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.899757995411460157312345244418D+00 xtab(3) = - 0.677186279510737753445885427091D+00 xtab(4) = - 0.363117463826178158710752068709D+00 xtab(5) = 0.0D+00 xtab(6) = 0.363117463826178158710752068709D+00 xtab(7) = 0.677186279510737753445885427091D+00 xtab(8) = 0.899757995411460157312345244418D+00 xtab(9) = 1.0D+00 weight(1) = 0.277777777777777777777777777778D-01 weight(2) = 0.165495361560805525046339720029D+00 weight(3) = 0.274538712500161735280705618579D+00 weight(4) = 0.346428510973046345115131532140D+00 weight(5) = 0.371519274376417233560090702948D+00 weight(6) = 0.346428510973046345115131532140D+00 weight(7) = 0.274538712500161735280705618579D+00 weight(8) = 0.165495361560805525046339720029D+00 weight(9) = 0.277777777777777777777777777778D-01 else if ( order == 10 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.919533908166458813828932660822D+00 xtab(3) = - 0.738773865105505075003106174860D+00 xtab(4) = - 0.477924949810444495661175092731D+00 xtab(5) = - 0.165278957666387024626219765958D+00 xtab(6) = 0.165278957666387024626219765958D+00 xtab(7) = 0.477924949810444495661175092731D+00 xtab(8) = 0.738773865105505075003106174860D+00 xtab(9) = 0.919533908166458813828932660822D+00 xtab(10) = 1.0D+00 weight(1) = 0.222222222222222222222222222222D-01 weight(2) = 0.133305990851070111126227170755D+00 weight(3) = 0.224889342063126452119457821731D+00 weight(4) = 0.292042683679683757875582257374D+00 weight(5) = 0.327539761183897456656510527917D+00 weight(6) = 0.327539761183897456656510527917D+00 weight(7) = 0.292042683679683757875582257374D+00 weight(8) = 0.224889342063126452119457821731D+00 weight(9) = 0.133305990851070111126227170755D+00 weight(10) = 0.222222222222222222222222222222D-01 else if ( order == 11 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.934001430408059134332274136099D+00 xtab(3) = - 0.784483473663144418622417816108D+00 xtab(4) = - 0.565235326996205006470963969478D+00 xtab(5) = - 0.295758135586939391431911515559D+00 xtab(6) = 0.0D+00 xtab(7) = 0.295758135586939391431911515559D+00 xtab(8) = 0.565235326996205006470963969478D+00 xtab(9) = 0.784483473663144418622417816108D+00 xtab(10) = 0.934001430408059134332274136099D+00 xtab(11) = 1.0D+00 weight(1) = 0.181818181818181818181818181818D-01 weight(2) = 0.109612273266994864461403449580D+00 weight(3) = 0.187169881780305204108141521899D+00 weight(4) = 0.248048104264028314040084866422D+00 weight(5) = 0.286879124779008088679222403332D+00 weight(6) = 0.300217595455690693785931881170D+00 weight(7) = 0.286879124779008088679222403332D+00 weight(8) = 0.248048104264028314040084866422D+00 weight(9) = 0.187169881780305204108141521899D+00 weight(10) = 0.109612273266994864461403449580D+00 weight(11) = 0.181818181818181818181818181818D-01 else if ( order == 12 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.944899272222882223407580138303D+00 xtab(3) = - 0.819279321644006678348641581717D+00 xtab(4) = - 0.632876153031869677662404854444D+00 xtab(5) = - 0.399530940965348932264349791567D+00 xtab(6) = - 0.136552932854927554864061855740D+00 xtab(7) = 0.136552932854927554864061855740D+00 xtab(8) = 0.399530940965348932264349791567D+00 xtab(9) = 0.632876153031869677662404854444D+00 xtab(10) = 0.819279321644006678348641581717D+00 xtab(11) = 0.944899272222882223407580138303D+00 xtab(12) = 1.0D+00 weight(1) = 0.151515151515151515151515151515D-01 weight(2) = 0.916845174131961306683425941341D-01 weight(3) = 0.157974705564370115164671062700D+00 weight(4) = 0.212508417761021145358302077367D+00 weight(5) = 0.251275603199201280293244412148D+00 weight(6) = 0.271405240910696177000288338500D+00 weight(7) = 0.271405240910696177000288338500D+00 weight(8) = 0.251275603199201280293244412148D+00 weight(9) = 0.212508417761021145358302077367D+00 weight(10) = 0.157974705564370115164671062700D+00 weight(11) = 0.916845174131961306683425941341D-01 weight(12) = 0.151515151515151515151515151515D-01 else if ( order == 13 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.953309846642163911896905464755D+00 xtab(3) = - 0.846347564651872316865925607099D+00 xtab(4) = - 0.686188469081757426072759039566D+00 xtab(5) = - 0.482909821091336201746937233637D+00 xtab(6) = - 0.249286930106239992568673700374D+00 xtab(7) = 0.0D+00 xtab(8) = 0.249286930106239992568673700374D+00 xtab(9) = 0.482909821091336201746937233637D+00 xtab(10) = 0.686188469081757426072759039566D+00 xtab(11) = 0.846347564651872316865925607099D+00 xtab(12) = 0.953309846642163911896905464755D+00 xtab(13) = 1.0D+00 weight(1) = 0.128205128205128205128205128205D-01 weight(2) = 0.778016867468189277935889883331D-01 weight(3) = 0.134981926689608349119914762589D+00 weight(4) = 0.183646865203550092007494258747D+00 weight(5) = 0.220767793566110086085534008379D+00 weight(6) = 0.244015790306676356458578148360D+00 weight(7) = 0.251930849333446736044138641541D+00 weight(8) = 0.244015790306676356458578148360D+00 weight(9) = 0.220767793566110086085534008379D+00 weight(10) = 0.183646865203550092007494258747D+00 weight(11) = 0.134981926689608349119914762589D+00 weight(12) = 0.778016867468189277935889883331D-01 weight(13) = 0.128205128205128205128205128205D-01 else if ( order == 14 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.959935045267260901355100162015D+00 xtab(3) = - 0.867801053830347251000220202908D+00 xtab(4) = - 0.728868599091326140584672400521D+00 xtab(5) = - 0.550639402928647055316622705859D+00 xtab(6) = - 0.342724013342712845043903403642D+00 xtab(7) = - 0.116331868883703867658776709736D+00 xtab(8) = 0.116331868883703867658776709736D+00 xtab(9) = 0.342724013342712845043903403642D+00 xtab(10) = 0.550639402928647055316622705859D+00 xtab(11) = 0.728868599091326140584672400521D+00 xtab(12) = 0.867801053830347251000220202908D+00 xtab(13) = 0.959935045267260901355100162015D+00 xtab(14) = 1.0D+00 weight(1) = 0.109890109890109890109890109890D-01 weight(2) = 0.668372844976812846340706607461D-01 weight(3) = 0.116586655898711651540996670655D+00 weight(4) = 0.160021851762952142412820997988D+00 weight(5) = 0.194826149373416118640331778376D+00 weight(6) = 0.219126253009770754871162523954D+00 weight(7) = 0.231612794468457058889628357293D+00 weight(8) = 0.231612794468457058889628357293D+00 weight(9) = 0.219126253009770754871162523954D+00 weight(10) = 0.194826149373416118640331778376D+00 weight(11) = 0.160021851762952142412820997988D+00 weight(12) = 0.116586655898711651540996670655D+00 weight(13) = 0.668372844976812846340706607461D-01 weight(14) = 0.109890109890109890109890109890D-01 else if ( order == 15 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.965245926503838572795851392070D+00 xtab(3) = - 0.885082044222976298825401631482D+00 xtab(4) = - 0.763519689951815200704118475976D+00 xtab(5) = - 0.606253205469845711123529938637D+00 xtab(6) = - 0.420638054713672480921896938739D+00 xtab(7) = - 0.215353955363794238225679446273D+00 xtab(8) = 0.0D+00 xtab(9) = 0.215353955363794238225679446273D+00 xtab(10) = 0.420638054713672480921896938739D+00 xtab(11) = 0.606253205469845711123529938637D+00 xtab(12) = 0.763519689951815200704118475976D+00 xtab(13) = 0.885082044222976298825401631482D+00 xtab(14) = 0.965245926503838572795851392070D+00 xtab(15) = 1.0D+00 weight(1) = 0.952380952380952380952380952381D-02 weight(2) = 0.580298930286012490968805840253D-01 weight(3) = 0.101660070325718067603666170789D+00 weight(4) = 0.140511699802428109460446805644D+00 weight(5) = 0.172789647253600949052077099408D+00 weight(6) = 0.196987235964613356092500346507D+00 weight(7) = 0.211973585926820920127430076977D+00 weight(8) = 0.217048116348815649514950214251D+00 weight(9) = 0.211973585926820920127430076977D+00 weight(10) = 0.196987235964613356092500346507D+00 weight(11) = 0.172789647253600949052077099408D+00 weight(12) = 0.140511699802428109460446805644D+00 weight(13) = 0.101660070325718067603666170789D+00 weight(14) = 0.580298930286012490968805840253D-01 weight(15) = 0.952380952380952380952380952381D-02 else if ( order == 16 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.969568046270217932952242738367D+00 xtab(3) = - 0.899200533093472092994628261520D+00 xtab(4) = - 0.792008291861815063931088270963D+00 xtab(5) = - 0.652388702882493089467883219641D+00 xtab(6) = - 0.486059421887137611781890785847D+00 xtab(7) = - 0.299830468900763208098353454722D+00 xtab(8) = - 0.101326273521949447843033005046D+00 xtab(9) = 0.101326273521949447843033005046D+00 xtab(10) = 0.299830468900763208098353454722D+00 xtab(11) = 0.486059421887137611781890785847D+00 xtab(12) = 0.652388702882493089467883219641D+00 xtab(13) = 0.792008291861815063931088270963D+00 xtab(14) = 0.899200533093472092994628261520D+00 xtab(15) = 0.969568046270217932952242738367D+00 xtab(16) = 1.0D+00 weight(1) = 0.833333333333333333333333333333D-02 weight(2) = 0.508503610059199054032449195655D-01 weight(3) = 0.893936973259308009910520801661D-01 weight(4) = 0.124255382132514098349536332657D+00 weight(5) = 0.154026980807164280815644940485D+00 weight(6) = 0.177491913391704125301075669528D+00 weight(7) = 0.193690023825203584316913598854D+00 weight(8) = 0.201958308178229871489199125411D+00 weight(9) = 0.201958308178229871489199125411D+00 weight(10) = 0.193690023825203584316913598854D+00 weight(11) = 0.177491913391704125301075669528D+00 weight(12) = 0.154026980807164280815644940485D+00 weight(13) = 0.124255382132514098349536332657D+00 weight(14) = 0.893936973259308009910520801661D-01 weight(15) = 0.508503610059199054032449195655D-01 weight(16) = 0.833333333333333333333333333333D-02 else if ( order == 17 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.973132176631418314156979501874D+00 xtab(3) = - 0.910879995915573595623802506398D+00 xtab(4) = - 0.815696251221770307106750553238D+00 xtab(5) = - 0.691028980627684705394919357372D+00 xtab(6) = - 0.541385399330101539123733407504D+00 xtab(7) = - 0.372174433565477041907234680735D+00 xtab(8) = - 0.189511973518317388304263014753D+00 xtab(9) = 0.0D+00 xtab(10) = 0.189511973518317388304263014753D+00 xtab(11) = 0.372174433565477041907234680735D+00 xtab(12) = 0.541385399330101539123733407504D+00 xtab(13) = 0.691028980627684705394919357372D+00 xtab(14) = 0.815696251221770307106750553238D+00 xtab(15) = 0.910879995915573595623802506398D+00 xtab(16) = 0.973132176631418314156979501874D+00 xtab(17) = 1.0D+00 weight(1) = 0.735294117647058823529411764706D-02 weight(2) = 0.449219405432542096474009546232D-01 weight(3) = 0.791982705036871191902644299528D-01 weight(4) = 0.110592909007028161375772705220D+00 weight(5) = 0.137987746201926559056201574954D+00 weight(6) = 0.160394661997621539516328365865D+00 weight(7) = 0.177004253515657870436945745363D+00 weight(8) = 0.187216339677619235892088482861D+00 weight(9) = 0.190661874753469433299407247028D+00 weight(10) = 0.187216339677619235892088482861D+00 weight(11) = 0.177004253515657870436945745363D+00 weight(12) = 0.160394661997621539516328365865D+00 weight(13) = 0.137987746201926559056201574954D+00 weight(14) = 0.110592909007028161375772705220D+00 weight(15) = 0.791982705036871191902644299528D-01 weight(16) = 0.449219405432542096474009546232D-01 weight(17) = 0.735294117647058823529411764706D-02 else if ( order == 18 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.976105557412198542864518924342D+00 xtab(3) = - 0.920649185347533873837854625431D+00 xtab(4) = - 0.835593535218090213713646362328D+00 xtab(5) = - 0.723679329283242681306210365302D+00 xtab(6) = - 0.588504834318661761173535893194D+00 xtab(7) = - 0.434415036912123975342287136741D+00 xtab(8) = - 0.266362652878280984167665332026D+00 xtab(9) = - 0.897490934846521110226450100886D-01 xtab(10) = 0.897490934846521110226450100886D-01 xtab(11) = 0.266362652878280984167665332026D+00 xtab(12) = 0.434415036912123975342287136741D+00 xtab(13) = 0.588504834318661761173535893194D+00 xtab(14) = 0.723679329283242681306210365302D+00 xtab(15) = 0.835593535218090213713646362328D+00 xtab(16) = 0.920649185347533873837854625431D+00 xtab(17) = 0.976105557412198542864518924342D+00 xtab(18) = 1.0D+00 weight(1) = 0.653594771241830065359477124183D-02 weight(2) = 0.399706288109140661375991764101D-01 weight(3) = 0.706371668856336649992229601678D-01 weight(4) = 0.990162717175028023944236053187D-01 weight(5) = 0.124210533132967100263396358897D+00 weight(6) = 0.145411961573802267983003210494D+00 weight(7) = 0.161939517237602489264326706700D+00 weight(8) = 0.173262109489456226010614403827D+00 weight(9) = 0.179015863439703082293818806944D+00 weight(10) = 0.179015863439703082293818806944D+00 weight(11) = 0.173262109489456226010614403827D+00 weight(12) = 0.161939517237602489264326706700D+00 weight(13) = 0.145411961573802267983003210494D+00 weight(14) = 0.124210533132967100263396358897D+00 weight(15) = 0.990162717175028023944236053187D-01 weight(16) = 0.706371668856336649992229601678D-01 weight(17) = 0.399706288109140661375991764101D-01 weight(18) = 0.653594771241830065359477124183D-02 else if ( order == 19 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.978611766222080095152634063110D+00 xtab(3) = - 0.928901528152586243717940258797D+00 xtab(4) = - 0.852460577796646093085955970041D+00 xtab(5) = - 0.751494202552613014163637489634D+00 xtab(6) = - 0.628908137265220497766832306229D+00 xtab(7) = - 0.488229285680713502777909637625D+00 xtab(8) = - 0.333504847824498610298500103845D+00 xtab(9) = - 0.169186023409281571375154153445D+00 xtab(10) = 0.0D+00 xtab(11) = 0.169186023409281571375154153445D+00 xtab(12) = 0.333504847824498610298500103845D+00 xtab(13) = 0.488229285680713502777909637625D+00 xtab(14) = 0.628908137265220497766832306229D+00 xtab(15) = 0.751494202552613014163637489634D+00 xtab(16) = 0.852460577796646093085955970041D+00 xtab(17) = 0.928901528152586243717940258797D+00 xtab(18) = 0.978611766222080095152634063110D+00 xtab(19) = 1.0D+00 weight(1) = 0.584795321637426900584795321637D-02 weight(2) = 0.357933651861764771154255690351D-01 weight(3) = 0.633818917626297368516956904183D-01 weight(4) = 0.891317570992070844480087905562D-01 weight(5) = 0.112315341477305044070910015464D+00 weight(6) = 0.132267280448750776926046733910D+00 weight(7) = 0.148413942595938885009680643668D+00 weight(8) = 0.160290924044061241979910968184D+00 weight(9) = 0.167556584527142867270137277740D+00 weight(10) = 0.170001919284827234644672715617D+00 weight(11) = 0.167556584527142867270137277740D+00 weight(12) = 0.160290924044061241979910968184D+00 weight(13) = 0.148413942595938885009680643668D+00 weight(14) = 0.132267280448750776926046733910D+00 weight(15) = 0.112315341477305044070910015464D+00 weight(16) = 0.891317570992070844480087905562D-01 weight(17) = 0.633818917626297368516956904183D-01 weight(18) = 0.357933651861764771154255690351D-01 weight(19) = 0.584795321637426900584795321637D-02 else if ( order == 20 ) then xtab(1) = - 1.0D+00 xtab(2) = - 0.980743704893914171925446438584D+00 xtab(3) = - 0.935934498812665435716181584931D+00 xtab(4) = - 0.866877978089950141309847214616D+00 xtab(5) = - 0.775368260952055870414317527595D+00 xtab(6) = - 0.663776402290311289846403322971D+00 xtab(7) = - 0.534992864031886261648135961829D+00 xtab(8) = - 0.392353183713909299386474703816D+00 xtab(9) = - 0.239551705922986495182401356927D+00 xtab(10) = - 0.805459372388218379759445181596D-01 xtab(11) = 0.805459372388218379759445181596D-01 xtab(12) = 0.239551705922986495182401356927D+00 xtab(13) = 0.392353183713909299386474703816D+00 xtab(14) = 0.534992864031886261648135961829D+00 xtab(15) = 0.663776402290311289846403322971D+00 xtab(16) = 0.775368260952055870414317527595D+00 xtab(17) = 0.866877978089950141309847214616D+00 xtab(18) = 0.935934498812665435716181584931D+00 xtab(19) = 0.980743704893914171925446438584D+00 xtab(20) = 1.0D+00 weight(1) = 0.526315789473684210526315789474D-02 weight(2) = 0.322371231884889414916050281173D-01 weight(3) = 0.571818021275668260047536271732D-01 weight(4) = 0.806317639961196031447768461137D-01 weight(5) = 0.101991499699450815683781205733D+00 weight(6) = 0.120709227628674725099429705002D+00 weight(7) = 0.136300482358724184489780792989D+00 weight(8) = 0.148361554070916825814713013734D+00 weight(9) = 0.156580102647475487158169896794D+00 weight(10) = 0.160743286387845749007726726449D+00 weight(11) = 0.160743286387845749007726726449D+00 weight(12) = 0.156580102647475487158169896794D+00 weight(13) = 0.148361554070916825814713013734D+00 weight(14) = 0.136300482358724184489780792989D+00 weight(15) = 0.120709227628674725099429705002D+00 weight(16) = 0.101991499699450815683781205733D+00 weight(17) = 0.806317639961196031447768461137D-01 weight(18) = 0.571818021275668260047536271732D-01 weight(19) = 0.322371231884889414916050281173D-01 weight(20) = 0.526315789473684210526315789474D-02 else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LOBATTO_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are between 2 and 20.' stop end if return end function log_gamma ( x ) !*****************************************************************************80 ! !! LOG_GAMMA calculates the natural logarithm of GAMMA(X). ! ! Discussion: ! ! The method uses Stirling's approximation, and is accurate to about ! 12 decimal places. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 19 September 1998 ! ! Author: ! ! Original FORTRAN77 version by Arthur Stroud, Don Secrest. ! FORTRAN90 version by John Burkardt. ! ! Reference: ! ! Arthur Stroud, Don Secrest, ! Gaussian Quadrature Formulas, ! Prentice Hall, 1966, ! LC: QA299.4G3S7. ! ! Parameters: ! ! Input, real ( kind = 8 ) X, the evaluation point. The routine ! will fail if GAMMA(X) is not positive. X should be greater than 0. ! ! Output, real ( kind = 8 ) LOG_GAMMA, the natural logarithm of the ! gamma function of X. ! implicit none integer ( kind = 4 ) i integer ( kind = 4 ) k real ( kind = 8 ) log_gamma integer ( kind = 4 ) m real ( kind = 8 ) p real ( kind = 8 ) :: pi = 3.141592653589793D+00 real ( kind = 8 ) x real ( kind = 8 ) x2 real ( kind = 8 ) y real ( kind = 8 ) z if ( x < 0.5D+00 ) then m = 1 x2 = 1.0D+00 - x else m = 0 x2 = x end if k = - 1 do k = k + 1 if ( 6.0D+00 < x2 + real ( k, kind = 8 ) ) then exit end if end do z = x2 + real ( k, kind = 8 ) y = ( z - 0.5D+00 ) * log ( z ) - z + 0.9189385332047D+00 + & ( ( ( ( ( & - 4146.0D+00 / z**2 & + 1820.0D+00 ) / z**2 & - 1287.0D+00 ) / z**2 & + 1716.0D+00 ) / z**2 & - 6006.0D+00 ) / z**2 & + 180180.0D+00 ) / z / 2162160.0D+00 if ( 0 < k ) then do i = 1, k y = y - log ( x2 + real ( k - i, kind = 8 ) ) end do end if if ( m /= 0 ) then p = pi / sin ( pi * ( 1.0D+00 - x2 ) ) if ( p <= 0.0D+00 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'LOG_GAMMA - fatal error!' stop else y = log ( p ) - y end if end if log_gamma = y return end subroutine moulton_set ( order, xtab, weight ) !*****************************************************************************80 ! !! MOULTON_SET sets weights for Adams-Moulton quadrature. ! ! Discussion: ! ! Adams-Moulton quadrature formulas are normally used in solving ! ordinary differential equations, and are not suitable for general ! quadrature computations. However, an Adams-Moulton formula is ! equivalent to approximating the integral of F(Y(X)) between X(M) ! and X(M+1), using an implicit formula that relies on known values ! of F(Y(X)) at X(M-N+1) through X(M), plus the unknown value at X(M+1). ! ! Suppose the unknown function is denoted by Y(X), with derivative F(Y(X)), ! and that approximate values of the function are known at a series of ! X values, which we write as X(1), X(2), ..., X(M). We write the value ! Y(X(1)) as Y(1) and so on. ! ! Then the solution of the ODE Y' = F(X,Y) at the next point X(M+1) is ! computed by: ! ! Y(M+1) = Y(M) + Integral ( X(M) < X < X(M+1) ) F(Y(X)) dX ! = Y(M) + H * Sum ( 1 <= I <= N ) W(I) * F(Y(M+2-I)) approximately. ! ! Note that this formula is implicit, since the unknown value Y(M+1) ! appears on the right hand side. Hence, in ODE applications, this ! equation must be solved via a nonlinear equation solver. For ! quadrature problems, where the function to be integrated is known ! beforehand, this is not a problem, and the calculation is explicit. ! ! In the documentation that follows, we replace F(Y(X)) by F(X). ! ! ! The Adams-Moulton formulas require equally spaced data. ! ! Here is how the formula is applied in the case with non-unit spacing: ! ! Integral ( A <= X <= A+H ) F(X) dX = ! H * Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( A - (I-2)*H ), ! approximately. ! ! The integration interval is [ 0, 1 ]. ! ! The weight function is w(x) = 1.0. ! ! The integral to approximate: ! ! Integral ( 0 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( 2 - I ) ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 01 May 2006 ! ! 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. ! ! Leon Lapidus, John Seinfeld, ! Numerical Solution of Ordinary Differential Equations, ! Academic Press, 1971, ! ISBN: 0124366503. ! ! Daniel Zwillinger, editor, ! CRC Standard Mathematical Tables and Formulae, ! 30th Edition, ! CRC Press, 1996, ! ISBN: 0-8493-2479-3, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ORDER must be ! between 1 and 10, 12, 14, 16, 18 or 20. ! ! Output, real ( kind = 8 ) XTAB(ORDER), the abscissas. ! ! Output, real ( kind = 8 ) WEIGHT(ORDER), the weights. ! WEIGHT(1) is the weight at X = 1, WEIGHT(2) the weight at X = 0, and so on. ! The weights are rational. The weights are not symmetric, and ! some weights may be negative. They should sum to 1. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) d integer ( kind = 4 ) i real ( kind = 8 ) weight(order) real ( kind = 8 ) xtab(order) if ( order == 1 ) then weight(1) = 1.0D+00 else if ( order == 2 ) then d = 2.0D+00 weight(1) = 1.0D+00 / d weight(2) = 1.0D+00 / d else if ( order == 3 ) then d = 12.0D+00 weight(1) = 5.0D+00 / d weight(2) = 8.0D+00 / d weight(3) = - 1.0D+00 / d else if ( order == 4 ) then d = 24.0D+00 weight(1) = 9.0D+00 / d weight(2) = 19.0D+00 / d weight(3) = - 5.0D+00 / d weight(4) = 1.0D+00 / d else if ( order == 5 ) then d = 720.0D+00 weight(1) = 251.0D+00 / d weight(2) = 646.0D+00 / d weight(3) = - 264.0D+00 / d weight(4) = 106.0D+00 / d weight(5) = - 19.0D+00 / d else if ( order == 6 ) then d = 1440.0D+00 weight(1) = 475.0D+00 / d weight(2) = 1427.0D+00 / d weight(3) = - 798.0D+00 / d weight(4) = 482.0D+00 / d weight(5) = - 173.0D+00 / d weight(6) = 27.0D+00 / d else if ( order == 7 ) then d = 60480.0D+00 weight(1) = 19087.0D+00 / d weight(2) = 65112.0D+00 / d weight(3) = - 46461.0D+00 / d weight(4) = 37504.0D+00 / d weight(5) = - 20211.0D+00 / d weight(6) = 6312.0D+00 / d weight(7) = - 863.0D+00 / d else if ( order == 8 ) then d = 120960.0D+00 weight(1) = 36799.0D+00 / d weight(2) = 139849.0D+00 / d weight(3) = - 121797.0D+00 / d weight(4) = 123133.0D+00 / d weight(5) = - 88547.0D+00 / d weight(6) = 41499.0D+00 / d weight(7) = - 11351.0D+00 / d weight(8) = 1375.0D+00 / d else if ( order == 9 ) then d = 3628800.0D+00 weight(1) = 1070017.0D+00 / d weight(2) = 4467094.0D+00 / d weight(3) = - 4604594.0D+00 / d weight(4) = 5595358.0D+00 / d weight(5) = - 5033120.0D+00 / d weight(6) = 3146338.0D+00 / d weight(7) = - 1291214.0D+00 / d weight(8) = 312874.0D+00 / d weight(9) = - 33953.0D+00 / d else if ( order == 10 ) then d = 7257600.0D+00 weight(1) = 2082753.0D+00 / d weight(2) = 9449717.0D+00 / d weight(3) = - 11271304.0D+00 / d weight(4) = 16002320.0D+00 / d weight(5) = - 17283646.0D+00 / d weight(6) = 13510082.0D+00 / d weight(7) = - 7394032.0D+00 / d weight(8) = 2687864.0D+00 / d weight(9) = - 583435.0D+00 / d weight(10) = 57281.0D+00 / d else if ( order == 12 ) then d = 958003200.0D+00 weight(1) = 262747265.0D+00 / d weight(2) = 1374799219.0D+00 / d weight(3) = -2092490673.0D+00 / d weight(4) = 3828828885.0D+00 / d weight(5) = -5519460582.0D+00 / d weight(6) = 6043521486.0D+00 / d weight(7) = -4963166514.0D+00 / d weight(8) = 3007739418.0D+00 / d weight(9) = -1305971115.0D+00 / d weight(10) = 384709327.0D+00 / d weight(11) = -68928781.0D+00 / d weight(12) = 5675265.0D+00 / d else if ( order == 14 ) then d = 5230697472000.0D+00 weight(1) = 1382741929621.0D+00 / d weight(2) = 8153167962181.0D+00 / d weight(3) = -15141235084110.0D+00 / d weight(4) = 33928990133618.0D+00 / d weight(5) = -61188680131285.0D+00 / d weight(6) = 86180228689563.0D+00 / d weight(7) = -94393338653892.0D+00 / d weight(8) = 80101021029180.0D+00 / d weight(9) = -52177910882661.0D+00 / d weight(10) = 25620259777835.0D+00 / d weight(11) = -9181635605134.0D+00 / d weight(12) = 2268078814386.0D+00 / d weight(13) = -345457086395.0D+00 / d weight(14) = 24466579093.0D+00 / d else if ( order == 16 ) then d = 62768369664000.0D+00 weight(1) = 16088129229375.0D+00 / d weight(2) = 105145058757073.0D+00 / d weight(3) = -230992163723849.0D+00 / d weight(4) = 612744541065337.0D+00 / d weight(5) = -1326978663058069.0D+00 / d weight(6) = 2285168598349733.0D+00 / d weight(7) = -3129453071993581.0D+00 / d weight(8) = 3414941728852893.0D+00 / d weight(9) = -2966365730265699.0D+00 / d weight(10) = 2039345879546643.0D+00 / d weight(11) = -1096355235402331.0D+00 / d weight(12) = 451403108933483.0D+00 / d weight(13) = -137515713789319.0D+00 / d weight(14) = 29219384284087.0D+00 / d weight(15) = -3867689367599.0D+00 / d weight(16) = 240208245823.0D+00 / d else if ( order == 18 ) then d = 64023737057280000.0D+00 weight(1) = 15980174332775873.0D+00 / d weight(2) = 114329243705491117.0D+00 / d weight(3) = -290470969929371220.0D+00 / d weight(4) = 890337710266029860.0D+00 / d weight(5) = -2250854333681641520.0D+00 / d weight(6) = 4582441343348851896.0D+00 / d weight(7) = -7532171919277411636.0D+00 / d weight(8) = 10047287575124288740.0D+00 / d weight(9) = -10910555637627652470.0D+00 / d weight(10) = 9644799218032932490.0D+00 / d weight(11) = -6913858539337636636.0D+00 / d weight(12) = 3985516155854664396.0D+00 / d weight(13) = -1821304040326216520.0D+00 / d weight(14) = 645008976643217360.0D+00 / d weight(15) = -170761422500096220.0D+00 / d weight(16) = 31816981024600492.0D+00 / d weight(17) = -3722582669836627.0D+00 / d weight(18) = 205804074290625.0D+00 / d else if ( order == 20 ) then d = 102181884343418880000.0D+00 weight(1) = 24919383499187492303.0D+00 / d weight(2) = 193280569173472261637.0D+00 / d weight(3) = -558160720115629395555.0D+00 / d weight(4) = 1941395668950986461335.0D+00 / d weight(5) = -5612131802364455926260.0D+00 / d weight(6) = 13187185898439270330756.0D+00 / d weight(7) = -25293146116627869170796.0D+00 / d weight(8) = 39878419226784442421820.0D+00 / d weight(9) = -51970649453670274135470.0D+00 / d weight(10) = 56154678684618739939910.0D+00 / d weight(11) = -50320851025594566473146.0D+00 / d weight(12) = 37297227252822858381906.0D+00 / d weight(13) = -22726350407538133839300.0D+00 / d weight(14) = 11268210124987992327060.0D+00 / d weight(15) = -4474886658024166985340.0D+00 / d weight(16) = 1389665263296211699212.0D+00 / d weight(17) = -325187970422032795497.0D+00 / d weight(18) = 53935307402575440285.0D+00 / d weight(19) = -5652892248087175675.0D+00 / d weight(20) = 281550972898020815.0D+00 / d else write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'MOULTON_SET - Fatal error!' write ( *, '(a,i8)' ) ' Illegal value of ORDER = ', order write ( *, '(a)' ) ' Legal values are 1 through 10, 12, 14, 16, 18 or 20.' stop end if do i = 1, order xtab(i) = real ( 2 - i, kind = 8 ) end do return end subroutine nc_compute ( n, x_min, x_max, x, w ) !*****************************************************************************80 ! !! NC_COMPUTE computes a Newton-Cotes quadrature rule. ! ! Discussion: ! ! For the interval [X_MIN,X_MAX], the Newton-Cotes quadrature rule ! estimates ! ! Integral ( X_MIN <= X <= X_MAX ) F(X) dX ! ! using N abscissas X and weights W: ! ! Sum ( 1 <= I <= N ) W(I) * F ( X(I) ). ! ! For the CLOSED rule, the abscissas include the end points. ! For an OPEN rule, the abscissas do not include the end points. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 17 November 2009 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. ! ! Input, real ( kind = 8 ) X_MIN, X_MAX, the endpoints of the interval. ! ! Input, real ( kind = 8 ) X(N), the abscissas. ! ! Output, real ( kind = 8 ) W(N), the weights. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) d(n) integer ( kind = 4 ) i integer ( kind = 4 ) j integer ( kind = 4 ) k real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) real ( kind = 8 ) x_max real ( kind = 8 ) x_min real ( kind = 8 ) yvala real ( kind = 8 ) yvalb do i = 1, n ! ! Compute the Lagrange basis polynomial which is 1 at X(I), ! and zero at the other nodes. ! d(1:n) = 0.0D+00 d(i) = 1.0D+00 do j = 2, n do k = j, n d(n+j-k) = ( d(n+j-k-1) - d(n+j-k) ) / ( x(n+1-k) - x(n+j-k) ) end do end do do j = 1, n - 1 do k = 1, n - j d(n-k) = d(n-k) - x(n-k-j+1) * d(n-k+1) end do end do ! ! Evaluate the antiderivative of the polynomial at the endpoints. ! yvala = d(n) / real ( n, kind = 8 ) do j = n - 1, 1, -1 yvala = yvala * x_min + d(j) / real ( j, kind = 8 ) end do yvala = yvala * x_min yvalb = d(n) / real ( n, kind = 8 ) do j = n - 1, 1, -1 yvalb = yvalb * x_max + d(j) / real ( j, kind = 8 ) end do yvalb = yvalb * x_max w(i) = yvalb - yvala end do return end subroutine ncc_compute ( n, x, w ) !*****************************************************************************80 ! !! NCC_COMPUTE: Newton-Cotes Closed quadrature rule. ! ! Discussion: ! ! For the interval [-1,+1], the Newton-Cotes closed quadrature rule ! estimates ! ! Integral ( -1 <= X <= +1 ) F(X) dX ! ! using N abscissas X and weights W: ! ! sum ( 1 <= I <= N ) W(I) * F ( X(I) ). ! ! For the CLOSED rule, the abscissas are equally spaced and include ! the end points. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 16 November 2009 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. ! ! Output, real ( kind = 8 ) X(N), the abscissas. ! ! Output, real ( kind = 8 ) W(N), the weights. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) call ncc_compute_points ( n, x ) call ncc_compute_weights ( n, w ) return end subroutine ncc_compute_points ( n, x ) !*****************************************************************************80 ! !! NCC_COMPUTE_POINTS: Newton-Cotes Closed points ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 16 November 2009 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. ! ! Output, real ( kind = 8 ) X(N), the abscissas. ! implicit none integer ( kind = 4 ) n integer ( kind = 4 ) i real ( kind = 8 ) x(n) real ( kind = 8 ) :: x_max = +1.0D+00 real ( kind = 8 ) :: x_min = -1.0D+00 if ( n == 1 ) then x(1) = ( x_max + x_min ) / 2.0D+00 else do i = 1, n x(i) = ( real ( n - i, kind = 8 ) * x_min & + real ( i - 1, kind = 8 ) * x_max ) & / real ( n - 1, kind = 8 ) end do end if return end subroutine ncc_compute_weights ( n, w ) !*****************************************************************************80 ! !! NCC_COMPUTE_WEIGHTS: Newton-Cotes Closed weights. ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 16 November 2009 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer ( kind = 4 ) N, the order. ! ! Output, real ( kind = 8 ) W(N), the weights. ! implicit none integer ( kind = 4 ) n real ( kind = 8 ) w(n) real ( kind = 8 ) x(n) real ( kind = 8 ) :: x_max = +1.0D+00 real ( kind = 8 ) :: x_min = -1.0D+00 if ( n == 1 ) then w(1) = x_max - x_min else call ncc_compute_points ( n, x ) call nc_compute ( n, x_min, x_max, x, w ) end if return end subroutine ncc_set ( order, x, w ) !*****************************************************************************80 ! !! NCC_SET sets abscissas and weights for closed Newton-Cotes quadrature. ! ! Discussion: ! ! The closed Newton-Cotes rules use equally spaced abscissas, and ! hence may be used with tabulated function data. ! ! The rules are called "closed" because they include the endpoints. ! As a favor, we include an order 1 rule, the midpoint rule, even ! though this does not satisfy the requirement that the endpoints ! be included! ! ! The higher order rules involve negative weights. These can produce ! loss of accuracy due to the subtraction of large, nearly equal quantities. ! ! ORDER = 1 is the midpoint rule (and is not really an NCC rule!) ! ORDER = 2 is the trapezoidal rule. ! ORDER = 3 is Simpson's rule. ! ORDER = 4 is Simpson's 3/8 rule. ! ORDER = 5 is Bode's rule. ! ! The Kopal reference for ORDER = 12 lists ! W(6) = 15494566.0D+00 / 43545600.0D+00 ! but this results in a set of coeffients that don't add up to 2. ! The correct value is ! W(6) = 15493566.0D+00 / 43545600.0. ! ! The integration interval is [ -1, 1 ]. ! ! The weight function is w(x) = 1.0. ! ! The integral to approximate: ! ! Integral ( -1 <= X <= 1 ) F(X) dX ! ! The quadrature rule: ! ! Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) ) ! ! In Mathematica, the closed Newton-Cotes weights ! can be computed by: ! ! << NumericalMath`NewtonCotes` ! NewtonCotesWeights [ order, -1, 1, QuadratureType -> Closed ] ! ! Licensing: ! ! This code is distributed under the GNU LGPL license. ! ! Modified: ! ! 08 May 2007 ! ! 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. ! ! Johnson, ! Quarterly Journal of Mathematics, ! Volume 46, Number 52, 1915. ! ! Zdenek Kopal, ! Numerical Analysis, ! John Wiley, 1955, ! LC: QA297.K6. ! ! Stephen Wolfram, ! The Mathematica Book, ! Fourth Edition, ! Cambridge University Press, 1999, ! ISBN: 0-521-64314-7, ! LC: QA76.95.W65. ! ! Daniel Zwillinger, editor, ! CRC Standard Mathematical Tables and Formulae, ! 30th Edition, ! CRC Press, 1996, ! ISBN: 0-8493-2479-3, ! LC: QA47.M315. ! ! Parameters: ! ! Input, integer ( kind = 4 ) ORDER, the order. ! ORDER must be between 1 and 21. ! ! Output, real ( kind = 8 ) X(ORDER), the abscissas. ! The abscissas are uniformly spaced in the interval, and, except ! for the rule of order 1, include -1 and 1. ! ! Output, real ( kind = 8 ) W(ORDER), the weights. ! The weights are symmetric, rational, and should sum to 2.0. ! Some weights may be negative. ! implicit none integer ( kind = 4 ) order real ( kind = 8 ) w(order) real ( kind = 8 ) x(order) if ( order == 1 ) then ! ! 2 ! x(1) = 0.00000000000000000000D+00 w(1) = 2.00000000000000000000D+00 else if ( order == 2 ) then ! ! 1 ! 1 ! x(1) = -1.00000000000000000000D+00 x(2) = 1.00000000000000000000D+00 w(1) = 1.00000000000000000000D+00 w(2) = 1.00000000000000000000D+00 else if ( order == 3 ) then ! ! 1 / 3 ! 4 / 3 ! 1 / 3 ! x(1) = -1.00000000000000000000D+00 x(2) = 0.00000000000000000000D+00 x(3) = 1.00000000000000000000D+00 w(1) = 0.33333333333333333333D+00 w(2) = 1.33333333333333333333D+00 w(3) = 0.33333333333333333333D+00 else if ( order == 4 ) then ! ! 1 / 4 ! 3 / 4 ! 3 / 4 ! 1 / 4 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.33333333333333333333D+00 x(3) = 0.33333333333333333333D+00 x(4) = 1.00000000000000000000D+00 w(1) = 0.25000000000000000000D+00 w(2) = 0.75000000000000000000D+00 w(3) = 0.75000000000000000000D+00 w(4) = 0.25000000000000000000D+00 else if ( order == 5 ) then ! ! 7 / 45 ! 32 / 45 ! 12 / 45 ! 32 / 45 ! 7 / 45 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.50000000000000000000D+00 x(3) = 0.00000000000000000000D+00 x(4) = 0.50000000000000000000D+00 x(5) = 1.00000000000000000000D+00 w(1) = 0.15555555555555555556D+00 w(2) = 0.71111111111111111111D+00 w(3) = 0.26666666666666666667D+00 w(4) = 0.71111111111111111111D+00 w(5) = 0.15555555555555555556D+00 else if ( order == 6 ) then ! ! 19 / 144 ! 75 / 144 ! 50 / 144 ! 50 / 144 ! 75 / 144 ! 19 / 144 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.60000000000000000000D+00 x(3) = -0.20000000000000000000D+00 x(4) = 0.20000000000000000000D+00 x(5) = 0.60000000000000000000D+00 x(6) = 1.00000000000000000000D+00 w(1) = 0.13194444444444444444D+00 w(2) = 0.52083333333333333333D+00 w(3) = 0.34722222222222222222D+00 w(4) = 0.34722222222222222222D+00 w(5) = 0.52083333333333333333D+00 w(6) = 0.13194444444444444444D+00 else if ( order == 7 ) then ! ! 41 / 420 ! 216 / 420 ! 27 / 420 ! 272 / 420 ! 27 / 420 ! 216 / 420 ! 41 / 420 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.66666666666666666667D+00 x(3) = -0.33333333333333333333D+00 x(4) = 0.00000000000000000000D+00 x(5) = 0.33333333333333333333D+00 x(6) = 0.66666666666666666667D+00 x(7) = 1.00000000000000000000D+00 w(1) = 0.097619047619047619048D+00 w(2) = 0.51428571428571428571D+00 w(3) = 0.064285714285714285714D+00 w(4) = 0.64761904761904761905D+00 w(5) = 0.064285714285714285714D+00 w(6) = 0.51428571428571428571D+00 w(7) = 0.097619047619047619048D+00 else if ( order == 8 ) then ! ! 751 / 8640 ! 3577 / 8640 ! 1323 / 8640 ! 2989 / 8640 ! 2989 / 8640 ! 1323 / 8640 ! 3577 / 8640 ! 751 / 8640 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.71428571428571428571D+00 x(3) = -0.42857142857142857143D+00 x(4) = -0.14285714285714285714D+00 x(5) = 0.14285714285714285714D+00 x(6) = 0.42857142857142857143D+00 x(7) = 0.71428571428571428571D+00 x(8) = 1.00000000000000000000D+00 w(1) = 0.086921296296296296296D+00 w(2) = 0.41400462962962962963D+00 w(3) = 0.15312500000000000000D+00 w(4) = 0.34594907407407407407D+00 w(5) = 0.34594907407407407407D+00 w(6) = 0.15312500000000000000D+00 w(7) = 0.41400462962962962963D+00 w(8) = 0.086921296296296296296D+00 else if ( order == 9 ) then ! ! 989 / 14175 ! 5888 / 14175 ! -928 / 14175 ! 10496 / 14175 ! -4540 / 14175 ! 10496 / 14175 ! -928 / 14175 ! 5888 / 14175 ! 989 / 14175 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.75000000000000000000D+00 x(3) = -0.50000000000000000000D+00 x(4) = -0.25000000000000000000D+00 x(5) = 0.00000000000000000000D+00 x(6) = 0.25000000000000000000D+00 x(7) = 0.50000000000000000000D+00 x(8) = 0.75000000000000000000D+00 x(9) = 1.00000000000000000000D+00 w(1) = 0.069770723104056437390D+00 w(2) = 0.41537918871252204586D+00 w(3) = -0.065467372134038800705D+00 w(4) = 0.74045855379188712522D+00 w(5) = -0.32028218694885361552D+00 w(6) = 0.74045855379188712522D+00 w(7) = -0.065467372134038800705D+00 w(8) = 0.41537918871252204586D+00 w(9) = 0.069770723104056437390D+00 else if ( order == 10 ) then ! ! 2857 / 44800 ! 15741 / 44800 ! 1080 / 44800 ! 19344 / 44800 ! 5778 / 44800 ! 5778 / 44800 ! 19344 / 44800 ! 1080 / 44800 ! 15741 / 44800 ! 2857 / 44800 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.77777777777777777778D+00 x(3) = -0.55555555555555555556D+00 x(4) = -0.33333333333333333333D+00 x(5) = -0.11111111111111111111D+00 x(6) = 0.11111111111111111111D+00 x(7) = 0.33333333333333333333D+00 x(8) = 0.55555555555555555556D+00 x(9) = 0.77777777777777777778D+00 x(10) = 1.00000000000000000000D+00 w(1) = 0.063772321428571428571D+00 w(2) = 0.35136160714285714286D+00 w(3) = 0.024107142857142857143D+00 w(4) = 0.43178571428571428571D+00 w(5) = 0.12897321428571428571D+00 w(6) = 0.12897321428571428571D+00 w(7) = 0.43178571428571428571D+00 w(8) = 0.024107142857142857143D+00 w(9) = 0.35136160714285714286D+00 w(10) = 0.063772321428571428571D+00 else if ( order == 11 ) then ! ! 16067 / 299376 ! 106300 / 299376 ! - 48525 / 299376 ! 272400 / 299376 ! - 260550 / 299376 ! 427368 / 299376 ! - 260550 / 299376 ! 272400 / 299376 ! - 48525 / 299376 ! 106300 / 299376 ! 16067 / 299376 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.80000000000000000000D+00 x(3) = -0.60000000000000000000D+00 x(4) = -0.40000000000000000000D+00 x(5) = -0.20000000000000000000D+00 x(6) = 0.00000000000000000000D+00 x(7) = 0.20000000000000000000D+00 x(8) = 0.40000000000000000000D+00 x(9) = 0.60000000000000000000D+00 x(10) = 0.80000000000000000000D+00 x(11) = 1.00000000000000000000D+00 w(1) = 0.053668296723852279408D+00 w(2) = 0.35507188284966062744D+00 w(3) = -0.16208714125380792047D+00 w(4) = 0.90989257655924322591D+00 w(5) = -0.87031024531024531025D+00 w(6) = 1.4275292608625941959D+00 w(7) = -0.87031024531024531025D+00 w(8) = 0.90989257655924322591D+00 w(9) = -0.16208714125380792047D+00 w(10) = 0.35507188284966062744D+00 w(11) = 0.053668296723852279408D+00 else if ( order == 12 ) then ! ! 2171465 / 43545600 ! 13486539 / 43545600 ! - 3237113 / 43545600 ! 25226685 / 43545600 ! - 9595542 / 43545600 ! 15493566 / 43545600 ! 15493566 / 43545600 ! - 9595542 / 43545600 ! 25226685 / 43545600 ! - 3237113 / 43545600 ! 13486539 / 43545600 ! 2171465 / 43545600 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.81818181818181818182D+00 x(3) = -0.63636363636363636364D+00 x(4) = -0.45454545454545454545D+00 x(5) = -0.27272727272727272727D+00 x(6) = -0.090909090909090909091D+00 x(7) = 0.090909090909090909091D+00 x(8) = 0.27272727272727272727D+00 x(9) = 0.45454545454545454545D+00 x(10) = 0.63636363636363636364D+00 x(11) = 0.81818181818181818182D+00 x(12) = 1.00000000000000000000D+00 w(1) = 0.049866461823927101705D+00 w(2) = 0.30971071704144620811D+00 w(3) = -0.074338463587595532040D+00 w(4) = 0.57931650958994708995D+00 w(5) = -0.22035617835097001764D+00 w(6) = 0.35580095348324514991D+00 w(7) = 0.35580095348324514991D+00 w(8) = -0.22035617835097001764D+00 w(9) = 0.57931650958994708995D+00 w(10) = -0.074338463587595532040D+00 w(11) = 0.30971071704144620811D+00 w(12) = 0.049866461823927101705D+00 else if ( order == 13 ) then ! ! 1364651 / 31531500 ! 9903168 / 31531500 ! - 7587864 / 31531500 ! 35725120 / 31531500 ! - 51491295 / 31531500 ! 87516288 / 31531500 ! - 87797136 / 31531500 ! 87516288 / 31531500 ! - 51491295 / 31531500 ! 35725120 / 31531500 ! - 7587864 / 31531500 ! 9903168 / 31531500 ! 1364651 / 31531500 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.83333333333333333333D+00 x(3) = -0.66666666666666666667D+00 x(4) = -0.50000000000000000000D+00 x(5) = -0.33333333333333333333D+00 x(6) = -0.16666666666666666667D+00 x(7) = 0.00000000000000000000D+00 x(8) = 0.16666666666666666667D+00 x(9) = 0.33333333333333333333D+00 x(10) = 0.50000000000000000000D+00 x(11) = 0.66666666666666666667D+00 x(12) = 0.83333333333333333333D+00 x(13) = 1.00000000000000000000D+00 w(1) = 0.043278974993260707546D+00 w(2) = 0.31407221350078492936D+00 w(3) = -0.24064392750107035821D+00 w(4) = 1.1329977958549387121D+00 w(5) = -1.6330112744398458684D+00 w(6) = 2.7755193378050520908D+00 w(7) = -2.7844262404262404262D+00 w(8) = 2.7755193378050520908D+00 w(9) = -1.6330112744398458684D+00 w(10) = 1.1329977958549387121D+00 w(11) = -0.24064392750107035821D+00 w(12) = 0.31407221350078492936D+00 w(13) = 0.043278974993260707546D+00 else if ( order == 14 ) then ! ! 6137698213 / 150885504000 ! 42194238652 / 150885504000 ! - 23361540993 / 150885504000 ! 116778274403 / 150885504000 ! - 113219777650 / 150885504000 ! 154424590209 / 150885504000 ! - 32067978834 / 150885504000 ! - 32067978834 / 150885504000 ! 154424590209 / 150885504000 ! - 113219777650 / 150885504000 ! 116778274403 / 150885504000 ! - 23361540993 / 150885504000 ! 42194238652 / 150885504000 ! 6137698213 / 150885504000 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.84615384615384615385D+00 x(3) = -0.69230769230769230769D+00 x(4) = -0.53846153846153846154D+00 x(5) = -0.38461538461538461538D+00 x(6) = -0.23076923076923076923D+00 x(7) = -0.076923076923076923077D+00 x(8) = 0.076923076923076923077D+00 x(9) = 0.23076923076923076923D+00 x(10) = 0.38461538461538461538D+00 x(11) = 0.53846153846153846154D+00 x(12) = 0.69230769230769230769D+00 x(13) = 0.84615384615384615385D+00 x(14) = 1.00000000000000000000D+00 w(1) = 0.040669438210247155353D+00 w(2) = 0.27975217053157074652D+00 w(3) = -0.15542374057682837445D+00 w(4) = 0.77579230848776566369D+00 w(5) = -0.75384763266423526013D+00 w(6) = 1.0273523591123107492D+00 w(7) = -0.21429490310083068020D+00 w(8) = -0.21429490310083068020D+00 w(9) = 1.0273523591123107492D+00 w(10) = -0.75384763266423526013D+00 w(11) = 0.77579230848776566369D+00 w(12) = -0.15542374057682837445D+00 w(13) = 0.27975217053157074652D+00 w(14) = 0.040669438210247155353D+00 else if ( order == 15 ) then ! ! 90241897 / 2501928000 ! 710986864 / 2501928000 ! - 770720657 / 2501928000 ! 3501442784 / 2501928000 ! - 6625093363 / 2501928000 ! 12630121616 / 2501928000 ! - 16802270373 / 2501928000 ! 19534438464 / 2501928000 ! - 16802270373 / 2501928000 ! 12630121616 / 2501928000 ! - 6625093363 / 2501928000 ! 3501442784 / 2501928000 ! - 770720657 / 2501928000 ! 710986864 / 2501928000 ! 90241897 / 2501928000 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.85714285714285714286D+00 x(3) = -0.71428571428571428571D+00 x(4) = -0.57142857142857142857D+00 x(5) = -0.42857142857142857143D+00 x(6) = -0.28571428571428571429D+00 x(7) = -0.14285714285714285714D+00 x(8) = 0.00000000000000000000D+00 x(9) = 0.14285714285714285714D+00 x(10) = 0.28571428571428571429D+00 x(11) = 0.42857142857142857143D+00 x(12) = 0.57142857142857142857D+00 x(13) = 0.71428571428571428571D+00 x(14) = 0.85714285714285714286D+00 x(15) = 1.00000000000000000000D+00 w(1) = 0.036068942431596752584D+00 w(2) = 0.28417558938546592868D+00 w(3) = -0.30805069410470645039D+00 w(4) = 1.3994978208805369299D+00 w(5) = -2.6479952112930507992D+00 w(6) = 5.0481555088715582543D+00 w(7) = -6.7157289790113864188D+00 w(8) = 7.8077540456799716059D+00 w(9) = -6.7157289790113864188D+00 w(10) = 5.0481555088715582543D+00 w(11) = -2.6479952112930507992D+00 w(12) = 1.3994978208805369299D+00 w(13) = -0.30805069410470645039D+00 w(14) = 0.28417558938546592868D+00 w(15) = 0.036068942431596752584D+00 else if ( order == 16 ) then ! ! 105930069 / 3099672576 ! 796661595 / 3099672576 ! - 698808195 / 3099672576 ! 3143332755 / 3099672576 ! - 4688522055 / 3099672576 ! 7385654007 / 3099672576 ! - 6000998415 / 3099672576 ! 3056422815 / 3099672576 ! 3056422815 / 3099672576 ! - 6000998415 / 3099672576 ! 7385654007 / 3099672576 ! - 4688522055 / 3099672576 ! 3143332755 / 3099672576 ! - 698808195 / 3099672576 ! 796661595 / 3099672576 ! 105930069 / 3099672576 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.86666666666666666667D+00 x(3) = -0.73333333333333333333D+00 x(4) = -0.60000000000000000000D+00 x(5) = -0.46666666666666666667D+00 x(6) = -0.33333333333333333333D+00 x(7) = -0.20000000000000000000D+00 x(8) = -0.066666666666666666667D+00 x(9) = 0.066666666666666666667D+00 x(10) = 0.20000000000000000000D+00 x(11) = 0.33333333333333333333D+00 x(12) = 0.46666666666666666667D+00 x(13) = 0.60000000000000000000D+00 x(14) = 0.73333333333333333333D+00 x(15) = 0.86666666666666666667D+00 x(16) = 1.00000000000000000000D+00 w(1) = 0.034174599543251887002D+00 w(2) = 0.25701475735481036820D+00 w(3) = -0.22544581011901045383D+00 w(4) = 1.0140854164204471124D+00 w(5) = -1.5125862296882804695D+00 w(6) = 2.3827206990135980091D+00 w(7) = -1.9360104229924960952D+00 w(8) = 0.98604699046767964179D+00 w(9) = 0.98604699046767964179D+00 w(10) = -1.9360104229924960952D+00 w(11) = 2.3827206990135980091D+00 w(12) = -1.5125862296882804695D+00 w(13) = 1.0140854164204471124D+00 w(14) = -0.22544581011901045383D+00 w(15) = 0.25701475735481036820D+00 w(16) = 0.034174599543251887002D+00 else if ( order == 17 ) then ! ! 15043611773 / 488462349375 ! 127626606592 / 488462349375 ! - 179731134720 / 488462349375 ! 832211855360 / 488462349375 ! - 1929498607520 / 488462349375 ! 4177588893696 / 488462349375 ! - 6806534407936 / 488462349375 ! 9368875018240 / 488462349375 ! - 10234238972220 / 488462349375 ! 9368875018240 / 488462349375 ! - 6806534407936 / 488462349375 ! 4177588893696 / 488462349375 ! - 1929498607520 / 488462349375 ! 832211855360 / 488462349375 ! - 179731134720 / 488462349375 ! 127626606592 / 488462349375 ! 15043611773 / 488462349375 ! x(1) = -1.00000000000000000000D+00 x(2) = -0.87500000000000000000D+00 x(3) = -0.75000000000000000000D+00 x(4) = -0.62500000000000000000D+00 x(5) = -0.50000000000000000000D+00 x(6) = -0.37500000000000000000D+00 x(7) = -0.25000000000000000000D+00 x(8) = -0.12500000000000000000D+00 x(9) = 0.00000000000000000000D+00 x(10) = 0.12500000000000000000D+00 x(11) = 0.25000000000000000000D+00 x(12) = 0.37500000000000000000D+00 x(13) = 0.50000000000000000000D+00 x(14) = 0.62500000000000000000D+00 x(15) = 0.75000000000000000000D+00 x(16) = 0.87500000000000000000D+00 x(17) = 1.00000000000000000000D+00 w(1) = 0.030797894233299012495D+00 w(2) = 0.26128238288028031086D+00 w(3) = -0.36795289329867605622D+00 w(4) = 1.7037379778090086905D+00 w(5) = -3.9501480717783930427D+00 w(6) = 8.5525299934402953388D+00 w(7) = -13.934614237197880038D+00 w(8) = 19.180342211078732848D+00 w(9) = -20.951950514333334128D+00 w(10) = 19.180342211078732848D+00 w(11) = -13.934614237197880038D+00 w(12) = 8.5525299934402953388D+00 w(13) = -3.9501480717783930427D+00 w(14) = 1.7037379778090086905D+00 w(15) = -0.36795289329867605622D+00 w(16) = 0.26128238288028031086D+00 w(17) = 0.030797894233299012495D+00 else if ( order == 18 ) then ! ! 55294720874657 / 1883051089920000 ! 450185515446285 / 1883051089920000 ! - 542023437008852 / 1883051089920000 ! 2428636525764260 / 1883051089920000 ! - 4768916800123440 / 1883051089920000 ! 8855416648684984 / 1883051089920000 ! - 1