28 March 2024 10:29:38 AM polpak_test() C version Test polpak(). agud_test(): agud() computes the inverse Gudermannian; X GUD(X) AGUD(GUD(X)) 1.000000 0.865769 1.000000 1.200000 0.985692 1.200000 1.400000 1.087250 1.400000 1.600000 1.172359 1.600000 1.800000 1.243161 1.800000 2.000000 1.301760 2.000000 2.200000 1.350090 2.200000 2.400000 1.389856 2.400000 2.600000 1.422521 2.600000 2.800000 1.449326 2.800000 3.000000 1.471304 3.000000 align_enum_test(): align_enum() counts the number of possible alignments of two biological sequences. Alignment enumeration table: 0 1 2 3 4 5 0 1 1 1 1 1 1 1 1 3 5 7 9 11 2 1 5 13 25 41 61 3 1 7 25 63 129 231 4 1 9 41 129 321 681 5 1 11 61 231 681 1683 6 1 13 85 377 1289 3653 7 1 15 113 575 2241 7183 8 1 17 145 833 3649 13073 9 1 19 181 1159 5641 22363 10 1 21 221 1561 8361 36365 6 7 8 9 10 0 1 1 1 1 1 1 13 15 17 19 21 2 85 113 145 181 221 3 377 575 833 1159 1561 4 1289 2241 3649 5641 8361 5 3653 7183 13073 22363 36365 6 8989 19825 40081 75517 134245 7 19825 48639 108545 224143 433905 8 40081 108545 265729 598417 1256465 9 75517 224143 598417 1462563 3317445 10 134245 433905 1256465 3317445 8097453 bell_test(): bell() computes Bell numbers. 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 bell_poly_coef_test(): bell_poly_coef() returns the coefficients of a Bell polynomial. Table of polynomial coefficients: 0: 1 1: 0 1 2: 0 1 1 3: 0 1 3 1 4: 0 1 7 6 1 5: 0 1 15 25 10 1 6: 0 1 31 90 65 15 1 7: 0 1 63 301 350 140 21 1 8: 0 1 127 966 1701 1050 266 28 1 9: 0 1 255 3025 7770 6951 2646 462 36 1 10: 0 1 511 9330 34105 42525 22827 5880 750 45 1 benford_test(): benford(i): is the Benford probability of the initial digit sequence I. I BENFORD(I) 1 0.3010 2 0.1761 3 0.1249 4 0.0969 5 0.0792 6 0.0669 7 0.0580 8 0.0512 9 0.0458 bernoulli_number_test(): bernoulli_number() computes Bernoulli numbers; I Exact BERNOULLI_NUMBER 0 1 1 1 -0.5 -0.5 2 0.166667 0.166667 3 0 0 4 -0.0333333 -0.0333333 6 -0.0238095 0.0238095 8 -0.0333333 -0.0333333 10 0.0757576 0.0757576 20 -529.124 -529.124 30 6.01581e+08 6.01581e+08 bernoulli_number2_test(): bernoulli_number2() computes Bernoulli numbers; I Exact BERNOULLI_NUMBER2 0 1 1 1 -0.5 -0.5 2 0.166667 0.166667 3 0 0 4 -0.0333333 -0.0333333 6 -0.0238095 0.0238095 8 -0.0333333 -0.0333333 10 0.0757576 0.0757576 20 -529.124 -529.124 30 6.01581e+08 6.01581e+08 bernoulli_number3_test(): bernoulli_number3() computes Bernoulli numbers; I Exact BERNOULLI_NUMBER3 0 1 1 1 -0.5 -0.5 2 0.166667 0.166667 3 0 0 4 -0.0333333 -0.0333331 6 -0.0238095 0.0238095 8 -0.0333333 -0.0333333 10 0.0757576 0.0757576 20 -529.124 -529.124 30 6.01581e+08 6.01581e+08 bernoulli_poly_test(): bernoulli_poly() evaluates Bernoulli polynomials; X = 0.2 I BX 1 -0.3 2 0.00666667 3 4.93935e+07 4 -1.46383e+07 5 -1.46335e+07 6 -0.0397531 7 11.6062 8 5.46313 9 -4117.9 10 -284.855 11 26409.7 12 14220.5 13 4.54586e+07 14 -846056 15 1.08937e+08 bernoulli_poly2_test(): bernoulli_poly2() evaluates Bernoulli polynomials; X = 0.2 I BX 1 -0.3 2 0.00666667 3 0.048 4 -0.00773314 5 -0.0236798 6 0.00691363 7 0.0249088 8 -0.01015 9 -0.0452782 10 0.0233263 11 0.12605 12 -0.0781468 13 -0.497979 14 0.36044 15 2.64878 bernstein_poly_test(): bernstein_poly() evaluates the Bernstein polynomials. N K X Exact B(N,K)(X) 0 0 0.25 1 1 1 0 0.25 0.75 0.75 1 1 0.25 0.25 0.25 2 0 0.25 0.5625 0.5625 2 1 0.25 0.375 0.375 2 2 0.25 0.0625 0.0625 3 0 0.25 0.421875 0.421875 3 1 0.25 0.421875 0.421875 3 2 0.25 0.140625 0.140625 3 3 0.25 0.015625 0.015625 4 0 0.25 0.316406 0.316406 4 1 0.25 0.421875 0.421875 4 2 0.25 0.210938 0.210938 4 3 0.25 0.046875 0.046875 4 4 0.25 0.00390625 0.00390625 bpab_test(): bpab() evaluates Bernstein polynomials. The Bernstein polynomials of degree 10 based on the interval from 0 to 1 evaluated at X = 0.3 0 0.0282475 1 0.121061 2 0.233474 3 0.266828 4 0.200121 5 0.102919 6 0.0367569 7 0.00900169 8 0.0014467 9 0.000137781 10 5.9049e-06 CARDAN_POLY_TEST CARDAN_POLY evaluates the Cardan polynomial. Compare CARDAN_POLY_COEF + R8POLY_VALUE_HORNER versus CARDAN_POLY alone. Evaluate polynomials at X = 0.25 We use the parameter S = 0.5 Order Horner Direct 0 2 2 1 0.25 0.25 2 -0.9375 -0.9375 3 -0.359375 -0.359375 4 0.378906 0.378906 5 0.274414 0.274414 6 -0.12085 -0.12085 7 -0.167419 -0.167419 8 0.0185699 0.0185699 9 0.0883522 0.0883522 10 0.0128031 0.0128031 CARDAN_POLY_COEF_TEST CARDAN_POLY_COEF returns the coefficients of a Cardan polynomial. We use the parameter S = 1 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 CARDINAL_COS_TEST CARDINAL_COS evaluates cardinal cosine functions. Ci(Tj) = Delta(i,j), where Tj = cos(pi*i/(n+1)). A simple check of all pairs should form the identity matrix. The CARDINAL_COS test matrix: 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 CARDINAL_SIN_TEST CARDINAL_SIN evaluates cardinal sine functions. Si(Tj) = Delta(i,j), where Tj = cos(pi*i/(n+1)). A simple check of all pairs should form the identity matrix. The CARDINAL_SIN test matrix: 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 -0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 0.0 -0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 0.0 -0.0 1.0 CATALAN_TEST CATALAN computes Catalan numbers. 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 CATALAN_ROW_NEXT_TEST 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 consecutively, one at a time: 8 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 CHARLIER_TEST: CHARLIER evaluates Charlier polynomials. N A X P(N,A,X) 0 0.25 0 1 1 0.25 0 -0 2 0.25 0 -4 3 0.25 0 -36 4 0.25 0 -420 5 0.25 0 -6564 0 0.25 0.5 1 1 0.25 0.5 -2 2 0.25 0.5 -10 3 0.25 0.5 -54 4 0.25 0.5 -474 5 0.25 0.5 -6246 0 0.25 1 1 1 0.25 1 -4 2 0.25 1 -8 3 0.25 1 -8 4 0.25 1 24 5 0.25 1 440 0 0.25 1.5 1 1 0.25 1.5 -6 2 0.25 1.5 2 3 0.25 1.5 54 4 0.25 1.5 354 5 0.25 1.5 3030 0 0.25 2 1 1 0.25 2 -8 2 0.25 2 20 3 0.25 2 84 4 0.25 2 180 5 0.25 2 276 0 0.25 2.5 1 1 0.25 2.5 -10 2 0.25 2.5 46 3 0.25 2.5 34 4 0.25 2.5 -450 5 0.25 2.5 -3694 0 0.5 0 1 1 0.5 0 -0 2 0.5 0 -2 3 0.5 0 -10 4 0.5 0 -58 5 0.5 0 -442 0 0.5 0.5 1 1 0.5 0.5 -1 2 0.5 0.5 -4 3 0.5 0.5 -12 4 0.5 0.5 -48 5 0.5 0.5 -288 0 0.5 1 1 1 0.5 1 -2 2 0.5 1 -4 3 0.5 1 -4 4 0.5 1 4 5 0.5 1 60 0 0.5 1.5 1 1 0.5 1.5 -3 2 0.5 1.5 -2 3 0.5 1.5 8 4 0.5 1.5 44 5 0.5 1.5 200 0 0.5 2 1 1 0.5 2 -4 2 0.5 2 2 3 0.5 2 18 4 0.5 2 42 5 0.5 2 66 0 0.5 2.5 1 1 0.5 2.5 -5 2 0.5 2.5 8 3 0.5 2.5 20 4 0.5 2.5 -8 5 0.5 2.5 -192 0 1 0 1 1 1 0 -0 2 1 0 -1 3 1 0 -3 4 1 0 -9 5 1 0 -33 0 1 0.5 1 1 1 0.5 -0.5 2 1 0.5 -1.75 3 1 0.5 -3.375 4 1 0.5 -6.5625 5 1 0.5 -16.0312 0 1 1 1 1 1 1 -1 2 1 1 -2 3 1 1 -2 4 1 1 0 5 1 1 8 0 1 1.5 1 1 1 1.5 -1.5 2 1 1.5 -1.75 3 1 1.5 0.375 4 1 1.5 6.1875 5 1 1.5 20.1562 0 1 2 1 1 1 2 -2 2 1 2 -1 3 1 2 3 4 1 2 9 5 1 2 15 0 1 2.5 1 1 1 2.5 -2.5 2 1 2.5 0.25 3 1 2.5 5.125 4 1 2.5 6.9375 5 1 2.5 -3.15625 0 2 0 1 1 2 0 -0 2 2 0 -0.5 3 2 0 -1 4 2 0 -1.75 5 2 0 -3.25 0 2 0.5 1 1 2 0.5 -0.25 2 2 0.5 -0.8125 3 2 0.5 -1.17188 4 2 0.5 -1.41797 5 2 0.5 -1.55566 0 2 1 1 1 2 1 -0.5 2 2 1 -1 3 2 1 -1 4 2 1 -0.5 5 2 1 0.75 0 2 1.5 1 1 2 1.5 -0.75 2 2 1.5 -1.0625 3 2 1.5 -0.578125 4 2 1.5 0.582031 5 2 1.5 2.46582 0 2 2 1 1 2 2 -1 2 2 2 -1 3 2 2 0 4 2 2 1.5 5 2 2 3 0 2 2.5 1 1 2 2.5 -1.25 2 2 2.5 -0.8125 3 2 2.5 0.640625 4 2 2.5 2.01953 5 2 2.5 2.25293 0 10 0 1 1 10 0 -0 2 10 0 -0.1 3 10 0 -0.12 4 10 0 -0.126 5 10 0 -0.1284 0 10 0.5 1 1 10 0.5 -0.05 2 10 0.5 -0.1525 3 10 0.5 -0.165375 4 10 0.5 -0.160969 5 10 0.5 -0.151158 0 10 1 1 1 10 1 -0.1 2 10 1 -0.2 3 10 1 -0.2 4 10 1 -0.18 5 10 1 -0.154 0 10 1.5 1 1 10 1.5 -0.15 2 10 1.5 -0.2425 3 10 1.5 -0.224625 4 10 1.5 -0.185569 5 10 1.5 -0.142111 0 10 2 1 1 10 2 -0.2 2 10 2 -0.28 3 10 2 -0.24 4 10 2 -0.18 5 10 2 -0.12 0 10 2.5 1 1 10 2.5 -0.25 2 10 2.5 -0.3125 3 10 2.5 -0.246875 4 10 2.5 -0.165469 5 10 2.5 -0.0915391 CHEBY_T_POLY_TEST: CHEBY_T_POLY evaluates the Chebyshev T polynomial. N X Exact F T(N,X) 0 0.8 1 1 1 0.8 0.8 0.8 2 0.8 0.28 0.28 3 0.8 -0.352 -0.352 4 0.8 -0.8432 -0.8432 5 0.8 -0.99712 -0.99712 6 0.8 -0.752192 -0.752192 7 0.8 -0.206387 -0.206387 8 0.8 0.421972 0.421972 9 0.8 0.881543 0.881543 10 0.8 0.988497 0.988497 11 0.8 0.700051 0.700051 12 0.8 0.131586 0.131586 CHEBY_T_POLY_COEF_TEST CHEBY_T_POLY_COEF determines the polynomial coefficients of the Chebyshev polynomial T(n,x). T(0,x) 1 T(1,x) 1 * x T(2,x) 2 * x^2 -1 T(3,x) 4 * x^3 -2 * x T(4,x) 8 * x^4 -4 * x^2 1 * x 1 T(5,x) 16 * x^5 -8 * x^3 4 * x^2 2 * x CHEBY_T_POLY_ZERO_TEST: CHEBY_T_POLY_ZERO returns zeroes of T(N,X). N X T(N,X) 1 6.12323e-17 6.12323e-17 2 0.707107 2.22045e-16 2 -0.707107 -2.22045e-16 3 0.866025 3.33067e-16 3 6.12323e-17 -1.83697e-16 3 -0.866025 -3.33067e-16 4 0.92388 -2.22045e-16 4 0.382683 -2.22045e-16 4 -0.382683 1.11022e-16 4 -0.92388 -2.22045e-16 CHEBY_U_POLY_TEST: CHEBY_U_POLY evaluates the Chebyshev U polynomial. N X Exact F U(N,X) 0 0.8 1 1 1 0.8 1.6 1.6 2 0.8 1.56 1.56 3 0.8 0.896 0.896 4 0.8 -0.1264 -0.1264 5 0.8 -1.09824 -1.09824 6 0.8 -1.63078 -1.63078 7 0.8 -1.51101 -1.51101 8 0.8 -0.786839 -0.786839 9 0.8 0.252072 0.252072 10 0.8 1.19015 1.19015 11 0.8 1.65217 1.65217 12 0.8 1.45333 1.45333 CHEBY_U_POLY_COEF_TEST CHEBY_U_POLY_COEF determines the polynomial coefficients of the Chebyshev polynomial U(n,x). U(0,x) 1 U(1,x) 2 * x U(2,x) 4 * x^2 -1 U(3,x) 8 * x^3 -4 * x U(4,x) 16 * x^4 -12 * x^2 1 U(5,x) 32 * x^5 -32 * x^3 6 * x CHEBY_U_POLY_ZERO_TEST: CHEBY_U_POLY_ZERO returns zeroes of U(N,X). N X U(N,X) 1 6.12323e-17 1.22465e-16 2 0.5 4.44089e-16 2 -0.5 -8.88178e-16 3 0.707107 6.66134e-16 3 6.12323e-17 -2.44929e-16 3 -0.707107 6.66134e-16 4 0.809017 0 4 0.309017 -1.11022e-16 4 -0.309017 5.55112e-16 4 -0.809017 -8.88178e-16 CHEBYSHEV_DISCRETE_TEST: CHEBYSHEV_DISCRETE evaluates discrete Chebyshev polynomials. N M X T(N,M,X) 0 5 0 1 1 5 0 -4 2 5 0 12 3 5 0 -24 4 5 0 24 5 5 0 0 0 5 0.5 1 1 5 0.5 -3 2 5 0.5 1.5 3 5 0.5 34.5 4 5 0.5 -199.125 5 5 0.5 826.875 0 5 1 1 1 5 1 -2 2 5 1 -6 3 5 1 48 4 5 1 -96 5 5 1 0 0 5 1.5 1 1 5 1.5 -1 2 5 1.5 -10.5 3 5 1.5 31.5 4 5 1.5 70.875 5 5 1.5 -354.375 0 5 2 1 1 5 2 0 2 5 2 -12 3 5 2 -0 4 5 2 144 5 5 2 0 0 5 2.5 1 1 5 2.5 1 2 5 2.5 -10.5 3 5 2.5 -31.5 4 5 2.5 70.875 5 5 2.5 354.375 COLLATZ_COUNT_TEST: 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 collatz_count_max_test(): 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 COMB_ROW_NEXT_TEST COMB_ROW_NEXT computes the next 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 COMMUL_TEST COMMUL computes a multinomial coefficient. N = 8 Number of factors = 2 0 6 1 2 Value of coefficient = 28 N = 8 Number of factors = 3 0 2 1 2 2 4 Value of coefficient = 420 N = 13 Number of factors = 4 0 5 1 3 2 3 3 2 Value of coefficient = 720720 complete_symmetric_poly_test(): complete_symmetric_poly() evaluates a complete symmetric. polynomial in a given set of variables X. Variable vector X: 0: 1 1: 2 2: 3 3: 4 4: 5 N\R 0 1 2 3 4 5 0 1 0 0 0 0 0 1 1 1 1 1 1 1 2 1 3 7 15 31 63 3 1 6 25 90 301 966 4 1 10 65 350 1701 7770 5 1 15 140 1050 6951 42525 conway_sequence_test(): conway_sequence() returns the first N entries of the Conway challenge sequence. 0 0 1 1 2 1 3 2 4 2 5 3 6 4 7 4 8 4 9 5 10 6 11 7 12 7 13 8 14 8 15 8 16 8 17 9 18 10 19 11 20 12 21 12 22 13 23 14 24 14 25 15 26 15 27 15 28 16 29 16 30 16 31 16 32 16 33 17 34 18 35 19 36 20 37 21 38 21 39 22 40 23 41 24 42 24 43 25 44 26 45 26 46 27 47 27 48 27 49 28 50 29 51 29 52 30 53 30 54 30 55 31 56 31 57 31 58 31 59 32 60 32 61 32 62 32 63 32 64 32 COS_POWER_INT_TEST: COS_POWER_INT computes the integral of the N-th power of the cosine function. A B N Exact Computed 0 3.14159 0 3.14159 3.14159 0 3.14159 1 0 1.22465e-16 0 3.14159 2 1.5708 1.5708 0 3.14159 3 0 1.22465e-16 0 3.14159 4 1.1781 1.1781 0 3.14159 5 0 1.22465e-16 0 3.14159 6 0.981748 0.981748 0 3.14159 7 0 1.22465e-16 0 3.14159 8 0.859029 0.859029 0 3.14159 9 0 1.22465e-16 0 3.14159 10 0.773126 0.773126 DELANNOY_TEST DELANNOY computes the Delannoy numbers A(0:M,0:N). A(M,N) counts the paths from (0,0) to (M,N). The Delannoy numbers: Col: 0 1 2 3 4 5 6 7 8 Row 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 377 1289 3653 8989 19825 40081 7: 1 15 113 575 2241 7183 19825 48639 108545 8: 1 17 145 833 3649 13073 40081 108545 265729 DOMINO_TILING_NUM_TEST: DOMINO_TILING_NUM returns the number of tilings of an MxN rectangle by dominoes. M N Tilings 1 1 0 2 1 1 2 2 2 3 1 0 3 2 3 3 3 0 4 1 1 4 2 5 4 3 11 4 4 36 5 1 0 5 2 8 5 3 0 5 4 95 5 5 0 6 1 1 6 2 13 6 3 41 6 4 281 6 5 1183 6 6 6728 7 1 0 7 2 21 7 3 0 7 4 781 7 5 0 7 6 31529 7 7 0 8 1 1 8 2 34 8 3 153 8 4 2245 8 5 14824 8 6 167089 8 7 1292697 8 8 12988816 euler_mascheroni_test(): euler_mascheroni() returns the Euler-Mascheroni constant sometimes denoted by 'gamma'. gamma = limit ( N -> oo ) ( sum ( 1 <= I <= N ) 1 / I ) - log ( N ) Numerically, g = 0.577216 N Partial Sum |gamma - partial sum| 1 1 0.422784 2 0.806853 0.229637 4 0.697039 0.119823 8 0.638416 0.0611999 16 0.60814 0.0309246 32 0.592759 0.0155436 64 0.585008 0.00779216 128 0.581117 0.00390116 256 0.579168 0.00195185 512 0.578192 0.000976245 1024 0.577704 0.000488202 2048 0.57746 0.000244121 4096 0.577338 0.000122065 8192 0.577277 6.10339e-05 16384 0.577246 3.05173e-05 32768 0.577231 1.52587e-05 65536 0.577223 7.62938e-06 131072 0.577219 3.81469e-06 262144 0.577218 1.90735e-06 524288 0.577217 9.53674e-07 1048576 0.577216 4.76837e-07 EULER_NUMBER_TEST EULER_NUMBER computes Euler numbers. 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 EULER_NUMBER2_TEST EULER_NUMBER2 computes Euler numbers. N exact EULER_NUMBER2 0 1 1 1 0 0 2 -1 -1 4 5 5 6 -61 -61 8 1385 1385 10 -50521 -50521 12 2702765 2702765 EULER_POLY_TEST EULER_POLY evaluates Euler polynomials. N X F(X) 0 0.5 1 1 0.5 2.77556e-17 2 0.5 -0.25 3 0.5 -1.45953e-06 4 0.5 0.312497 5 0.5 -3.32929e-06 6 0.5 -0.953128 7 0.5 -1.73264e-06 8 0.5 5.41016 9 0.5 -1.02449e-06 10 0.5 -49.3369 11 0.5 6.47439e-07 12 0.5 659.855 13 0.5 5.22754e-06 14 0.5 -12168 15 0.5 0.000218677 EULERIAN_TEST 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 F_HOFSTADTER_TEST F_HOFSTADTER evaluates Hofstadter's recursive F function. N F(N) 0 0 1 1 2 1 3 2 4 2 5 3 6 3 7 4 8 4 9 5 10 5 11 6 12 6 13 7 14 7 15 8 16 8 17 9 18 9 19 10 20 10 21 11 22 11 23 12 24 12 25 13 26 13 27 14 28 14 29 15 30 15 FIBONACCI_DIRECT_TEST FIBONACCI_DIRECT evalutes a Fibonacci number directly. 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 FIBONACCI_FLOOR_TEST 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 FIBONACCI_RECURSIVE_TEST FIBONACCI_RECURSIVE computes the Fibonacci sequence. 0 1 1 1 2 2 3 3 4 5 5 8 6 13 7 21 8 34 9 55 10 89 11 144 12 233 13 377 14 610 15 987 16 1597 17 2584 18 4181 19 6765 G_HOFSTADTER_TEST G_HOFSTADTER evaluates Hofstadter's recursive G function. N G(N) 0 0 1 1 2 1 3 2 4 3 5 3 6 4 7 4 8 5 9 6 10 6 11 7 12 8 13 8 14 9 15 9 16 10 17 11 18 11 19 12 20 12 21 13 22 14 23 14 24 15 25 16 26 16 27 17 28 17 29 18 30 19 GEGENBAUER_POLY_TEST GEGENBAUER_POLY evaluates the Gegenbauer polynomials. N A X GPV GEGENBAUER 0 0.5 0.2 1 1 1 0.5 0.2 0.2 0.2 2 0.5 0.2 -0.44 -0.44 3 0.5 0.2 -0.28 -0.28 4 0.5 0.2 0.232 0.232 5 0.5 0.2 0.30752 0.30752 6 0.5 0.2 -0.080576 -0.080576 7 0.5 0.2 -0.293517 -0.293517 8 0.5 0.2 -0.0395648 -0.0395648 9 0.5 0.2 0.245971 0.245957 10 0.5 0.2 0.129072 0.129072 2 0 0.4 0 0 2 1 0.4 -0.36 -0.36 2 2 0.4 -0.08 -0.08 2 3 0.4 0.84 0.84 2 4 0.4 2.4 2.4 2 5 0.4 4.6 4.6 2 6 0.4 7.44 7.44 2 7 0.4 10.92 10.92 2 8 0.4 15.04 15.04 2 9 0.4 19.8 19.8 2 10 0.4 25.2 25.2 5 3 -0.5 -9 9 5 3 -0.4 -0.16128 -0.16128 5 3 -0.3 -6.67296 -6.67296 5 3 -0.2 -8.37504 -8.37504 5 3 -0.1 -5.52672 -5.52672 5 3 0 0 0 5 3 0.1 5.52672 5.52672 5 3 0.2 8.37504 8.37504 5 3 0.3 6.67296 6.67296 5 3 0.4 0.16128 0.16128 5 3 0.5 -9 -9 5 3 0.6 -15.4253 -15.4253 5 3 0.7 -9.69696 -9.69696 5 3 0.8 22.441 22.441 5 3 0.9 100.889 100.889 5 3 1 252 252 GEN_HERMITE_POLY_TEST GEN_HERMITE_POLY evaluates the generalized Hermite polynomials. Table of H(N,MU)(X) for N(max) = 10 MU = 0 X = 0 0 1 1 0 2 -2 3 -0 4 12 5 0 6 -120 7 -0 8 1680 9 0 10 -30240 Table of H(N,MU)(X) for N(max) = 10 MU = 0 X = 1 0 1 1 2 2 2 3 -4 4 -20 5 -8 6 184 7 464 8 -1648 9 -10720 10 8224 Table of H(N,MU)(X) for N(max) = 10 MU = 0.1 X = 0 0 1 1 0 2 -2.4 3 -0 4 15.36 5 0 6 -159.744 7 -0 8 2300.31 9 0 10 -42325.8 Table of H(N,MU)(X) for N(max) = 10 MU = 0.1 X = 0.5 0 1 1 1 2 -1.4 3 -5.4 4 3.56 5 46.76 6 9.736 7 -551.384 8 -691.582 9 8130.56 10 20855.7 Table of H(N,MU)(X) for N(max) = 10 MU = 0.5 X = 0.5 0 1 1 1 2 -3 3 -7 4 17 5 73 6 -131 7 -1007 8 1089 9 17201 10 -4579 Table of H(N,MU)(X) for N(max) = 10 MU = 1 X = 0.5 0 1 1 1 2 -5 3 -9 4 41 5 113 6 -461 7 -1817 8 6481 9 35553 10 -107029 GEN_LAGUERRE_POLY_TEST GEN_LAGUERRE_POLY evaluates the generalized Laguerre functions. Table of L(N,ALPHA,X) for N(max) = 10 ALPHA = 0 X = 0 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 Table of L(N,ALPHA,X) for N(max) = 10 ALPHA = 0 X = 1 0 1 1 0 2 -0.5 3 -0.666667 4 -0.625 5 -0.466667 6 -0.256944 7 -0.0404762 8 0.153993 9 0.309744 10 0.418946 Table of L(N,ALPHA,X) for N(max) = 10 ALPHA = 0.1 X = 0 0 1 1 1.1 2 1.155 3 1.1935 4 1.22334 5 1.2478 6 1.2686 7 1.28672 8 1.30281 9 1.31728 10 1.33046 Table of L(N,ALPHA,X) for N(max) = 10 ALPHA = 0.1 X = 0.5 0 1 1 0.6 2 0.23 3 -0.0673333 4 -0.28935 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.5 X = 0.5 0 1 1 1 2 0.75 3 0.416667 4 0.0729167 5 -0.24375 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 X = 0.5 0 1 1 1.5 2 1.625 3 1.47917 4 1.14844 5 0.702865 6 0.19872 7 -0.31962 8 -0.817983 9 -1.2709 10 -1.66028 GUD_TEST: GUD evaluates the Gudermannian function. X Exact F GUD(X) -2 -1.30176 -1.30176 -1 -0.865769 -0.865769 0 0 0 0.1 0.0998337 0.0998337 0.2 0.19868 0.19868 0.5 0.480381 0.480381 1 0.865769 0.865769 1.5 1.13173 1.13173 2 1.30176 1.30176 2.5 1.40699 1.40699 3 1.4713 1.4713 3.5 1.51042 1.51042 4 1.53417 1.53417 H_HOFSTADTER_TEST H_HOFSTADTER evaluates Hofstadter's recursive H function. N H(N) 0 0 1 1 2 1 3 2 4 3 5 4 6 4 7 5 8 5 9 6 10 7 11 7 12 8 13 9 14 10 15 10 16 11 17 12 18 13 19 13 20 14 21 14 22 15 23 16 24 17 25 17 26 18 27 18 28 19 29 20 30 20 HAIL_TEST HAIL(I) computes the length of the hail sequence for I, also known as the 3*N+1 sequence. I, HAIL(I) 1 0 2 1 3 7 4 2 5 5 6 8 7 16 8 3 9 19 10 6 11 14 12 9 13 9 14 17 15 17 16 4 17 12 18 20 19 20 20 7 harmonic_test(): harmonic() computes Harmonic numbers. N exact H(n) computed H(n) 1 1 1 2 1.5 1.5 3 1.8333333333333 1.8333333333333 4 2.0833333333333 2.0833333333333 5 2.2833333333333 2.2833333333333 6 2.45 2.45 7 2.5928571428571 2.5928571428571 8 2.7178571428571 2.7178571428571 9 2.8289682539683 2.8289682539683 10 2.9289682539683 2.9289682539683 11 3.0198773448773 3.0198773448773 12 3.1032106782107 3.1032106782107 13 3.1801337551338 3.1801337551338 14 3.2515623265623 3.2515623265623 15 3.318228993229 3.318228993229 16 3.380728993229 3.380728993229 17 3.4395525226408 3.4395525226408 18 3.4951080781963 3.4951080781963 19 3.5477396571437 3.5477396571437 20 3.5977396571437 3.5977396571437 21 3.6453587047627 3.6453587047627 22 3.6908132502173 3.6908132502173 23 3.7342915110868 3.7342915110868 24 3.7759581777535 3.7759581777535 25 3.8159581777535 3.8159581777535 26 3.854419716215 3.854419716215 27 3.8914567532521 3.8914567532521 28 3.9271710389664 3.9271710389664 29 3.9616537975871 3.9616537975871 30 3.9949871309204 3.9949871309204 31 4.0272451954365 4.0272451954365 32 4.0584951954365 4.0584951954365 33 4.0887982257396 4.0887982257396 34 4.1182099904454 4.1182099904454 35 4.1467814190169 4.1467814190169 36 4.1745591967946 4.1745591967946 37 4.2015862238217 4.2015862238217 38 4.2279020132953 4.2279020132953 39 4.2535430389364 4.2535430389364 40 4.2785430389364 4.2785430389364 harmonic_estimate_test(): harmonic_estimate() estimates Harmonic numbers. N estimated H(n) exact H(n) computed H(n) 1 1.0022156649015 1 1 2 1.5000503454615 1.5 1.5 3 1.8333382416355 1.8333333333333 1.8333333333333 4 2.0833342447714 2.0833333333333 2.0833333333333 5 2.2833335773356 2.2833333333333 2.2833333333333 6 2.4500000826893 2.45 2.45 7 2.5928571758894 2.5928571428571 2.5928571428571 8 2.7178571577532 2.7178571428571 2.7178571428571 9 2.8289682613405 2.8289682539683 2.8289682539683 10 2.9289682578956 2.9289682539683 2.9289682539683 11 3.0198773470982 3.0198773448773 3.0198773448773 12 3.1032106795301 3.1032106782107 3.1032106782107 13 3.1801337559508 3.1801337551338 3.1801337551338 14 3.2515623270866 3.2515623265623 3.2515623265623 15 3.3182289935758 3.318228993229 3.318228993229 16 3.3807289934646 3.380728993229 3.380728993229 17 3.4395525228046 3.4395525226408 3.4395525226408 18 3.4951080783126 3.4951080781963 3.4951080781963 19 3.5477396572278 3.5477396571437 3.5477396571437 20 3.5977396572055 3.5977396571437 3.5977396571437 21 3.6453587048089 3.6453587047627 3.6453587047627 22 3.6908132502522 3.6908132502173 3.6908132502173 23 3.7342915111136 3.7342915110868 3.7342915110868 24 3.7759581777742 3.7759581777535 3.7759581777535 25 3.8159581777697 3.8159581777535 3.8159581777535 26 3.8544197162279 3.854419716215 3.854419716215 27 3.8914567532623 3.8914567532521 3.8914567532521 28 3.9271710389746 3.9271710389664 3.9271710389664 29 3.9616537975937 3.9616537975871 3.9616537975871 30 3.9949871309258 3.9949871309204 3.9949871309204 31 4.027245195441 4.0272451954365 4.0272451954365 32 4.0584951954402 4.0584951954365 4.0584951954365 33 4.0887982257426 4.0887982257396 4.0887982257396 34 4.118209990448 4.1182099904454 4.1182099904454 35 4.146781419019 4.1467814190169 4.1467814190169 36 4.1745591967965 4.1745591967946 4.1745591967946 37 4.2015862238232 4.2015862238217 4.2015862238217 38 4.2279020132967 4.2279020132953 4.2279020132953 39 4.2535430389375 4.2535430389364 4.2535430389364 40 4.2785430389373 4.2785430389364 4.2785430389364 HERMITE_POLY_PHYS_TEST: HERMITE_POLY_PHYS evaluates the physicist's Hermite polynomial. N X Exact F H(N)(X) 0 5 1 1 1 5 10 10 2 5 98 98 3 5 940 940 4 5 8812 8812 5 5 80600 80600 6 5 717880 717880 7 5 6.2116e+06 6.2116e+06 8 5 5.20657e+07 5.20657e+07 9 5 4.21271e+08 4.21271e+08 10 5 3.27553e+09 3.27553e+09 11 5 2.43299e+10 2.43299e+10 12 5 1.71237e+11 1.71237e+11 5 0.5 41 41 5 1 -8 -8 5 3 3816 3816 5 10 3.0412e+06 3.0412e+06 HERMITE_POLY_PHYS_COEF_TEST HERMITE_POLY_PHYS_COEF determines physicist's Hermite polynomial coefficients. H(0) 1 H(1) 2 * x 0 H(2) 4 * x^2 0 * x -2 H(3) 8 * x^3 0 * x^2 -12 * x -0 H(4) 16 * x^4 0 * x^3 -48 * x^2 -0 * x 12 H(5) 32 * x^5 0 * x^4 -160 * x^3 -0 * x^2 120 * x 0 I4_CHOOSE_TEST 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 I4_FACTOR_TEST: I4_FACTOR tries to factor an I4 Factors of N = 60 2^2 3^1 5^1 Factors of N = 664048 2^4 7^3 11^2 Factors of N = 8466763 2699^1 3137^1 I4_FACTORIAL_TEST: I4_FACTORIAL evaluates the factorial function. 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 I4_FACTORIAL2_TEST: 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 I4_IS_FIBONACCI_TEST I4_IS_FIBONACCI determines if an I4 is a Fibonacci number. I4 T/F -13 0 0 0 1 1 8 1 10 0 50 0 55 1 100 0 144 1 200 0 I4_IS_TRIANGULAR_TEST I4_IS_TRIANGULAR returns 0 or 1 depending on whether I is triangular. I => 0/1 0 1 1 0 2 1 3 0 4 0 5 1 6 0 7 0 8 0 9 1 10 0 11 0 12 0 13 0 14 1 15 0 16 0 17 0 18 0 19 0 20 1 I4_PARTITION_DISTINCT_COUNT_TEST: For the number of partitions of an integer into distinct parts, I4_PARTITION_DISTINCT_COUNT computes any value. N Exact F Q(N) 0 1 1 1 1 0 2 1 2 3 2 0 4 2 3 5 3 1 6 4 5 7 5 1 8 6 8 9 8 3 10 10 12 11 12 4 12 15 18 13 18 7 14 22 27 15 27 10 16 32 38 17 38 16 18 46 54 19 54 22 20 64 76 I4_TO_TRIANGLE_LOWER_TEST I4_TO_TRIANGLE_LOWER converts a linear index to a lower triangular one. K => I J 0 0 0 1 1 0 2 1 1 3 2 0 4 2 1 5 2 2 6 3 0 7 3 1 8 3 2 9 3 3 10 4 0 11 4 1 12 4 2 13 4 3 14 4 4 15 5 0 16 5 1 17 5 2 18 5 3 19 5 4 20 5 5 JACOBI_POLY_TEST: JACOBI_POLY computes values of the Jacobi polynomial.. N A B X JPV JACOBI 0 0.000000 1.000000 0.5000 1.000000 1.000000 1 0.000000 1.000000 0.5000 0.250000 0.250000 2 0.000000 1.000000 0.5000 -0.375000 -0.375000 3 0.000000 1.000000 0.5000 -0.484375 -0.484375 4 0.000000 1.000000 0.5000 -0.132812 -0.132812 5 0.000000 1.000000 0.5000 0.275391 0.275391 5 1.000000 1.000000 0.5000 -0.164062 -0.164062 5 2.000000 1.000000 0.5000 -1.174805 -1.174805 5 3.000000 1.000000 0.5000 -2.361328 -2.361328 5 4.000000 1.000000 0.5000 -2.616211 -2.616211 5 5.000000 1.000000 0.5000 0.117188 0.117188 5 0.000000 2.000000 0.5000 0.421875 0.421875 5 0.000000 3.000000 0.5000 0.504883 0.504883 5 0.000000 4.000000 0.5000 0.509766 0.509766 5 0.000000 5.000000 0.5000 0.430664 0.430664 5 0.000000 1.000000 -1.0000 -6.000000 -6.000000 5 0.000000 1.000000 -0.8000 0.038620 0.038620 5 0.000000 1.000000 -0.6000 0.811840 0.811840 5 0.000000 1.000000 -0.4000 0.036660 0.036660 5 0.000000 1.000000 -0.2000 -0.485120 -0.485120 5 0.000000 1.000000 0.0000 -0.312500 -0.312500 5 0.000000 1.000000 0.2000 0.189120 0.189120 5 0.000000 1.000000 0.4000 0.402340 0.402340 5 0.000000 1.000000 0.6000 0.012160 0.012160 5 0.000000 1.000000 0.8000 -0.439620 -0.439620 5 0.000000 1.000000 1.0000 1.000000 1.000000 JACOBI_SYMBOL_TEST 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 KRAWTCHOUK_TEST: KRAWTCHOUK evaluates Krawtchouk polynomials. N P X M K(N,P,X,M) 0 0.25 0 5 1 1 0.25 0 5 -1.25 2 0.25 0 5 0.625 3 0.25 0 5 -0.15625 4 0.25 0 5 0.0195312 5 0.25 0 5 -0.000976562 0 0.25 0.5 5 1 1 0.25 0.5 5 -0.75 2 0.25 0.5 5 0 3 0.25 0.5 5 0.1875 4 0.25 0.5 5 -0.105469 5 0.25 0.5 5 0.0439453 0 0.25 1 5 1 1 0.25 1 5 -0.25 2 0.25 1 5 -0.375 3 0.25 1 5 0.21875 4 0.25 1 5 -0.0429688 5 0.25 1 5 0.00292969 0 0.25 1.5 5 1 1 0.25 1.5 5 0.25 2 0.25 1.5 5 -0.5 3 0.25 1.5 5 0.0625 4 0.25 1.5 5 0.0507812 5 0.25 1.5 5 -0.0224609 0 0.25 2 5 1 1 0.25 2 5 0.75 2 0.25 2 5 -0.375 3 0.25 2 5 -0.15625 4 0.25 2 5 0.0820312 5 0.25 2 5 -0.00878906 0 0.25 2.5 5 1 1 0.25 2.5 5 1.25 2 0.25 2.5 5 0 3 0.25 2.5 5 -0.3125 4 0.25 2.5 5 0.0195312 5 0.25 2.5 5 0.0205078 0 0.5 0 5 1 1 0.5 0 5 -2.5 2 0.5 0 5 2.5 3 0.5 0 5 -1.25 4 0.5 0 5 0.3125 5 0.5 0 5 -0.03125 0 0.5 0.5 5 1 1 0.5 0.5 5 -2 2 0.5 0.5 5 1.375 3 0.5 0.5 5 -0.25 4 0.5 0.5 5 -0.132812 5 0.5 0.5 5 0.078125 0 0.5 1 5 1 1 0.5 1 5 -1.5 2 0.5 1 5 0.5 3 0.5 1 5 0.25 4 0.5 1 5 -0.1875 5 0.5 1 5 0.03125 0 0.5 1.5 5 1 1 0.5 1.5 5 -1 2 0.5 1.5 5 -0.125 3 0.5 1.5 5 0.375 4 0.5 1.5 5 -0.0703125 5 0.5 1.5 5 -0.0234375 0 0.5 2 5 1 1 0.5 2 5 -0.5 2 0.5 2 5 -0.5 3 0.5 2 5 0.25 4 0.5 2 5 0.0625 5 0.5 2 5 -0.03125 0 0.5 2.5 5 1 1 0.5 2.5 5 0 2 0.5 2.5 5 -0.625 3 0.5 2.5 5 -0 4 0.5 2.5 5 0.117188 5 0.5 2.5 5 0 LAGUERRE_ASSOCIATED_TEST LAGUERRE_ASSOCIATED evaluates the associated Laguerre polynomials. Table of L(N,M,X) for N(max) = 6 M = 0 X = 0 0 1 1 1 2 1 3 1 4 1 5 1 6 1 Table of L(N,M,X) for N(max) = 6 M = 0 X = 1 0 1 1 0 2 -0.5 3 -0.666667 4 -0.625 5 -0.466667 6 -0.256944 Table of L(N,M,X) for N(max) = 6 M = 1 X = 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 Table of L(N,M,X) for N(max) = 6 M = 2 X = 0.5 0 1 1 2.5 2 4.125 3 5.60417 4 6.7526 5 7.45547 6 7.65419 Table of L(N,M,X) for N(max) = 6 M = 3 X = 0.5 0 1 1 3.5 2 7.625 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.5 0 1 1 1.5 2 1.625 3 1.47917 4 1.14844 5 0.702865 6 0.19872 LAGUERRE_POLY_TEST: LAGUERRE_POLY evaluates the Laguerre polynomial. N X Exact F L(N,X) 0 1 1 1 1 1 0 0 2 1 -0.5 -0.5 3 1 -0.666667 -0.666667 4 1 -0.625 -0.625 5 1 -0.466667 -0.466667 6 1 -0.256944 -0.256944 7 1 -0.0404762 -0.0404762 8 1 0.153993 0.153993 9 1 0.309744 0.309744 10 1 0.418946 0.418946 11 1 0.480134 0.480134 12 1 0.496212 0.496212 5 0.5 -0.445573 -0.445573 5 3 0.85 0.85 5 5 -3.16667 -3.16667 5 10 34.3333 34.3333 LAGUERRE_POLY_COEF_TEST LAGUERRE_POLY_COEF determines Laguerre polynomial coefficients. L(0) 1 L(1) -1 * x 1 L(2) 0.5 * x^2 -2 * x 1 L(3) -0.166667 * x^3 1.5 * x^2 -3 * x 1 L(4) 0.0416667 * x^4 -0.666667 * x^3 3 * x^2 -4 * x 1 L(5) -0.00833333 * x^5 0.208333 * x^4 -1.66667 * x^3 5 * x^2 -5 * x 1 Factorially scaled L(0) 1 Factorially scaled L(1) -1 * x 1 Factorially scaled L(2) 1 * x^2 -4 * x 2 Factorially scaled L(3) -1 * x^3 9 * x^2 -18 * x 6 Factorially scaled L(4) 1 * x^4 -16 * x^3 72 * x^2 -96 * x 24 Factorially scaled L(5) -1 * x^5 25 * x^4 -200 * x^3 600 * x^2 -600 * x 120 lambert_w_test(): lambert_w() estimates the Lambert W function. X W(X) W(X) Tabulated Computed 0 0 1.45313e-14 0.5 0.351734 0.351734 1 0.567143 0.567143 1.5 0.725861 0.725861 2 0.852606 0.852606 2.5 0.958586 0.958586 2.71828 1 1 3 1.04991 1.04991 3.5 1.13029 1.13029 4 1.20217 1.20217 4.5 1.26724 1.26724 5 1.32672 1.32672 5.5 1.38155 1.38155 6 1.4324 1.4324 6.5 1.47986 1.47986 7 1.52435 1.52435 7.5 1.56623 1.56623 8 1.60581 1.60581 10 1.74553 1.74553 100 3.38563 3.38563 1000 5.2496 5.2496 1e+06 11.3834 11.3834 lambert_w_estimate_test(): lambert_w_estimate() estimates the Lambert W function. X W(X) W(X) Tabulated Estimate 0 0 0.04 0.5 0.351734 0.311766 1 0.567143 0.507173 1.5 0.725861 0.660221 2 0.852606 0.786228 2.5 0.958586 0.893439 2.71828 1 0.935684 3 1.04991 0.986807 3.5 1.13029 1.06955 4 1.20217 1.14387 4.5 1.26724 1.21134 5 1.32672 1.27315 5.5 1.38155 1.33018 6 1.4324 1.38313 6.5 1.47986 1.43256 7 1.52435 1.4789 7.5 1.56623 1.52253 8 1.60581 1.56376 10 1.74553 1.70916 100 3.38563 3.38525 1000 5.2496 5.25088 1e+06 11.3834 11.3798 LEGENDRE_ASSOCIATED_TEST: LEGENDRE_ASSOCIATED evaluates associated Legendre functions. N M X Exact F PNM(X) 1 0 0.000000 0.000000 0.000000 1 0 0.500000 0.500000 0.500000 1 0 0.707107 0.707107 0.707107 1 0 1.000000 1.000000 1.000000 1 1 0.500000 -0.866025 -0.866025 2 0 0.500000 -0.125000 -0.125000 2 1 0.500000 -1.299040 -1.299038 2 2 0.500000 2.250000 2.250000 3 0 0.500000 -0.437500 -0.437500 3 1 0.500000 -0.324759 -0.324760 3 2 0.500000 5.625000 5.625000 3 3 0.500000 -9.742780 -9.742786 4 2 0.500000 4.218750 4.218750 5 2 0.500000 -4.921870 -4.921875 6 3 0.500000 12.787400 12.787406 7 3 0.500000 116.685000 116.685083 8 4 0.500000 -1050.670000 -1050.666504 9 4 0.500000 -2078.490000 -2078.492432 10 5 0.500000 30086.200000 30086.169706 LEGENDRE_ASSOCIATED_NORMALIZED_TEST: LEGENDRE_ASSOCIATED_NORMALIZED evaluates normalized associated Legendre functions. N M X Exact F PNM(X) 0 0 0.500000 0.282095 0.282095 1 0 0.500000 0.244301 0.244301 1 1 0.500000 -0.299207 -0.299207 2 0 0.500000 -0.078848 -0.078848 2 1 0.500000 -0.334523 -0.334523 2 2 0.500000 0.289706 0.289706 3 0 0.500000 -0.326529 -0.326529 3 1 0.500000 -0.069971 -0.069971 3 2 0.500000 0.383245 0.383245 3 3 0.500000 -0.270995 -0.270995 4 0 0.500000 -0.244629 -0.244629 4 1 0.500000 0.256066 0.256066 4 2 0.500000 0.188169 0.188169 4 3 0.500000 -0.406492 -0.406492 4 4 0.500000 0.248925 0.248925 5 0 0.500000 0.084058 0.084058 5 1 0.500000 0.329379 0.329379 5 2 0.500000 -0.158885 -0.158885 5 3 0.500000 -0.280871 -0.280871 5 4 0.500000 0.412795 0.412795 5 5 0.500000 -0.226097 -0.226097 LEGENDRE_FUNCTION_Q_TEST: LEGENDRE_FUNCTION_Q evaluates the Legendre Q function. N X Exact F Q(N,X) 0 0 0 0 1 0 -1 -1 2 0 0 -0 3 0 0.666667 0.666667 9 0 -0.406349 -0.406349 10 0 0 -0 0 0.5 0.549306 0.549306 1 0.5 -0.725347 -0.725347 2 0.5 -0.818663 -0.818663 3 0.5 -0.198655 -0.198655 9 0.5 -0.116163 -0.116163 10 0.5 0.291658 0.291658 LEGENDRE_POLY_TEST: LEGENDRE_POLY evaluates the Legendre PN function. N X Exact F P(N,X) 0 0.25 1 1 1 0.25 0.25 0.25 2 0.25 -0.40625 -0.40625 3 0.25 -0.335938 -0.335938 4 0.25 0.157715 0.157715 5 0.25 0.339722 0.339722 6 0.25 0.0242767 0.0242767 7 0.25 -0.279919 -0.279919 8 0.25 -0.152454 -0.152454 9 0.25 0.176824 0.176824 10 0.25 0.2212 0.2212 3 0 0 -0 3 0.1 -0.1475 -0.1475 3 0.2 -0.28 -0.28 3 0.3 -0.3825 -0.3825 3 0.4 -0.44 -0.44 3 0.5 -0.4375 -0.4375 3 0.6 -0.36 -0.36 3 0.7 -0.1925 -0.1925 3 0.8 0.08 0.08 3 0.9 0.4725 0.4725 3 1 1 1 LEGENDRE_POLY_COEF_TEST LEGENDRE_POLY_COEF determines the Legendre P polynomial coefficients. P( 0) 1 P( 1) 1 * x 0 P( 2) 1.5 * x^2 0 * x -0.5 P( 3) 2.5 * x^3 0 * x^2 -1.5 * x -0 P( 4) 4.375 * x^4 0 * x^3 -3.75 * x^2 -0 * x 0.375 P( 5) 7.875 * x^5 0 * x^4 -8.75 * x^3 -0 * x^2 1.875 * x 0 LEGENDRE_SYMBOL_TEST 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 LERCH_TEST: LERCH evaluates the Lerch function. Z S A Lerch Lerch Tabulated Computed 1 2 0 1.64493 1.64492 1 3 0 1.20206 1.20206 1 10 0 1.00099 1.00099 0.5 2 1 1.16448 1.16448 0.5 3 1 1.07443 1.07443 0.5 10 1 1.00049 1.00049 0.333333 2 2 0.295919 0.295919 0.333333 3 2 0.139451 0.139451 0.333333 10 2 0.000982318 0.000982318 0.1 2 3 0.117791 0.117791 0.1 3 3 0.0386845 0.0386845 0.1 10 3 1.70315e-05 1.70315e-05 LGAMMA_TEST: LGAMMA is a C math library function which evaluates the logarithm of the Gamma function. X Exact F LGAMMA(X) 0.2 1.52406 1.52406 0.4 0.796678 0.796678 0.6 0.398234 0.398234 0.8 0.15206 0.15206 1 0 0 1.1 -0.0498724 -0.0498724 1.2 -0.0853741 -0.0853741 1.3 -0.108175 -0.108175 1.4 -0.119613 -0.119613 1.5 -0.120782 -0.120782 1.6 -0.112592 -0.112592 1.7 -0.0958077 -0.0958077 1.8 -0.0710839 -0.0710839 1.9 -0.0389843 -0.0389843 2 0 0 3 0.693147 0.693147 4 1.79176 1.79176 10 12.8018 12.8018 20 39.3399 39.3399 30 71.257 71.257 LOCK_TEST 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 MEIXNER_TEST: MEIXNER evaluates Meixner polynomials. N BETA C X M(N,BETA,C,X) 0 0.5 0.125 0 1 1 0.5 0.125 0 1 2 0.5 0.125 0 0.125 3 0.5 0.125 0 -0.684375 4 0.5 0.125 0 -0.779297 5 0.5 0.125 0 -0.181787 0 0.5 0.125 0.5 1 1 0.5 0.125 0.5 -6 2 0.5 0.125 0.5 -3.66667 3 0.5 0.125 0.5 2.05 4 0.5 0.125 0.5 4.9 5 0.5 0.125 0.5 2.66944 0 0.5 0.125 1 1 1 0.5 0.125 1 -13 2 0.5 0.125 1 -3.375 3 0.5 0.125 1 8.45937 4 0.5 0.125 1 9.08633 5 0.5 0.125 1 -0.0737033 0 0.5 0.125 1.5 1 1 0.5 0.125 1.5 -20 2 0.5 0.125 1.5 1 3 0.5 0.125 1.5 16.4 4 0.5 0.125 1.5 9.1 5 0.5 0.125 1.5 -8.00556 0 0.5 0.125 2 1 1 0.5 0.125 2 -27 2 0.5 0.125 2 9.45833 3 0.5 0.125 2 23.7281 4 0.5 0.125 2 3.3332 5 0.5 0.125 2 -19.0084 0 0.5 0.125 2.5 1 1 0.5 0.125 2.5 -34 2 0.5 0.125 2.5 22 3 0.5 0.125 2.5 28.3 4 0.5 0.125 2.5 -8.75 5 0.5 0.125 2.5 -29.7736 0 1 0.25 0 1 1 1 0.25 0 1 2 1 0.25 0 0.25 3 1 0.25 0 -0.4375 4 1 0.25 0 -0.625 5 1 0.25 0 -0.30625 0 1 0.25 0.5 1 1 1 0.25 0.5 -0.5 2 1 0.25 0.5 -0.78125 3 1 0.25 0.5 -0.285156 4 1 0.25 0.5 0.327515 5 1 0.25 0.5 0.547452 0 1 0.25 1 1 1 1 0.25 1 -2 2 1 0.25 1 -1.25 3 1 0.25 1 0.5 4 1 0.25 1 1.34375 5 1 0.25 1 0.809375 0 1 0.25 1.5 1 1 1 0.25 1.5 -3.5 2 1 0.25 1.5 -1.15625 3 1 0.25 1.5 1.70703 4 1 0.25 1.5 2.09412 5 1 0.25 1.5 0.362021 0 1 0.25 2 1 1 1 0.25 2 -5 2 1 0.25 2 -0.5 3 1 0.25 2 3.125 4 1 0.25 2 2.32812 5 1 0.25 2 -0.753906 0 1 0.25 2.5 1 1 1 0.25 2.5 -6.5 2 1 0.25 2.5 0.71875 3 1 0.25 2.5 4.54297 4 1 0.25 2.5 1.87439 5 1 0.25 2.5 -2.36916 0 2 0.5 0 1 1 2 0.5 0 1 2 2 0.5 0 0.5 3 2 0.5 0 0 4 2 0.5 0 -0.3 5 2 0.5 0 -0.35 0 2 0.5 0.5 1 1 2 0.5 0.5 0.75 2 2 0.5 0.5 0.229167 3 2 0.5 0.5 -0.160156 4 2 0.5 0.5 -0.305664 5 2 0.5 0.5 -0.237101 0 2 0.5 1 1 1 2 0.5 1 0.5 2 2 0.5 1 0 3 2 0.5 1 -0.25 4 2 0.5 1 -0.25 5 2 0.5 1 -0.104167 0 2 0.5 1.5 1 1 2 0.5 1.5 0.25 2 2 0.5 1.5 -0.1875 3 2 0.5 1.5 -0.277344 4 2 0.5 1.5 -0.150977 5 2 0.5 1.5 0.0276286 0 2 0.5 2 1 1 2 0.5 2 0 2 2 0.5 2 -0.333333 3 2 0.5 2 -0.25 4 2 0.5 2 -0.025 5 2 0.5 2 0.141667 0 2 0.5 2.5 1 1 2 0.5 2.5 -0.25 2 2 0.5 2.5 -0.4375 3 2 0.5 2.5 -0.175781 4 2 0.5 2.5 0.113086 5 2 0.5 2.5 0.225562 MERTENS_TEST MERTENS computes the Mertens function. 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 MOEBIUS_TEST MOEBIUS computes the Moebius function. 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 MOTKIN_TEST 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 NORMAL_01_CDF_INVERSE_TEST: NORMAL_01_CDF_INVERSE inverts the Normal 01 CDF. FX X1 X2 0.500000 0.000000 0.000000 0.539828 0.100000 0.100000 0.579260 0.200000 0.200000 0.617911 0.300000 0.300000 0.655422 0.400000 0.400000 0.691462 0.500000 0.500000 0.725747 0.600000 0.600000 0.758036 0.700000 0.700000 0.788145 0.800000 0.800000 0.815940 0.900000 0.900000 0.841345 1.000000 1.000000 0.933193 1.500000 1.500000 0.977250 2.000000 2.000000 0.993790 2.500000 2.500000 0.998650 3.000000 3.000000 0.999767 3.500000 3.500000 0.999968 4.000000 4.000000 OMEGA_TEST OMEGA computes the OMEGA function. 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 PENTAGON_NUM_TEST PENTAGON_NUM computes the pentagonal numbers. 1 1 2 5 3 12 4 22 5 35 6 51 7 70 8 92 9 117 10 145 PHI_TEST PHI computes the PHI function. 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 pi_estimate_test(): pi_estimate() estimates Harmonic numbers. N estimated Pi(n) exact Pi(n) ratio 10 4.3429448190325 4 1.0857362047581 20 6.6761640139067 8 0.83452050173834 30 8.8204231138562 10 0.88204231138562 40 10.843401227273 12 0.90361676893939 50 12.781110931767 15 0.85207406211777 60 14.654360200558 17 0.86202118826814 70 16.476421888667 19 0.86718009940353 80 18.256392913493 22 0.82983604152243 90 20.000845945423 24 0.83336858105929 100 21.714724095163 25 0.8685889638065 1000 144.76482730108 168 0.86169540060169 10000 1085.7362047581 1229 0.88343059785039 100000 8685.889638065 9592 0.9055347829509 1000000 72382.413650542 78498 0.92209245650261 10000000 620420.68843322 664579 0.93355445843642 100000000 5428681.0237906 5761455 0.94224133032205 1000000000 48254942.433695 50847534 0.94901244244597 plane_partition_num_test(): plane_partition_num() counts the number of plane partitions of an integer. 1 1 2 3 3 6 4 13 5 24 6 48 7 86 8 160 9 282 10 500 POLY_BERNOULLI_TEST POLY_BERNOULLI computes the poly-Bernoulli numbers of negative index, B_n^(-k) N K B_N^(-K) 0 0 1 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 0 1 1 1 1 2 2 1 4 3 1 8 4 1 16 5 1 32 6 1 64 0 2 1 1 2 4 2 2 14 3 2 46 4 2 146 5 2 454 6 2 1394 0 3 1 1 3 8 2 3 46 3 3 230 4 3 1066 5 3 4718 6 3 20266 0 4 1 1 4 16 2 4 146 3 4 1066 4 4 6902 5 4 41506 6 4 237686 0 5 1 1 5 32 2 5 454 3 5 4718 4 5 41506 5 5 329462 6 5 2441314 0 6 1 1 6 64 2 6 1394 3 6 20266 4 6 237686 5 6 2441314 6 6 22934774 POLY_COEF_COUNT_TEST 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 PRIME_TEST PRIME returns primes from a table. Number of primes stored is 1600 I Prime(I) 1 2 2 3 3 5 4 7 5 11 6 13 7 17 8 19 9 23 10 29 1590 13411 1591 13417 1592 13421 1593 13441 1594 13451 1595 13457 1596 13463 1597 13469 1598 13477 1599 13487 1600 13499 PYRAMID_NUM_TEST PYRAMID_NUM computes the pyramidal numbers. 1 1 2 4 3 10 4 20 5 35 6 56 7 84 8 120 9 165 10 220 PYRAMID_SQUARE_NUM_TEST PYRAMID_SQARE_NUM computes the pyramidal square numbers. 1 1 2 5 3 14 4 30 5 55 6 91 7 140 8 204 9 285 10 385 R8_AGM_TEST R8_AGM computes the arithmetic geometric mean. A B AGM AGM Diff (Tabulated) R8_AGM(A,B) 22.000000 96.000000 52.2746411987042379 52.2746411987042450 7.105427e-15 83.000000 56.000000 68.8365300598585179 68.8365300598585179 0.000000e+00 42.000000 7.000000 20.6593011967340097 20.6593011967340061 3.552714e-15 26.000000 11.000000 17.6968548737436500 17.6968548737436677 1.776357e-14 4.000000 63.000000 23.8670497217533004 23.8670497217533040 3.552714e-15 6.000000 45.000000 20.7170159828059930 20.7170159828059894 3.552714e-15 40.000000 75.000000 56.1278422556166845 56.1278422556166845 0.000000e+00 80.000000 0.000000 0.0000000000000000 0.0000000000000000 0.000000e+00 90.000000 35.000000 59.2695650812296364 59.2695650812298851 2.486900e-13 9.000000 1.000000 3.9362355036495553 3.9362355036495558 4.440892e-16 53.000000 53.000000 53.0000000000000000 53.0000000000000000 0.000000e+00 1.000000 2.000000 1.4567910310469068 1.4567910310469068 0.000000e+00 1.000000 4.000000 2.2430285802876027 2.2430285802876027 0.000000e+00 1.000000 8.000000 3.6157561775973628 3.6157561775973628 0.000000e+00 1.500000 8.000000 4.0816924080221630 4.0816924080221630 0.000000e+00 R8_BETA_TEST: R8_BETA evaluates the Beta function. X Y Exact F R8_BETA(X,Y) 0.200000 1.000000 5 5 0.400000 1.000000 2.5 2.5 0.600000 1.000000 1.66667 1.66667 0.800000 1.000000 1.25 1.25 1.000000 0.200000 5 5 1.000000 0.400000 2.5 2.5 1.000000 1.000000 1 1 2.000000 2.000000 0.166667 0.166667 3.000000 3.000000 0.0333333 0.0333333 4.000000 4.000000 0.00714286 0.00714286 5.000000 5.000000 0.0015873 0.0015873 6.000000 2.000000 0.0238095 0.0238095 6.000000 3.000000 0.00595238 0.00595238 6.000000 4.000000 0.00198413 0.00198413 6.000000 5.000000 0.000793651 0.000793651 6.000000 6.000000 0.00036075 0.00036075 7.000000 7.000000 8.32501e-05 8.32501e-05 r8_choose_test(): r8_choose() evaluates C(N,K) using real arithmetic. 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 r8_cube_root_test() r8_cube_root()() computes the cube root of an R8. X Y Y^3 -10 -2.15443 -10 -9.98029 -2.15302 -9.98029 -9.16738 -2.0929 -9.16738 -6.46715 -1.86311 -6.46715 -2.70796 -1.39384 -2.70796 -8.17339 -2.01435 -8.17339 -8.15405 -2.01276 -8.15405 -0.255656 -0.634675 -0.255656 0.535006 0.811807 0.535006 -0.911332 -0.969525 -0.911332 R8_ERF_TEST: R8_ERF evaluates the error function. X Exact F R8_ERF(X) 0.000000 0.000000 0.000000 0.100000 0.112463 0.112463 0.200000 0.222703 0.222703 0.300000 0.328627 0.328627 0.400000 0.428392 0.428392 0.500000 0.520500 0.520500 0.600000 0.603856 0.603856 0.700000 0.677801 0.677801 0.800000 0.742101 0.742101 0.900000 0.796908 0.796908 1.000000 0.842701 0.842701 1.100000 0.880205 0.880205 1.200000 0.910314 0.910314 1.300000 0.934008 0.934008 1.400000 0.952285 0.952285 1.500000 0.966105 0.966105 1.600000 0.976348 0.976348 1.700000 0.983790 0.983790 1.800000 0.989091 0.989091 1.900000 0.992790 0.992790 2.000000 0.995322 0.995322 R8_ERF_INVERSE_TEST: R8_ERF_INVERSE inverts the error function. FX X1 X2 0.000000 0.000000 0.000000 0.112463 0.100000 0.100000 0.222703 0.200000 0.200000 0.328627 0.300000 0.300000 0.428392 0.400000 0.400000 0.520500 0.500000 0.500000 0.603856 0.600000 0.600000 0.677801 0.700000 0.700000 0.742101 0.800000 0.800000 0.796908 0.900000 0.900000 0.842701 1.000000 1.000000 0.880205 1.100000 1.100000 0.910314 1.200000 1.200000 0.934008 1.300000 1.300000 0.952285 1.400000 1.400000 0.966105 1.500000 1.500000 0.976348 1.600000 1.600000 0.983790 1.700000 1.700000 0.989091 1.800000 1.800000 0.992790 1.900000 1.900000 0.995322 2.000000 2.000000 R8_FACTORIAL_TEST: R8_FACTORIAL evaluates the factorial function. N Exact F R8_FACTORIAL(N) 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 3.6288e+06 3.6288e+06 11 3.99168e+07 3.99168e+07 12 4.79002e+08 4.79002e+08 13 6.22702e+09 6.22702e+09 14 8.71783e+10 8.71783e+10 15 1.30767e+12 1.30767e+12 16 2.09228e+13 2.09228e+13 17 3.55687e+14 3.55687e+14 18 6.40237e+15 6.40237e+15 19 1.21645e+17 1.21645e+17 20 2.4329e+18 2.4329e+18 25 1.55112e+25 1.55112e+25 50 3.04141e+64 3.04141e+64 100 9.33262e+157 9.33262e+157 150 5.71338e+262 5.71338e+262 R8_FACTORIAL_LOG_TEST: R8_FACTORIAL_LOG evaluates the logarithm of the factorial function. N Exact F R8_FACTORIAL_LOG(N) 0 0 0 1 0 0 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.02 605.02 500 2611.33 2611.33 1000 5912.13 5912.13 R8_HYPER_2F1_TEST: R8_HYPER_2F1 evaluates the hypergeometric function 2F1. A B C X 2F1 2F1 DIFF (tabulated) (computed) -2.500000 3.300000 6.700000 0.250000 0.7235612934899779 0.7235612934899781 2.22e-16 -0.500000 1.100000 6.700000 0.250000 0.9791110934527796 0.9791110934527797 1.11e-16 0.500000 1.100000 6.700000 0.250000 1.021657814008856 1.021657814008856 0 2.500000 3.300000 6.700000 0.250000 1.405156320011213 1.405156320011212 4.441e-16 -2.500000 3.300000 6.700000 0.550000 0.4696143163982161 0.4696143163982162 5.551e-17 -0.500000 1.100000 6.700000 0.550000 0.9529619497744632 0.9529619497744636 3.331e-16 0.500000 1.100000 6.700000 0.550000 1.051281421394799 1.051281421394798 8.882e-16 2.500000 3.300000 6.700000 0.550000 2.399906290477786 2.399906290477784 1.776e-15 -2.500000 3.300000 6.700000 0.850000 0.2910609592841472 0.2910609592841473 1.665e-16 -0.500000 1.100000 6.700000 0.850000 0.9253696791037318 0.9253696791037314 4.441e-16 0.500000 1.100000 6.700000 0.850000 1.0865504094807 1.086550409480699 2.22e-16 2.500000 3.300000 6.700000 0.850000 5.738156552618904 5.738156552618818 8.615e-14 3.300000 6.700000 -5.500000 0.250000 15090.66974870461 15090.6697487046 1.091e-11 1.100000 6.700000 -0.500000 0.250000 -104.3117006736435 -104.3117006736435 2.842e-14 1.100000 6.700000 0.500000 0.250000 21.17505070776881 21.1750507077688 1.066e-14 3.300000 6.700000 4.500000 0.250000 4.194691581903192 4.194691581903191 8.882e-16 3.300000 6.700000 -5.500000 0.550000 10170777974.04881 10170777974.04883 1.144e-05 1.100000 6.700000 -0.500000 0.550000 -24708.63532248916 -24708.63532248914 1.819e-11 1.100000 6.700000 0.500000 0.550000 1372.230454838499 1372.230454838497 2.274e-12 3.300000 6.700000 4.500000 0.550000 58.09272870639465 58.09272870639462 2.842e-14 3.300000 6.700000 -5.500000 0.850000 5.868208761512417e+18 5.868208761512405e+18 1.229e+04 1.100000 6.700000 -0.500000 0.850000 -446350101.47296 -446350101.4729605 4.768e-07 1.100000 6.700000 0.500000 0.850000 5383505.756129573 5383505.75612958 6.519e-09 3.300000 6.700000 4.500000 0.850000 20396.91377601966 20396.91377601965 1.455e-11 R8_PSI_TEST: R8_PSI evaluates the Psi function. X Psi(X) Psi(X) DIFF (Tabulated) (R8_PSI) 1 -0.5772156649015329 -0.5772156649015329 0 1.1 -0.4237549404110768 -0.4237549404110768 5.551e-17 1.2 -0.2890398965921883 -0.2890398965921884 5.551e-17 1.3 -0.1691908888667997 -0.1691908888667995 1.665e-16 1.4 -0.06138454458511615 -0.06138454458511624 9.021e-17 1.5 0.03648997397857652 0.03648997397857652 0 1.6 0.1260474527734763 0.1260474527734763 2.776e-17 1.7 0.208547874873494 0.208547874873494 2.776e-17 1.8 0.2849914332938615 0.2849914332938615 0 1.9 0.3561841611640597 0.3561841611640596 1.11e-16 2 0.4227843350984671 0.4227843350984672 1.11e-16 R8POLY_DEGREE_TEST R8POLY_DEGREE determines the degree of an R8POLY. The R8POLY: p(x) = 4.000000 * x^3 +3.000000 * x^2 +2.000000 * x +1.000000 Dimensioned degree = 3, Actual degree = 3 The R8POLY: p(x) = 3.000000 * x^2 +2.000000 * x +1.000000 Dimensioned degree = 3, Actual degree = 2 The R8POLY: p(x) = 4.000000 * x^3 +2.000000 * x +1.000000 Dimensioned degree = 3, Actual degree = 3 The R8POLY: p(x) = 1.000000 Dimensioned degree = 3, Actual degree = 0 The R8POLY: p(x) = 0.000000 Dimensioned degree = 3, Actual degree = 0 R8POLY_PRINT_TEST R8POLY_PRINT prints an R8POLY. The R8POLY: p(x) = 9.000000 * x^5 +0.780000 * x^4 +56.000000 * x^2 -3.400000 * x +2.000000 R8POLY_VALUE_HORNER_TEST R8POLY_VALUE_HORNER evaluates a polynomial at one point, using Horner's method. The polynomial coefficients: p(x) = 1.000000 * x^4 -10.000000 * x^3 +35.000000 * x^2 -50.000000 * x +24.000000 I X P(X) 0 0.0000 24 1 0.3333 10.8642 2 0.6667 3.45679 3 1.0000 0 4 1.3333 -0.987654 5 1.6667 -0.691358 6 2.0000 0 7 2.3333 0.493827 8 2.6667 0.493827 9 3.0000 0 10 3.3333 -0.691358 11 3.6667 -0.987654 12 4.0000 0 13 4.3333 3.45679 14 4.6667 10.8642 15 5.0000 24 SIGMA_TEST SIGMA computes the SIGMA function. 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 SIMPLEX_NUM_TEST SIMPLEX_NUM computes the N-th simplex number in M dimensions. M: 0 1 2 3 4 5 N 0 1 0 0 0 0 0 1 1 1 1 1 1 1 2 1 2 3 4 5 6 3 1 3 6 10 15 21 4 1 4 10 20 35 56 5 1 5 15 35 70 126 6 1 6 21 56 126 252 7 1 7 28 84 210 462 8 1 8 36 120 330 792 9 1 9 45 165 495 1287 10 1 10 55 220 715 2002 SIN_POWER_INT_TEST: SIN_POWER_INT computes the integral of the N-th power of the sine function. A B N Exact Computed 10 20 0 10 10 0 1 1 0.459698 0.459698 0 1 2 0.272676 0.272676 0 1 3 0.178941 0.178941 0 1 4 0.124026 0.124026 0 1 5 0.0889744 0.0889744 0 2 5 0.903931 0.903931 1 2 5 0.814957 0.814957 0 1 10 0.0218875 0.0218875 0 1 11 0.0170234 0.0170234 SLICES_TEST: SLICES determines the maximum number of pieces created by SLICE_NUM slices in a DIM_NUM space. Slice Array: Col: 0 1 2 3 4 5 6 7 Row 0: 2 3 4 5 6 7 8 9 1: 2 4 7 11 16 22 29 37 2: 2 4 8 15 26 42 64 93 3: 2 4 8 16 31 57 99 163 4: 2 4 8 16 32 63 120 219 SPHERICAL_HARMONIC_TEST: SPHERICAL_HARMONIC evaluates spherical harmonic functions. N M THETA PHI YR YI 0 0 0.523599 1.0472 0.282095 0 0.282095 0 1 0 0.523599 1.0472 0.423142 0 0.423142 0 2 1 0.523599 1.0472 -0.167262 -0.289706 -0.167262 -0.289706 3 2 0.523599 1.0472 -0.110633 0.191622 -0.110633 0.191622 4 3 0.523599 1.0472 0.135497 0 0.135497 1.03752e-16 5 5 0.261799 0.628319 0.000539042 0 0.000539042 -6.60136e-20 5 4 0.261799 0.628319 -0.00514669 0.00373929 -0.00514669 0.00373929 5 3 0.261799 0.628319 0.01371 -0.0421952 0.01371 -0.0421952 5 2 0.261799 0.628319 0.0609635 0.187626 0.0609635 0.187626 5 1 0.261799 0.628319 -0.41704 -0.302997 -0.41704 -0.302997 4 2 0.628319 0.785398 0 0.413939 2.53464e-17 0.413939 4 2 1.88496 0.785398 0 -0.100323 -6.14301e-18 -0.100323 4 2 3.14159 0.785398 0 0 0 0 4 2 4.39823 0.785398 0 -0.100323 -6.14301e-18 -0.100323 4 2 5.65487 0.785398 0 0.413939 2.53464e-17 0.413939 3 -1 0.392699 0.448799 0.364121 -0.175351 0.364121 -0.175351 3 -1 0.392699 0.897598 0.251979 -0.315972 0.251979 -0.315972 3 -1 0.392699 1.3464 0.0899304 -0.394011 0.0899304 -0.394011 3 -1 0.392699 1.7952 -0.0899304 -0.394011 -0.0899304 -0.394011 3 -1 0.392699 2.24399 -0.251979 -0.315972 -0.251979 -0.315972 stirling_estimate_test(): stirling_estimate() returns the Stirling estimate for log(n!). N Estimate Exact 0 0 0 1 -0.0810615 0 2 0.651806 0.693147 3 1.76408 1.79176 4 3.15726 3.17805 5 4.77085 4.78749 6 6.56538 6.57925 7 8.51326 8.52516 8 10.5942 10.6046 9 12.7926 12.8018 10 15.0961 15.1044 11 17.4947 17.5023 12 19.9803 19.9872 13 22.5458 22.5522 14 25.1853 25.1912 15 27.8937 27.8993 16 30.6667 30.6719 17 33.5002 33.5051 18 36.3908 36.3954 19 39.3355 39.3399 20 42.3315 42.3356 25 58.0003 58.0036 50 148.476 148.478 100 363.739 363.739 150 605.02 605.02 500 2611.33 2611.33 1000 5912.13 5912.13 stirling1_table_test(): stirling1_table(): 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 stirling2_number_test(): stirling2_number(): evaluates Stirling numbers of second kind. 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 2 0 1 1 0 0 0 0 0 0 3 0 1 3 1 0 0 0 0 0 4 0 1 7 6 1 0 0 0 0 5 0 1 15 25 10 1 0 0 0 6 0 1 31 90 65 15 1 0 0 7 0 1 63 301 350 140 21 1 0 8 0 1 127 966 1701 1050 266 28 1 stirling2_table_test(): stirling2_table(): 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 TAU_TEST TAU computes the Tau function. 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 TETRAHEDRON_NUM_TEST TETRAHEDRON_NUM computes the tetrahedron numbers. 1 1 2 4 3 10 4 20 5 35 6 56 7 84 8 120 9 165 10 220 TRIANGLE_NUM_TEST TRIANGLE_NUM computes the triangular numbers. 1 1 2 3 3 6 4 10 5 15 6 21 7 28 8 36 9 45 10 55 TRIANGLE_LOWER_TO_I4_TEST TRIANGLE_LOWER_TO_I4 converts a lower triangular index to a linear one. I J ==> K 0 0 0 1 0 1 1 1 2 2 0 3 2 1 4 2 2 5 3 0 6 3 1 7 3 2 8 3 3 9 4 0 10 4 1 11 4 2 12 4 3 13 4 4 14 tribonacci_direct_test(): tribonacci_direct() computes the Tribonacci sequence. 1 1 2 1 3 2 4 4 5 7 6 13 7 24 8 44 9 81 10 149 11 274 12 504 13 927 14 1705 15 3136 16 5768 17 10609 18 19513 19 35890 20 66012 tribonacci_recursive_test(): tribonacci_recursive() computes the Tribonacci sequence. -1 0 0 0 1 1 2 1 3 2 4 4 5 7 6 13 7 24 8 44 9 81 10 149 11 274 12 504 13 927 14 1705 15 3136 16 5768 17 10609 18 19513 19 35890 20 66012 tribonacci_roots_test(): tribonacci_roots() computes the Tribonacci roots. alpha = 1.83929, p(alpha) = -1.33227e-15 beta = -0.419643+0.606291i, p(beta) = -8.88178e-16+3.33067e-16i gamma = -0.419643+-0.606291i, p(gamma) = -8.88178e-16+-3.33067e-16i trinomial_test(): trinomial() evaluates the trinomial coefficient: T(I,J,K) = (I+J+K)! / I! / J! / K! I J K T(I,J,K) 0 0 0 1 1 0 0 1 2 0 0 1 3 0 0 1 4 0 0 1 0 1 0 1 1 1 0 2 2 1 0 3 3 1 0 4 4 1 0 5 0 2 0 1 1 2 0 3 2 2 0 6 3 2 0 10 4 2 0 15 0 3 0 1 1 3 0 4 2 3 0 10 3 3 0 20 4 3 0 35 0 4 0 1 1 4 0 5 2 4 0 15 3 4 0 35 4 4 0 70 0 0 1 1 1 0 1 2 2 0 1 3 3 0 1 4 4 0 1 5 0 1 1 2 1 1 1 6 2 1 1 12 3 1 1 20 4 1 1 30 0 2 1 3 1 2 1 12 2 2 1 30 3 2 1 60 4 2 1 105 0 3 1 4 1 3 1 20 2 3 1 60 3 3 1 140 4 3 1 280 0 4 1 5 1 4 1 30 2 4 1 105 3 4 1 280 4 4 1 630 0 0 2 1 1 0 2 3 2 0 2 6 3 0 2 10 4 0 2 15 0 1 2 3 1 1 2 12 2 1 2 30 3 1 2 60 4 1 2 105 0 2 2 6 1 2 2 30 2 2 2 90 3 2 2 210 4 2 2 420 0 3 2 10 1 3 2 60 2 3 2 210 3 3 2 560 4 3 2 1260 0 4 2 15 1 4 2 105 2 4 2 420 3 4 2 1260 4 4 2 3150 0 0 3 1 1 0 3 4 2 0 3 10 3 0 3 20 4 0 3 35 0 1 3 4 1 1 3 20 2 1 3 60 3 1 3 140 4 1 3 280 0 2 3 10 1 2 3 60 2 2 3 210 3 2 3 560 4 2 3 1260 0 3 3 20 1 3 3 140 2 3 3 560 3 3 3 1680 4 3 3 4200 0 4 3 35 1 4 3 280 2 4 3 1260 3 4 3 4200 4 4 3 11550 0 0 4 1 1 0 4 5 2 0 4 15 3 0 4 35 4 0 4 70 0 1 4 5 1 1 4 30 2 1 4 105 3 1 4 280 4 1 4 630 0 2 4 15 1 2 4 105 2 2 4 420 3 2 4 1260 4 2 4 3150 0 3 4 35 1 3 4 280 2 3 4 1260 3 3 4 4200 4 3 4 11550 0 4 4 70 1 4 4 630 2 4 4 3150 3 4 4 11550 4 4 4 34650 V_HOFSTADTER_TEST V_HOFSTADTER evaluates Hofstadter's recursive V function. N V(N) 0 0 1 1 2 1 3 1 4 1 5 2 6 3 7 4 8 5 9 5 10 6 11 6 12 7 13 8 14 8 15 9 16 9 17 10 18 11 19 11 20 11 21 12 22 12 23 13 24 14 25 14 26 15 27 15 28 16 29 17 30 17 VIBONACCI_TEST VIBONACCI computes a Vibonacci sequence. We compute the series 3 times. I V1 V2 V3 0 1 1 1 1 1 1 1 2 0 0 -2 3 1 -1 1 4 -1 -1 -1 5 0 0 -2 6 -1 -1 -3 7 1 1 1 8 -2 0 -2 9 -3 1 -3 10 -1 -1 5 11 4 -2 2 12 3 -3 -7 13 -7 -1 -5 14 10 -4 2 15 -3 3 7 16 -13 1 9 17 -16 2 -2 18 -3 -3 -11 19 -19 1 -9 ZECKENDORF_TEST 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 ZERNIKE_POLY_TEST 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 1 1 0 0 0 1 1 0.987654 0.987654 2 0 0.950922 0.950922 2 1 0 0 2 2 0.975461 0.975461 3 0 0 0 3 1 0.914946 0.914946 3 2 0 0 3 3 0.963418 0.963418 4 0 0.856379 0.856379 4 1 0 0 4 2 0.879714 0.879714 4 3 0 0 4 4 0.951524 0.951524 5 0 0 0 5 1 0.799714 0.799714 5 2 0 0 5 3 0.845212 0.845212 5 4 0 0 5 5 0.939777 0.939777 ZERNIKE_POLY_COEF_TEST ZERNIKE_POLY_COEF determines the Zernike polynomial coefficients. Zernike polynomial p(x) = 0.000000 Zernike polynomial p(x) = 10.000000 * x^5 -12.000000 * x^3 +3.000000 * x Zernike polynomial p(x) = 0.000000 Zernike polynomial p(x) = 5.000000 * x^5 -4.000000 * x^3 Zernike polynomial p(x) = 0.000000 Zernike polynomial p(x) = 1.000000 * x^5 ZETA_M1_TEST ZETA_M1 computes the Zeta Minus One function. Requested relative tolerance = 1e-10 P ZETA_M1(P) ZETA_M1(P) tabulated computed 2.00 0.64493406684823 0.64493406682177 2.50 0.3414872573 0.3414872572331 3.00 0.20205690315959 0.20205690314033 3.50 0.1267338673 0.12673386730311 4.00 0.082323233711138 0.082323233700504 5.00 0.03692775514337 0.036927755139801 6.00 0.017343061984449 0.017343061981036 7.00 0.0083492773819228 0.0083492773801574 8.00 0.0040773561979443 0.0040773561976435 9.00 0.0020083929260822 0.0020083928260337 10.00 0.00099457512781809 0.00099457512781058 11.00 0.00049418860411946 0.00049418860411835 12.00 0.00024608655330805 0.00024608655330789 16.00 1.5282259408652e-05 1.5282259408652e-05 20.00 9.539620338728e-07 9.539620338728e-07 30.00 9.3132743242e-11 9.3132743241967e-10 40.00 9.0949478e-13 9.0949478402639e-13 ZETA_NAIVE_TEST ZETA_NAIVE computes the Zeta function. N exact Zeta computed Zeta 2 1.6449340668482 1.6449140670482 3 1.2020569031596 1.2020569029596 4 1.0823232337111 1.0823232337109 5 1.0369277551434 1.0369277551433 6 1.0173430619844 1.0173430619844 7 1.0083492773819 1.0083492773819 8 1.0040773561979 1.0040773561979 9 1.0020083929261 1.0020083928261 10 1.0009945751278 1.0009945751278 11 1.0004941886041 1.0004941886041 12 1.0002460865533 1.0002460865533 16 1.0000152822594 1.0000152822594 20 1.000000953962 1.000000953962 30 1.0000000009313 1.0000000009313 40 1.0000000000009 1.0000000000009 polpak_test(): Normal end of execution. 28 March 2024 10:29:38 AM