20 April 2012 8:34:36.276 AM POLPAK_PRB FORTRAN77 version Test the POLPAK library. TEST001 AGM computes the arithmetic geometric mean. AGM_VALUES returns some exact values. A B AGM AGM Diff (Tabulated) AGM(A,B) 22.000000 96.000000 52.27464119870424 52.27464119870424 0.7105E-14 83.000000 56.000000 68.83653005985852 68.83653005985852 0.000 42.000000 7.000000 20.65930119673401 20.65930119673401 0.3553E-14 26.000000 11.000000 17.69685487374365 17.69685487374367 0.1776E-13 4.000000 63.000000 23.86704972175330 23.86704972175330 0.3553E-14 6.000000 45.000000 20.71701598280599 20.71701598280599 0.3553E-14 40.000000 75.000000 56.12784225561668 56.12784225561668 0.000 80.000000 0.000000 0.000000000000000 0.000000000000000 0.000 90.000000 35.000000 59.26956508122964 59.26956508122989 0.2487E-12 9.000000 1.000000 3.936235503649555 3.936235503649556 0.4441E-15 53.000000 53.000000 53.00000000000000 53.00000000000000 0.000 1.000000 2.000000 1.456791031046907 1.456791031046907 0.000 1.000000 4.000000 2.243028580287603 2.243028580287603 0.000 1.000000 8.000000 3.615756177597363 3.615756177597363 0.000 1.500000 8.000000 4.081692408022163 4.081692408022163 0.000 TEST002 AGUD computes the inverse Gudermannian; GUD computes the Gudermannian. X GUD(X) AGUD(GUD(X)) 1.00000 0.865769 1.00000 1.20000 0.985692 1.20000 1.40000 1.08725 1.40000 1.60000 1.17236 1.60000 1.80000 1.24316 1.80000 2.00000 1.30176 2.00000 2.20000 1.35009 2.20000 2.40000 1.38986 2.40000 2.60000 1.42252 2.60000 2.80000 1.44933 2.80000 3.00000 1.47130 3.00000 TEST003 ALIGN_ENUM counts the number of possible alignments of two biological sequences. Alignment enumeration table: 0 1 2 3 4 5 6 7 8 9 10 0 1 1 1 1 1 1 1 1 1 1 1 1 1 3 5 7 9 11 13 15 17 19 21 2 1 5 13 25 41 61 85 113 145 181 221 3 1 7 25 63 129 231 377 575 833 1159 1561 4 1 9 41 129 321 681 1289 2241 3649 5641 8361 5 1 11 61 231 681 1683 3653 7183 13073 22363 36365 6 1 13 85 377 1289 3653 8989 19825 40081 75517 134245 7 1 15 113 575 2241 7183 19825 48639 108545 224143 433905 8 1 17 145 833 3649 13073 40081 108545 265729 598417 1256465 9 1 19 181 1159 5641 22363 75517 224143 598417 1462563 3317445 10 1 21 221 1561 8361 36365 134245 433905 1256465 3317445 8097453 TEST0035 ARC_COSINE computes the inverse cosine of a given value, and chops out of bound arguments. X ARC_COSINE(X) COS(ARC_COSINE(X)) 0.00000 1.57080 0.612323E-16 0.200000 1.36944 0.200000 0.400000 1.15928 0.400000 0.600000 0.927295 0.600000 0.800000 0.643501 0.800000 1.00000 0.00000 1.00000 1.20000 0.00000 1.00000 1.40000 0.00000 1.00000 1.60000 0.00000 1.00000 1.80000 0.00000 1.00000 2.00000 0.00000 1.00000 TEST005 ATAN4 computes the arc-tangent given Y and X; ATAN2 is the system version of this routine. X Y ATAN2(Y,X) ATAN4(Y,X) 1.00000 0.00000 0.00000 0.00000 1.00000 1.00000 0.785398 0.785398 0.00000 1.00000 1.57080 1.57080 -1.00000 1.00000 2.35619 2.35619 -1.00000 0.00000 3.14159 3.14159 -1.00000 -1.00000 -2.35619 3.92699 0.00000 -1.00000 -1.57080 4.71239 1.00000 -1.00000 -0.785398 5.49779 TEST007 BELL computes Bell numbers. BELL_VALUES returns some exact values. N exact C(I) computed C(I) 0 1 1 1 1 1 2 2 2 3 5 5 4 15 15 5 52 52 6 203 203 7 877 877 8 4140 4140 9 21147 21147 10 115975 115975 TEST008 BENFORD(I) is the Benford probability of the initial digit sequence I. I, BENFORD(I) 1 0.301030 2 0.176091 3 0.124939 4 0.969100E-01 5 0.791812E-01 6 0.669468E-01 7 0.579919E-01 8 0.511525E-01 9 0.457575E-01 TEST010 BERNOULLI_NUMBER computes Bernoulli numbers; BERNOULLI_NUMBER_VALUES returns some exact values. I Exact Bernoulli 0 1.00000 1.00000 1 -0.500000 -0.500000 2 0.166667 0.166667 3 0.00000 0.00000 4 -0.333333E-01 -0.333333E-01 6 -0.238095E-01 0.238095E-01 8 -0.333333E-01 -0.333333E-01 10 0.757576E-01 0.757576E-01 20 -529.124 -529.124 30 0.601581E+09 0.601581E+09 TEST0102 BERNOULLI_NUMBER2 computes Bernoulli numbers; BERNOULLI_NUMBER_VALUES returns some exact values. I Exact Bernoulli2 0 1.00000 1.00000 1 -0.500000 -0.500000 2 0.166667 0.166667 3 0.00000 0.00000 4 -0.333333E-01 -0.333333E-01 6 -0.238095E-01 0.238095E-01 8 -0.333333E-01 -0.333333E-01 10 0.757576E-01 0.757576E-01 20 -529.124 -529.124 30 0.601581E+09 0.601581E+09 TEST0104 BERNOULLI_NUMBER3 computes Bernoulli numbers. BERNOULLI_NUMBER_VALUES returns some exact values. I Exact BERNOULLI3 0 1.00000 1.00000 1 -0.500000 -0.500000 2 0.166667 0.166667 3 0.00000 0.00000 4 -0.333333E-01 -0.333331E-01 6 -0.238095E-01 0.238095E-01 8 -0.333333E-01 -0.333333E-01 10 0.757576E-01 0.757576E-01 20 -529.124 -529.124 30 0.601581E+09 0.601581E+09 TEST011 BERNOULLI_POLY evaluates Bernoulli polynomials; X = 0.200000 I BX 1 -0.30000000 2 0.66666667E-02 3 0.48000000E-01 4 -0.77333333E-02 5 -0.23680000E-01 6 0.69135238E-02 7 0.24908800E-01 8 -0.10149973E-01 9 -0.45278208E-01 10 0.23326318E-01 11 0.12605002 12 -0.78146785E-01 13 -0.49797890 14 0.36043995 15 2.6487812 TEST0115 BERNOULLI_POLY2 evaluates Bernoulli polynomials. X = 0.200000 I BX 1 -0.30000000 2 0.66666667E-02 3 0.48000000E-01 4 -0.77331387E-02 5 -0.23679805E-01 6 0.69136254E-02 7 0.24908833E-01 8 -0.10149965E-01 9 -0.45278204E-01 10 0.23326320E-01 11 0.12605002 12 -0.78146787E-01 13 -0.49797890 14 0.36043994 15 2.6487812 TEST013: BERNSTEIN_POLY evaluates the Bernstein polynomials. BERNSTEIN_POLY_VALUES returns some exact values. N K X Exact B(N,K)(X) 0 0 0.2500 1.00000 1.00000 1 0 0.2500 0.750000 0.750000 1 1 0.2500 0.250000 0.250000 2 0 0.2500 0.562500 0.562500 2 1 0.2500 0.375000 0.375000 2 2 0.2500 0.625000E-01 0.625000E-01 3 0 0.2500 0.421875 0.421875 3 1 0.2500 0.421875 0.421875 3 2 0.2500 0.140625 0.140625 3 3 0.2500 0.156250E-01 0.156250E-01 4 0 0.2500 0.316406 0.316406 4 1 0.2500 0.421875 0.421875 4 2 0.2500 0.210938 0.210938 4 3 0.2500 0.468750E-01 0.468750E-01 4 4 0.2500 0.390625E-02 0.390625E-02 TEST012: BETA evaluates the Beta function. BETA_VALUES returns some exact values. X Y Exact F BETA(X,Y) 0.2000 1.0000 5.00000 5.00000 0.4000 1.0000 2.50000 2.50000 0.6000 1.0000 1.66667 1.66667 0.8000 1.0000 1.25000 1.25000 1.0000 0.2000 5.00000 5.00000 1.0000 0.4000 2.50000 2.50000 1.0000 1.0000 1.00000 1.00000 2.0000 2.0000 0.166667 0.166667 3.0000 3.0000 0.333333E-01 0.333333E-01 4.0000 4.0000 0.714286E-02 0.714286E-02 5.0000 5.0000 0.158730E-02 0.158730E-02 6.0000 2.0000 0.238095E-01 0.238095E-01 6.0000 3.0000 0.595238E-02 0.595238E-02 6.0000 4.0000 0.198413E-02 0.198413E-02 6.0000 5.0000 0.793651E-03 0.793651E-03 6.0000 6.0000 0.360750E-03 0.360750E-03 7.0000 7.0000 0.832501E-04 0.832501E-04 TEST014 BPAB evaluates Bernstein polynomials. The Bernstein polynomials of degree 10 based on the interval from 0.00000 to 1.00000 evaluated at X = 0.300000 0 0.282475E-01 1 0.121061 2 0.233474 3 0.266828 4 0.200121 5 0.102919 6 0.367569E-01 7 0.900169E-02 8 0.144670E-02 9 0.137781E-03 10 0.590490E-05 TEST0141 C4_ACOSH computes the inverse hyperbolic cosine of a given value. X C4_ACOSH(X) COSH(C4_ACOSH(X)) --------------------- --------------------- --------------------- 0.449860 -0.126667 -0.141010 1.109149 0.449860 -0.126667 -0.843197 -0.344280 -0.498201 2.416418 -0.843197 -0.344280 0.589627 0.260090 0.309595 0.973444 0.589627 0.260090 0.391140 0.323400 0.341349 1.192424 0.391140 0.323400 -0.139466 -0.156136 -0.156993 1.709000 -0.139466 -0.156136 -0.236066 0.077459 0.079613 1.808344 -0.236066 0.077459 0.018599 -0.633214 -0.597163 1.555083 0.018599 -0.633214 0.892850 0.010314 0.022876 0.467681 0.892850 0.010314 -0.560465 0.763795 0.767531 2.013147 -0.560465 0.763795 0.306357 0.026275 0.027598 1.259556 0.306357 0.026275 0.500804 -0.779931 -0.766803 1.178104 0.500804 -0.779931 TEST0142 C4_ASINH computes the inverse hyperbolic sine of a given value. X C4_ASINH(X) SINH(C4_ASINH(X)) --------------------- --------------------- --------------------- 0.449860 -0.126667 0.438679 -0.115643 0.449860 -0.126667 -0.843197 -0.344280 -0.788715 -0.262344 -0.843197 -0.344280 0.589627 0.260090 0.572932 0.224433 0.589627 0.260090 0.391140 0.323400 0.399232 0.303890 0.391140 0.323400 -0.139466 -0.156136 -0.140698 -0.155225 -0.139466 -0.156136 -0.236066 0.077459 -0.234582 0.075447 -0.236066 0.077459 0.018599 -0.633214 0.024024 -0.685463 0.018599 -0.633214 0.892850 0.010314 0.803563 0.007693 0.892850 0.010314 -0.560465 0.763795 -0.665099 0.670334 -0.560465 0.763795 0.306357 0.026275 0.301849 0.025125 0.306357 0.026275 0.500804 -0.779931 0.619390 -0.708914 0.500804 -0.779931 TEST0143 C4_ATANH computes the inverse hyperbolic tangent of a given value. X C4_ATANH(X) TANH(C4_ATANH(X)) --------------------- --------------------- --------------------- 0.449860 -0.126667 0.473511 -0.156723 0.449860 -0.126667 -0.843197 -0.344280 -0.800349 -0.664037 -0.843197 -0.344280 0.589627 0.260090 0.599279 0.363538 0.589627 0.260090 0.391140 0.323400 0.364173 0.358338 0.391140 0.323400 -0.139466 -0.156136 -0.136934 -0.157832 -0.139466 -0.156136 -0.236066 0.077459 -0.239027 0.081817 -0.236066 0.077459 0.018599 -0.633214 0.013276 -0.564596 0.018599 -0.633214 0.892850 0.010314 1.433505 0.050703 0.892850 0.010314 -0.560465 0.763795 -0.339400 0.751900 -0.560465 0.763795 0.306357 0.026275 0.316262 0.028986 0.306357 0.026275 0.500804 -0.779931 0.301204 -0.740355 0.500804 -0.779931 TEST015 CARDAN_POLY_COEF returns the coefficients of a Cardan polynomial. CARDAN evaluates a Cardan polynomial directly. We use the parameter S = 1.00000 Table of polynomial coefficients: 0 2. 1 0. 1. 2 -2. 0. 1. 3 0. -3. 0. 1. 4 2. 0. -4. 0. 1. 5 0. 5. 0. -5. 0. 1. 6 -2. 0. 9. 0. -6. 0. 1. 7 0. -7. 0. 14. 0. -7. 0. 1. 8 2. 0. -16. 0. 20. 0. -8. 0. 1. 9 0. 9. 0. -30. 0. 27. 0. -9. 0. 1. 10 -2. 0. 25. 0. -50. 0. 35. 0. -10. 0. 1. Compare CARDAN_POLY_COEF + R8POLY_VAL_HORNER versus CARDAN alone. Evaluate polynomials at X = 0.250000 We use the parameter S = 0.500000 Order, Horner, Direct 0 2.00000 2.00000 1 0.250000 0.250000 2 -0.937500 -0.937500 3 -0.359375 -0.359375 4 0.378906 0.378906 5 0.274414 0.274414 6 -0.120850 -0.120850 7 -0.167419 -0.167419 8 0.185699E-01 0.185699E-01 9 0.883522E-01 0.883522E-01 10 0.128031E-01 0.128031E-01 TEST016 CATALAN computes Catalan numbers. CATALAN_VALUES returns some exact values. N exact C(I) computed C(I) 0 1 1 1 1 1 2 2 2 3 5 5 4 14 14 5 42 42 6 132 132 7 429 429 8 1430 1430 9 4862 4862 10 16796 16796 TEST017 CATALAN_ROW_NEXT computes a row of Catalan's triangle. First, compute row 7: 7 1 7 27 75 165 297 429 429 Now compute rows one at a time: 0 1 1 1 1 2 1 2 2 3 1 3 5 5 4 1 4 9 14 14 5 1 5 14 28 42 42 6 1 6 20 48 90 132 132 7 1 7 27 75 165 297 429 429 8 1 8 35 110 275 572 1001 1430 1430 9 1 9 44 154 429 1001 2002 3432 4862 4862 10 1 10 54 208 637 1638 3640 7072 11934 16796 16796 TEST0175: CHARLIER evaluates Charlier polynomials. N A X P(N,A,X) 0 0.2500 0.0000 1.00000 1 0.2500 0.0000 -0.00000 2 0.2500 0.0000 -4.00000 3 0.2500 0.0000 -36.0000 4 0.2500 0.0000 -420.000 5 0.2500 0.0000 -6564.00 0 0.2500 0.5000 1.00000 1 0.2500 0.5000 -2.00000 2 0.2500 0.5000 -10.0000 3 0.2500 0.5000 -54.0000 4 0.2500 0.5000 -474.000 5 0.2500 0.5000 -6246.00 0 0.2500 1.0000 1.00000 1 0.2500 1.0000 -4.00000 2 0.2500 1.0000 -8.00000 3 0.2500 1.0000 -8.00000 4 0.2500 1.0000 24.0000 5 0.2500 1.0000 440.000 0 0.2500 1.5000 1.00000 1 0.2500 1.5000 -6.00000 2 0.2500 1.5000 2.00000 3 0.2500 1.5000 54.0000 4 0.2500 1.5000 354.000 5 0.2500 1.5000 3030.00 0 0.2500 2.0000 1.00000 1 0.2500 2.0000 -8.00000 2 0.2500 2.0000 20.0000 3 0.2500 2.0000 84.0000 4 0.2500 2.0000 180.000 5 0.2500 2.0000 276.000 0 0.2500 2.5000 1.00000 1 0.2500 2.5000 -10.0000 2 0.2500 2.5000 46.0000 3 0.2500 2.5000 34.0000 4 0.2500 2.5000 -450.000 5 0.2500 2.5000 -3694.00 0 0.5000 0.0000 1.00000 1 0.5000 0.0000 -0.00000 2 0.5000 0.0000 -2.00000 3 0.5000 0.0000 -10.0000 4 0.5000 0.0000 -58.0000 5 0.5000 0.0000 -442.000 0 0.5000 0.5000 1.00000 1 0.5000 0.5000 -1.00000 2 0.5000 0.5000 -4.00000 3 0.5000 0.5000 -12.0000 4 0.5000 0.5000 -48.0000 5 0.5000 0.5000 -288.000 0 0.5000 1.0000 1.00000 1 0.5000 1.0000 -2.00000 2 0.5000 1.0000 -4.00000 3 0.5000 1.0000 -4.00000 4 0.5000 1.0000 4.00000 5 0.5000 1.0000 60.0000 0 0.5000 1.5000 1.00000 1 0.5000 1.5000 -3.00000 2 0.5000 1.5000 -2.00000 3 0.5000 1.5000 8.00000 4 0.5000 1.5000 44.0000 5 0.5000 1.5000 200.000 0 0.5000 2.0000 1.00000 1 0.5000 2.0000 -4.00000 2 0.5000 2.0000 2.00000 3 0.5000 2.0000 18.0000 4 0.5000 2.0000 42.0000 5 0.5000 2.0000 66.0000 0 0.5000 2.5000 1.00000 1 0.5000 2.5000 -5.00000 2 0.5000 2.5000 8.00000 3 0.5000 2.5000 20.0000 4 0.5000 2.5000 -8.00000 5 0.5000 2.5000 -192.000 0 1.0000 0.0000 1.00000 1 1.0000 0.0000 -0.00000 2 1.0000 0.0000 -1.00000 3 1.0000 0.0000 -3.00000 4 1.0000 0.0000 -9.00000 5 1.0000 0.0000 -33.0000 0 1.0000 0.5000 1.00000 1 1.0000 0.5000 -0.500000 2 1.0000 0.5000 -1.75000 3 1.0000 0.5000 -3.37500 4 1.0000 0.5000 -6.56250 5 1.0000 0.5000 -16.0313 0 1.0000 1.0000 1.00000 1 1.0000 1.0000 -1.00000 2 1.0000 1.0000 -2.00000 3 1.0000 1.0000 -2.00000 4 1.0000 1.0000 0.00000 5 1.0000 1.0000 8.00000 0 1.0000 1.5000 1.00000 1 1.0000 1.5000 -1.50000 2 1.0000 1.5000 -1.75000 3 1.0000 1.5000 0.375000 4 1.0000 1.5000 6.18750 5 1.0000 1.5000 20.1563 0 1.0000 2.0000 1.00000 1 1.0000 2.0000 -2.00000 2 1.0000 2.0000 -1.00000 3 1.0000 2.0000 3.00000 4 1.0000 2.0000 9.00000 5 1.0000 2.0000 15.0000 0 1.0000 2.5000 1.00000 1 1.0000 2.5000 -2.50000 2 1.0000 2.5000 0.250000 3 1.0000 2.5000 5.12500 4 1.0000 2.5000 6.93750 5 1.0000 2.5000 -3.15625 0 2.0000 0.0000 1.00000 1 2.0000 0.0000 -0.00000 2 2.0000 0.0000 -0.500000 3 2.0000 0.0000 -1.00000 4 2.0000 0.0000 -1.75000 5 2.0000 0.0000 -3.25000 0 2.0000 0.5000 1.00000 1 2.0000 0.5000 -0.250000 2 2.0000 0.5000 -0.812500 3 2.0000 0.5000 -1.17188 4 2.0000 0.5000 -1.41797 5 2.0000 0.5000 -1.55566 0 2.0000 1.0000 1.00000 1 2.0000 1.0000 -0.500000 2 2.0000 1.0000 -1.00000 3 2.0000 1.0000 -1.00000 4 2.0000 1.0000 -0.500000 5 2.0000 1.0000 0.750000 0 2.0000 1.5000 1.00000 1 2.0000 1.5000 -0.750000 2 2.0000 1.5000 -1.06250 3 2.0000 1.5000 -0.578125 4 2.0000 1.5000 0.582031 5 2.0000 1.5000 2.46582 0 2.0000 2.0000 1.00000 1 2.0000 2.0000 -1.00000 2 2.0000 2.0000 -1.00000 3 2.0000 2.0000 0.00000 4 2.0000 2.0000 1.50000 5 2.0000 2.0000 3.00000 0 2.0000 2.5000 1.00000 1 2.0000 2.5000 -1.25000 2 2.0000 2.5000 -0.812500 3 2.0000 2.5000 0.640625 4 2.0000 2.5000 2.01953 5 2.0000 2.5000 2.25293 0 10.0000 0.0000 1.00000 1 10.0000 0.0000 -0.00000 2 10.0000 0.0000 -0.100000 3 10.0000 0.0000 -0.120000 4 10.0000 0.0000 -0.126000 5 10.0000 0.0000 -0.128400 0 10.0000 0.5000 1.00000 1 10.0000 0.5000 -0.500000E-01 2 10.0000 0.5000 -0.152500 3 10.0000 0.5000 -0.165375 4 10.0000 0.5000 -0.160969 5 10.0000 0.5000 -0.151158 0 10.0000 1.0000 1.00000 1 10.0000 1.0000 -0.100000 2 10.0000 1.0000 -0.200000 3 10.0000 1.0000 -0.200000 4 10.0000 1.0000 -0.180000 5 10.0000 1.0000 -0.154000 0 10.0000 1.5000 1.00000 1 10.0000 1.5000 -0.150000 2 10.0000 1.5000 -0.242500 3 10.0000 1.5000 -0.224625 4 10.0000 1.5000 -0.185569 5 10.0000 1.5000 -0.142111 0 10.0000 2.0000 1.00000 1 10.0000 2.0000 -0.200000 2 10.0000 2.0000 -0.280000 3 10.0000 2.0000 -0.240000 4 10.0000 2.0000 -0.180000 5 10.0000 2.0000 -0.120000 0 10.0000 2.5000 1.00000 1 10.0000 2.5000 -0.250000 2 10.0000 2.5000 -0.312500 3 10.0000 2.5000 -0.246875 4 10.0000 2.5000 -0.165469 5 10.0000 2.5000 -0.915391E-01 TEST018: CHEBY_T_POLYNOMIAL evaluates the Chebyshev T polynomial. CHEBY_T_POLYNOMIAL_VALUES returns some exact values. N X Exact F T(N)(X) 0 0.8000 1.00000 1.00000 1 0.8000 0.800000 0.800000 2 0.8000 0.280000 0.280000 3 0.8000 -0.352000 -0.352000 4 0.8000 -0.843200 -0.843200 5 0.8000 -0.997120 -0.997120 6 0.8000 -0.752192 -0.752192 7 0.8000 -0.206387 -0.206387 8 0.8000 0.421972 0.421972 9 0.8000 0.881543 0.881543 10 0.8000 0.988497 0.988497 11 0.8000 0.700051 0.700051 12 0.8000 0.131586 0.131586 TEST0185: CHEBY_T_POLYNOMIAL_ZERO returns zeroes of the T(N)(X). N X T(N)(X) 1 0.0000 0.612323E-16 2 0.7071 0.222045E-15 2 -0.7071 -0.222045E-15 3 0.8660 0.333067E-15 3 0.0000 -0.183697E-15 3 -0.8660 -0.333067E-15 4 0.9239 -0.222045E-15 4 0.3827 -0.222045E-15 4 -0.3827 0.111022E-15 4 -0.9239 -0.222045E-15 TEST019 CHEBY_T_POLYNOMIAL_COEF determines the Chebyshev T polynomial coefficients. T( 0) 1.00000 T( 1) 1.00000 * x 0.00000 T( 2) 2.00000 * x** 2 0.00000 * x -1.00000 T( 3) 4.00000 * x** 3 0.00000 * x** 2 -2.00000 * x -0.00000 T( 4) 8.00000 * x** 4 0.00000 * x** 3 -4.00000 * x** 2 1.00000 * x 1.00000 T( 5) 16.0000 * x** 5 0.00000 * x** 4 -8.00000 * x** 3 4.00000 * x** 2 2.00000 * x 0.00000 TEST020: CHEBY_U_POLYNOMIAL evaluates the Chebyshev U polynomial. CHEBY_U_POLYNOMIAL_VALUES returns some exact values. N X Exact F U(N)(X) 0 0.8000 1.00000 1.00000 1 0.8000 1.60000 1.60000 2 0.8000 1.56000 1.56000 3 0.8000 0.896000 0.896000 4 0.8000 -0.126400 -0.126400 5 0.8000 -1.09824 -1.09824 6 0.8000 -1.63078 -1.63078 7 0.8000 -1.51101 -1.51101 8 0.8000 -0.786839E-01 -0.786839 9 0.8000 0.252072 0.252072 10 0.8000 1.19015 1.19015 11 0.8000 1.65217 1.65217 12 0.8000 1.45333 1.45333 TEST021 CHEBY_U_POLYNOMIAL_COEF determines the Chebyshev U polynomial coefficients. T( 0) 1.00000 T( 1) 2.00000 * x 0.00000 T( 2) 4.00000 * x** 2 0.00000 * x -1.00000 T( 3) 8.00000 * x** 3 0.00000 * x** 2 -4.00000 * x -0.00000 T( 4) 16.0000 * x** 4 0.00000 * x** 3 -12.0000 * x** 2 -0.00000 * x 1.00000 T( 5) 32.0000 * x** 5 0.00000 * x** 4 -32.0000 * x** 3 -0.00000 * x** 2 6.00000 * x 0.00000 TEST0215: CHEBY_U_POLYNOMIAL_ZERO returns zeroes of the U(N)(X). N X U(N)(X) 1 0.0000 0.122465E-15 2 0.5000 0.444089E-15 2 -0.5000 -0.888178E-15 3 0.7071 0.666134E-15 3 0.0000 -0.244929E-15 3 -0.7071 0.666134E-15 4 0.8090 0.00000 4 0.3090 -0.111022E-15 4 -0.3090 0.555112E-15 4 -0.8090 -0.888178E-15 TEST0216: CHEBYSHEV_DISCRETE evaluates discrete Chebyshev polynomials. N M X T(N,M,X) 0 5 0.0000 1.00000 1 5 0.0000 -4.00000 2 5 0.0000 12.0000 3 5 0.0000 -24.0000 4 5 0.0000 24.0000 5 5 0.0000 0.00000 0 5 0.5000 1.00000 1 5 0.5000 -3.00000 2 5 0.5000 1.50000 3 5 0.5000 34.5000 4 5 0.5000 -199.125 5 5 0.5000 826.875 0 5 1.0000 1.00000 1 5 1.0000 -2.00000 2 5 1.0000 -6.00000 3 5 1.0000 48.0000 4 5 1.0000 -96.0000 5 5 1.0000 0.00000 0 5 1.5000 1.00000 1 5 1.5000 -1.00000 2 5 1.5000 -10.5000 3 5 1.5000 31.5000 4 5 1.5000 70.8750 5 5 1.5000 -354.375 0 5 2.0000 1.00000 1 5 2.0000 0.00000 2 5 2.0000 -12.0000 3 5 2.0000 -0.00000 4 5 2.0000 144.000 5 5 2.0000 0.00000 0 5 2.5000 1.00000 1 5 2.5000 1.00000 2 5 2.5000 -10.5000 3 5 2.5000 -31.5000 4 5 2.5000 70.8750 5 5 2.5000 354.375 TEST0217: COLLATZ_COUNT(N) counts the length of the Collatz sequence beginning with N. N COUNT(N) COUNT(N) (computed) (table) 1 1 1 2 2 2 3 8 8 4 3 3 5 6 6 6 9 9 7 17 17 8 4 4 9 20 20 10 7 7 27 112 112 50 25 25 100 26 26 200 27 27 300 17 17 400 28 28 500 111 111 600 18 18 700 83 83 800 29 29 TEST0218: COLLATZ_COUNT_MAX(N) returns the length of the longest Collatz sequence from 1 to N. N I_MAX J_MAX 10 9 20 100 97 119 1000 871 179 10000 6171 262 100000 77031 351 TEST024 COMB_ROW computes a row of Pascal's triangle. 0 1 1 1 1 2 1 2 1 3 1 3 3 1 4 1 4 6 4 1 5 1 5 10 10 5 1 6 1 6 15 20 15 6 1 7 1 7 21 35 35 21 7 1 8 1 8 28 56 70 56 28 8 1 9 1 9 36 84 126 126 84 36 9 1 10 1 10 45 120 210 252 210 120 45 10 1 TEST02405 COMMUL computes a multinomial coefficient. N = 8 Number of factors = 2 1 6 2 2 Value of coefficient = 28 N = 8 Number of factors = 3 1 2 2 2 3 4 Value of coefficient = 420 N = 13 Number of factors = 4 1 5 2 3 3 3 4 2 Value of coefficient = 720720 TEST0241 COS_DEG computes the cosine of an angle given in degrees. ANGLE COS_DEG(ANGLE) 0.00 1.00000 10.00 0.984808 20.00 0.939693 30.00 0.866025 40.00 0.766044 50.00 0.642788 60.00 0.500000 70.00 0.342020 80.00 0.173648 90.00 0.612323E-16 100.00 -0.173648 110.00 -0.342020 120.00 -0.500000 130.00 -0.642788 140.00 -0.766044 150.00 -0.866025 160.00 -0.939693 170.00 -0.984808 180.00 -1.00000 190.00 -0.984808 200.00 -0.939693 210.00 -0.866025 220.00 -0.766044 230.00 -0.642788 240.00 -0.500000 250.00 -0.342020 260.00 -0.173648 270.00 -0.183697E-15 280.00 0.173648 290.00 0.342020 300.00 0.500000 310.00 0.642788 320.00 0.766044 330.00 0.866025 340.00 0.939693 350.00 0.984808 360.00 1.00000 TEST0242 R8_CAS computes the "casine" of an angle. ANGLE R8_CAS(ANGLE) 0.00 1.00000 10.00 1.15846 20.00 1.28171 30.00 1.36603 40.00 1.40883 50.00 1.40883 60.00 1.36603 70.00 1.28171 80.00 1.15846 90.00 1.00000 100.00 0.811160 110.00 0.597672 120.00 0.366025 130.00 0.123257 140.00 -0.123257 150.00 -0.366025 160.00 -0.597672 170.00 -0.811160 180.00 -1.00000 190.00 -1.15846 200.00 -1.28171 210.00 -1.36603 220.00 -1.40883 230.00 -1.40883 240.00 -1.36603 250.00 -1.28171 260.00 -1.15846 270.00 -1.00000 280.00 -0.811160 290.00 -0.597672 300.00 -0.366025 310.00 -0.123257 320.00 0.123257 330.00 0.366025 340.00 0.597672 350.00 0.811160 360.00 1.00000 TEST0243: COS_POWER_INT returns values of the integral of COS(X)^N from A to B. COS_POWER_INT_VALUES stores some selected values. A B N Exact Computed 0.0000 3.1416 0 3.14159 3.14159 0.0000 3.1416 1 0.00000 0.122465E-15 0.0000 3.1416 2 1.57080 1.57080 0.0000 3.1416 3 0.00000 0.122465E-15 0.0000 3.1416 4 1.17810 1.17810 0.0000 3.1416 5 0.00000 0.122465E-15 0.0000 3.1416 6 0.981748 0.981748 0.0000 3.1416 7 0.00000 0.122465E-15 0.0000 3.1416 8 0.859029 0.859029 0.0000 3.1416 9 0.00000 0.122465E-15 0.0000 3.1416 10 0.773126 0.773126 TEST01155 DELANNOY computes the Delannoy numbers A(0:M,0:N). A(M,N) counts the paths from (0,0) to (M,N). 0 1 1 1 1 1 1 1 1 1 1 1 3 5 7 9 11 13 15 17 2 1 5 13 25 41 61 85 113 145 3 1 7 25 63 129 231 377 575 833 4 1 9 41 129 321 681 1289 2241 3649 5 1 11 61 231 681 1683 3653 7183 13073 6 1 13 85 3771289 3653 8989 19825 40081 7 1 15 113 5752241 7183 19825 48639 108545 8 1 17 145 8333649 13073 40081 108545 265729 TEST0245: R8_FACTORIAL evaluates the factorial function. R8_FACTORIAL_VALUES returns some exact values. N Exact F R8_FACTORIAL(N) 0 1.00000 1.00000 1 1.00000 1.00000 2 2.00000 2.00000 3 6.00000 6.00000 4 24.0000 24.0000 5 120.000 120.000 6 720.000 720.000 7 5040.00 5040.00 8 40320.0 40320.0 9 362880. 362880. 10 0.362880E+07 0.362880E+07 11 0.399168E+08 0.399168E+08 12 0.479002E+09 0.479002E+09 13 0.622702E+10 0.622702E+10 14 0.871783E+11 0.871783E+11 15 0.130767E+13 0.130767E+13 16 0.209228E+14 0.209228E+14 17 0.355687E+15 0.355687E+15 18 0.640237E+16 0.640237E+16 19 0.121645E+18 0.121645E+18 20 0.243290E+19 0.243290E+19 25 0.155112E+26 0.155112E+26 50 0.304141E+65 0.304141E+65 100 0.933262+158 0.933262+158 150 0.571338+263 0.571338+263 TEST025: ERROR_F evaluates the error function. ERF_VALUES returns some exact values. X Exact F ERROR_F(X) 0.0000 0.00000 0.00000 0.1000 0.112463 0.112463 0.2000 0.222703 0.222703 0.3000 0.328627 0.328627 0.4000 0.428392 0.428392 0.5000 0.520500 0.520500 0.6000 0.603856 0.603856 0.7000 0.677801 0.677801 0.8000 0.742101 0.742101 0.9000 0.796908 0.796908 1.0000 0.842701 0.842701 1.1000 0.880205 0.880205 1.2000 0.910314 0.910314 1.3000 0.934008 0.934008 1.4000 0.952285 0.952285 1.5000 0.966105 0.966105 1.6000 0.976348 0.976348 1.7000 0.983790 0.983790 1.8000 0.989091 0.989091 1.9000 0.992790 0.992790 2.0000 0.995322 0.995322 TEST0255: ERROR_F_INVERSE inverts the error function. ERF_VALUES returns some exact values. FX X ERROR_F_INVERSE(FX) 0.0000 0.00000 0.00000 0.1125 0.100000 0.100000 0.2227 0.200000 0.200000 0.3286 0.300000 0.300000 0.4284 0.400000 0.400000 0.5205 0.500000 0.500000 0.6039 0.600000 0.600000 0.6778 0.700000 0.700000 0.7421 0.800000 0.800000 0.7969 0.900000 0.900000 0.8427 1.00000 1.00000 0.8802 1.10000 1.10000 0.9103 1.20000 1.20000 0.9340 1.30000 1.30000 0.9523 1.40000 1.40000 0.9661 1.50000 1.50000 0.9763 1.60000 1.60000 0.9838 1.70000 1.70000 0.9891 1.80000 1.80000 0.9928 1.90000 1.90000 0.9953 2.00000 2.00000 TEST026 EULER_NUMBER computes Euler numbers. EULER_NUMBER_VALUES returns some exact values. N exact EULER_NUMBER 0 1 1 1 0 0 2 -1 -1 4 5 5 6 61 -61 8 1385 1385 10 -50521 -50521 12 2702765 2702765 TEST0265 EULER_NUMBER2 computes Euler numbers. EULER_NUMBER_VALUES returns some exact values. N exact EULER_NUMBER2 0 1 1.00000 1 0 0.00000 2 -1 -1.00000 4 5 5.00000 6 61 -61.0000 8 1385 1385.00 10 -50521 -50521.0 12 2702765 0.270277E+07 TEST028 EULER_POLY evaluates Euler polynomials. N X F(X) 0 0.500000 1.00000 1 0.500000 0.277556E-16 2 0.500000 -0.250000 3 0.500000 -0.145953E-05 4 0.500000 0.312497 5 0.500000 -0.332929E-05 6 0.500000 -0.953128 7 0.500000 -0.173264E-05 8 0.500000 5.41016 9 0.500000 -0.102449E-05 10 0.500000 -49.3369 11 0.500000 0.647439E-06 12 0.500000 659.855 13 0.500000 0.522754E-05 14 0.500000 -12168.0 15 0.500000 0.218677E-03 TEST027 EULERIAN evaluates Eulerian numbers. 1 0 0 0 0 0 0 1 1 0 0 0 0 0 1 4 1 0 0 0 0 1 11 11 1 0 0 0 1 26 66 26 1 0 0 1 57 302 302 57 1 0 1 120 1191 2416 1191 120 1 TEST031 FIBONACCI_DIRECT evalutes a Fibonacci number directly. I F(I) 1 1 2 1 3 2 4 3 5 5 6 8 7 13 8 21 9 34 10 55 11 89 12 144 13 233 14 377 15 610 16 987 17 1597 18 2584 19 4181 20 6765 TEST032 FIBONACCI_FLOOR computes the largest Fibonacci number less than or equal to a given positive integer. N Fibonacci Index 1 1 2 2 2 3 3 3 4 4 3 4 5 5 5 6 5 5 7 5 5 8 8 6 9 8 6 10 8 6 11 8 6 12 8 6 13 13 7 14 13 7 15 13 7 16 13 7 17 13 7 18 13 7 19 13 7 20 13 7 TEST036: R8_GAMMA_LOG evaluates the logarithm of the Gamma function. GAMMA_LOG_VALUES returns some exact values. X Exact F GAMMA_LOG(X) 0.2000 1.524063822 1.524063822 0.4000 0.7966778177 0.7966778177 0.6000 0.3982338581 0.3982338581 0.8000 0.1520596784 0.1520596784 1.0000 0.000000000 0.000000000 1.1000 -0.4987244126E-01 -0.4987244126E-01 1.2000 -0.8537409000E-01 -0.8537409000E-01 1.3000 -0.1081748095 -0.1081748095 1.4000 -0.1196129142 -0.1196129142 1.5000 -0.1207822376 -0.1207822376 1.6000 -0.1125917657 -0.1125917657 1.7000 -0.9580769741E-01 -0.9580769741E-01 1.8000 -0.7108387291E-01 -0.7108387291E-01 1.9000 -0.3898427592E-01 -0.3898427592E-01 2.0000 0.000000000 0.000000000 3.0000 0.6931471806 0.6931471806 4.0000 1.791759469 1.791759469 10.0000 12.80182748 12.80182748 20.0000 39.33988419 39.33988419 30.0000 71.25703897 71.25703897 TEST037: GEGENBAUER_POLY computes values of the Gegenbauer polynomials. GEGENBAUER_POLY_VALUES returns values of the Gegenbauer polynomials. N A X GPV GEGENBAUER 0 0.5000 0.2000 1.00000 1.00000 1 0.5000 0.2000 0.200000 0.200000 2 0.5000 0.2000 -0.440000 -0.440000 3 0.5000 0.2000 -0.280000 -0.280000 4 0.5000 0.2000 0.232000 0.232000 5 0.5000 0.2000 0.307520 0.307520 6 0.5000 0.2000 -0.805760E-01 -0.805760E-01 7 0.5000 0.2000 -0.293517 -0.293517 8 0.5000 0.2000 -0.395648E-01 -0.395648E-01 9 0.5000 0.2000 0.245971 0.245957 10 0.5000 0.2000 0.129072 0.129072 2 0.0000 0.4000 0.00000 0.00000 2 1.0000 0.4000 -0.360000 -0.360000 2 2.0000 0.4000 -0.800000E-01 -0.800000E-01 2 3.0000 0.4000 0.840000 0.840000 2 4.0000 0.4000 2.40000 2.40000 2 5.0000 0.4000 4.60000 4.60000 2 6.0000 0.4000 7.44000 7.44000 2 7.0000 0.4000 10.9200 10.9200 2 8.0000 0.4000 15.0400 15.0400 2 9.0000 0.4000 19.8000 19.8000 2 10.0000 0.4000 25.2000 25.2000 5 3.0000 -0.5000 -9.00000 9.00000 5 3.0000 -0.4000 -0.161280 -0.161280 5 3.0000 -0.3000 -6.67296 -6.67296 5 3.0000 -0.2000 -8.37504 -8.37504 5 3.0000 -0.1000 -5.52672 -5.52672 5 3.0000 0.0000 0.00000 0.00000 5 3.0000 0.1000 5.52672 5.52672 5 3.0000 0.2000 8.37504 8.37504 5 3.0000 0.3000 6.67296 6.67296 5 3.0000 0.4000 0.161280 0.161280 5 3.0000 0.5000 -9.00000 -9.00000 5 3.0000 0.6000 -15.4253 -15.4253 5 3.0000 0.7000 -9.69696 -9.69696 5 3.0000 0.8000 22.4410 22.4410 5 3.0000 0.9000 100.889 100.889 5 3.0000 1.0000 252.000 252.000 TEST038: GUD evaluates the Gudermannian function. GUD_VALUES returns some exact values. X Exact F GUD(X) -2.0000 -1.30176 -1.30176 -1.0000 -0.865769 -0.865769 0.0000 0.00000 0.00000 0.1000 0.998337E-01 0.998337E-01 0.2000 0.198680 0.198680 0.5000 0.480381 0.480381 1.0000 0.865769 0.865769 1.5000 1.13173 1.13173 2.0000 1.30176 1.30176 2.5000 1.40699 1.40699 3.0000 1.47130 1.47130 3.5000 1.51042 1.51042 4.0000 1.53417 1.53417 TEST041: HERMITE_POLY evaluates the Hermite polynomial. HERMITE_POLY_VALUES returns some exact values. N X Exact F H(N)(X) 0 5.0000 1.00000 1.00000 1 5.0000 10.0000 10.0000 2 5.0000 98.0000 98.0000 3 5.0000 940.000 940.000 4 5.0000 8812.00 8812.00 5 5.0000 80600.0 80600.0 6 5.0000 717880. 717880. 7 5.0000 0.621160E+07 0.621160E+07 8 5.0000 0.520657E+08 0.520657E+08 9 5.0000 0.421271E+09 0.421271E+09 10 5.0000 0.327553E+10 0.327553E+10 11 5.0000 0.243299E+11 0.243299E+11 12 5.0000 0.171237E+12 0.171237E+12 5 0.5000 41.0000 41.0000 5 1.0000 -8.00000 -8.00000 5 3.0000 3816.00 3816.00 5 10.0000 0.304120E+07 0.304120E+07 TEST042 HERMITE_POLY_COEF determines the Hermite polynomial coefficients. H( 0) 1.00000 H( 1) 2.00000 * x 0.695322-309 H( 2) 4.00000 * x** 2 0.139064-308 * x -2.00000 H( 3) 8.00000 * x** 3 0.278129-308 * x** 2 -12.0000 * x -0.278129-308 H( 4) 16.0000 * x** 4 0.556258-308 * x** 3 -48.0000 * x** 2 -0.139064-307 * x 12.0000 H( 5) 32.0000 * x** 5 0.111252-307 * x** 4 -160.000 * x** 3 -0.500632-307 * x** 2 120.000 * x 0.222503-307 TEST0425: R8_HYPER_2F1 evaluates the hypergeometric 2F1 function. A B C X 2F1 2F1 DIFF (tabulated) (computed) -2.50 3.30 6.70 0.25 0.7235612934899779 0.7235612934899781 0.2220E-15 -0.50 1.10 6.70 0.25 0.9791110934527796 0.9791110934527797 0.1110E-15 0.50 1.10 6.70 0.25 1.021657814008856 1.021657814008856 0.000 2.50 3.30 6.70 0.25 1.405156320011213 1.405156320011212 0.4441E-15 -2.50 3.30 6.70 0.55 0.4696143163982161 0.4696143163982162 0.5551E-16 -0.50 1.10 6.70 0.55 0.9529619497744632 0.9529619497744636 0.3331E-15 0.50 1.10 6.70 0.55 1.051281421394799 1.051281421394798 0.8882E-15 2.50 3.30 6.70 0.55 2.399906290477786 2.399906290477784 0.1776E-14 -2.50 3.30 6.70 0.85 0.2910609592841472 0.2910609592841474 0.2220E-15 -0.50 1.10 6.70 0.85 0.9253696791037318 0.9253696791037318 0.000 0.50 1.10 6.70 0.85 1.086550409480700 1.086550409480700 0.000 2.50 3.30 6.70 0.85 5.738156552618904 5.738156552619301 0.3970E-12 3.30 6.70 -5.50 0.25 15090.66974870461 15090.66974870460 0.1091E-10 1.10 6.70 -0.50 0.25 -104.3117006736435 -104.3117006736435 0.2842E-13 1.10 6.70 0.50 0.25 21.17505070776881 21.17505070776880 0.1066E-13 3.30 6.70 4.50 0.25 4.194691581903192 4.194691581903191 0.8882E-15 3.30 6.70 -5.50 0.55 10170777974.04881 10170777974.04883 0.1144E-04 1.10 6.70 -0.50 0.55 -24708.63532248916 -24708.63532248914 0.1819E-10 1.10 6.70 0.50 0.55 1372.230454838499 1372.230454838497 0.2274E-11 3.30 6.70 4.50 0.55 58.09272870639465 58.09272870639462 0.2842E-13 3.30 6.70 -5.50 0.85 0.5868208761512417E+19 0.5868208761512380E+19 0.3686E+05 1.10 6.70 -0.50 0.85 -446350101.4729600 -446350101.4729605 0.4768E-06 1.10 6.70 0.50 0.85 5383505.756129573 5383505.756129581 0.8382E-08 3.30 6.70 4.50 0.85 20396.91377601966 20396.91377601965 0.1455E-10 TEST023 I4_CHOOSE evaluates C(N,K). N K CNK 0 0 1 1 0 1 1 1 1 2 0 1 2 1 2 2 2 1 3 0 1 3 1 3 3 2 3 3 3 1 4 0 1 4 1 4 4 2 6 4 3 4 4 4 1 TEST043: I4_FACTORIAL evaluates the factorial function. I4_FACTORIAL_VALUES returns some exact values. X Exact F I4_FACTORIAL(X) 0 1 1 1 1 1 2 2 2 3 6 6 4 24 24 5 120 120 6 720 720 7 5040 5040 8 40320 40320 9 362880 362880 10 3628800 3628800 11 39916800 39916800 12 479001600 479001600 TEST044: I4_FACTORIAL2 evaluates the double factorial function. N Exact I4_FACTORIAL2(N) 0 1 1 1 1 1 2 2 2 3 3 3 4 8 8 5 15 15 6 48 48 7 105 105 8 384 384 9 945 945 10 3840 3840 11 10395 10395 12 46080 46080 13 135135 135135 14 645120 645120 15 2027025 2027025 TEST045: For the number of partitions of an integer, PARTITION_COUNT_VALUES returns some exact values. N Exact F 0 1 1 1 2 2 3 3 4 5 5 7 6 11 7 15 8 22 9 30 10 42 11 56 12 77 13 101 14 135 15 176 16 231 17 297 18 385 19 490 20 627 TEST046: For the number of partitions of an integer into distinct parts, I4_PARTITION_DISTINCT_COUNT computes any value. PARTITION_DISTINCT_COUNT_VALUES returns some exact values. N Exact F Q(N) 0 1 1 1 1 1 2 1 1 3 2 2 4 2 2 5 3 3 6 4 4 7 5 5 8 6 6 9 8 8 10 10 10 11 12 12 12 15 15 13 18 18 14 22 22 15 27 27 16 32 32 17 38 38 18 46 46 19 54 54 20 64 64 TEST047: I4_POCHHAMMER evaluates the Pochhammer function. I J I4_Pochhammer(I,J) 3 3 3 3 4 12 3 5 60 TEST048 I4_TO_TRIANGLE converts a linear index to a triangular one. TRIANGLE_TO_I4 converts a triangular index to a linear one. I4_IS_TRIANGULAR returns T or F depending on whether I is triangular. I => J K => I T/F 0 0 0 0 T 1 1 1 1 T 2 2 1 2 F 3 2 2 3 T 4 3 1 4 F 5 3 2 5 F 6 3 3 6 T 7 4 1 7 F 8 4 2 8 F 9 4 3 9 F 10 4 4 10 T 11 5 1 11 F 12 5 2 12 F 13 5 3 13 F 14 5 4 14 F 15 5 5 15 T 16 6 1 16 F 17 6 2 17 F 18 6 3 18 F 19 6 4 19 F 20 6 5 20 F TEST049: JACOBI_POLY computes values of the Jacobi polynomial. JACOBI_POLY_VALUES returns values of the Jacobi polynomial. N A B X JPV JACOBI 0 0.0000 1.0000 0.5000 1.00000 1.00000 1 0.0000 1.0000 0.5000 0.250000 0.250000 2 0.0000 1.0000 0.5000 -0.375000 -0.375000 3 0.0000 1.0000 0.5000 -0.484375 -0.484375 4 0.0000 1.0000 0.5000 -0.132813 -0.132813 5 0.0000 1.0000 0.5000 0.275391 0.275391 5 1.0000 1.0000 0.5000 -0.164063 -0.164063 5 2.0000 1.0000 0.5000 -1.17480 -1.17480 5 3.0000 1.0000 0.5000 -2.36133 -2.36133 5 4.0000 1.0000 0.5000 -2.61621 -2.61621 5 5.0000 1.0000 0.5000 0.117188 0.117188 5 0.0000 2.0000 0.5000 0.421875 0.421875 5 0.0000 3.0000 0.5000 0.504883 0.504883 5 0.0000 4.0000 0.5000 0.509766 0.509766 5 0.0000 5.0000 0.5000 0.430664 0.430664 5 0.0000 1.0000 -1.0000 -6.00000 -6.00000 5 0.0000 1.0000 -0.8000 0.386200E-01 0.386200E-01 5 0.0000 1.0000 -0.6000 0.811840 0.811840 5 0.0000 1.0000 -0.4000 0.366600E-01 0.366600E-01 5 0.0000 1.0000 -0.2000 -0.485120 -0.485120 5 0.0000 1.0000 0.0000 -0.312500 -0.312500 5 0.0000 1.0000 0.2000 0.189120 0.189120 5 0.0000 1.0000 0.4000 0.402340 0.402340 5 0.0000 1.0000 0.6000 0.121600E-01 0.121600E-01 5 0.0000 1.0000 0.8000 -0.439620 -0.439620 5 0.0000 1.0000 1.0000 1.00000 1.00000 TEST050 JACOBI_SYMBOL computes the Jacobi symbol (Q/P), which records if Q is a quadratic residue modulo the number P. Jacobi Symbols for P = 3 3 0 0 3 1 1 3 2 -1 3 3 0 Jacobi Symbols for P = 9 9 0 0 9 1 1 9 2 1 9 3 0 9 4 1 9 5 1 9 6 0 9 7 1 9 8 1 9 9 0 Jacobi Symbols for P = 10 10 0 0 10 1 1 10 2 0 10 3 -1 10 4 0 10 5 0 10 6 0 10 7 -1 10 8 0 10 9 1 10 10 0 Jacobi Symbols for P = 12 12 0 0 12 1 1 12 2 0 12 3 0 12 4 0 12 5 -1 12 6 0 12 7 1 12 8 0 12 9 0 12 10 0 12 11 -1 12 12 0 TEST0505: KRAWTCHOUK evaluates Krawtchouk polynomials. N P X M K(N,P,X,M) 0 0.2500 0.0000 5 1.00000 1 0.2500 0.0000 5 -1.25000 2 0.2500 0.0000 5 0.625000 3 0.2500 0.0000 5 -0.156250 4 0.2500 0.0000 5 0.195313E-01 5 0.2500 0.0000 5 -0.976563E-03 0 0.2500 0.5000 5 1.00000 1 0.2500 0.5000 5 -0.750000 2 0.2500 0.5000 5 0.00000 3 0.2500 0.5000 5 0.187500 4 0.2500 0.5000 5 -0.105469 5 0.2500 0.5000 5 0.439453E-01 0 0.2500 1.0000 5 1.00000 1 0.2500 1.0000 5 -0.250000 2 0.2500 1.0000 5 -0.375000 3 0.2500 1.0000 5 0.218750 4 0.2500 1.0000 5 -0.429688E-01 5 0.2500 1.0000 5 0.292969E-02 0 0.2500 1.5000 5 1.00000 1 0.2500 1.5000 5 0.250000 2 0.2500 1.5000 5 -0.500000 3 0.2500 1.5000 5 0.625000E-01 4 0.2500 1.5000 5 0.507813E-01 5 0.2500 1.5000 5 -0.224609E-01 0 0.2500 2.0000 5 1.00000 1 0.2500 2.0000 5 0.750000 2 0.2500 2.0000 5 -0.375000 3 0.2500 2.0000 5 -0.156250 4 0.2500 2.0000 5 0.820313E-01 5 0.2500 2.0000 5 -0.878906E-02 0 0.2500 2.5000 5 1.00000 1 0.2500 2.5000 5 1.25000 2 0.2500 2.5000 5 0.00000 3 0.2500 2.5000 5 -0.312500 4 0.2500 2.5000 5 0.195313E-01 5 0.2500 2.5000 5 0.205078E-01 0 0.5000 0.0000 5 1.00000 1 0.5000 0.0000 5 -2.50000 2 0.5000 0.0000 5 2.50000 3 0.5000 0.0000 5 -1.25000 4 0.5000 0.0000 5 0.312500 5 0.5000 0.0000 5 -0.312500E-01 0 0.5000 0.5000 5 1.00000 1 0.5000 0.5000 5 -2.00000 2 0.5000 0.5000 5 1.37500 3 0.5000 0.5000 5 -0.250000 4 0.5000 0.5000 5 -0.132813 5 0.5000 0.5000 5 0.781250E-01 0 0.5000 1.0000 5 1.00000 1 0.5000 1.0000 5 -1.50000 2 0.5000 1.0000 5 0.500000 3 0.5000 1.0000 5 0.250000 4 0.5000 1.0000 5 -0.187500 5 0.5000 1.0000 5 0.312500E-01 0 0.5000 1.5000 5 1.00000 1 0.5000 1.5000 5 -1.00000 2 0.5000 1.5000 5 -0.125000 3 0.5000 1.5000 5 0.375000 4 0.5000 1.5000 5 -0.703125E-01 5 0.5000 1.5000 5 -0.234375E-01 0 0.5000 2.0000 5 1.00000 1 0.5000 2.0000 5 -0.500000 2 0.5000 2.0000 5 -0.500000 3 0.5000 2.0000 5 0.250000 4 0.5000 2.0000 5 0.625000E-01 5 0.5000 2.0000 5 -0.312500E-01 0 0.5000 2.5000 5 1.00000 1 0.5000 2.5000 5 0.00000 2 0.5000 2.5000 5 -0.625000 3 0.5000 2.5000 5 -0.00000 4 0.5000 2.5000 5 0.117188 5 0.5000 2.5000 5 0.00000 TEST051 LAGUERRE_ASSOCIATED evaluates the associated Laguerre polynomials. Table of L(N,M)(X) for N(max) = 6 M = 0 X = 0.00000 0 1.00000 1 1.00000 2 1.00000 3 1.00000 4 1.00000 5 1.00000 6 1.00000 Table of L(N,M)(X) for N(max) = 6 M = 0 X = 1.00000 0 1.00000 1 0.00000 2 -0.500000 3 -0.666667 4 -0.625000 5 -0.466667 6 -0.256944 Table of L(N,M)(X) for N(max) = 6 M = 1 X = 0.00000 0 1.00000 1 2.00000 2 3.00000 3 4.00000 4 5.00000 5 6.00000 6 7.00000 Table of L(N,M)(X) for N(max) = 6 M = 2 X = 0.500000 0 1.00000 1 2.50000 2 4.12500 3 5.60417 4 6.75260 5 7.45547 6 7.65419 Table of L(N,M)(X) for N(max) = 6 M = 3 X = 0.500000 0 1.00000 1 3.50000 2 7.62500 3 13.2292 4 19.9818 5 27.4372 6 35.0914 Table of L(N,M)(X) for N(max) = 6 M = 1 X = 0.500000 0 1.00000 1 1.50000 2 1.62500 3 1.47917 4 1.14844 5 0.702865 6 0.198720 TEST052 GEN_LAGUERRE_POLY evaluates the generalized Laguerre functions. Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 0.00000 X = 0.00000 0 1.00000 1 1.00000 2 1.00000 3 1.00000 4 1.00000 5 1.00000 6 1.00000 7 1.00000 8 1.00000 9 1.00000 10 1.00000 Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 0.00000 X = 1.00000 0 1.00000 1 0.00000 2 -0.500000 3 -0.666667 4 -0.625000 5 -0.466667 6 -0.256944 7 -0.404762E-01 8 0.153993 9 0.309744 10 0.418946 Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 0.100000 X = 0.00000 0 1.00000 1 1.10000 2 1.15500 3 1.19350 4 1.22334 5 1.24780 6 1.26860 7 1.28672 8 1.30281 9 1.31728 10 1.33046 Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 0.100000 X = 0.500000 0 1.00000 1 0.600000 2 0.230000 3 -0.673333E-01 4 -0.289350 5 -0.442469 6 -0.535747 7 -0.578765 8 -0.580771 9 -0.550311 10 -0.495076 Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 0.500000 X = 0.500000 0 1.00000 1 1.00000 2 0.750000 3 0.416667 4 0.729167E-01 5 -0.243750 6 -0.513715 7 -0.727703 8 -0.882836 9 -0.980303 10 -1.02388 Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 1.00000 X = 0.500000 0 1.00000 1 1.50000 2 1.62500 3 1.47917 4 1.14844 5 0.702865 6 0.198720 7 -0.319620 8 -0.817983 9 -1.27090 10 -1.66028 TEST054: LAGUERRE_POLY evaluates the Laguerre polynomial. LAGUERRE_POLYNOMIAL_VALUES returns some exact values. N X Exact F L(N)(X) 0 1.0000 1.00000 1.00000 1 1.0000 0.00000 0.00000 2 1.0000 -0.500000 -0.500000 3 1.0000 -0.666667 -0.666667 4 1.0000 -0.625000 -0.625000 5 1.0000 -0.466667 -0.466667 6 1.0000 -0.256944 -0.256944 7 1.0000 -0.404762E-01 -0.404762E-01 8 1.0000 0.153993 0.153993 9 1.0000 0.309744 0.309744 10 1.0000 0.418946 0.418946 11 1.0000 0.480134 0.480134 12 1.0000 0.496212 0.496212 5 0.5000 -0.445573 -0.445573 5 3.0000 0.850000 0.850000 5 5.0000 -3.16667 -3.16667 5 10.0000 34.3333 34.3333 TEST055 LAGUERRE_POLY_COEF determines the Laguerre polynomial coefficients. L( 0) 1.00000 L( 1) -1.00000 * x 1.00000 L( 2) 0.500000 * x** 2 -2.00000 * x 1.00000 L( 3) -0.166667 * x** 3 1.50000 * x** 2 -3.00000 * x 1.00000 L( 4) 0.416667E-01 * x** 4 -0.666667 * x** 3 3.00000 * x** 2 -4.00000 * x 1.00000 L( 5) -0.833333E-02 * x** 5 0.208333 * x** 4 -1.66667 * x** 3 5.00000 * x** 2 -5.00000 * x 1.00000 Factorially scaled L( 0) 1.00000 Factorially scaled L( 1) -1.00000 * x 1.00000 Factorially scaled L( 2) 1.00000 * x** 2 -4.00000 * x 2.00000 Factorially scaled L( 3) -1.00000 * x** 3 9.00000 * x** 2 -18.0000 * x 6.00000 Factorially scaled L( 4) 1.00000 * x** 4 -16.0000 * x** 3 72.0000 * x** 2 -96.0000 * x 24.0000 Factorially scaled L( 5) -1.00000 * x** 5 25.0000 * x** 4 -200.000 * x** 3 600.000 * x** 2 -600.000 * x 120.000 TEST0552: LAMBERT_W estimates the Lambert W function. LAMBERT_W_CRUDE makes a crude estimate of the Lambert W function. LAMBERT_W_VALUES returns some tabulated values. X W(X) W(X) W(X) Tabulated Crude Estimate 0.00000 120.000 0.400000E-01 0.145313E-13 0.522210-314 120.000 0.400000E-01 0.145313E-13 0.526354-314 120.000 0.400000E-01 0.145313E-13 0.528427-314 120.000 0.400000E-01 0.145313E-13 0.530499-314 120.000 0.400000E-01 0.145313E-13 0.531535-314 120.000 0.400000E-01 0.145313E-13 0.531987-314 120.000 0.400000E-01 0.145313E-13 0.532571-314 120.000 0.400000E-01 0.145313E-13 0.533607-314 120.000 0.400000E-01 0.145313E-13 0.534643-314 120.000 0.400000E-01 0.145313E-13 0.535162-314 120.000 0.400000E-01 0.145313E-13 0.535680-314 120.000 0.400000E-01 0.145313E-13 0.536198-314 120.000 0.400000E-01 0.145313E-13 0.536716-314 120.000 0.400000E-01 0.145313E-13 0.537234-314 120.000 0.400000E-01 0.145313E-13 0.537752-314 120.000 0.400000E-01 0.145313E-13 0.538270-314 120.000 0.400000E-01 0.145313E-13 0.538788-314 120.000 0.400000E-01 0.145313E-13 0.539824-314 120.000 0.400000E-01 0.145313E-13 0.553553-314 120.000 0.400000E-01 0.145313E-13 0.567605-314 120.000 0.400000E-01 0.145313E-13 0.608861-314 120.000 0.400000E-01 0.145313E-13 TEST059: LEGENDRE_ASSOCIATED evaluates associated Legendre functions. LEGENDRE_ASSOCIATED_VALUES returns some exact values. N M X Exact F PNM(X) 1 0 0.0000 0.00000 0.00000 2 0 0.0000 -0.500000 -0.500000 3 0 0.0000 0.00000 -0.00000 4 0 0.0000 0.375000 0.375000 5 0 0.0000 0.00000 0.00000 1 1 0.5000 -0.866025 -0.866025 2 1 0.5000 -1.29904 -1.29904 3 1 0.5000 -0.324760 -0.324760 4 1 0.5000 1.35316 1.35316 3 0 0.2000 -0.280000 -0.280000 3 1 0.2000 1.17576 1.17576 3 2 0.2000 2.88000 2.88000 3 3 0.2000 -14.1091 -14.1091 4 2 0.2500 -3.95508 -3.95508 5 2 0.2500 -9.99756 -9.99756 6 3 0.2500 82.6531 82.6531 7 3 0.2500 20.2444 20.2444 8 4 0.2500 -423.800 -423.800 9 4 0.2500 1638.32 1638.32 10 5 0.2500 -20256.9 -20256.9 TEST0595: LEGENDRE_ASSOCIATED_NORMALIZED evaluates normalized associated Legendre functions. LEGENDRE_ASSOCIATED_NORMALIZED_VALUES returns some exact values. N M X Exact F PNM(X) 0 0 0.5000 0.282095 0.282095 1 0 0.5000 0.244301 0.244301 1 1 0.5000 -0.299207 -0.299207 2 0 0.5000 -0.788479E-01 -0.788479E-01 2 1 0.5000 -0.334523 -0.334523 2 2 0.5000 0.289706 0.289706 3 0 0.5000 -0.326529 -0.326529 3 1 0.5000 -0.699706E-01 -0.699706E-01 3 2 0.5000 0.383245 0.383245 3 3 0.5000 -0.270995 -0.270995 4 0 0.5000 -0.244629 -0.244629 4 1 0.5000 0.256066 0.256066 4 2 0.5000 0.188169 0.188169 4 3 0.5000 -0.406492 -0.406492 4 4 0.5000 0.248925 0.248925 5 0 0.5000 0.840580E-01 0.840580E-01 5 1 0.5000 0.329379 0.329379 5 2 0.5000 -0.158885 -0.158885 5 3 0.5000 -0.280871 -0.280871 5 4 0.5000 0.412795 0.412795 5 5 0.5000 -0.226097 -0.226097 TEST060: LEGENDRE_FUNCTION_Q evaluates the Legendre Q function. LEGENDRE_FUNCTION_Q_VALUES returns some exact values. N X Exact F Q(N)(X) 0 0.2500 0.255413 0.255413 1 0.2500 -0.936147 -0.936147 2 0.2500 -0.478761 -0.478761 3 0.2500 0.424614 0.424614 4 0.2500 0.544840 0.544840 5 0.2500 -0.945133E-01 -0.945133E-01 6 0.2500 -0.497352 -0.497352 7 0.2500 -0.149902 -0.149902 8 0.2500 0.364916 0.364916 9 0.2500 0.305568 0.305568 10 0.2500 -0.183280 -0.183280 3 0.0000 0.666667 0.666667 3 0.1000 0.626867 0.626867 3 0.2000 0.509902 0.509902 3 0.3000 0.323275 0.323275 3 0.4000 0.802611E-01 0.802611E-01 3 0.5000 -0.198655 -0.198655 3 0.6000 -0.482866 -0.482866 3 0.7000 -0.725289 -0.725289 3 0.8000 -0.845444 -0.845444 3 0.9000 -0.662710 -0.662710 TEST057: LEGENDRE_POLY evaluates the Legendre PN function. LEGENDRE_POLY_VALUES returns some exact values. N X Exact F P(N)(X) 0 0.2500 1.00000 1.00000 1 0.2500 0.250000 0.250000 2 0.2500 -0.406250 -0.406250 3 0.2500 -0.335938 -0.335938 4 0.2500 0.157715 0.157715 5 0.2500 0.339722 0.339722 6 0.2500 0.242767E-01 0.242767E-01 7 0.2500 -0.279919 -0.279919 8 0.2500 -0.152454 -0.152454 9 0.2500 0.176824 0.176824 10 0.2500 0.221200 0.221200 3 0.0000 0.00000 -0.00000 3 0.1000 -0.147500 -0.147500 3 0.2000 -0.280000 -0.280000 3 0.3000 -0.382500 -0.382500 3 0.4000 -0.440000 -0.440000 3 0.5000 -0.437500 -0.437500 3 0.6000 -0.360000 -0.360000 3 0.7000 -0.192500 -0.192500 3 0.8000 0.800000E-01 0.800000E-01 3 0.9000 0.472500 0.472500 3 1.0000 1.00000 1.00000 TEST058 LEGENDRE_POLY_COEF returns Legendre polynomial coefficients. P( 0) 1.00000 P( 1) 1.00000 * x 0.00000 P( 2) 1.50000 * x** 2 0.00000 * x -0.500000 P( 3) 2.50000 * x** 3 0.00000 * x** 2 -1.50000 * x -0.00000 P( 4) 4.37500 * x** 4 0.00000 * x** 3 -3.75000 * x** 2 -0.00000 * x 0.375000 P( 5) 7.87500 * x** 5 0.00000 * x** 4 -8.75000 * x** 3 -0.00000 * x** 2 1.87500 * x 0.00000 TEST061 LEGENDRE_SYMBOL computes the Legendre symbol (Q/P) which records whether Q is a quadratic residue modulo the prime P. Legendre Symbols for P = 7 7 0 0 7 1 1 7 2 1 7 3 -1 7 4 1 7 5 -1 7 6 -1 7 7 0 Legendre Symbols for P = 11 11 0 0 11 1 1 11 2 -1 11 3 1 11 4 1 11 5 1 11 6 -1 11 7 -1 11 8 -1 11 9 1 11 10 -1 11 11 0 Legendre Symbols for P = 13 13 0 0 13 1 1 13 2 -1 13 3 1 13 4 1 13 5 -1 13 6 -1 13 7 -1 13 8 -1 13 9 1 13 10 1 13 11 -1 13 12 1 13 13 0 Legendre Symbols for P = 17 17 0 0 17 1 1 17 2 1 17 3 -1 17 4 1 17 5 -1 17 6 -1 17 7 -1 17 8 1 17 9 1 17 10 -1 17 11 -1 17 12 -1 17 13 1 17 14 -1 17 15 1 17 16 1 17 17 0 TEST0615 LERCH computes the Lerch function. LERCH_VALUES returns some tabulated values. Z S A Lerch Lerch Tabulated Computed 1.0000 2 0.0000 1.64493 1.64492 1.0000 3 0.0000 1.20206 1.20206 1.0000 10 0.0000 1.00099 1.00099 0.5000 2 1.0000 1.16448 1.16448 0.5000 3 1.0000 1.07443 1.07443 0.5000 10 1.0000 1.00049 1.00049 0.3333 2 2.0000 0.295919 0.295919 0.3333 3 2.0000 0.139451 0.139451 0.3333 10 2.0000 0.982318E-03 0.982318E-03 0.1000 2 3.0000 0.117791 0.117791 0.1000 3 3.0000 0.386845E-01 0.386845E-01 0.1000 10 3.0000 0.170315E-04 0.170315E-04 TEST062 LOCK counts the combinations on a button lock. I LOCK(I) 0 1 1 1 2 3 3 13 4 75 5 541 6 4683 7 47293 8 545835 9 7087261 10 102247563 POLPAK_TEST0623: MEIXNER evaluates Meixner polynomials. N BETA C X M(N,BETA,C,X) 0 0.5000 0.1250 0.0000 1.00000 1 0.5000 0.1250 0.0000 1.00000 2 0.5000 0.1250 0.0000 0.125000 3 0.5000 0.1250 0.0000 -0.684375 4 0.5000 0.1250 0.0000 -0.779297 5 0.5000 0.1250 0.0000 -0.181787 0 0.5000 0.1250 0.5000 1.00000 1 0.5000 0.1250 0.5000 -6.00000 2 0.5000 0.1250 0.5000 -3.66667 3 0.5000 0.1250 0.5000 2.05000 4 0.5000 0.1250 0.5000 4.90000 5 0.5000 0.1250 0.5000 2.66944 0 0.5000 0.1250 1.0000 1.00000 1 0.5000 0.1250 1.0000 -13.0000 2 0.5000 0.1250 1.0000 -3.37500 3 0.5000 0.1250 1.0000 8.45937 4 0.5000 0.1250 1.0000 9.08633 5 0.5000 0.1250 1.0000 -0.737033E-01 0 0.5000 0.1250 1.5000 1.00000 1 0.5000 0.1250 1.5000 -20.0000 2 0.5000 0.1250 1.5000 1.00000 3 0.5000 0.1250 1.5000 16.4000 4 0.5000 0.1250 1.5000 9.10000 5 0.5000 0.1250 1.5000 -8.00556 0 0.5000 0.1250 2.0000 1.00000 1 0.5000 0.1250 2.0000 -27.0000 2 0.5000 0.1250 2.0000 9.45833 3 0.5000 0.1250 2.0000 23.7281 4 0.5000 0.1250 2.0000 3.33320 5 0.5000 0.1250 2.0000 -19.0084 0 0.5000 0.1250 2.5000 1.00000 1 0.5000 0.1250 2.5000 -34.0000 2 0.5000 0.1250 2.5000 22.0000 3 0.5000 0.1250 2.5000 28.3000 4 0.5000 0.1250 2.5000 -8.75000 5 0.5000 0.1250 2.5000 -29.7736 0 1.0000 0.2500 0.0000 1.00000 1 1.0000 0.2500 0.0000 1.00000 2 1.0000 0.2500 0.0000 0.250000 3 1.0000 0.2500 0.0000 -0.437500 4 1.0000 0.2500 0.0000 -0.625000 5 1.0000 0.2500 0.0000 -0.306250 0 1.0000 0.2500 0.5000 1.00000 1 1.0000 0.2500 0.5000 -0.500000 2 1.0000 0.2500 0.5000 -0.781250 3 1.0000 0.2500 0.5000 -0.285156 4 1.0000 0.2500 0.5000 0.327515 5 1.0000 0.2500 0.5000 0.547452 0 1.0000 0.2500 1.0000 1.00000 1 1.0000 0.2500 1.0000 -2.00000 2 1.0000 0.2500 1.0000 -1.25000 3 1.0000 0.2500 1.0000 0.500000 4 1.0000 0.2500 1.0000 1.34375 5 1.0000 0.2500 1.0000 0.809375 0 1.0000 0.2500 1.5000 1.00000 1 1.0000 0.2500 1.5000 -3.50000 2 1.0000 0.2500 1.5000 -1.15625 3 1.0000 0.2500 1.5000 1.70703 4 1.0000 0.2500 1.5000 2.09412 5 1.0000 0.2500 1.5000 0.362021 0 1.0000 0.2500 2.0000 1.00000 1 1.0000 0.2500 2.0000 -5.00000 2 1.0000 0.2500 2.0000 -0.500000 3 1.0000 0.2500 2.0000 3.12500 4 1.0000 0.2500 2.0000 2.32813 5 1.0000 0.2500 2.0000 -0.753906 0 1.0000 0.2500 2.5000 1.00000 1 1.0000 0.2500 2.5000 -6.50000 2 1.0000 0.2500 2.5000 0.718750 3 1.0000 0.2500 2.5000 4.54297 4 1.0000 0.2500 2.5000 1.87439 5 1.0000 0.2500 2.5000 -2.36916 0 2.0000 0.5000 0.0000 1.00000 1 2.0000 0.5000 0.0000 1.00000 2 2.0000 0.5000 0.0000 0.500000 3 2.0000 0.5000 0.0000 0.00000 4 2.0000 0.5000 0.0000 -0.300000 5 2.0000 0.5000 0.0000 -0.350000 0 2.0000 0.5000 0.5000 1.00000 1 2.0000 0.5000 0.5000 0.750000 2 2.0000 0.5000 0.5000 0.229167 3 2.0000 0.5000 0.5000 -0.160156 4 2.0000 0.5000 0.5000 -0.305664 5 2.0000 0.5000 0.5000 -0.237101 0 2.0000 0.5000 1.0000 1.00000 1 2.0000 0.5000 1.0000 0.500000 2 2.0000 0.5000 1.0000 0.00000 3 2.0000 0.5000 1.0000 -0.250000 4 2.0000 0.5000 1.0000 -0.250000 5 2.0000 0.5000 1.0000 -0.104167 0 2.0000 0.5000 1.5000 1.00000 1 2.0000 0.5000 1.5000 0.250000 2 2.0000 0.5000 1.5000 -0.187500 3 2.0000 0.5000 1.5000 -0.277344 4 2.0000 0.5000 1.5000 -0.150977 5 2.0000 0.5000 1.5000 0.276286E-01 0 2.0000 0.5000 2.0000 1.00000 1 2.0000 0.5000 2.0000 0.00000 2 2.0000 0.5000 2.0000 -0.333333 3 2.0000 0.5000 2.0000 -0.250000 4 2.0000 0.5000 2.0000 -0.250000E-01 5 2.0000 0.5000 2.0000 0.141667 0 2.0000 0.5000 2.5000 1.00000 1 2.0000 0.5000 2.5000 -0.250000 2 2.0000 0.5000 2.5000 -0.437500 3 2.0000 0.5000 2.5000 -0.175781 4 2.0000 0.5000 2.5000 0.113086 5 2.0000 0.5000 2.5000 0.225562 TEST0625 MERTENS computes the Mertens function. MERTENS_VALUES returns some exact values. N Exact MERTENS(N) 1 1 1 2 0 0 3 -1 -1 4 -1 -1 5 -2 -2 6 -1 -1 7 -2 -2 8 -2 -2 9 -2 -2 10 -1 -1 11 -2 -2 12 -2 -2 100 1 1 1000 2 2 10000 -23 -23 TEST063 MOEBIUS computes the Moebius function. MOEBIUS_VALUES returns some exact values. N Exact MOEBIUS(N) 1 1 1 2 -1 -1 3 -1 -1 4 0 0 5 -1 -1 6 1 1 7 -1 -1 8 0 0 9 0 0 10 1 1 11 -1 -1 12 0 0 13 -1 -1 14 1 1 15 1 1 16 0 0 17 -1 -1 18 0 0 19 -1 -1 20 0 0 TEST0635 MOTZKIN computes the Motzkin numbers A(0:N). A(N) counts the paths from (0,0) to (N,0). I A(I) 0 1 1 1 2 2 3 4 4 9 5 21 6 51 7 127 8 323 9 835 10 2188 TEST064 OMEGA counts the distinct prime divisors of an integer N. OMEGA_VALUES returns some exact values. N Exact OMEGA(N) 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 2 2 7 1 1 8 1 1 9 1 1 10 2 2 30 3 3 101 1 1 210 4 4 1320 4 4 1764 3 3 2003 1 1 2310 5 5 2827 2 2 8717 2 2 12553 1 1 30030 6 6 510510 7 7 9699690 8 8 TEST065 PENTAGON_NUM computes the pentagonal numbers. I Pent(I) 1 1 2 5 3 12 4 22 5 35 6 51 7 70 8 92 9 117 10 145 TEST066 PHI computes the PHI function. PHI_VALUES returns some exact values. N Exact PHI(N) 1 1 1 2 1 1 3 2 2 4 2 2 5 4 4 6 2 2 7 6 6 8 4 4 9 6 6 10 4 4 20 8 8 30 8 8 40 16 16 50 20 20 60 16 16 100 40 40 149 148 148 500 200 200 750 200 200 999 648 648 TEST0665 POLY_BERNOULLI computes the poly-Bernoulli numbers of negative index, B_n^(-k) N K B_N^(-K) 0 0 1 1 0 1 2 0 1 3 0 1 4 0 1 5 0 1 6 0 1 0 1 1 1 1 2 2 1 33 3 1 1 4 1 1 5 1 1 6 1 1 0 2 1 1 2 1 2 2 1 3 2 1 4 2 1 5 2 1 6 2 1 0 3 1 1 3 1 2 3 1 3 3 -2359259 4 3 -1476876531 5 3 1179613 6 3 7077673 0 4 1 1 4 1 2 4 1 3 4 -1476876531 4 4 -1307767226 5 4 -1878957515 6 4 -1300691910 0 5 1 1 5 1 2 5 1 3 5 1179613 4 5 -1878957515 5 5 -37748123 6 5 339725987 0 6 1 1 6 1 2 6 1 3 6 7077673 4 6 -1300691910 5 6 339725987 6 6 -1862414894 TEST0667 POLY_COEF_COUNT counts the number of coefficients in a polynomial of degree DEGREE and dimension DIM Dimension Degree Count 1 0 1 1 1 2 1 2 3 1 3 4 1 4 5 1 5 6 4 0 1 4 1 5 4 2 15 4 3 35 4 4 70 4 5 126 7 0 1 7 1 8 7 2 36 7 3 120 7 4 330 7 5 792 10 0 1 10 1 11 10 2 66 10 3 286 10 4 1001 10 5 3003 TEST067 PYRAMID_NUM computes the pyramidal numbers. I PYR(I) 1 1 2 4 3 10 4 20 5 35 6 56 7 84 8 120 9 165 10 220 TEST0675 R8_ACOSH computes the inverse hyperbolic cosine of a given value. X R8_ACOSH(X) COSH(R8_ACOSH(X)) 1.00000 0.00000 1.00000 1.20000 0.622363 1.20000 1.40000 0.867015 1.40000 1.60000 1.04697 1.60000 1.80000 1.19291 1.80000 2.00000 1.31696 2.00000 2.20000 1.42542 2.20000 2.40000 1.52208 2.40000 2.60000 1.60944 2.60000 2.80000 1.68924 2.80000 3.00000 1.76275 3.00000 TEST004 R8_ASINH computes the inverse hyperbolic sine of a given value. X R8_ASINH(X) SINH(R8_ASINH(X)) 1.00000 0.881374 1.00000 1.20000 1.01597 1.20000 1.40000 1.13798 1.40000 1.60000 1.24898 1.60000 1.80000 1.35044 1.80000 2.00000 1.44364 2.00000 2.20000 1.52966 2.20000 2.40000 1.60944 2.40000 2.60000 1.68374 2.60000 2.80000 1.75323 2.80000 3.00000 1.81845 3.00000 TEST006 R8_ATANH computes the inverse hyperbolic tangent of a given value. X R8_ATANH(X) TANH(R8_ATANH(X)) -0.200000 -0.202733 -0.200000 -0.100000 -0.100335 -0.100000 0.00000 0.00000 0.00000 0.100000 0.100335 0.100000 0.200000 0.202733 0.200000 0.300000 0.309520 0.300000 0.400000 0.423649 0.400000 0.500000 0.549306 0.500000 0.600000 0.693147 0.600000 0.700000 0.867301 0.700000 0.800000 1.09861 0.800000 0.900000 1.47222 0.900000 TEST022 R8_CHOOSE evaluates C(N,K). N K CNK 0 0 1.00000 1 0 1.00000 1 1 1.00000 2 0 1.00000 2 1 2.00000 2 2 1.00000 3 0 1.00000 3 1 3.00000 3 2 3.00000 3 3 1.00000 4 0 1.00000 4 1 4.00000 4 2 6.00000 4 3 4.00000 4 4 1.00000 TEST0685: R8_FACTORIAL_LOG evaluates the logarithm of the factorial function. R8_FACTORIAL_LOG_VALUES returns some exact values. N Exact F R8_FACTORIAL_LOG(N) 0 0.00000 0.00000 1 0.00000 0.00000 2 0.693147 0.693147 3 1.79176 1.79176 4 3.17805 3.17805 5 4.78749 4.78749 6 6.57925 6.57925 7 8.52516 8.52516 8 10.6046 10.6046 9 12.8018 12.8018 10 15.1044 15.1044 11 17.5023 17.5023 12 19.9872 19.9872 13 22.5522 22.5522 14 25.1912 25.1912 15 27.8993 27.8993 16 30.6719 30.6719 17 33.5051 33.5051 18 36.3954 36.3954 19 39.3399 39.3399 20 42.3356 42.3356 25 58.0036 58.0036 50 148.478 148.478 100 363.739 363.739 150 605.020 605.020 500 2611.33 2611.33 1000 5912.13 5912.13 TEST06855: R8_GAMMA evaluates the Gamma function. GAMMA_VALUES returns some exact values. X Gamma(X) Gamma(X) DIFF (Tabulated) (R8_GAMMA) -0.5000 -3.544907701811032 -3.544907701811032 0.4441E-15 -0.0100 -100.5871979644108 -100.5871979644108 0.2842E-13 0.0100 99.43258511915060 99.43258511915060 0.000 0.1000 9.513507698668732 9.513507698668731 0.1776E-14 0.2000 4.590843711998803 4.590843711998803 0.000 0.4000 2.218159543757688 2.218159543757688 0.000 0.5000 1.772453850905516 1.772453850905516 0.000 0.6000 1.489192248812817 1.489192248812817 0.000 0.8000 1.164229713725303 1.164229713725303 0.2220E-15 1.0000 1.000000000000000 1.000000000000000 0.000 1.1000 0.9513507698668732 0.9513507698668732 0.000 1.2000 0.9181687423997607 0.9181687423997607 0.000 1.3000 0.8974706963062772 0.8974706963062772 0.000 1.4000 0.8872638175030753 0.8872638175030754 0.1110E-15 1.5000 0.8862269254527581 0.8862269254527581 0.000 1.6000 0.8935153492876903 0.8935153492876903 0.000 1.7000 0.9086387328532904 0.9086387328532904 0.000 1.8000 0.9313837709802427 0.9313837709802427 0.000 1.9000 0.9617658319073874 0.9617658319073874 0.000 2.0000 1.000000000000000 1.000000000000000 0.000 3.0000 2.000000000000000 2.000000000000000 0.000 4.0000 6.000000000000000 6.000000000000000 0.000 10.0000 362880.0000000000 362880.0000000000 0.000 20.0000 0.1216451004088320E+18 0.1216451004088321E+18 80.00 30.0000 0.8841761993739702E+31 0.8841761993739751E+31 0.4954E+17 TEST06856: R8_PSI evaluates the Psi function. PSI_VALUES returns some exact values. X Psi(X) Psi(X) DIFF (Tabulated) (R8_PSI) 1.0000 -0.5772156649015329 -0.5772156649015329 0.000 1.1000 -0.4237549404110768 -0.4237549404110768 0.5551E-16 1.2000 -0.2890398965921883 -0.2890398965921884 0.5551E-16 1.3000 -0.1691908888667997 -0.1691908888667995 0.1665E-15 1.4000 -0.6138454458511615E-01 -0.6138454458511624E-01 0.9021E-16 1.5000 0.3648997397857652E-01 0.3648997397857652E-01 0.000 1.6000 0.1260474527734763 0.1260474527734763 0.2776E-16 1.7000 0.2085478748734940 0.2085478748734940 0.2776E-16 1.8000 0.2849914332938615 0.2849914332938615 0.000 1.9000 0.3561841611640597 0.3561841611640596 0.1110E-15 2.0000 0.4227843350984671 0.4227843350984672 0.1110E-15 TEST069 SIGMA computes the SIGMA function. SIGMA_VALUES returns some exact values. N Exact SIGMA(N) 1 1 1 2 3 3 3 4 4 4 7 7 5 6 6 6 12 12 7 8 8 8 15 15 9 13 13 10 18 18 30 72 72 127 128 128 128 255 255 129 176 176 210 576 576 360 1170 1170 617 618 618 815 984 984 816 2232 2232 1000 2340 2340 TEST0695: SIN_POWER_INT returns values of the integral of SIN(X)^N from A to B. SIN_POWER_INT_VALUES stores some selected values. A B N Exact Computed 10.0000 20.0000 0 10.0000 10.0000 0.0000 1.0000 1 0.459698 0.459698 0.0000 1.0000 2 0.272676 0.272676 0.0000 1.0000 3 0.178941 0.178941 0.0000 1.0000 4 0.124026 0.124026 0.0000 1.0000 5 0.889744E-01 0.889744E-01 0.0000 2.0000 5 0.903931 0.903931 1.0000 2.0000 5 0.814957 0.814957 0.0000 1.0000 10 0.218875E-01 0.218875E-01 0.0000 1.0000 11 0.170234E-01 0.170234E-01 TEST0696: SLICE determines the maximum number of pieces created by SLICE_NUM slices in a DIM_NUM space. Slice Array: Col 1 2 3 4 5 6 7 8 Row 1: 2 3 4 5 6 7 8 9 2: 2 4 7 11 16 22 29 37 3: 2 4 8 15 26 42 64 93 4: 2 4 8 16 31 57 99 163 5: 2 4 8 16 32 63 120 219 TEST0697: SPHERICAL_HARMONIC evaluates spherical harmonic functions. SPHERICAL_HARMONIC_VALUES returns some exact values. L M THETA PHI C S 0 0 0.5236 1.0472 0.282095 0.00000 0.282095 0.00000 1 0 0.5236 1.0472 0.423142 0.00000 0.423142 0.00000 2 1 0.5236 1.0472 -0.167262 -0.289706 -0.167262 -0.289706 3 2 0.5236 1.0472 -0.110633 0.191622 -0.110633 0.191622 4 3 0.5236 1.0472 0.135497 0.00000 0.135497 0.103752E-15 5 5 0.2618 0.6283 0.539042E-03 0.00000 0.539042E-03 -0.660136E-19 5 4 0.2618 0.6283 -0.514669E-02 0.373929E-02 -0.514669E-02 0.373929E-02 5 3 0.2618 0.6283 0.137100E-01 -0.421952E-01 0.137100E-01 -0.421952E-01 5 2 0.2618 0.6283 0.609635E-01 0.187626 0.609635E-01 0.187626 5 1 0.2618 0.6283 -0.417040 -0.302997 -0.417040 -0.302997 4 2 0.6283 0.7854 0.00000 0.413939 0.253464E-16 0.413939 4 2 1.8850 0.7854 0.00000 -0.100323 -0.614301E-17 -0.100323 4 2 3.1416 0.7854 0.00000 0.00000 0.00000 0.00000 4 2 4.3982 0.7854 0.00000 -0.100323 -0.614301E-17 -0.100323 4 2 5.6549 0.7854 0.00000 0.413939 0.253464E-16 0.413939 3 -1 0.3927 0.4488 0.364121 -0.175351 0.364121 -0.175351 3 -1 0.3927 0.8976 0.251979 -0.315972 0.251979 -0.315972 3 -1 0.3927 1.3464 0.899304E-01 -0.394011 0.899304E-01 -0.394011 3 -1 0.3927 1.7952 -0.899304E-01 -0.394011 -0.899304E-01 -0.394011 3 -1 0.3927 2.2440 -0.251979 -0.315972 -0.251979 -0.315972 TEST070 STIRLING1: Stirling numbers of first kind. Get rows 1 through 8 1 1 0 0 0 0 0 0 0 2 -1 1 0 0 0 0 0 0 3 2 -3 1 0 0 0 0 0 4 -6 11 -6 1 0 0 0 0 5 24 -50 35 -10 1 0 0 0 6 -120 274 -225 85 -15 1 0 0 7 720 -1764 1624 -735 175 -21 1 0 8 -5040 13068 -13132 6769 -1960 322 -28 1 TEST071 STIRLING2: Stirling numbers of second kind. Get rows 1 through 8 1 1 0 0 0 0 0 0 0 2 1 1 0 0 0 0 0 0 3 1 3 1 0 0 0 0 0 4 1 7 6 1 0 0 0 0 5 1 15 25 10 1 0 0 0 6 1 31 90 65 15 1 0 0 7 1 63 301 350 140 21 1 0 8 1 127 966 1701 1050 266 28 1 TEST072 TAU computes the Tau function. TAU_VALUES returns some exact values. N exact C(I) computed C(I) 1 1 1 2 2 2 3 2 2 4 3 3 5 2 2 6 4 4 7 2 2 8 4 4 9 3 3 10 4 4 23 2 2 72 12 12 126 12 12 226 4 4 300 18 18 480 24 24 521 2 2 610 8 8 832 14 14 960 28 28 TEST073 TETRAHEDRON_NUM computes the tetrahedron numbers. I TETR(I) 1 1 2 4 3 10 4 20 5 35 6 56 7 84 8 120 9 165 10 220 TEST074 TRIANGLE_NUM computes the triangular numbers. I TRI(I) 1 1 2 3 3 6 4 10 5 15 6 21 7 28 8 36 9 45 10 55 TEST076 VIBONACCI computes a Vibonacci sequence. Number of times we compute the series: 3 1 1 1 1 2 1 1 1 3 0 0 -2 4 1 -1 1 5 -1 -1 -1 6 0 0 -2 7 -1 -1 -3 8 1 1 1 9 -2 0 -2 10 -3 1 -3 11 -1 -1 5 12 4 -2 2 13 3 -3 -7 14 -7 -1 -5 15 10 -4 2 16 -3 3 7 17 -13 1 9 18 -16 2 -2 19 -3 -3 -11 20 -19 1 -9 TEST077 ZECKENDORF computes the Zeckendorf decomposition of an integer N into nonconsecutive Fibonacci numbers. N Sum M Parts 1 1 2 2 3 3 4 3 1 5 5 6 5 1 7 5 2 8 8 9 8 1 10 8 2 11 8 3 12 8 3 1 13 13 14 13 1 15 13 2 16 13 3 17 13 3 1 18 13 5 19 13 5 1 20 13 5 2 21 21 22 21 1 23 21 2 24 21 3 25 21 3 1 26 21 5 27 21 5 1 28 21 5 2 29 21 8 30 21 8 1 31 21 8 2 32 21 8 3 33 21 8 3 1 34 34 35 34 1 36 34 2 37 34 3 38 34 3 1 39 34 5 40 34 5 1 41 34 5 2 42 34 8 43 34 8 1 44 34 8 2 45 34 8 3 46 34 8 3 1 47 34 13 48 34 13 1 49 34 13 2 50 34 13 3 51 34 13 3 1 52 34 13 5 53 34 13 5 1 54 34 13 5 2 55 55 56 55 1 57 55 2 58 55 3 59 55 3 1 60 55 5 61 55 5 1 62 55 5 2 63 55 8 64 55 8 1 65 55 8 2 66 55 8 3 67 55 8 3 1 68 55 13 69 55 13 1 70 55 13 2 71 55 13 3 72 55 13 3 1 73 55 13 5 74 55 13 5 1 75 55 13 5 2 76 55 21 77 55 21 1 78 55 21 2 79 55 21 3 80 55 21 3 1 81 55 21 5 82 55 21 5 1 83 55 21 5 2 84 55 21 8 85 55 21 8 1 86 55 21 8 2 87 55 21 8 3 88 55 21 8 3 1 89 89 90 89 1 91 89 2 92 89 3 93 89 3 1 94 89 5 95 89 5 1 96 89 5 2 97 89 8 98 89 8 1 99 89 8 2 100 89 8 3 TEST0773 ZERNIKE_POLY_COEF returns the coefficients of a Zernike polynomial. ZERNIKE_POLY evaluates a Zernike polynomial directly. Table of polynomial coefficients: N M 0 0 1. 1 0 0. 0. 1 1 0. 1. 2 0 -1. 0. 2. 2 1 0. 0. 0. 2 2 0. 0. 1. 3 0 0. 0. 0. 0. 3 1 0. -2. 0. 3. 3 2 0. 0. 0. 0. 3 3 0. 0. 0. 1. 4 0 1. 0. -6. 0. 6. 4 1 0. 0. 0. 0. 0. 4 2 0. 0. -3. 0. 4. 4 3 0. 0. 0. 0. 0. 4 4 0. 0. 0. 0. 1. 5 0 0. 0. 0. 0. 0. 0. 5 1 0. 3. 0. -12. 0. 10. 5 2 0. 0. 0. 0. 0. 0. 5 3 0. 0. 0. -4. 0. 5. 5 4 0. 0. 0. 0. 0. 0. 5 5 0. 0. 0. 0. 0. 1. Z1: Compute polynomial coefficients, then evaluate by Horner's method; Z2: Evaluate directly by recursion. N M Z1 Z2 0 0 1.0000000 1.0000000 1 0 0.0000000 0.0000000 1 1 0.98765432 0.98765432 2 0 0.95092212 0.95092212 2 1 0.0000000 0.0000000 2 2 0.97546106 0.97546106 3 0 0.0000000 0.0000000 3 1 0.91494634 0.91494634 3 2 0.0000000 0.0000000 3 3 0.96341833 0.96341833 4 0 0.85637930 0.85637930 4 1 0.0000000 0.0000000 4 2 0.87971393 0.87971393 4 3 0.0000000 0.0000000 4 4 0.95152428 0.95152428 5 0 0.0000000 0.0000000 5 1 0.79971364 0.79971364 5 2 0.0000000 0.0000000 5 3 0.84521200 0.84521200 5 4 0.0000000 0.0000000 5 5 0.93977706 0.93977706 TEST0775 ZERNIKE_POLY_COEF determines the Zernike polynomial coefficients. Zernike polynomial p(x) = 0.00000 Zernike polynomial p(x) = 10.0000 * x ^ 5 - 12.0000 * x ^ 3 + 3.00000 * x Zernike polynomial p(x) = 0.00000 Zernike polynomial p(x) = 5.00000 * x ^ 5 - 4.00000 * x ^ 3 Zernike polynomial p(x) = 0.00000 Zernike polynomial p(x) = 1.00000 * x ^ 5 TEST078 ZETA computes the Zeta function. ZETA_VALUES returns some exact values. N exact Zeta computed Zeta 2 1.64493406685 1.64393456668 3 1.20205690316 1.20205640366 4 1.08232323371 1.08232323338 5 1.03692775514 1.03692775514 6 1.01734306198 1.01734306198 7 1.00834927738 1.00834927738 8 1.00407735620 1.00407735620 9 1.00200839293 1.00200839283 10 1.00099457513 1.00099457513 11 1.00049418860 1.00049418860 12 1.00024608655 1.00024608655 16 1.00001528226 1.00001528226 20 1.00000095396 1.00000095396 30 1.00000000093 1.00000000093 40 1.00000000000 1.00000000000 POLPAK_PRB Normal end of execution. 20 April 2012 8:34:36.387 AM