24 June 2008 07:09:32 PM QUADRULE_PRB C++ version Test the routines in the QUADRULE library. TEST01 BASHFORTH_SET sets up an Adams-Bashforth rule; SUMMER carries it out. The integration interval is [0,1]. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0 0 0 0 2 1 0.5 -0.5 0.5 -0.5 3 1 0.5 0.33333333 -2 5.3333333 4 1 0.5 0.33333333 0.25 -8.1666667 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 10 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0 0 0 0 1 2 0.5 -0.5 0.5 0.42073549 1.3160603 3 -12 25.333333 -52 0.74308739 1.4825504 4 44.25 -177.16667 625.25 0.71970264 1.5772681 5 -39.416667 366.66667 -2303.0833 0.45175383 1.6329278 6 0.16666667 -227.08333 3238.5833 0.23756477 1.6662191 7 0.16666667 0.14285714 -1533.1667 0.27217635 1.6863529 8 0.16666667 0.14285714 0.125 0.48447149 1.6986215 9 0.16666667 0.14285714 0.125 0.64391964 1.7061382 10 0.16666667 0.14285714 0.125 0.60247512 1.7107624 Order SQRT(|X|) 1 0 2 -0.5 3 -0.74407768 4 -0.92760648 5 -1.082014 6 -1.2187217 7 -1.3432956 8 -1.4589143 9 -1.5675858 10 -1.6706701 TEST02 BDFC_SET sets up a Backward Difference Corrector rule; BDF_SUM carries it out. The integration interval is [0,1]. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 1 1 1 1 2 1 0.5 0.5 0.5 0.5 3 1 0.5 0.33333333 0.5 0.33333333 4 1 0.5 0.33333333 0.25 0.83333333 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 10 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 1 1 1 0.84147098 2.7182818 2 0.5 0.5 0.5 0.42073549 1.8591409 3 0.5 0.33333333 0.5 0.42073549 1.7686275 4 -0.75 2.8333333 -4.75 0.45297068 1.7400198 5 2.4166667 -9.8333333 39.583333 0.47174071 1.7285669 6 0.16666667 10.416667 -86.416667 0.47066572 1.7234229 7 0.16666667 0.14285714 57.416667 0.4605822 1.7209484 8 0.16666667 0.14285714 1.511536 0.4539602 1.7197325 9 0.16666667 0.14285714 1.511536 0.45490363 1.7190841 10 0.16666667 0.14285714 1.511536 0.45996731 1.7187384 Order SQRT(|X|) 1 1 2 0.5 3 0.33333333 4 0.22559223 5 0.14444121 6 0.078476491 7 0.022362102 8 -0.025637441 9 -0.069681782 10 -0.10974341 TEST03 BDFP_SET sets up a Backward Difference Predictor rule; BDF_SUM carries it out. The integration interval is [0,1]. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0 0 0 0 2 1 0.5 -0.5 0.5 -0.5 3 1 0.5 0.33333333 -2 5.3333333 4 1 0.5 0.33333333 0.25 -8.1666667 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 10 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0 0 0 0 1 2 0.5 -0.5 0.5 0.42073549 1.3160603 3 -12 25.333333 -52 0.74308739 1.4825504 4 44.25 -177.16667 625.25 0.71970264 1.5772681 5 -39.416667 366.66667 -2303.0833 0.45175383 1.6329278 6 0.16666667 -227.08333 3238.5833 0.23756477 1.6662191 7 0.16666667 0.14285714 -1533.1667 0.27217635 1.6863529 8 0.16666667 0.14285714 0.125 0.48447149 1.6986215 9 0.16666667 0.14285714 0.125 0.64391964 1.7061382 10 0.16666667 0.14285714 0.125 0.60247512 1.7107624 Order SQRT(|X|) 1 0 2 -0.5 3 -0.74407768 4 -0.92760648 5 -1.082014 6 -1.2187217 7 -1.3432956 8 -1.4589143 9 -1.5675858 10 -1.6706701 TEST04 CHEB_SET sets up a Chebyshev rule; SUM_SUB carries it out. The integration interval is [0,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 2 1 0.5 0.33333333 0.25 0.19444444 3 1 0.5 0.33333333 0.25 0.19791667 4 1 0.5 0.33333333 0.25 0.2 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 2 0.15277778 0.12037037 0.094907407 0.45958781 1.7178964 3 0.16145833 0.13411458 0.11263021 0.45965669 1.7181366 4 0.16666667 0.14259259 0.12407407 0.45969787 1.7182812 5 0.16666667 0.1427228 0.1245298 0.45969778 1.7182815 6 0.16666667 0.14285714 0.125 0.45969769 1.7182818 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 9 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0.70710678 2 0.67388734 3 0.67122325 4 0.6689056 5 0.66839073 6 0.66777528 7 0.66758934 9 0.66724897 TEST05 CHEBYSHEV1_COMPUTE sets up a Gauss-Chebyshev type 1 rule, SUMMER carries it out. The integration interval is [-1,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. The weight function is 1 / sqrt ( 1 - X**2 ) Order 1 X X^2 X^3 X^4 1 3.14159 1.92367e-16 1.17791e-32 7.21261e-49 4.41645e-65 2 3.14159 0 1.5708 0 0.785398 3 3.14159 1.11022e-16 1.5708 0 1.1781 4 3.14159 -1.11022e-16 1.5708 1.11022e-16 1.1781 5 3.14159 1.11022e-16 1.5708 0 1.1781 6 3.14159 2.22045e-16 1.5708 2.22045e-16 1.1781 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 2.7043e-81 1.6559e-97 1.01395e-113 1.92367e-16 3.14159 2 0 0.392699 0 0 3.96027 3 0 0.883573 0 1.11022e-16 3.97732 4 0 0.981748 0 1.11022e-16 3.97746 5 0 0.981748 0 0 3.97746 6 2.22045e-16 0.981748 3.33067e-16 -5.55112e-17 3.97746 Order SQRT(|X|) 1 2.45833e-08 2 2.64175 3 1.94905 4 2.48155 5 2.18893 6 2.44254 TEST06 CHEBYSHEV2_COMPUTE sets up a Gauss-Chebyshev type 2 rule, SUMMER carries it out. The integration interval is [-1,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. The weight function is 1 / sqrt ( 1 - X**2 ) Order 1 X X^2 X^3 X^4 1 1.5708 9.61835e-17 5.88954e-33 3.6063e-49 2.20822e-65 2 1.5708 5.55112e-17 0.392699 1.249e-16 0.0981748 3 1.5708 5.55112e-17 0.392699 0 0.19635 4 1.5708 -2.77556e-17 0.392699 1.38778e-17 0.19635 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 1.35215e-81 8.27952e-98 5.06974e-114 9.61835e-17 1.5708 2 5.89806e-17 0.0245437 2.08167e-17 0 1.77127 3 0 0.0981748 0 5.55112e-17 1.77546 4 -1.38778e-17 0.122718 0 0 1.7755 Order SQRT(|X|) 1 1.22917e-08 2 1.11072 3 0.660439 4 1.02235 TEST07 CHEBYSHEV3_COMPUTE sets up a Gauss-Chebyshev type 3 rule, SUMMER carries it out. The integration interval is [-1,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. The weight function is 1 / sqrt ( 1 - X**2 ) Order 1 X X^2 X^3 X^4 1 3.14159 0 0 0 0 2 3.14159 0 3.14159 0 3.14159 3 3.14159 1.11022e-16 1.5708 0 1.5708 4 3.14159 3.33067e-16 1.5708 2.22045e-16 1.1781 5 3.14159 0 1.5708 -5.55112e-17 1.1781 6 3.14159 2.22045e-16 1.5708 1.66533e-16 1.1781 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0 0 0 0 3.14159 2 0 3.14159 0 0 4.84773 3 0 1.5708 0 1.11022e-16 3.99466 4 1.11022e-16 1.07992 1.11022e-16 2.77556e-16 3.9776 5 0 0.981748 0 5.55112e-17 3.97746 6 0 0.981748 1.11022e-16 1.66533e-16 3.97746 Order SQRT(|X|) 1 0 2 3.14159 3 1.5708 4 2.52816 5 2.10628 6 2.45716 TEST0725 CLENSHAW_CURTIS_COMPUTE computes a Clenshaw-Curtis quadrature rule over [-1,1] of given order. Order W X 1 2 0 2 1 1 1 -1 3 0.333333 1 1.33333 6.12323e-17 0.333333 -1 4 0.111111 1 0.888889 0.5 0.888889 -0.5 0.111111 -1 5 0.0666667 1 0.533333 0.707107 0.8 6.12323e-17 0.533333 -0.707107 0.0666667 -1 6 0.04 1 0.360743 0.809017 0.599257 0.309017 0.599257 -0.309017 0.360743 -0.809017 0.04 -1 7 0.0285714 1 0.253968 0.866025 0.457143 0.5 0.520635 6.12323e-17 0.457143 -0.5 0.253968 -0.866025 0.0285714 -1 8 0.0204082 1 0.190141 0.900969 0.352242 0.62349 0.437208 0.222521 0.437208 -0.222521 0.352242 -0.62349 0.190141 -0.900969 0.0204082 -1 9 0.015873 1 0.146219 0.92388 0.279365 0.707107 0.361718 0.382683 0.393651 6.12323e-17 0.361718 -0.382683 0.279365 -0.707107 0.146219 -0.92388 0.015873 -1 10 0.0123457 1 0.116567 0.939693 0.225284 0.766044 0.30194 0.5 0.343863 0.173648 0.343863 -0.173648 0.30194 -0.5 0.225284 -0.766044 0.116567 -0.939693 0.0123457 -1 TEST075 CLENSHAW_CURTIS_SET sets up a Clenshaw-Curtis rule; SUMMER carries it out. The integration interval is [-1,1]. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 2 0 0 0 0 2 2 0 2 0 2 3 2 0 0.66666667 0 0.66666667 4 2 -5.5511151e-17 0.66666667 0 0.33333333 5 2 1.3877788e-17 0.66666667 1.3877788e-17 0.4 6 2 -3.5874081e-15 0.66666667 -7.1401218e-15 0.4 7 2 -1.0408341e-17 0.66666667 -1.0408341e-17 0.4 8 2 -7.979728e-17 0.66666667 3.469447e-18 0.4 9 2 0 0.66666667 5.5511151e-17 0.4 10 2 -5.5511151e-17 0.66666667 0 0.4 11 2 -8.6736174e-18 0.66666667 5.2041704e-18 0.4 12 2 -6.9388939e-17 0.66666667 -1.3877788e-17 0.4 13 2 4.2500725e-17 0.66666667 -6.0715322e-18 0.4 14 2 -3.7296555e-17 0.66666667 -9.5409791e-18 0.4 15 2 1.8214596e-17 0.66666667 -5.1174343e-17 0.4 16 2 -1.4658413e-16 0.66666667 -1.474515e-17 0.4 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0 0 0 0 2 2 0 2 0 0 3.0861613 3 0 0.66666667 0 0 2.3620538 4 -1.3877788e-17 0.25 0 -4.1633363e-17 2.3475752 5 1.3877788e-17 0.26666667 -1.3877788e-17 -6.9388939e-18 2.3503754 6 -7.8062556e-15 0.28333333 -7.126244e-15 -2.5326963e-15 2.3503988 7 3.469447e-18 0.28571429 3.469447e-18 0 2.3504024 8 3.469447e-18 0.28571429 3.469447e-18 -4.1633363e-17 2.3504024 9 0 0.28571429 1.3877788e-17 -1.0408341e-17 2.3504024 10 0 0.28571429 0 1.5612511e-17 2.3504024 11 5.2041704e-18 0.28571429 -8.6736174e-18 -1.2143064e-17 2.3504024 12 0 0.28571429 0 -1.3877788e-17 2.3504024 13 -1.3010426e-17 0.28571429 7.8062556e-18 9.5409791e-18 2.3504024 14 -9.5409791e-18 0.28571429 -9.5409791e-18 0 2.3504024 15 -9.5409791e-18 0.28571429 -2.6020852e-18 -8.6736174e-19 2.3504024 16 -8.6736174e-19 0.28571429 -8.6736174e-19 1.4311469e-17 2.3504024 Order SQRT(|X|) 1 0 2 2 3 0.66666667 4 1.4793009 5 1.0302895 6 1.3951888 7 1.1763287 8 1.3705295 9 1.2301946 10 1.358633 11 1.2601126 12 1.3520299 13 1.2774746 14 1.347854 15 1.2891202 16 1.3450415 TEST076 FEJER1_COMPUTE computes a Fejer type 1 quadrature rule; FEJER1_SET sets a Fejer type 1 quadrature rule; Compare: (W1,X1) from FEJER1_SET, (W2,X2) from FEJER1_COMPUTE. Order W1 W2 X1 X2 1 2 2 0 0 2 1 1 -0.70710678 -0.70710678 1 1 0.70710678 0.70710678 3 0.44444444 0.44444444 -0.8660254 -0.8660254 1.1111111 1.1111111 0 6.123234e-17 0.44444444 0.44444444 0.8660254 0.8660254 4 0.26429774 0.26429774 -0.92387953 -0.92387953 0.73570226 0.73570226 -0.38268343 -0.38268343 0.73570226 0.73570226 0.38268343 0.38268343 0.26429774 0.26429774 0.92387953 0.92387953 5 0.16778123 0.16778123 -0.95105652 -0.95105652 0.5255521 0.5255521 -0.58778525 -0.58778525 0.61333333 0.61333333 0 6.123234e-17 0.5255521 0.5255521 0.58778525 0.58778525 0.16778123 0.16778123 0.95105652 0.95105652 6 0.11866102 0.11866102 -0.96592583 -0.96592583 0.37777778 0.37777778 -0.70710678 -0.70710678 0.5035612 0.5035612 -0.25881905 -0.25881905 0.5035612 0.5035612 0.25881905 0.25881905 0.37777778 0.37777778 0.70710678 0.70710678 0.11866102 0.11866102 0.96592583 0.96592583 7 0.086716181 0.086716181 -0.97492791 -0.97492791 0.28783139 0.28783139 -0.78183148 -0.78183148 0.39824154 0.39824154 -0.43388374 -0.43388374 0.45442177 0.45442177 0 6.123234e-17 0.39824154 0.39824154 0.43388374 0.43388374 0.28783139 0.28783139 0.78183148 0.78183148 0.086716181 0.086716181 0.97492791 0.97492791 8 0.066982946 0.066982946 -0.98078528 -0.98078528 0.22298793 0.22298793 -0.83146961 -0.83146961 0.32415252 0.32415252 -0.55557023 -0.55557023 0.3858766 0.3858766 -0.19509032 -0.19509032 0.3858766 0.3858766 0.19509032 0.19509032 0.32415252 0.32415252 0.55557023 0.55557023 0.22298793 0.22298793 0.83146961 0.83146961 0.066982946 0.066982946 0.98078528 0.98078528 9 0.05273665 0.05273665 -0.98480775 -0.98480775 0.17918871 0.17918871 -0.8660254 -0.8660254 0.26403722 0.26403722 -0.64278761 -0.64278761 0.33084518 0.33084518 -0.34202014 -0.34202014 0.34638448 0.34638448 0 6.123234e-17 0.33084518 0.33084518 0.34202014 0.34202014 0.26403722 0.26403722 0.64278761 0.64278761 0.17918871 0.17918871 0.8660254 0.8660254 0.05273665 0.05273665 0.98480775 0.98480775 10 0.04293912 0.04293912 -0.98768834 -0.98768834 0.14587492 0.14587492 -0.89100652 -0.89100652 0.22031746 0.22031746 -0.70710678 -0.70710678 0.28087922 0.28087922 -0.4539905 -0.4539905 0.30998928 0.30998928 -0.15643447 -0.15643447 0.30998928 0.30998928 0.15643447 0.15643447 0.28087922 0.28087922 0.4539905 0.4539905 0.22031746 0.22031746 0.70710678 0.70710678 0.14587492 0.14587492 0.89100652 0.89100652 0.04293912 0.04293912 0.98768834 0.98768834 TEST078 FEJER2_COMPUTE computes a Fejer type 2 quadrature rule; FEJER2_SET sets a Fejer type 2 quadrature rule; Compare: (W1,X1) from FEJER2_SET, (W2,X2) from FEJER2_COMPUTE. Order W1 W2 X1 X2 1 2 2 0 0 2 1 0.66666667 -0.5 -0.5 1 0.66666667 0.5 0.5 3 0.66666667 0.66666667 -0.70710678 -0.70710678 0.66666667 0.66666667 0 6.123234e-17 0.66666667 0.66666667 0.70710678 0.70710678 4 0.4254644 0.4254644 -0.80901699 -0.80901699 0.5745356 0.5745356 -0.30901699 -0.30901699 0.5745356 0.5745356 0.30901699 0.30901699 0.4254644 0.4254644 0.80901699 0.80901699 5 0.31111111 0.31111111 -0.8660254 -0.8660254 0.4 0.4 -0.5 -0.5 0.57777778 0.57777778 0 6.123234e-17 0.4 0.4 0.5 0.5 0.31111111 0.31111111 0.8660254 0.8660254 6 0.22691525 0.22691525 -0.90096887 -0.90096887 0.32679386 0.32679386 -0.6234898 -0.6234898 0.44629089 0.44629089 -0.22252093 -0.22252093 0.44629089 0.44629089 0.22252093 0.22252093 0.32679386 0.32679386 0.6234898 0.6234898 0.22691525 0.22691525 0.90096887 0.90096887 7 0.17796468 0.17796468 -0.92387953 -0.92387953 0.24761905 0.24761905 -0.70710678 -0.70710678 0.39346389 0.39346389 -0.38268343 -0.38268343 0.36190476 0.36190476 0 6.123234e-17 0.39346389 0.39346389 0.38268343 0.38268343 0.24761905 0.24761905 0.70710678 0.70710678 0.17796468 0.17796468 0.92387953 0.92387953 8 0.13976974 0.13976974 -0.93969262 -0.93969262 0.20636965 0.20636965 -0.76604444 -0.76604444 0.31428571 0.31428571 -0.5 -0.5 0.3395749 0.3395749 -0.17364818 -0.17364818 0.3395749 0.3395749 0.17364818 0.17364818 0.31428571 0.31428571 0.5 0.5 0.20636965 0.20636965 0.76604444 0.76604444 0.13976974 0.13976974 0.93969262 0.93969262 9 0.11478108 0.11478108 -0.95105652 -0.95105652 0.16543319 0.16543319 -0.80901699 -0.80901699 0.27379035 0.27379035 -0.58778525 -0.58778525 0.27901125 0.27901125 -0.30901699 -0.30901699 0.33396825 0.33396825 0 6.123234e-17 0.27901125 0.27901125 0.30901699 0.30901699 0.27379035 0.27379035 0.58778525 0.58778525 0.16543319 0.16543319 0.80901699 0.80901699 0.11478108 0.11478108 0.95105652 0.95105652 10 0.094419542 0.094419542 -0.95949297 -0.95949297 0.14113544 0.14113544 -0.84125353 -0.84125353 0.22638669 0.22638669 -0.65486073 -0.65486073 0.25305098 0.25305098 -0.41541501 -0.41541501 0.28500735 0.28500735 -0.14231484 -0.14231484 0.28500735 0.28500735 0.14231484 0.14231484 0.25305098 0.25305098 0.41541501 0.41541501 0.22638669 0.22638669 0.65486073 0.65486073 0.14113544 0.14113544 0.84125353 0.84125353 0.094419542 0.094419542 0.95949297 0.95949297 TEST079 GEGENBAUER_COMPUTE computes a Gauss-Gegenbauer rule; The printed output of this routine can be inserted into a C++ program. // // Abscissas X and weights W for a Gauss Gegenbauer rule // of ORDER = 5 // with ALPHA = 0.5 // x[ 0] = -0.8660254037844387; x[ 1] = -0.5; x[ 2] = 0; x[ 3] = 0.5; x[ 4] = 0.8660254037844387; w[ 0] = 0.130899693899574; w[ 1] = 0.3926990816987242; w[ 2] = 0.5235987755982989; w[ 3] = 0.3926990816987242; w[ 4] = 0.1308996938995745; TEST079 GEGENBAUER_COMPUTE computes a Gauss-Gegenbauer rule; The printed output of this routine can be inserted into a C++ program. // // Abscissas X and weights W for a Gauss Gegenbauer rule // of ORDER = 10 // with ALPHA = -0.5 // x[ 0] = -0.9876883405951378; x[ 1] = -0.8910065241883679; x[ 2] = -0.7071067811865476; x[ 3] = -0.4539904997395468; x[ 4] = -0.1564344650402309; x[ 5] = 0.1564344650402309; x[ 6] = 0.4539904997395468; x[ 7] = 0.7071067811865476; x[ 8] = 0.8910065241883679; x[ 9] = 0.9876883405951378; w[ 0] = 0.3141592653589749; w[ 1] = 0.3141592653589789; w[ 2] = 0.3141592653589792; w[ 3] = 0.3141592653589794; w[ 4] = 0.3141592653589794; w[ 5] = 0.3141592653589794; w[ 6] = 0.3141592653589789; w[ 7] = 0.3141592653589792; w[ 8] = 0.3141592653589789; w[ 9] = 0.3141592653589749; TEST08 HERMITE_COMPUTE computes a Gauss-Hermite rule; SUMMER carries it out. The integration interval is ( -Infinity, +Infinity ). The weight function is exp ( - X**2 ) Order 1 X X^2 X^3 X^4 1 1.7724539 0 0 0 0 2 1.7724539 0 0.88622693 0 0.44311346 3 1.7724539 0 0.88622693 0 1.3293404 4 1.7724539 0 0.88622693 0 1.3293404 5 1.7724539 -1.3877788e-17 0.88622693 2.7755576e-17 1.3293404 6 1.7724539 -3.8163916e-17 0.88622693 -6.9388939e-18 1.3293404 7 1.7724539 1.8214596e-17 0.88622693 6.9388939e-18 1.3293404 8 1.7724539 -1.496199e-17 0.88622693 2.2551405e-17 1.3293404 9 1.7724539 -3.48571e-17 0.88622693 9.97466e-18 1.3293404 10 1.7724539 1.7621673e-17 0.88622693 3.6862874e-17 1.3293404 11 1.7724539 -3.0021389e-17 0.88622693 -4.1904414e-17 1.3293404 12 1.7724539 -2.9898145e-18 0.88622693 3.7035669e-17 1.3293404 13 1.7724539 5.8153047e-18 0.88622693 -1.6062286e-17 1.3293404 14 1.7724539 2.6134222e-17 0.88622693 1.8538587e-17 1.3293404 15 1.7724539 3.5957333e-17 0.88622693 6.9303309e-17 1.3293404 16 1.7724539 7.3520042e-17 0.88622693 1.1812569e-18 1.3293404 17 1.7724539 2.0949711e-17 0.88622693 8.2483137e-17 1.3293404 18 1.7724539 3.9859022e-17 0.88622693 -1.405102e-17 1.3293404 19 1.7724539 4.3266784e-18 0.88622693 5.0598858e-17 1.3293404 20 1.7724539 3.2716864e-17 0.88622693 -2.2583908e-17 1.3293404 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0 0 0 0 1.7724539 2 0 0.22155673 0 0 2.2343409 3 0 1.9940106 0 0 2.2738014 4 1.110223e-16 3.323351 0 0 2.2758017 5 0 3.323351 0 -6.9388939e-18 2.2758737 6 -5.5511151e-17 3.323351 0 -3.3827108e-17 2.2758757 7 -5.5511151e-17 3.323351 -1.110223e-16 -2.7050844e-17 2.2758758 8 6.9388939e-17 3.323351 3.8857806e-16 3.0838776e-17 2.2758758 9 2.7755576e-17 3.323351 2.7755576e-16 -8.7197807e-18 2.2758758 10 -1.0408341e-17 3.323351 9.7144515e-17 -1.5558725e-17 2.2758758 11 5.3451167e-17 3.323351 -8.6736174e-17 -1.0803588e-17 2.2758758 12 -9.240113e-17 3.323351 2.2724878e-16 -3.5313598e-17 2.2758758 13 5.0124022e-17 3.323351 -1.6154612e-16 -3.6154609e-18 2.2758758 14 4.6857863e-17 3.323351 -3.040916e-16 8.6154715e-18 2.2758758 15 -5.2320378e-17 3.323351 2.9708495e-16 1.8300014e-17 2.2758758 16 -2.3225749e-17 3.323351 -1.4949962e-16 8.0163239e-18 2.2758758 17 9.9880537e-18 3.323351 3.4346424e-16 -1.6659447e-17 2.2758758 18 3.5454086e-18 3.323351 3.2426782e-16 1.6825323e-17 2.2758758 19 1.3865585e-16 3.323351 -2.1284106e-16 8.5848861e-18 2.2758758 20 1.2439488e-17 3.323351 -2.4478121e-16 4.1239499e-17 2.2758758 Order SQRT(|X|) 1 0 2 1.4904501 3 0.65384754 4 1.3749793 5 0.82747983 6 1.3339991 7 0.91327495 8 1.3122322 9 0.96550308 10 1.2985043 11 1.0010473 12 1.2889609 13 1.026994 14 1.2818946 15 1.0468727 16 1.2764253 17 1.062651 18 1.2720506 19 1.0755182 20 1.2684616 TEST085 HERMITE_COMPUTE computes a Gauss-Hermite rule which is appropriate for integrands of the form f(x) * exp(-x**2) from -infinity to infinity. HERMITE_INTEGRAL determines the exact value of this integal when f(x) = x^n. N Order Estimate Exact Error 0 1 1.7724539 1.7724539 0 0 2 1.7724539 1.7724539 2.220446e-16 0 3 1.7724539 1.7724539 2.220446e-16 0 4 1.7724539 1.7724539 0 0 5 1.7724539 1.7724539 2.220446e-16 0 6 1.7724539 1.7724539 4.4408921e-16 0 7 1.7724539 1.7724539 0 0 8 1.7724539 1.7724539 4.4408921e-16 0 9 1.7724539 1.7724539 0 0 10 1.7724539 1.7724539 2.220446e-16 2 1 0 0.88622693 0.88622693 2 2 0.88622693 0.88622693 3.3306691e-16 2 3 0.88622693 0.88622693 3.3306691e-16 2 4 0.88622693 0.88622693 0 2 5 0.88622693 0.88622693 2.220446e-16 2 6 0.88622693 0.88622693 4.4408921e-16 2 7 0.88622693 0.88622693 5.5511151e-16 2 8 0.88622693 0.88622693 7.7715612e-16 2 9 0.88622693 0.88622693 0 2 10 0.88622693 0.88622693 1.110223e-16 4 1 0 1.3293404 1.3293404 4 2 0.44311346 1.3293404 0.88622693 4 3 1.3293404 1.3293404 2.220446e-16 4 4 1.3293404 1.3293404 4.4408921e-16 4 5 1.3293404 1.3293404 2.220446e-16 4 6 1.3293404 1.3293404 6.6613381e-16 4 7 1.3293404 1.3293404 1.3322676e-15 4 8 1.3293404 1.3293404 1.5543122e-15 4 9 1.3293404 1.3293404 2.220446e-16 4 10 1.3293404 1.3293404 4.4408921e-16 6 1 0 3.323351 3.323351 6 2 0.22155673 3.323351 3.1017942 6 3 1.9940106 3.323351 1.3293404 6 4 3.323351 3.323351 0 6 5 3.323351 3.323351 4.4408921e-16 6 6 3.323351 3.323351 4.4408921e-16 6 7 3.323351 3.323351 3.1086245e-15 6 8 3.323351 3.323351 1.3322676e-15 6 9 3.323351 3.323351 1.3322676e-15 6 10 3.323351 3.323351 4.4408921e-16 8 1 0 11.631728 11.631728 8 2 0.11077837 11.631728 11.52095 8 3 2.9910159 11.631728 8.6407125 8 4 8.9730476 11.631728 2.6586808 8 5 11.631728 11.631728 3.5527137e-15 8 6 11.631728 11.631728 1.7763568e-15 8 7 11.631728 11.631728 7.1054274e-15 8 8 11.631728 11.631728 3.5527137e-15 8 9 11.631728 11.631728 8.8817842e-15 8 10 11.631728 11.631728 1.7763568e-15 10 1 0 52.342778 52.342778 10 2 0.055389183 52.342778 52.287389 10 3 4.4865238 52.342778 47.856254 10 4 24.42663 52.342778 27.916148 10 5 45.696076 52.342778 6.6467019 10 6 52.342778 52.342778 0 10 7 52.342778 52.342778 0 10 8 52.342778 52.342778 0 10 9 52.342778 52.342778 6.3948846e-14 10 10 52.342778 52.342778 2.8421709e-14 TEST087 HERMITE_COMPUTE computes a Gauss-Hermite rule; Compute the data for ORDER = 31 xtab[ 0] = -6.99568012371854; xtab[ 1] = -6.27507870494286; xtab[ 2] = -5.673961444618588; xtab[ 3] = -5.133595577112381; xtab[ 4] = -4.63155950631286; xtab[ 5] = -4.156271755818145; xtab[ 6] = -3.700743403231469; xtab[ 7] = -3.260320732313541; xtab[ 8] = -2.831680453390205; xtab[ 9] = -2.41231770548042; xtab[10] = -2.000258548935639; xtab[11] = -1.59388586047214; xtab[12] = -1.191826998350046; xtab[13] = -0.7928769769153089; xtab[14] = -0.3959427364714231; xtab[15] = -2.350988701644575e-38; xtab[16] = 0.3959427364714231; xtab[17] = 0.7928769769153089; xtab[18] = 1.191826998350046; xtab[19] = 1.59388586047214; xtab[20] = 2.000258548935639; xtab[21] = 2.41231770548042; xtab[22] = 2.831680453390205; xtab[23] = 3.260320732313541; xtab[24] = 3.700743403231469; xtab[25] = 4.156271755818145; xtab[26] = 4.63155950631286; xtab[27] = 5.133595577112381; xtab[28] = 5.673961444618588; xtab[29] = 6.27507870494286; xtab[30] = 6.99568012371854; weight[ 0] = 4.61896839446421e-22; weight[ 1] = 5.110609007927184e-18; weight[ 2] = 5.899556498753906e-15; weight[ 3] = 1.860373521452161e-12; weight[ 4] = 2.352492003208644e-10; weight[ 5] = 1.461198834491042e-08; weight[ 6] = 5.043712558939817e-07; weight[ 7] = 1.049860275767566e-05; weight[ 8] = 0.0001395209039504715; weight[ 9] = 0.001233683307306897; weight[10] = 0.007482799914035269; weight[11] = 0.03184723073130061; weight[12] = 0.09671794816087124; weight[13] = 0.2121327886687664; weight[14] = 0.3387726578941103; weight[15] = 0.3957785560986126; weight[16] = 0.3387726578941103; weight[17] = 0.2121327886687664; weight[18] = 0.09671794816087124; weight[19] = 0.03184723073130061; weight[20] = 0.007482799914035269; weight[21] = 0.001233683307306897; weight[22] = 0.0001395209039504715; weight[23] = 1.049860275767566e-05; weight[24] = 5.043712558939817e-07; weight[25] = 1.461198834491042e-08; weight[26] = 2.352492003208644e-10; weight[27] = 1.860373521452161e-12; weight[28] = 5.899556498753906e-15; weight[29] = 5.110609007927184e-18; weight[30] = 4.61896839446421e-22; TEST09 HERMITE_SET sets up a Gauss-Hermite rule; SUMMER carries it out. The integration interval is ( -Infinity, +Infinity ). The weight function is exp ( - X**2 ) Order 1 X X^2 X^3 X^4 1 1.7724539 0 0 0 0 2 1.7724539 0 0.88622693 0 0.44311346 3 1.7724539 0 0.88622693 0 1.3293404 4 1.7724539 5.5511151e-17 0.88622693 0 1.3293404 5 1.7724539 2.7755576e-17 0.88622693 2.7755576e-17 1.3293404 6 1.7724539 -2.9490299e-17 0.88622693 -1.3877788e-17 1.3293404 7 1.7724539 0 0.88622693 -2.0816682e-17 1.3293404 8 1.7724539 6.1582683e-17 0.88622693 -3.469447e-18 1.3293404 9 1.7724539 -1.8865118e-17 0.88622693 -1.3444107e-17 1.3293404 10 1.7724539 3.3589939e-17 0.88622693 3.2363435e-17 1.3293404 11 1.7724539 -1.4518145e-17 0.88622693 2.6603611e-17 1.3293404 12 1.7724539 6.1898627e-17 0.88622693 -8.0840824e-18 1.3293404 13 1.7724539 1.3433678e-17 0.88622693 -4.4762303e-17 1.3293404 14 1.7724539 3.0928449e-17 0.88622693 -2.6265645e-17 1.3293404 15 1.7724539 3.524672e-17 0.88622693 1.5026391e-17 1.3293404 16 1.7724539 1.0255247e-17 0.88622693 1.7313638e-17 1.3293404 17 1.7724539 -1.4656165e-17 0.88622693 -4.8976352e-17 1.3293404 18 1.7724539 -7.2840329e-18 0.88622693 3.4918918e-17 1.3293404 19 1.7724539 3.3776209e-17 0.88622693 2.9347069e-17 1.3293404 20 1.7724539 -1.2945466e-17 0.88622693 3.5305685e-17 1.3293404 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0 0 0 0 1.7724539 2 0 0.22155673 0 0 2.2343409 3 0 1.9940106 0 0 2.2738014 4 1.110223e-16 3.323351 0 -1.3877788e-17 2.2758017 5 0 3.323351 0 -1.0408341e-17 2.2758737 6 1.110223e-16 3.323351 2.220446e-16 2.3852448e-17 2.2758757 7 -5.5511151e-17 3.323351 2.220446e-16 6.9388939e-18 2.2758758 8 -2.0816682e-17 3.323351 5.5511151e-17 3.7797998e-17 2.2758758 9 1.3357371e-16 3.323351 1.3877788e-16 -1.7416268e-17 2.2758758 10 -1.0755286e-16 3.323351 2.6367797e-16 -1.6633186e-17 2.2758758 11 -6.4618449e-17 3.323351 2.2551405e-17 1.023004e-17 2.2758758 12 -1.0649576e-16 3.323351 -8.1532003e-17 -2.0568263e-17 2.2758758 13 -1.9610507e-17 3.323351 -3.1929754e-16 -2.9861571e-17 2.2758758 14 7.1152462e-17 3.323351 3.4829995e-16 -2.3316403e-17 2.2758758 15 -1.1643315e-17 3.323351 -2.7151133e-16 2.7418208e-17 2.2758758 16 -1.4319727e-16 3.323351 1.2448674e-16 -8.7892048e-18 2.2758758 17 -9.2793703e-17 3.323351 -4.4755527e-16 2.2876239e-17 2.2758758 18 -2.3258135e-17 3.323351 -2.8651821e-16 3.3688795e-18 2.2758758 19 -3.1362646e-17 3.323351 -4.7575816e-16 6.1457269e-18 2.2758758 20 5.1781832e-17 3.323351 1.7674285e-16 1.2888751e-17 2.2758758 Order SQRT(|X|) 1 0 2 1.4904501 3 0.65384754 4 1.3749793 5 0.82747983 6 1.3339991 7 0.91327495 8 1.3122322 9 0.96550308 10 1.2985043 11 1.0010473 12 1.2889609 13 1.026994 14 1.2818946 15 1.0468727 16 1.2764253 17 1.062651 18 1.2720506 19 1.0755182 20 1.2684616 TEST10 JACOBI_COMPUTE computes a Gauss-Jacobi rule; SUM_SUB carries it out. The integration interval is [-1,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. ALPHA = 0 BETA = 0 Order 1 X X^2 X^3 X^4 1 2 0 0 0 0 2 2 0 0.66666667 0 0.22222222 3 2 6.1062266e-16 0.66666667 3.3306691e-16 0.4 4 2 0 0.66666667 0 0.4 5 2 2.7755576e-17 0.66666667 -2.7755576e-17 0.4 6 2 -1.2490009e-15 0.66666667 -9.15934e-16 0.4 7 2 -2.4147351e-15 0.66666667 -2.5396352e-15 0.4 8 2 2.5812685e-15 0.66666667 2.4424907e-15 0.4 9 2 -6.9388939e-17 0.66666667 1.3877788e-17 0.4 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0 0 0 0 2 2 0 0.074074074 0 0 2.3426961 3 2.220446e-16 0.24 1.2490009e-16 5.5511151e-16 2.3503369 4 0 0.28571429 0 0 2.3504021 5 0 0.28571429 -1.3877788e-17 0 2.3504024 6 -7.3552275e-16 0.28571429 -5.9674488e-16 -1.0547119e-15 2.3504024 7 -2.553513e-15 0.28571429 -2.4008573e-15 -2.0122792e-15 2.3504024 8 2.2620794e-15 0.28571429 2.0816682e-15 2.2482016e-15 2.3504024 9 0 0.28571429 -2.7755576e-17 2.7755576e-17 2.3504024 Order SQRT(|X|) 1 0 2 1.5196714 3 0.97790193 4 1.4061049 5 1.1535178 6 1.3747215 7 1.2205122 8 1.3608784 9 1.254222 ALPHA = 1 BETA = 0 Order 1 X X^2 X^3 X^4 1 2 -0.66666667 0.22222222 -0.074074074 0.024691358 2 2 -0.66666667 0.66666667 -0.4 0.29333333 3 2 -0.66666667 0.66666667 -0.4 0.4 4 2 -0.66666667 0.66666667 -0.4 0.4 5 2 -0.66666667 0.66666667 -0.4 0.4 6 2 -0.66666667 0.66666667 -0.4 0.4 7 2 -0.66666667 0.66666667 -0.4 0.4 8 2 -0.66666667 0.66666667 -0.4 0.4 9 2 -0.66666667 0.66666667 -0.4 0.4 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 -0.0082304527 0.0027434842 -0.00091449474 -0.65438939 1.4330626 2 -0.19733333 0.1376 -0.094506667 -0.60162582 1.6107516 3 -0.28571429 0.25959184 -0.19941691 -0.60234176 1.6146106 4 -0.28571429 0.28571429 -0.22222222 -0.60233734 1.6146434 5 -0.28571429 0.28571429 -0.22222222 -0.60233736 1.6146435 6 -0.28571429 0.28571429 -0.22222222 -0.60233736 1.6146435 7 -0.28571429 0.28571429 -0.22222222 -0.60233736 1.6146435 8 -0.28571429 0.28571429 -0.22222222 -0.60233736 1.6146435 9 -0.28571429 0.28571429 -0.22222222 -0.60233736 1.6146435 Order SQRT(|X|) 1 1.1547005 2 1.4485438 3 1.3310986 4 1.3720836 5 1.3386022 6 1.3535579 7 1.3386548 8 1.3460607 9 1.3379243 TEST105 JACOBI_COMPUTE computes a Gauss-Jacobi rule; Here, we simply compute a single rule and print it, to check for accuracy. The integration interval is [-1,1]. N = 20 ALPHA = 0 BETA = 1 I X(I) W(I) 1 -0.98339991 0.00046152763 2 -0.94471389 0.0027322491 3 -0.88493108 0.0080458305 4 -0.80539174 0.017292876 5 -0.70787351 0.030910672 6 -0.59455502 0.048816185 7 -0.46796772 0.070388268 8 -0.3309394 0.094501185 9 -0.18653107 0.11960697 10 -0.037968577 0.14385968 11 0.11142943 0.16527083 12 0.25832564 0.18188236 13 0.39943865 0.19194185 14 0.53161623 0.19406442 15 0.65190577 0.18736677 16 0.75762027 0.17156118 17 0.84639833 0.14700096 18 0.91625714 0.11467295 19 0.96563756 0.076139878 20 0.99344779 0.033483377 TEST108 JACOBI_COMPUTE computes a Gauss-Jacobi rule; The printed output of this test can be inserted into a C++ program. // // Abscissas X and weights W for a Gauss Jacobi rule // of ORDER = 10 // with ALPHA = 0.5 // and BETA = 2 // x[ 0] = -0.905783310747993; x[ 1] = -0.7536615689945177; x[ 2] = -0.548636893225815; x[ 3] = -0.3051523832352315; x[ 4] = -0.04048417093085124; x[ 5] = 0.2265685497214919; x[ 6] = 0.4770321235676097; x[ 7] = 0.6931099037348964; x[ 8] = 0.8594479437211198; x[ 9] = 0.9642264730559573; w[ 0] = 0.001493406975095244; w[ 1] = 0.01451910366053457; w[ 2] = 0.05753614967752155; w[ 3] = 0.1418263934072558; w[ 4] = 0.252674354492838; w[ 5] = 0.3464772295999966; w[ 6] = 0.3724465193703601; w[ 7] = 0.3072940130036397; w[ 8] = 0.1778276475883551; w[ 9] = 0.05189885826011838; TEST11 KRONROD_SET sets up a Kronrod rule; LEGENDRE_SET sets up Gauss-Legendre rule; SUMMER_GK carries it out. The integration interval is [-1, 1]. Integrand is X**2 / SQRT ( 1.1 - X**2 ). 10 1.073789659 21 1.074744084 -0.0009544251929 TEST12 KRONROD_SET sets up a Kronrod rule; LEGENDRE_SET sets up Gauss-Legendre rule; SUM_SUB_GK carries it out. The integration interval is [-1,1] Number of subintervals is 5 Integrand is X**2 / SQRT ( 1.1 - X**2 ). 7 1.074724759 15 1.074743089 1.832906306e-05 TEST13 LAGUERRE_COMPUTE computes a Gauss-Laguerre rule; LAGUERRE_SUM carries it out. The integration interval is [1, +oo). Quadrature order will vary. Integrand will vary. The weight function is EXP ( - X ). Order 1 X X^2 X^3 X^4 1 0.36787944 0.73575888 1.4715178 2.9430355 5.8860711 2 0.36787944 0.73575888 1.8393972 5.8860711 22.440646 3 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 4 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 5 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 6 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 7 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 8 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 9 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 10 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 11 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 12 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 13 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 14 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 15 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 16 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 17 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 18 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 19 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 20 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 11.772142 23.544284 47.088568 0.33451183 2.7182818 2 93.441378 403.56375 1767.2928 0.26247204 5.9842834 3 119.9287 706.69641 4616.1512 0.24610565 9.4409304 4 119.9287 719.94007 5039.9483 0.25590478 12.999133 5 119.9287 719.94007 5039.9483 0.2541117 16.621868 6 119.9287 719.94007 5039.9483 0.25409157 20.28984 7 119.9287 719.94007 5039.9483 0.25418388 23.991579 8 119.9287 719.94007 5039.9483 0.25416093 27.719653 9 119.9287 719.94007 5039.9483 0.25416257 31.468942 10 119.9287 719.94007 5039.9483 0.25416319 35.23575 11 119.9287 719.94007 5039.9483 0.25416296 39.017314 12 119.9287 719.94007 5039.9483 0.25416299 42.811508 13 119.9287 719.94007 5039.9483 0.25416299 46.616655 14 119.9287 719.94007 5039.9483 0.25416299 50.431409 15 119.9287 719.94007 5039.9483 0.25416299 54.25467 16 119.9287 719.94007 5039.9483 0.25416299 58.085527 17 119.9287 719.94007 5039.9483 0.25416299 61.923214 18 119.9287 719.94007 5039.9483 0.25416299 65.767084 19 119.9287 719.94007 5039.9483 0.25416299 69.616579 20 119.9287 719.94007 5039.9483 0.25416299 73.471221 Order SQRT(|X|) 1 0.5202601 2 0.50861083 3 0.50755159 4 0.50735604 5 0.50730644 6 0.50729121 7 0.50728588 8 0.50728382 9 0.50728297 10 0.50728259 11 0.50728241 12 0.50728233 13 0.50728228 14 0.50728226 15 0.50728225 16 0.50728224 17 0.50728224 18 0.50728224 19 0.50728224 20 0.50728223 TEST14 LAGUERRE_COMPUTE sets up a Gauss-Laguerre rule; LAGUERRE_SUM carries it out. The integration interval is [0, +oo). Quadrature order will vary. Integrand will vary. The weight function is EXP ( - X ). Order 1 X X^2 X^3 X^4 1 1 1 1 1 1 2 1 1 2 6 20 3 1 1 2 6 24 4 1 1 2 6 24 5 1 1 2 6 24 6 1 1 2 6 24 7 1 1 2 6 24 8 1 1 2 6 24 9 1 1 2 6 24 10 1 1 2 6 24 11 1 1 2 6 24 12 1 1 2 6 24 13 1 1 2 6 24 14 1 1 2 6 24 15 1 1 2 6 24 16 1 1 2 6 24 17 1 1 2 6 24 18 1 1 2 6 24 19 1 1 2 6 24 20 1 1 2 6 24 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 1 1 1 0.84147098 2.7182818 2 68 232 792 0.43245945 5.9842834 3 120 684 4140 0.49602983 9.4409304 4 120 720 5040 0.50487928 12.999133 5 120 720 5040 0.49890332 16.621868 6 120 720 5040 0.50004947 20.28984 7 120 720 5040 0.50003891 23.991579 8 120 720 5040 0.49998775 27.719653 9 120 720 5040 0.50000135 31.468942 10 120 720 5040 0.5000002 35.23575 11 120 720 5040 0.49999989 39.017314 12 120 720 5040 0.50000002 42.811508 13 120 720 5040 0.5 46.616655 14 120 720 5040 0.5 50.431409 15 120 720 5040 0.5 54.25467 16 120 720 5040 0.5 58.085527 17 120 720 5040 0.5 61.923214 18 120 720 5040 0.5 65.767084 19 120 720 5040 0.5 69.616579 20 120 720 5040 0.5 73.471221 Order SQRT(|X|) 1 1 2 0.92387953 3 0.90644045 4 0.89928022 5 0.8955375 6 0.89329552 7 0.89182852 8 0.89080711 9 0.89006239 10 0.8894997 11 0.88906231 12 0.88871436 13 0.88843218 14 0.8881996 15 0.88800521 16 0.88784077 17 0.8877002 18 0.88757892 19 0.88747341 20 0.88738094 TEST15 GEN_LAGUERRE_COMPUTE computes a generalized Gauss-Laguerre rule; LAGUERRE_SUM carries it out. The integration interval is [0, +oo). Quadrature order will vary. Integrand will vary. The weight function is EXP ( - X ) * X^ 1. Order 1 X X^2 X^3 X^4 1 1 2 4 8 16 2 1 2 6 24 108 3 1 2 6 24 120 4 1 2 6 24 120 5 1 2 6 24 120 6 1 2 6 24 120 7 1 2 6 24 120 8 1 2 6 24 120 9 1 2 6 24 120 10 1 2 6 24 120 11 1 2 6 24 120 12 1 2 6 24 120 13 1 2 6 24 120 14 1 2 6 24 120 15 1 2 6 24 120 16 1 2 6 24 120 17 1 2 6 24 120 18 1 2 6 24 120 19 1 2 6 24 120 20 1 2 6 24 120 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 32 64 128 0.90929743 7.3890561 2 504 2376 11232 0.54149948 26.793923 3 720 4896 35712 0.43015059 59.245569 4 720 5040 40320 0.51992138 105.29742 5 720 5040 40320 0.49895082 165.302 6 720 5040 40320 0.49896982 239.50655 7 720 5040 40320 0.50037016 328.09559 8 720 5040 40320 0.49995417 431.21297 9 720 5040 40320 0.49999205 548.97449 10 720 5040 40320 0.50000471 681.47572 11 720 5040 40320 0.49999913 828.79708 12 720 5040 40320 0.49999999 991.00739 13 720 5040 40320 0.50000005 1168.1663 14 720 5040 40320 0.49999999 1360.326 15 720 5040 40320 0.5 1567.5328 16 720 5040 40320 0.5 1789.8281 17 720 5040 40320 0.5 2027.2488 18 720 5040 40320 0.5 2279.8286 19 720 5040 40320 0.5 2547.5979 20 720 5040 40320 0.5 2830.5848 Order SQRT(|X|) 1 1.4142136 2 1.3477747 3 1.3367339 4 1.3331544 5 1.3316058 6 1.330814 7 1.3303619 8 1.3300827 9 1.3298998 10 1.3297743 11 1.3296849 12 1.3296194 13 1.3295701 14 1.3295321 15 1.3295024 16 1.3294788 17 1.3294597 18 1.3294441 19 1.3294312 20 1.3294205 TEST16 GEN_LAGUERRE_COMPUTE computes a generalized Gauss-Laguerre rule; LAGUERRE_SUM carries it out. The integration interval is [0, +Infinity). Quadrature order will vary. Integrand will vary. The weight function is EXP ( - X ) * X^ 2. Order 1 X X^2 X^3 X^4 1 2 6 18 54 162 2 2 6 24 120 672 3 2 6 24 120 720 4 2 6 24 120 720 5 2 6 24 120 720 6 2 6 24 120 720 7 2 6 24 120 720 8 2 6 24 120 720 9 2 6 24 120 720 10 2 6 24 120 720 11 2 6 24 120 720 12 2 6 24 120 720 13 2 6 24 120 720 14 2 6 24 120 720 15 2 6 24 120 720 16 2 6 24 120 720 17 2 6 24 120 720 18 2 6 24 120 720 19 2 6 24 120 720 20 2 6 24 120 720 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 486 1458 4374 0.28224002 40.171074 2 3936 23424 140160 1.2242384 212.79798 3 5040 39600 334800 0.2162965 617.93502 4 5040 40320 362880 0.51796865 1360.8688 5 5040 40320 362880 0.52321346 2550.2457 6 5040 40320 362880 0.49028003 4297.0688 7 5040 40320 362880 0.50136955 6714.0982 8 5040 40320 362880 0.50027722 9915.4622 9 5040 40320 362880 0.49981951 14016.389 10 5040 40320 362880 0.50003665 19133.014 11 5040 40320 362880 0.50000038 25382.236 12 5040 40320 362880 0.49999768 32881.603 13 5040 40320 362880 0.50000065 41749.232 14 5040 40320 362880 0.49999995 52103.731 15 5040 40320 362880 0.49999998 64064.147 16 5040 40320 362880 0.50000001 77749.917 17 5040 40320 362880 0.5 93280.828 18 5040 40320 362880 0.5 110776.98 19 5040 40320 362880 0.5 130358.78 20 5040 40320 362880 0.5 152146.87 Order SQRT(|X|) 1 3.4641016 2 3.3460652 3 3.3306163 4 3.3264697 5 3.3249375 6 3.3242535 7 3.3239069 8 3.3237145 9 3.3236 10 3.323528 11 3.3234807 12 3.3234485 13 3.3234259 14 3.3234096 15 3.3233976 16 3.3233886 17 3.3233817 18 3.3233763 19 3.3233721 20 3.3233688 TEST165 LAGUERRE_COMPUTE computes a generalized Gauss-Laguerre rule; The printed output of this routine can be inserted into a C++ program. // // Abscissas X and weights W for a Gauss Laguerre rule // of ORDER = 11 // with ALPHA = 0 // x[ 0] = 0.1257964421879677; x[ 1] = 0.6654182558392281; x[ 2] = 1.64715054587217; x[ 3] = 3.091138143035255; x[ 4] = 5.029284401579833; x[ 5] = 7.509887863806616; x[ 6] = 10.60595099954697; x[ 7] = 14.43161375806419; x[ 8] = 19.17885740321468; x[ 9] = 25.21770933967756; x[10] = 33.49719284717554; w[ 0] = 0.284933212894196; w[ 1] = 0.3897208895278507; w[ 2] = 0.2327818318489907; w[ 3] = 0.07656445354619686; w[ 4] = 0.01439328276735069; w[ 5] = 0.001518880846484874; w[ 6] = 8.513122435471922e-05; w[ 7] = 2.292403879574503e-06; w[ 8] = 2.486353702767795e-08; w[ 9] = 7.712626933691313e-11; w[10] = 2.883775868323608e-14; TEST165 LAGUERRE_COMPUTE computes a generalized Gauss-Laguerre rule; The printed output of this routine can be inserted into a C++ program. // // Abscissas X and weights W for a Gauss Laguerre rule // of ORDER = 11 // with ALPHA = 0.5 // x[ 0] = 0.2102574184831799; x[ 1] = 0.8448394164252121; x[ 2] = 1.915565574736173; x[ 3] = 3.443537268140795; x[ 4] = 5.461644772694418; x[ 5] = 8.019112688782045; x[ 6] = 11.18987571617644; x[ 7] = 15.08912822002115; x[ 8] = 19.91025764276847; x[ 9] = 26.02565538189142; x[10] = 34.39012589988069; w[ 0] = 0.1564919998464269; w[ 1] = 0.3356460803810054; w[ 2] = 0.2639277337279414; w[ 3] = 0.1047323210183777; w[ 4] = 0.02260648913203013; w[ 5] = 0.00265531584472984; w[ 6] = 0.000162237440704461; w[ 7] = 4.693742912624425e-06; w[ 8] = 5.414115327653742e-08; w[ 9] = 1.774072162971696e-10; w[10] = 6.988338125898187e-14; TEST165 LAGUERRE_COMPUTE computes a generalized Gauss-Laguerre rule; The printed output of this routine can be inserted into a C++ program. // // Abscissas X and weights W for a Gauss Laguerre rule // of ORDER = 11 // with ALPHA = 2 // x[ 0] = 0.5297880635681287; x[ 1] = 1.431834248511049; x[ 2] = 2.753324209989985; x[ 3] = 4.518949913023012; x[ 4] = 6.76432546291258; x[ 5] = 9.541162512224671; x[ 6] = 12.92592983812984; x[ 7] = 17.03674989811998; x[ 8] = 22.07099934899301; x[ 9] = 28.40788699071937; x[10] = 37.01904951380837; w[ 0] = 0.1154861791808043; w[ 1] = 0.5427759748685637; w[ 2] = 0.743205157262028; w[ 3] = 0.4448454978860337; w[ 4] = 0.1320746211103724; w[ 5] = 0.02004515682275461; w[ 6] = 0.001514234411685173; w[ 7] = 5.246733328213365e-05; w[ 8] = 7.084465340665184e-07; w[ 9] = 2.676735958607183e-09; w[10] = 1.209708239787269e-12; TEST17 LAGUERRE_SET sets up a Gauss-Laguerre rule; LAGUERRE_SUM carries it out. The integration interval is [1, +Infinity). Quadrature order will vary. Integrand will vary. The weight function is EXP ( - X ). Order 1 X X^2 X^3 X^4 1 0.36787944 0.73575888 1.4715178 2.9430355 5.8860711 2 0.36787944 0.73575888 1.8393972 5.8860711 22.440646 3 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 4 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 5 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 6 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 7 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 8 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 9 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 10 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 11 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 12 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 13 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 14 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 15 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 16 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 17 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 18 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 19 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 20 0.36787944 0.73575888 1.8393972 5.8860711 23.912164 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 11.772142 23.544284 47.088568 0.33451183 2.7182818 2 93.441378 403.56375 1767.2928 0.26247204 5.9842834 3 119.9287 706.69641 4616.1512 0.24610565 9.4409304 4 119.9287 719.94007 5039.9483 0.25590478 12.999133 5 119.9287 719.94007 5039.9483 0.2541117 16.621868 6 119.9287 719.94007 5039.9483 0.25409157 20.28984 7 119.9287 719.94007 5039.9483 0.25418388 23.991579 8 119.9287 719.94007 5039.9483 0.25416093 27.719653 9 119.9287 719.94007 5039.9483 0.25416257 31.468942 10 119.9287 719.94007 5039.9483 0.25416319 35.23575 11 119.9287 719.94007 5039.9483 0.25416296 39.017314 12 119.9287 719.94007 5039.9483 0.25416299 42.811508 13 119.9287 719.94007 5039.9483 0.25416299 46.616655 14 119.9287 719.94007 5039.9483 0.25416299 50.431409 15 119.9287 719.94007 5039.9483 0.25416299 54.25467 16 119.9287 719.94007 5039.9483 0.25416299 58.085527 17 119.9287 719.94007 5039.9483 0.25416299 61.923214 18 119.9287 719.94007 5039.9483 0.25416299 65.767084 19 119.9287 719.94007 5039.9483 0.25416299 69.616579 20 119.9287 719.94007 5039.9483 0.25416299 73.471221 Order SQRT(|X|) 1 0.5202601 2 0.50861083 3 0.50755159 4 0.50735604 5 0.50730644 6 0.50729121 7 0.50728588 8 0.50728382 9 0.50728297 10 0.50728259 11 0.50728241 12 0.50728233 13 0.50728228 14 0.50728226 15 0.50728225 16 0.50728224 17 0.50728224 18 0.50728224 19 0.50728224 20 0.50728223 TEST18 LEGENDRE_COMPUTE computes a Gauss-Legendre rule; LEGENDRE_SET looks up the same data. Compare the data for ORDER = 19 The computed and stored abscissas are identical. Maximum weight difference is 1.3877788e-16 for index I = 0 Computed:0.019461788 Stored: 0.019461788 TEST185 LEGENDRE_COMPUTE computes a Gauss-Legendre rule; Compute the data for ORDER = 31 xtab[ 0] = -0.997087481819477; xtab[ 1] = -0.9846859096651525; xtab[ 2] = -0.9625039250929497; xtab[ 3] = -0.9307569978966481; xtab[ 4] = -0.8897600299482711; xtab[ 5] = -0.8399203201462674; xtab[ 6] = -0.781733148416625; xtab[ 7] = -0.7157767845868532; xtab[ 8] = -0.6427067229242603; xtab[ 9] = -0.5632491614071492; xtab[10] = -0.4781937820449025; xtab[11] = -0.3883859016082329; xtab[12] = -0.2947180699817016; xtab[13] = -0.1981211993355706; xtab[14] = -0.09955531215234151; xtab[15] = 0; xtab[16] = 0.09955531215234151; xtab[17] = 0.1981211993355706; xtab[18] = 0.2947180699817016; xtab[19] = 0.3883859016082329; xtab[20] = 0.4781937820449025; xtab[21] = 0.5632491614071492; xtab[22] = 0.6427067229242603; xtab[23] = 0.7157767845868532; xtab[24] = 0.781733148416625; xtab[25] = 0.8399203201462674; xtab[26] = 0.8897600299482711; xtab[27] = 0.9307569978966481; xtab[28] = 0.9625039250929497; xtab[29] = 0.9846859096651525; xtab[30] = 0.997087481819477; weight[ 0] = 0.007470831579248783; weight[ 1] = 0.01731862079031058; weight[ 2] = 0.02700901918497941; weight[ 3] = 0.0364322739123855; weight[ 4] = 0.0454937075272011; weight[ 5] = 0.05410308242491679; weight[ 6] = 0.06217478656102854; weight[ 7] = 0.06962858323541025; weight[ 8] = 0.07639038659877659; weight[ 9] = 0.08239299176158929; weight[10] = 0.08757674060847785; weight[11] = 0.09189011389364142; weight[12] = 0.09529024291231955; weight[13] = 0.09774333538632875; weight[14] = 0.09922501122667234; weight[15] = 0.09972054479342644; weight[16] = 0.09922501122667234; weight[17] = 0.09774333538632875; weight[18] = 0.09529024291231955; weight[19] = 0.09189011389364142; weight[20] = 0.08757674060847785; weight[21] = 0.08239299176158929; weight[22] = 0.07639038659877659; weight[23] = 0.06962858323541025; weight[24] = 0.06217478656102854; weight[25] = 0.05410308242491679; weight[26] = 0.0454937075272011; weight[27] = 0.0364322739123855; weight[28] = 0.02700901918497941; weight[29] = 0.01731862079031058; weight[30] = 0.007470831579248783; TEST19 LEGENDRE_COMPUTE computes a Gauss-Legendre rule; SUM_SUB carries it out over subintervals. The integration interval is [0,1] Here, we use a fixed order ORDER = 2 and use more and more subintervals. NSUB Integral 1 0.47157381 2 0.51475612 4 0.53156894 8 0.53634334 16 0.53724874 32 0.537361 64 0.5373708 128 0.5373715 256 0.53737154 512 0.53737154 TEST20 LEGENDRE_COMPUTE sets up a Gauss-Legendre rule; SUM_SUB carries it out. The integration interval is [ 0,1]. The number of subintervals is 1. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 2 1 0.5 0.33333333 0.25 0.19444444 3 1 0.5 0.33333333 0.25 0.2 4 1 0.5 0.33333333 0.25 0.2 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 10 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 2 0.15277778 0.12037037 0.094907407 0.45958781 1.7178964 3 0.16666667 0.1425 0.12375 0.45969793 1.718281 4 0.16666667 0.14285714 0.125 0.45969769 1.7182818 5 0.16666667 0.14285714 0.125 0.45969769 1.7182818 6 0.16666667 0.14285714 0.125 0.45969769 1.7182818 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 8 0.16666667 0.14285714 0.125 0.45969769 1.7182818 9 0.16666667 0.14285714 0.125 0.45969769 1.7182818 10 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0.70710678 2 0.67388734 3 0.66917963 4 0.66782765 5 0.66729679 6 0.66704644 7 0.66691309 8 0.66683558 9 0.66678747 10 0.66675604 TEST21 LEGENDRE_SET sets up a Gauss-Legendre rule; SUM_SUB carries it out. The integration interval is [ 0,1]. The number of subintervals is 1. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 2 1 0.5 0.33333333 0.25 0.19444444 3 1 0.5 0.33333333 0.25 0.2 4 1 0.5 0.33333333 0.25 0.2 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 10 1 0.5 0.33333333 0.25 0.2 11 1 0.5 0.33333333 0.25 0.2 12 1 0.5 0.33333333 0.25 0.2 13 1 0.5 0.33333333 0.25 0.2 14 1 0.5 0.33333333 0.25 0.2 15 1 0.5 0.33333333 0.25 0.2 16 1 0.5 0.33333333 0.25 0.2 17 1 0.5 0.33333333 0.25 0.2 18 1 0.5 0.33333333 0.25 0.2 19 1 0.5 0.33333333 0.25 0.2 20 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 2 0.15277778 0.12037037 0.094907407 0.45958781 1.7178964 3 0.16666667 0.1425 0.12375 0.45969793 1.718281 4 0.16666667 0.14285714 0.125 0.45969769 1.7182818 5 0.16666667 0.14285714 0.125 0.45969769 1.7182818 6 0.16666667 0.14285714 0.125 0.45969769 1.7182818 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 8 0.16666667 0.14285714 0.125 0.45969769 1.7182818 9 0.16666667 0.14285714 0.125 0.45969769 1.7182818 10 0.16666667 0.14285714 0.125 0.45969769 1.7182818 11 0.16666667 0.14285714 0.125 0.45969769 1.7182818 12 0.16666667 0.14285714 0.125 0.45969769 1.7182818 13 0.16666667 0.14285714 0.125 0.45969769 1.7182818 14 0.16666667 0.14285714 0.125 0.45969769 1.7182818 15 0.16666667 0.14285714 0.125 0.45969769 1.7182818 16 0.16666667 0.14285714 0.125 0.45969769 1.7182818 17 0.16666667 0.14285714 0.125 0.45969769 1.7182818 18 0.16666667 0.14285714 0.125 0.45969769 1.7182818 19 0.16666667 0.14285714 0.125 0.45969769 1.7182818 20 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0.70710678 2 0.67388734 3 0.66917963 4 0.66782765 5 0.66729679 6 0.66704644 7 0.66691309 8 0.66683558 9 0.66678747 10 0.66675604 11 0.66673464 12 0.66671956 13 0.66670864 14 0.66670053 15 0.66669438 16 0.66668963 17 0.66668591 18 0.66668295 19 0.66668057 20 0.66667863 TEST22 LEGENDRE_SET sets up a Gauss-Legendre rule for integrating F(X) over [-1,1]; RULE_ADJUST adjusts a rule for a new interval. LEGENDRE_SET_X0_01 sets up a Gauss-Legendre rule for integrating F(X) over [0,1]; We will use LEGENDRE_SET to get a rule for [-1,1], adjust it to [0,1] using RULE_ADJUST, and compare the results of LEGENDRE_SET_X0_01. Abscissas: Original Adjusted Stored 0 -0.906179845939 0.0469100770307 0.046910077 1 -0.538469310106 0.230765344947 0.2307653449 2 0 0.5 0.5 3 0.538469310106 0.769234655053 0.7692346551 4 0.906179845939 0.953089922969 0.953089923 Weights: Original Adjusted Stored 0 0.236926885056 0.118463442528 0.1184634425 1 0.478628670499 0.23931433525 0.2393143352 2 0.568888888889 0.284444444444 0.2844444444 3 0.478628670499 0.23931433525 0.2393143352 4 0.236926885056 0.118463442528 0.1184634425 TEST23 LEGENDRE_SET_COS sets up a Gauss-Legendre rule over [-PI/2,PI/2] with weight function COS(X); SUM_SUB carries it out. The integration interval is [-1.57079632679,1.57079632679]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 2 0 0 0 0 2 2 0 0.9348022 0 0.43692758 4 2 -5.5511151e-17 0.9348022 0 0.95850997 8 2 -4.1633363e-17 0.9348022 2.7755576e-17 0.95850997 16 2 -3.989864e-17 0.9348022 6.9388939e-18 0.95850997 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0 0 0 0 2 2 0 0.20422043 0 0 2.4858924 4 0 1.2881131 0 -5.5511151e-17 2.5091737 8 -2.7755576e-17 1.2881131 0 -3.469447e-17 2.5091785 16 4.1633363e-17 1.2881131 -3.469447e-17 2.9056618e-17 2.5091785 Order SQRT(|X|) 1 0 2 1.6536836 4 1.5175561 8 1.4541365 16 1.4262807 TEST24 LEGENDRE_SET_SQRTX_01 sets up a Gauss-Legendre rule over [0,1] with weight function SQRT(X); SUMMER carries it out. The integration interval is [0,1]. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 0.66666667 0.4 0.24 0.144 0.0864 2 0.66666667 0.4 0.28571429 0.22222222 0.17888637 4 0.66666667 0.4 0.28571429 0.22222222 0.18181818 8 0.66666667 0.4 0.28571429 0.22222222 0.18181818 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.05184 0.031104 0.0186624 0.37642832 1.2147459 2 0.14585258 0.11946643 0.098013672 0.36415913 1.2554174 4 0.15384615 0.13333333 0.11764706 0.36422193 1.2556301 8 0.15384615 0.13333333 0.11764706 0.36422193 1.2556301 Order SQRT(|X|) 1 0.51639778 2 0.50205963 4 0.50020905 8 0.50001755 TEST25 LEGENDRE_SET_SQRTX2_01 sets up a Gauss-Legendre rule over [0,1] with weight function 1/SQRT(X); SUMMER carries it out. The integration interval is [0,1]. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1.1111111 0.66666667 0.4 0.24 0.144 2 1.4311111 0.66666667 0.4 0.28571429 0.22222222 4 1.6697606 0.66666667 0.4 0.28571429 0.22222222 8 1.8205535 0.66666667 0.4 0.28571429 0.22222222 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.0864 0.05184 0.031104 0.62738053 2.0245764 2 0.17888637 0.14585258 0.11946643 0.62051486 2.3563758 4 0.18181818 0.15384615 0.13333333 0.6205366 2.5950641 8 0.18181818 0.15384615 0.13333333 0.6205366 2.745857 Order SQRT(|X|) 1 0.86066297 2 0.94485044 4 0.98168976 8 0.99462159 TEST26 LEGENDRE_SET_COS2 sets up a Gauss-Legendre rule over [0,PI/2] with weight function COS(X); SUM_SUB carries it out. The integration interval is [-1.5707963,1.5707963]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 2 1 0.57079633 0.4674011 0.45100662 0.45813342 4 1 0.57079633 0.4674011 0.45100662 0.47925499 8 1 0.57079633 0.4674011 0.45100662 0.47925499 16 1 0.57079633 0.4674011 0.45100662 0.47925499 Order X^5 X^6 X^7 SIN(X) EXP(X) 2 0.47191765 0.48788986 0.50487644 0.49946251 1.9034786 4 0.54298266 0.64405656 0.79076895 0.49999999 1.9052387 8 0.54298266 0.64405656 0.79076895 0.5 1.9052387 16 0.54298266 0.64405656 0.79076895 0.5 1.9052387 Order SQRT(|X|) 2 0.71452828 4 0.70593166 8 0.70433678 16 0.70408047 TEST27 LEGENDRE_SET_LOG sets up a Gauss-Legendre rule for integrating -LOG(X) * F(X) over [0,1]; SUM_SUB carries it out. The integration interval is [ 0,1]. The number of subintervals is 1. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.25 0.0625 0.015625 0.00390625 2 1 0.25 0.11111111 0.0625 0.037147266 3 1 0.25 0.11111111 0.0625 0.04 4 1 0.25 0.11111111 0.0625 0.04 5 1 0.25 0.11111111 0.0625 0.04 6 1 0.25 0.11111111 0.0625 0.04 7 1 0.25 0.11111111 0.0625 0.04 8 1 0.25 0.11111111 0.0625 0.04 16 1 0.25 0.11111111 0.0625 0.04 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.0009765625 0.00024414062 6.1035156e-05 0.24740396 1.2840254 2 0.022317492 0.013435099 0.0080909543 0.23976772 1.3177264 3 0.027777778 0.020234921 0.015124045 0.23981184 1.3179018 4 0.027777778 0.020408163 0.015625 0.23981174 1.3179022 5 0.027777778 0.020408163 0.015625 0.23981174 1.3179022 6 0.027777778 0.020408163 0.015625 0.23981174 1.3179022 7 0.027777778 0.020408163 0.015625 0.23981174 1.3179022 8 0.027777778 0.020408163 0.015625 0.23981174 1.3179022 16 0.027777778 0.020408163 0.015625 0.23981174 1.3179022 Order SQRT(|X|) 1 0.5 2 0.45891049 3 0.45073646 4 0.4478323 5 0.44650553 6 0.44580318 7 0.4453929 8 0.4451356 16 0.44456943 TEST28 LEGENDRE_SET_X0_01 sets up a Gauss-Legendre rule for integrating F(X) over [0,1]; SUM_SUB carries it out. The integration interval is [ 0,1]. The number of subintervals is 1. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 2 1 0.5 0.33333333 0.25 0.19444444 3 1 0.5 0.33333333 0.25 0.2 4 1 0.5 0.33333333 0.25 0.2 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 2 0.15277778 0.12037037 0.094907407 0.45958781 1.7178964 3 0.16666667 0.1425 0.12375 0.45969793 1.718281 4 0.16666667 0.14285714 0.125 0.45969769 1.7182818 5 0.16666667 0.14285714 0.125 0.45969769 1.7182818 6 0.16666667 0.14285714 0.125 0.45969769 1.7182818 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 8 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0.70710678 2 0.67388734 3 0.66917963 4 0.66782765 5 0.66729679 6 0.66704644 7 0.66691309 8 0.66683558 TEST29 LEGENDRE_SET_X1 sets up a Gauss-Legendre rule for integrating ( 1 + X ) * F(X) over [-1,1]; SUM_SUB carries it out. The integration interval is [ 0,1]. The number of subintervals is 1. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.66666667 0.44444444 0.2962963 0.19753086 2 1 0.66666667 0.5 0.4 0.33 3 1 0.66666667 0.5 0.4 0.33333333 4 1 0.66666667 0.5 0.4 0.33333333 5 1 0.66666667 0.5 0.4 0.33333333 6 1 0.66666667 0.5 0.4 0.33333333 7 1 0.66666667 0.5 0.4 0.33333333 8 1 0.66666667 0.5 0.4 0.33333333 9 1 0.66666667 0.5 0.4 0.33333333 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.13168724 0.087791495 0.058527663 0.6183698 1.947734 2 0.276 0.2322 0.19584 0.60226153 1.9997492 3 0.28571429 0.24979592 0.22141885 0.60233751 1.9999995 4 0.28571429 0.25 0.22222222 0.60233736 2 5 0.28571429 0.25 0.22222222 0.60233736 2 6 0.28571429 0.25 0.22222222 0.60233736 2 7 0.28571429 0.25 0.22222222 0.60233736 2 8 0.28571429 0.25 0.22222222 0.60233736 2 9 0.28571429 0.25 0.22222222 0.60233736 2 Order SQRT(|X|) 1 0.81649658 2 0.80153861 3 0.80033005 4 0.80010349 5 0.80004063 6 0.80001854 7 0.80000942 8 0.8000052 9 0.80000306 TEST30: LEGENDRE_SET_X1 sets up a Gauss-Legendre rule for integrating ( 1 + X ) * F(X) over [-1,1]; RULE_ADJUST adjusts a rule for a new interval. LEGENDRE_SET_X1_01 sets up a Gauss-Legendre rule for integrating X * F(X) over [0,1]; We will use LEGENDRE_SET_X1 to get a rule for [-1,1], adjust it to [0,1] using RULE_ADJUST, make further adjustments because the weight function is not 1, and compare the results of LEGENDRE_SET_X1_01. Abscissas: Original Adjusted Stored 0 -0.802929828402 0.0985350857988 0.0985350858 1 -0.390928546707 0.304535726646 0.3045357266 2 0.124050379505 0.562025189753 0.5620251898 3 0.603973164253 0.801986582126 0.8019865821 4 0.920380285897 0.960190142949 0.9601901429 Weights: Original Adjusted Stored 0 0.0629916580868 0.0157479145217 0.0157479145 1 0.29563548029 0.0739088700726 0.0739088701 2 0.585547948339 0.146386987085 0.1463869871 3 0.668698552377 0.167174638094 0.1671746381 4 0.387126360907 0.0967815902267 0.0967815902 TEST31 LEGENDRE_SET_X1_01 sets up a Gauss-Legendre rule for integrating X * F(X) over [0,1]; SUM_SUB carries it out. The integration interval is [ 0,1]. The number of subintervals is 1. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 0.5 0.33333333 0.22222222 0.14814815 0.098765432 2 0.5 0.33333333 0.25 0.2 0.165 3 0.5 0.33333333 0.25 0.2 0.16666667 4 0.5 0.33333333 0.25 0.2 0.16666667 5 0.5 0.33333333 0.25 0.2 0.16666667 6 0.50000001 0.33333333 0.25 0.2 0.16666667 7 0.5 0.33333333 0.25 0.2 0.16666667 8 0.5 0.33333333 0.25 0.2 0.16666667 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.065843621 0.043895748 0.029263832 0.3091849 0.97386702 2 0.138 0.1161 0.09792 0.30113076 0.99987461 3 0.14285714 0.12489796 0.11070943 0.30116875 0.99999975 4 0.14285714 0.125 0.11111111 0.30116868 1 5 0.14285714 0.125 0.11111111 0.30116868 1 6 0.14285714 0.125 0.11111111 0.30116868 1 7 0.14285714 0.125 0.11111111 0.30116868 1 8 0.14285714 0.125 0.11111111 0.30116868 1 Order SQRT(|X|) 1 0.40824829 2 0.40076931 3 0.40016502 4 0.40005174 5 0.40002032 6 0.40000927 7 0.40000471 8 0.4000026 TEST32 LEGENDRE_SET_X2 sets up a Gauss-Legendre rule for integrating (1 + X)**2 * F(X) over [-1,1]; SUM_SUB carries it out. The integration interval is [ 0,1]. The number of subintervals is 1. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1.3333333 1 0.75 0.5625 0.421875 2 1.3333333 1 0.8 0.66666667 0.56888889 3 1.3333333 1 0.8 0.66666667 0.57142857 4 1.3333333 1 0.8 0.66666667 0.57142857 5 1.3333333 1 0.8 0.66666667 0.57142857 6 1.3333333 1 0.8 0.66666667 0.57142857 7 1.3333333 1 0.8 0.66666667 0.57142857 8 1.3333333 1 0.8 0.66666667 0.57142857 9 1.3333333 1 0.8 0.66666667 0.57142857 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.31640625 0.23730469 0.17797852 0.90885168 2.8226667 2 0.49185185 0.42824691 0.37425514 0.89291418 2.872925 3 0.5 0.44430272 0.39939413 0.89297721 2.8731269 4 0.5 0.44444444 0.4 0.8929771 2.8731273 5 0.5 0.44444444 0.4 0.8929771 2.8731273 6 0.5 0.44444444 0.4 0.8929771 2.8731273 7 0.5 0.44444444 0.4 0.8929771 2.8731273 8 0.5 0.44444444 0.4 0.8929771 2.8731273 9 0.5 0.44444444 0.4 0.8929771 2.8731273 Order SQRT(|X|) 1 1.1547005 2 1.1435362 3 1.1429559 4 1.1428795 5 1.1428638 6 1.1428595 7 1.1428581 8 1.1428576 9 1.1428574 TEST33: LEGENDRE_SET_X2 sets up a Gauss-Legendre rule for integrating ( 1 + X )^2 * F(X) over [-1,1]; RULE_ADJUST adjusts a rule for a new interval. LEGENDRE_SET_X2_01 sets up a Gauss-Legendre rule for integrating X^2 * F(X) over [0,1]; We will use LEGENDRE_SET_X2 to get a rule for [-1,1], adjust it to [0,1] using RULE_ADJUST, make further adjustments because the weight function is not 1, and compare the results of LEGENDRE_SET_X2_01. Abscissas: Original Adjusted Stored 0 -0.702108425894 0.148945787053 0.1489457871 1 -0.268666945262 0.365666527369 0.3656665274 2 0.220227225869 0.610113612934 0.6101136129 3 0.653039358457 0.826519679228 0.8265196792 4 0.930842120164 0.965421060082 0.9654210601 Weights: Original Adjusted Stored 0 0.0329106016248 0.0041138252031 0.0041138252 1 0.256444805784 0.032055600723 0.0320556007 2 0.713601289773 0.0892001612216 0.0892001612 3 1.0095916952 0.1261989619 0.1261989619 4 0.654118274286 0.0817647842858 0.0817647843 TEST34 LEGENDRE_SET_X2_01 sets up a Gauss-Legendre rule for integrating X*X * F(X) over [0,1]; SUM_SUB carries it out. The integration interval is [ 0,1]. The number of subintervals is 1. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 0.33333333 0.25 0.1875 0.140625 0.10546875 2 0.33333333 0.25 0.2 0.16666667 0.14222222 3 0.33333333 0.25 0.2 0.16666667 0.14285714 4 0.33333333 0.25 0.2 0.16666667 0.14285714 5 0.33333333 0.25 0.2 0.16666667 0.14285714 6 0.33333333 0.25 0.2 0.16666667 0.14285714 7 0.33333333 0.25 0.2 0.16666667 0.14285714 8 0.33333333 0.25 0.2 0.16666667 0.14285714 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.079101562 0.059326172 0.044494629 0.22721292 0.70566667 2 0.12296296 0.10706173 0.093563786 0.22322855 0.71823124 3 0.125 0.11107568 0.099848533 0.2232443 0.71828174 4 0.125 0.11111111 0.1 0.22324428 0.71828183 5 0.125 0.11111111 0.1 0.22324428 0.71828183 6 0.125 0.11111111 0.1 0.22324428 0.71828183 7 0.125 0.11111111 0.1 0.22324428 0.71828183 8 0.125 0.11111111 0.1 0.22324428 0.71828183 Order SQRT(|X|) 1 0.28867513 2 0.28588404 3 0.28573898 4 0.28571989 5 0.28571595 6 0.28571488 7 0.28571453 8 0.2857144 TEST345 LOBATTO_COMPUTE computes a Lobatto rule; LOBATTO_SET sets a rule from a table. I X1 X2 W1 W2 1 -1 -1 0.16666667 0.16666667 2 -0.4472136 -0.4472136 0.83333333 0.83333333 3 0.4472136 0.4472136 0.83333333 0.83333333 4 1 1 0.16666667 0.16666667 1 -1 -1 0.047619048 0.047619048 2 -0.8302239 -0.8302239 0.27682605 0.27682605 3 -0.46884879 -0.46884879 0.43174538 0.43174538 4 0 0 0.48761905 0.48761905 5 0.46884879 0.46884879 0.43174538 0.43174538 6 0.8302239 0.8302239 0.27682605 0.27682605 7 1 1 0.047619048 0.047619048 1 -1 -1 0.022222222 0.022222222 2 -0.91953391 -0.91953391 0.13330599 0.13330599 3 -0.73877387 -0.73877387 0.22488934 0.22488934 4 -0.47792495 -0.47792495 0.29204268 0.29204268 5 -0.16527896 -0.16527896 0.32753976 0.32753976 6 0.16527896 0.16527896 0.32753976 0.32753976 7 0.47792495 0.47792495 0.29204268 0.29204268 8 0.73877387 0.73877387 0.22488934 0.22488934 9 0.91953391 0.91953391 0.13330599 0.13330599 10 1 1 0.022222222 0.022222222 TEST35 LOBATTO_SET sets up a Lobatto rule; SUM_SUB carries it out. The integration interval is [-1,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 2 2 0 2 0 2 3 2 0 0.66666667 0 0.66666667 4 2 2.7755576e-17 0.66666667 2.7755576e-17 0.4 5 2 -2.7755576e-17 0.66666667 0 0.4 6 2 -4.1633363e-17 0.66666667 1.3877788e-17 0.4 7 2 2.7755576e-17 0.66666667 0 0.4 8 2 -4.1633363e-17 0.66666667 -1.3877788e-17 0.4 9 2 -4.1633363e-17 0.66666667 1.3877788e-17 0.4 10 2 3.8163916e-17 0.66666667 3.8163916e-17 0.4 11 2 2.0816682e-17 0.66666667 6.9388939e-18 0.4 12 2 -1.2490009e-16 0.66666667 1.3877788e-17 0.4 13 2 1.7347235e-17 0.66666667 3.469447e-18 0.4 14 2 -4.3368087e-17 0.66666667 1.2143064e-17 0.4 15 2 6.9388939e-17 0.66666667 -1.3877788e-17 0.4 Order X^5 X^6 X^7 SIN(X) EXP(X) 2 0 2 0 0 3.0861613 3 0 0.66666667 0 0 2.3620538 4 0 0.34666667 2.7755576e-17 -2.7755576e-17 2.3504899 5 0 0.28571429 0 0 2.3504028 6 1.3877788e-17 0.28571429 -1.3877788e-17 -6.9388939e-18 2.3504024 7 0 0.28571429 -1.3877788e-17 6.9388939e-18 2.3504024 8 -1.3877788e-17 0.28571429 0 3.469447e-17 2.3504024 9 0 0.28571429 1.3877788e-17 -2.4286129e-17 2.3504024 10 -1.7347235e-17 0.28571429 1.0408341e-17 4.510281e-17 2.3504024 11 -6.9388939e-18 0.28571429 6.9388939e-18 -2.6020852e-17 2.3504024 12 -1.3877788e-17 0.28571429 -6.9388939e-18 6.4184769e-17 2.3504024 13 -3.469447e-18 0.28571429 1.7347235e-17 -2.7755576e-17 2.3504024 14 1.2143064e-17 0.28571429 1.2143064e-17 -8.6736174e-18 2.3504024 15 6.9388939e-18 0.28571429 -2.0816682e-17 5.2041704e-18 2.3504024 Order SQRT(|X|) 2 2 3 0.66666667 4 1.4479005 5 1.0810273 6 1.3880853 7 1.1909612 8 1.3670757 9 1.2388721 10 1.3568084 11 1.2647936 12 1.350883 13 1.2806789 14 1.3470963 15 1.2912434 TEST36 MOULTON_SET sets up an Adams-Moulton rule; SUMMER carries it out. The integration interval is [0,1]. Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 1 1 1 1 2 1 0.5 0.5 0.5 0.5 3 1 0.5 0.33333333 0.5 0.33333333 4 1 0.5 0.33333333 0.25 0.83333333 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 10 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 1 1 1 0.84147098 2.7182818 2 0.5 0.5 0.5 0.42073549 1.8591409 3 0.5 0.33333333 0.5 0.42073549 1.7686275 4 -0.75 2.8333333 -4.75 0.45297068 1.7400198 5 2.4166667 -9.8333333 39.583333 0.47174071 1.7285669 6 0.16666667 10.416667 -86.416667 0.47066572 1.7234229 7 0.16666667 0.14285714 57.416667 0.4605822 1.7209484 8 0.16666667 0.14285714 0.125 0.45379596 1.7197023 9 0.16666667 0.14285714 0.125 0.4547394 1.719054 10 0.16666667 0.14285714 0.125 0.45980307 1.7187082 Order SQRT(|X|) 1 1 2 0.5 3 0.33333333 4 0.22559223 5 0.14444121 6 0.078476491 7 0.022362102 8 -0.026827906 9 -0.070872247 10 -0.11093388 TEST37 NCC_SET computes a closed Newton-Cotes rule; SUM_SUB carries it out. The integration interval is [0,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 2 1 0.5 0.5 0.5 0.5 3 1 0.5 0.33333333 0.25 0.20833333 4 1 0.5 0.33333333 0.25 0.2037037 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 10 1 0.5 0.33333333 0.25 0.2 11 1 0.5 0.33333333 0.25 0.2 12 1 0.5 0.33333333 0.25 0.2 13 1 0.5 0.33333333 0.25 0.2 14 1 0.5 0.33333333 0.25 0.2 15 1 0.5 0.33333333 0.25 0.2 16 1 0.5 0.33333333 0.25 0.2 17 1 0.5 0.33333333 0.25 0.2 18 1 0.5 0.33333333 0.25 0.2 19 1 0.5 0.33333333 0.25 0.2 20 1 0.5 0.33333333 0.25 0.2 21 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 2 0.5 0.5 0.5 0.42073549 1.8591409 3 0.1875 0.17708333 0.171875 0.45986219 1.7188612 4 0.17592593 0.15843621 0.14711934 0.45977056 1.7185402 5 0.16666667 0.14322917 0.12630208 0.45969745 1.7182827 6 0.16666667 0.14306667 0.12573333 0.45969756 1.7182823 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 8 0.16666667 0.14285714 0.125 0.45969769 1.7182818 9 0.16666667 0.14285714 0.125 0.45969769 1.7182818 10 0.16666667 0.14285714 0.125 0.45969769 1.7182818 11 0.16666667 0.14285714 0.125 0.45969769 1.7182818 12 0.16666667 0.14285714 0.125 0.45969769 1.7182818 13 0.16666667 0.14285714 0.125 0.45969769 1.7182818 14 0.16666667 0.14285714 0.125 0.45969769 1.7182818 15 0.16666667 0.14285714 0.125 0.45969769 1.7182818 16 0.16666667 0.14285714 0.125 0.45969769 1.7182818 17 0.16666667 0.14285714 0.125 0.45969769 1.7182818 18 0.16666667 0.14285714 0.125 0.45969769 1.7182818 19 0.16666667 0.14285714 0.125 0.45969769 1.7182818 20 0.16666667 0.14285714 0.125 0.45969769 1.7182818 21 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0.70710678 2 0.5 3 0.63807119 4 0.64769257 5 0.6577566 6 0.65963774 7 0.66229602 8 0.66297345 9 0.6640488 10 0.66437037 11 0.66491152 12 0.66509039 13 0.66540158 14 0.66551186 15 0.66570768 16 0.66578077 17 0.66591226 18 0.66596337 19 0.6660561 20 0.66609334 21 0.66616129 TEST38 NCC_COMPUTE computes a closed Newton-Cotes rule; SUM_SUB carries it out. The integration interval is [0,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 2 1 0.5 0.5 0.5 0.5 3 1 0.5 0.33333333 0.25 0.20833333 4 1 0.5 0.33333333 0.25 0.2037037 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 10 1 0.5 0.33333333 0.25 0.2 11 1 0.5 0.33333333 0.25 0.2 12 1 0.5 0.33333333 0.25 0.2 13 1 0.5 0.33333333 0.25 0.2 14 1 0.5 0.33333333 0.25 0.2 15 1 0.5 0.33333333 0.25 0.2 16 1 0.5 0.33333333 0.25 0.2 17 1 0.5 0.33333333 0.25 0.2 18 1 0.5 0.33333333 0.25 0.2 19 1 0.5 0.33333333 0.25 0.2 20 0.99999996 0.49999999 0.33333333 0.25 0.2 21 0.9999999 0.49999995 0.3333333 0.24999998 0.19999999 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 2 0.5 0.5 0.5 0.42073549 1.8591409 3 0.1875 0.17708333 0.171875 0.45986219 1.7188612 4 0.17592593 0.15843621 0.14711934 0.45977056 1.7185402 5 0.16666667 0.14322917 0.12630208 0.45969745 1.7182827 6 0.16666667 0.14306667 0.12573333 0.45969756 1.7182823 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 8 0.16666667 0.14285714 0.125 0.45969769 1.7182818 9 0.16666667 0.14285714 0.125 0.45969769 1.7182818 10 0.16666667 0.14285714 0.125 0.45969769 1.7182818 11 0.16666667 0.14285714 0.125 0.45969769 1.7182818 12 0.16666667 0.14285714 0.125 0.45969769 1.7182818 13 0.16666667 0.14285714 0.125 0.45969769 1.7182818 14 0.16666667 0.14285714 0.125 0.45969769 1.7182818 15 0.16666667 0.14285714 0.125 0.45969769 1.7182818 16 0.16666667 0.14285714 0.125 0.45969769 1.7182818 17 0.16666667 0.14285714 0.125 0.45969769 1.7182818 18 0.16666667 0.14285714 0.125 0.45969769 1.7182818 19 0.16666667 0.14285714 0.125 0.45969769 1.7182818 20 0.16666667 0.14285714 0.125 0.45969768 1.7182818 21 0.16666666 0.14285714 0.125 0.45969764 1.7182817 Order SQRT(|X|) 1 0.70710678 2 0.5 3 0.63807119 4 0.64769257 5 0.6577566 6 0.65963774 7 0.66229602 8 0.66297345 9 0.6640488 10 0.66437037 11 0.66491152 12 0.66509039 13 0.66540158 14 0.66551186 15 0.66570768 16 0.66578077 17 0.66591226 18 0.66596337 19 0.6660561 20 0.66609332 21 0.66616122 TEST39 NCO_SET sets up an open Newton-Cotes rule; SUM_SUB carries it out. The integration interval is [0,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 2 1 0.5 0.27777778 0.16666667 0.10493827 3 1 0.5 0.33333333 0.25 0.19270833 4 1 0.5 0.33333333 0.25 0.19493333 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 2 0.067901235 0.044581619 0.029492455 0.47278225 1.6716732 3 0.1484375 0.11360677 0.086425781 0.4595533 1.7177765 4 0.154 0.12229333 0.09736 0.45959752 1.7179302 5 0.16666667 0.14210391 0.12236368 0.45969819 1.7182801 6 0.16666667 0.14232519 0.12313818 0.45969805 1.7182806 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 9 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0.70710678 2 0.69692343 3 0.67498134 4 0.67354587 5 0.67016159 6 0.66969878 7 0.66859434 9 0.66789365 TEST40 NCO_COMPUTE computes an open Newton-Cotes rule; SUM_SUB carries it out. The integration interval is [0,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 2 1 0.5 0.27777778 0.16666667 0.10493827 3 1 0.5 0.33333333 0.25 0.19270833 4 1 0.5 0.33333333 0.25 0.19493333 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 2 0.067901235 0.044581619 0.029492455 0.47278225 1.6716732 3 0.1484375 0.11360677 0.086425781 0.4595533 1.7177765 4 0.154 0.12229333 0.09736 0.45959752 1.7179302 5 0.16666667 0.14210391 0.12236368 0.45969819 1.7182801 6 0.16666667 0.14232519 0.12313818 0.45969805 1.7182806 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 8 0.16666667 0.14285714 0.125 0.45969769 1.7182818 9 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0.70710678 2 0.69692343 3 0.67498134 4 0.67354587 5 0.67016159 6 0.66969878 7 0.66859434 8 0.66838671 9 0.66789365 TEST401 NCOH_SET sets up an open half Newton-Cotes rule; SUM_SUB carries it out. The integration interval is [0,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 2 1 0.5 0.3125 0.21875 0.16015625 3 1 0.5 0.33333333 0.25 0.19675926 4 1 0.5 0.33333333 0.25 0.19832357 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 2 0.11914062 0.089111328 0.066772461 0.46452136 1.7005127 3 0.15856481 0.12950103 0.10661008 0.45963375 1.7180564 4 0.16247559 0.13584646 0.11513138 0.45966469 1.718165 5 0.16666667 0.14259167 0.12407083 0.45969787 1.7182812 6 0.16666667 0.14269768 0.12444189 0.4596978 1.7182815 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 8 0.16666667 0.14285714 0.125 0.45969769 1.7182818 9 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0.70710678 2 0.6830127 3 0.6721964 4 0.67060294 5 0.6688765 6 0.66845061 7 0.6678745 8 0.66769842 9 0.66743641 TEST402 NCOH_COMPUTE computes an open half Newton-Cotes rule; SUM_SUB carries it out. The integration interval is [0,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 2 1 0.5 0.3125 0.21875 0.16015625 3 1 0.5 0.33333333 0.25 0.19675926 4 1 0.5 0.33333333 0.25 0.19832357 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 8 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 2 0.11914062 0.089111328 0.066772461 0.46452136 1.7005127 3 0.15856481 0.12950103 0.10661008 0.45963375 1.7180564 4 0.16247559 0.13584646 0.11513138 0.45966469 1.718165 5 0.16666667 0.14259167 0.12407083 0.45969787 1.7182812 6 0.16666667 0.14269768 0.12444189 0.4596978 1.7182815 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 8 0.16666667 0.14285714 0.125 0.45969769 1.7182818 9 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0.70710678 2 0.6830127 3 0.6721964 4 0.67060294 5 0.6688765 6 0.66845061 7 0.6678745 8 0.66769842 9 0.66743641 TEST403 PATTERSON_SET sets up a Patterson rule; SUM_SUB carries it out. The integration interval is [0,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0.5 0.25 0.125 0.0625 3 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 15 1 0.5 0.33333333 0.25 0.2 31 1 0.5 0.33333333 0.25 0.2 63 1 0.5 0.33333333 0.25 0.2 127 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0.03125 0.015625 0.0078125 0.47942554 1.6487213 3 0.16666667 0.1425 0.12375 0.45969793 1.718281 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 15 0.16666667 0.14285714 0.125 0.45969769 1.7182818 31 0.16666667 0.14285714 0.125 0.45969769 1.7182818 63 0.16666667 0.14285714 0.125 0.45969769 1.7182818 127 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0.70710678 3 0.66917963 7 0.66680883 15 0.66667372 31 0.666667 63 0.66666668 127 0.66666667 TEST404 RADAU_COMPUTE computes a Radau rule; RADAU_SET sets a rule from a table. I X1 X2 W1 W2 1 -1 -1 0.125 0.125 2 -0.57531892 -0.57531892 0.65768864 0.65768864 3 0.18106627 0.18106627 0.77638694 0.77638694 4 0.82282408 0.82282408 0.44092442 0.44092442 1 -1 -1 0.040816327 0.040816327 2 -0.85389134 -0.85389134 0.23922749 0.23922749 3 -0.53846772 -0.53846772 0.38094987 0.38094987 4 -0.11734304 -0.11734304 0.44710983 0.44710983 5 0.32603062 0.32603062 0.42470378 0.42470378 6 0.7038428 0.7038428 0.31820423 0.31820423 7 0.94136715 0.94136715 0.14898847 0.14898847 1 -1 -1 0.02 0.02 2 -0.92748437 -0.92748437 0.12029667 0.12029667 3 -0.76384204 -0.76384204 0.20427013 0.20427013 4 -0.52564603 -0.52564603 0.26819484 0.26819484 5 -0.23623447 -0.23623447 0.30585929 0.30585929 6 0.076059198 0.076059198 0.31358246 0.31358246 7 0.38066484 0.38066484 0.29061016 0.29061016 8 0.64776669 0.64776669 0.23919343 0.23919343 9 0.85122522 0.85122522 0.16437601 0.16437601 10 0.97117518 0.97117518 0.073617005 0.073617005 TEST41 RADAU_SET sets up a Radau rule; SUM_SUB carries it out. The integration interval is [0,1]. The number of subintervals is 1 Quadrature order will vary. Integrand will vary. Order 1 X X^2 X^3 X^4 1 1 0 0 0 0 2 1 0.5 0.33333333 0.22222222 0.14814815 3 1 0.5 0.33333333 0.25 0.2 4 1 0.5 0.33333333 0.25 0.2 5 1 0.5 0.33333333 0.25 0.2 6 1 0.5 0.33333333 0.25 0.2 7 1 0.5 0.33333333 0.25 0.2 9 1 0.5 0.33333333 0.25 0.2 10 1 0.5 0.33333333 0.25 0.2 11 1 0.5 0.33333333 0.25 0.2 12 1 0.5 0.33333333 0.25 0.2 13 1 0.5 0.33333333 0.25 0.2 14 1 0.5 0.33333333 0.25 0.2 15 1 0.5 0.33333333 0.25 0.2 Order X^5 X^6 X^7 SIN(X) EXP(X) 1 0 0 0 0 1 2 0.098765432 0.065843621 0.043895748 0.46377735 1.7108005 3 0.165 0.138 0.1161 0.45968552 1.718259 4 0.16666667 0.14285714 0.12489796 0.45969771 1.7182818 5 0.16666667 0.14285714 0.125 0.45969769 1.7182818 6 0.16666667 0.14285714 0.125 0.45969769 1.7182818 7 0.16666667 0.14285714 0.125 0.45969769 1.7182818 9 0.16666667 0.14285714 0.125 0.45969769 1.7182818 10 0.16666667 0.14285714 0.125 0.45969769 1.7182818 11 0.16666667 0.14285714 0.125 0.45969769 1.7182818 12 0.16666667 0.14285714 0.125 0.45969769 1.7182818 13 0.16666667 0.14285714 0.125 0.45969769 1.7182818 14 0.16666667 0.14285714 0.125 0.45969769 1.7182818 15 0.16666667 0.14285714 0.125 0.45969769 1.7182818 Order SQRT(|X|) 1 0 2 0.61237244 3 0.65136447 4 0.66031525 5 0.6634385 6 0.66480585 7 0.6654976 9 0.66611802 10 0.666267 11 0.66636655 12 0.6664356 13 0.66648499 14 0.66652124 15 0.66654845 QUADRULE_PRB Normal end of execution. 24 June 2008 07:09:32 PM