27-Mar-2024 10:46:29 polpak_test(): MATLAB/Octave version 9.14.0.2306882 (R2023a) Update 4 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 6 7 8 9 10 1 1 1 1 1 1 1 1 1 1 1 1 3 5 7 9 11 13 15 17 19 21 1 5 13 25 41 61 85 113 145 181 221 1 7 25 63 129 231 377 575 833 1159 1561 1 9 41 129 321 681 1289 2241 3649 5641 8361 1 11 61 231 681 1683 3653 7183 13073 22363 36365 1 13 85 377 1289 3653 8989 19825 40081 75517 134245 1 15 113 575 2241 7183 19825 48639 108545 224143 433905 1 17 145 833 3649 13073 40081 108545 265729 598417 1256465 1 19 181 1159 5641 22363 75517 224143 598417 1462563 3317445 1 21 221 1561 8361 36365 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() computes the Benford probability of the initial digit sequence I. I BENFORD(I) 1 0.301030 2 0.176091 3 0.124939 4 0.096910 5 0.079181 6 0.066947 7 0.057992 8 0.051153 9 0.045757 bernoulli_number_test(): bernoulli_number() computes Bernoulli numbers; I Exact Bernoulli 0 1.000000e+00 1.000000e+00 1 -5.000000e-01 -5.000000e-01 2 1.666667e-01 1.666667e-01 3 0.000000e+00 0.000000e+00 4 -3.333333e-02 -3.333333e-02 6 -2.380952e-02 2.380952e-02 8 -3.333333e-02 -3.333333e-02 10 7.575758e-02 7.575758e-02 20 -5.291242e+02 -5.291242e+02 30 6.015809e+08 6.015808e+08 bernoulli_number2_test(): bernoulli_number2() computes Bernoulli numbers; I Exact BERNOULLI_NUMBER2 0 1.000000e+00 1.000000e+00 1 -5.000000e-01 -5.000000e-01 2 1.666667e-01 1.666667e-01 3 0.000000e+00 0.000000e+00 4 -3.333333e-02 -3.333333e-02 6 -2.380952e-02 2.380949e-02 8 -3.333333e-02 -3.333332e-02 10 7.575758e-02 7.575757e-02 20 -5.291242e+02 -5.291242e+02 30 6.015809e+08 6.015809e+08 bernoulli_number3_test(): bernoulli_number3() computes Bernoulli numbers. I Exact BERNOULLI_NUMBER3 0 1.000000e+00 1.000000e+00 1 -5.000000e-01 -5.000000e-01 2 1.666667e-01 1.666667e-01 3 0.000000e+00 0.000000e+00 4 -3.333333e-02 -3.333314e-02 6 -2.380952e-02 2.380951e-02 8 -3.333333e-02 -3.333333e-02 10 7.575758e-02 7.575757e-02 20 -5.291242e+02 -5.291242e+02 30 6.015809e+08 6.015809e+08 bernoulli_poly_test(): bernoulli_poly() evaluates Bernoulli polynomials; X = 0.200000 I BX 1 -0.300000 2 0.006667 3 0.048000 4 -0.007733 5 -0.023680 6 0.006914 7 0.024909 8 -0.010150 9 -0.045278 10 0.023326 11 0.126050 12 -0.078147 13 -0.497979 14 0.360440 15 2.648781 bernoulli_poly2_test(): bernoulli_poly2() evaluates Bernoulli polynomials. X = 0.200000 I BX 1 -0.300000 2 0.006667 3 0.048000 4 -0.007733 5 -0.023680 6 0.006914 7 0.024909 8 -0.010150 9 -0.045278 10 0.023326 11 0.126050 12 -0.078147 13 -0.497979 14 0.360440 15 2.648781 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.000000 to 1.000000 evaluated at X = 0.300000 I Bern(I,X) 0 0.028248 1 0.121061 2 0.233474 3 0.266828 4 0.200121 5 0.102919 6 0.036757 7 0.009002 8 0.001447 9 0.000138 10 0.000006 cardan_poly_test(): cardan_poly() evaluates a Cardan polynomial directly. Compare CARDAN_POLY_COEF + R8POLY_VALUE_HORNER versus CARDAN_POLY alone. Evaluate polynomials at X = 0.250000 We use the parameter S = 0.500000 Order Horner Direct 0 2.000000 2.000000 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.018570 0.018570 9 0.088352 0.088352 10 0.012803 0.012803 cardan_poly_coef_test(): cardan_poly_coef() returns the coefficients of a Cardan polynomial. We use the parameter S = 1.000000 Table of polynomial coefficients: 0 2.000000 1 0.000000 1.000000 2 -2.000000 0.000000 1.000000 3 0.000000 -3.000000 0.000000 1.000000 4 2.000000 0.000000 -4.000000 0.000000 1.000000 5 0.000000 5.000000 0.000000 -5.000000 0.000000 1.000000 6 -2.000000 0.000000 9.000000 0.000000 -6.000000 0.000000 1.000000 7 0.000000 -7.000000 0.000000 14.000000 0.000000 -7.000000 0.000000 1.000000 8 2.000000 0.000000 -16.000000 0.000000 20.000000 0.000000 -8.000000 0.000000 1.000000 9 0.000000 9.000000 0.000000 -30.000000 0.000000 27.000000 0.000000 -9.000000 0.000000 1.000000 10 -2.000000 0.000000 25.000000 0.000000 -50.000000 0.000000 35.000000 0.000000 -10.000000 0.000000 1.000000 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: n = 13 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 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 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 charlier_test(): charlier() evaluates Charlier polynomials. N A X P(N,A,X) 0 0.250000 0.000000 1.000000 1 0.250000 0.000000 -0.000000 2 0.250000 0.000000 -4.000000 3 0.250000 0.000000 -36.000000 4 0.250000 0.000000 -420.000000 5 0.250000 0.000000 -6564.000000 0 0.250000 0.500000 1.000000 1 0.250000 0.500000 -2.000000 2 0.250000 0.500000 -10.000000 3 0.250000 0.500000 -54.000000 4 0.250000 0.500000 -474.000000 5 0.250000 0.500000 -6246.000000 0 0.250000 1.000000 1.000000 1 0.250000 1.000000 -4.000000 2 0.250000 1.000000 -8.000000 3 0.250000 1.000000 -8.000000 4 0.250000 1.000000 24.000000 5 0.250000 1.000000 440.000000 0 0.250000 1.500000 1.000000 1 0.250000 1.500000 -6.000000 2 0.250000 1.500000 2.000000 3 0.250000 1.500000 54.000000 4 0.250000 1.500000 354.000000 5 0.250000 1.500000 3030.000000 0 0.250000 2.000000 1.000000 1 0.250000 2.000000 -8.000000 2 0.250000 2.000000 20.000000 3 0.250000 2.000000 84.000000 4 0.250000 2.000000 180.000000 5 0.250000 2.000000 276.000000 0 0.250000 2.500000 1.000000 1 0.250000 2.500000 -10.000000 2 0.250000 2.500000 46.000000 3 0.250000 2.500000 34.000000 4 0.250000 2.500000 -450.000000 5 0.250000 2.500000 -3694.000000 0 0.500000 0.000000 1.000000 1 0.500000 0.000000 -0.000000 2 0.500000 0.000000 -2.000000 3 0.500000 0.000000 -10.000000 4 0.500000 0.000000 -58.000000 5 0.500000 0.000000 -442.000000 0 0.500000 0.500000 1.000000 1 0.500000 0.500000 -1.000000 2 0.500000 0.500000 -4.000000 3 0.500000 0.500000 -12.000000 4 0.500000 0.500000 -48.000000 5 0.500000 0.500000 -288.000000 0 0.500000 1.000000 1.000000 1 0.500000 1.000000 -2.000000 2 0.500000 1.000000 -4.000000 3 0.500000 1.000000 -4.000000 4 0.500000 1.000000 4.000000 5 0.500000 1.000000 60.000000 0 0.500000 1.500000 1.000000 1 0.500000 1.500000 -3.000000 2 0.500000 1.500000 -2.000000 3 0.500000 1.500000 8.000000 4 0.500000 1.500000 44.000000 5 0.500000 1.500000 200.000000 0 0.500000 2.000000 1.000000 1 0.500000 2.000000 -4.000000 2 0.500000 2.000000 2.000000 3 0.500000 2.000000 18.000000 4 0.500000 2.000000 42.000000 5 0.500000 2.000000 66.000000 0 0.500000 2.500000 1.000000 1 0.500000 2.500000 -5.000000 2 0.500000 2.500000 8.000000 3 0.500000 2.500000 20.000000 4 0.500000 2.500000 -8.000000 5 0.500000 2.500000 -192.000000 0 1.000000 0.000000 1.000000 1 1.000000 0.000000 -0.000000 2 1.000000 0.000000 -1.000000 3 1.000000 0.000000 -3.000000 4 1.000000 0.000000 -9.000000 5 1.000000 0.000000 -33.000000 0 1.000000 0.500000 1.000000 1 1.000000 0.500000 -0.500000 2 1.000000 0.500000 -1.750000 3 1.000000 0.500000 -3.375000 4 1.000000 0.500000 -6.562500 5 1.000000 0.500000 -16.031250 0 1.000000 1.000000 1.000000 1 1.000000 1.000000 -1.000000 2 1.000000 1.000000 -2.000000 3 1.000000 1.000000 -2.000000 4 1.000000 1.000000 0.000000 5 1.000000 1.000000 8.000000 0 1.000000 1.500000 1.000000 1 1.000000 1.500000 -1.500000 2 1.000000 1.500000 -1.750000 3 1.000000 1.500000 0.375000 4 1.000000 1.500000 6.187500 5 1.000000 1.500000 20.156250 0 1.000000 2.000000 1.000000 1 1.000000 2.000000 -2.000000 2 1.000000 2.000000 -1.000000 3 1.000000 2.000000 3.000000 4 1.000000 2.000000 9.000000 5 1.000000 2.000000 15.000000 0 1.000000 2.500000 1.000000 1 1.000000 2.500000 -2.500000 2 1.000000 2.500000 0.250000 3 1.000000 2.500000 5.125000 4 1.000000 2.500000 6.937500 5 1.000000 2.500000 -3.156250 0 2.000000 0.000000 1.000000 1 2.000000 0.000000 -0.000000 2 2.000000 0.000000 -0.500000 3 2.000000 0.000000 -1.000000 4 2.000000 0.000000 -1.750000 5 2.000000 0.000000 -3.250000 0 2.000000 0.500000 1.000000 1 2.000000 0.500000 -0.250000 2 2.000000 0.500000 -0.812500 3 2.000000 0.500000 -1.171875 4 2.000000 0.500000 -1.417969 5 2.000000 0.500000 -1.555664 0 2.000000 1.000000 1.000000 1 2.000000 1.000000 -0.500000 2 2.000000 1.000000 -1.000000 3 2.000000 1.000000 -1.000000 4 2.000000 1.000000 -0.500000 5 2.000000 1.000000 0.750000 0 2.000000 1.500000 1.000000 1 2.000000 1.500000 -0.750000 2 2.000000 1.500000 -1.062500 3 2.000000 1.500000 -0.578125 4 2.000000 1.500000 0.582031 5 2.000000 1.500000 2.465820 0 2.000000 2.000000 1.000000 1 2.000000 2.000000 -1.000000 2 2.000000 2.000000 -1.000000 3 2.000000 2.000000 0.000000 4 2.000000 2.000000 1.500000 5 2.000000 2.000000 3.000000 0 2.000000 2.500000 1.000000 1 2.000000 2.500000 -1.250000 2 2.000000 2.500000 -0.812500 3 2.000000 2.500000 0.640625 4 2.000000 2.500000 2.019531 5 2.000000 2.500000 2.252930 0 10.000000 0.000000 1.000000 1 10.000000 0.000000 -0.000000 2 10.000000 0.000000 -0.100000 3 10.000000 0.000000 -0.120000 4 10.000000 0.000000 -0.126000 5 10.000000 0.000000 -0.128400 0 10.000000 0.500000 1.000000 1 10.000000 0.500000 -0.050000 2 10.000000 0.500000 -0.152500 3 10.000000 0.500000 -0.165375 4 10.000000 0.500000 -0.160969 5 10.000000 0.500000 -0.151158 0 10.000000 1.000000 1.000000 1 10.000000 1.000000 -0.100000 2 10.000000 1.000000 -0.200000 3 10.000000 1.000000 -0.200000 4 10.000000 1.000000 -0.180000 5 10.000000 1.000000 -0.154000 0 10.000000 1.500000 1.000000 1 10.000000 1.500000 -0.150000 2 10.000000 1.500000 -0.242500 3 10.000000 1.500000 -0.224625 4 10.000000 1.500000 -0.185569 5 10.000000 1.500000 -0.142111 0 10.000000 2.000000 1.000000 1 10.000000 2.000000 -0.200000 2 10.000000 2.000000 -0.280000 3 10.000000 2.000000 -0.240000 4 10.000000 2.000000 -0.180000 5 10.000000 2.000000 -0.120000 0 10.000000 2.500000 1.000000 1 10.000000 2.500000 -0.250000 2 10.000000 2.500000 -0.312500 3 10.000000 2.500000 -0.246875 4 10.000000 2.500000 -0.165469 5 10.000000 2.500000 -0.091539 cheby_t_poly_test(): cheby_t_poly() evaluates the Chebyshev T polynomial. N X Exact F T(N)(X) 0 0.800000 1.000000 1.000000 1 0.800000 0.800000 0.800000 2 0.800000 0.280000 0.280000 3 0.800000 -0.352000 -0.352000 4 0.800000 -0.843200 -0.843200 5 0.800000 -0.997120 -0.997120 6 0.800000 -0.752192 -0.752192 7 0.800000 -0.206387 -0.206387 8 0.800000 0.421972 0.421972 9 0.800000 0.881543 0.881543 10 0.800000 0.988497 0.988497 11 0.800000 0.700051 0.700051 12 0.800000 0.131586 0.131586 cheby_t_poly_coef_test(): cheby_t_poly_coef() determines the Chebyshev T polynomial coefficients. T(0) 1.000000 T(1) 1.000000 * x 0.000000 T(2) 2.000000 * x^2 0.000000 * x -1.000000 T(3) 4.000000 * x^3 0.000000 * x^2 -3.000000 * x -0.000000 T(4) 8.000000 * x^4 0.000000 * x^3 -8.000000 * x^2 -0.000000 * x 1.000000 T(5) 16.000000 * x^5 0.000000 * x^4 -20.000000 * x^3 -0.000000 * x^2 5.000000 * x 0.000000 T(6) 32.000000 * x^6 0.000000 * x^5 -48.000000 * x^4 -0.000000 * x^3 18.000000 * x^2 0.000000 * x -1.000000 T(7) 64.000000 * x^7 0.000000 * x^6 -112.000000 * x^5 -0.000000 * x^4 56.000000 * x^3 0.000000 * x^2 -7.000000 * x -0.000000 T(8) 128.000000 * x^8 0.000000 * x^7 -256.000000 * x^6 -0.000000 * x^5 160.000000 * x^4 0.000000 * x^3 -32.000000 * x^2 -0.000000 * x 1.000000 T(9) 256.000000 * x^9 0.000000 * x^8 -576.000000 * x^7 -0.000000 * x^6 432.000000 * x^5 0.000000 * x^4 -120.000000 * x^3 -0.000000 * x^2 9.000000 * x 0.000000 T(10) 512.000000 * x^10 0.000000 * x^9 -1280.000000 * x^8 -0.000000 * x^7 1120.000000 * x^6 0.000000 * x^5 -400.000000 * x^4 -0.000000 * x^3 50.000000 * x^2 0.000000 * x -1.000000 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 T polynomial. N X Exact F U(N)(X) 0 0.800000 1.000000 1.000000 1 0.800000 1.600000 1.600000 2 0.800000 1.560000 1.560000 3 0.800000 0.896000 0.896000 4 0.800000 -0.126400 -0.126400 5 0.800000 -1.098240 -1.098240 6 0.800000 -1.630784 -1.630784 7 0.800000 -1.511014 -1.511014 8 0.800000 -0.786839 -0.786839 9 0.800000 0.252072 0.252072 10 0.800000 1.190154 1.190154 11 0.800000 1.652175 1.652175 12 0.800000 1.453325 1.453325 cheby_u_poly_coef_test(): cheby_u_poly_coef() determines the Chebyshev U polynomial coefficients. U(0) 1.000000 U(1) 2.000000 * x 0.000000 U(2) 4.000000 * x^2 0.000000 * x -1.000000 U(3) 8.000000 * x^3 0.000000 * x^2 -4.000000 * x -0.000000 U(4) 16.000000 * x^4 0.000000 * x^3 -12.000000 * x^2 -0.000000 * x 1.000000 U(5) 32.000000 * x^5 0.000000 * x^4 -32.000000 * x^3 -0.000000 * x^2 6.000000 * x 0.000000 cheby_u_poly_zero_test(): cheby_u_poly_zero() returns zeroes of the U(N)(X). N X U(N)(X) 1 6.123234e-17 1.224647e-16 2 5.000000e-01 4.440892e-16 2 -5.000000e-01 -8.881784e-16 3 7.071068e-01 6.661338e-16 3 6.123234e-17 -2.449294e-16 3 -7.071068e-01 6.661338e-16 4 8.090170e-01 0.000000e+00 4 3.090170e-01 -1.110223e-16 4 -3.090170e-01 5.551115e-16 4 -8.090170e-01 -8.881784e-16 chebyshev_discrete_test(): chebyshev_discrete() evaluates discrete Chebyshev polynomials. N M X T(N,M,X) 0 5 0.000000 1.000000 1 5 0.000000 -4.000000 2 5 0.000000 12.000000 3 5 0.000000 -24.000000 4 5 0.000000 24.000000 5 5 0.000000 0.000000 0 5 0.500000 1.000000 1 5 0.500000 -3.000000 2 5 0.500000 1.500000 3 5 0.500000 34.500000 4 5 0.500000 -199.125000 5 5 0.500000 826.875000 0 5 1.000000 1.000000 1 5 1.000000 -2.000000 2 5 1.000000 -6.000000 3 5 1.000000 48.000000 4 5 1.000000 -96.000000 5 5 1.000000 0.000000 0 5 1.500000 1.000000 1 5 1.500000 -1.000000 2 5 1.500000 -10.500000 3 5 1.500000 31.500000 4 5 1.500000 70.875000 5 5 1.500000 -354.375000 0 5 2.000000 1.000000 1 5 2.000000 0.000000 2 5 2.000000 -12.000000 3 5 2.000000 -0.000000 4 5 2.000000 144.000000 5 5 2.000000 0.000000 0 5 2.500000 1.000000 1 5 2.500000 1.000000 2 5 2.500000 -10.500000 3 5 2.500000 -31.500000 4 5 2.500000 70.875000 5 5 2.500000 354.375000 collatz_count_test(): collatz_count() 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() counts 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 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 complete_symmetric_poly_test(): complete_symmetric_poly() evaluates a complete symmetric. polynomial in a given set of variables X. Variable vector X: 1: 1 2: 2 3: 3 4: 4 5: 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. 1 1 2 2 3 4 4 4 5 6 7 7 8 8 8 8 9 10 11 12 12 13 14 14 15 15 15 16 16 16 16 16 17 18 19 20 21 21 22 23 24 24 25 26 26 27 27 27 28 29 29 30 30 30 31 31 31 31 32 32 32 32 32 32 cos_power_int_test(): cos_power_int() returns values of the integral of COS(X)^N from A to B. A B N Exact Computed 0.000000 3.141593 0 3.141593e+00 3.141593e+00 0.000000 3.141593 1 0.000000e+00 1.224647e-16 0.000000 3.141593 2 1.570796e+00 1.570796e+00 0.000000 3.141593 3 0.000000e+00 1.224647e-16 0.000000 3.141593 4 1.178097e+00 1.178097e+00 0.000000 3.141593 5 0.000000e+00 1.224647e-16 0.000000 3.141593 6 9.817477e-01 9.817477e-01 0.000000 3.141593 7 0.000000e+00 1.224647e-16 0.000000 3.141593 8 8.590292e-01 8.590292e-01 0.000000 3.141593 9 0.000000e+00 1.224647e-16 0.000000 3.141593 10 7.731263e-01 7.731263e-01 delannoy_test(): 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 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 erfc_estimate_test(): erfc_estimate() uses an asymptotic expansion to estimate erfc(x). X Erfc(X) Erfc(x) Ratio estimated tabulated Using M = 1 0.0000 0.00000000 1.00000000 0.0000 0.2000 -31.16887513 0.77729741 -40.0990 0.4000 -2.55409408 0.57160764 -4.4683 0.6000 -0.25512519 0.39614391 -0.6440 0.8000 0.08134571 0.25789904 0.3154 1.0000 0.10377687 0.15729921 0.6597 1.2000 0.07271519 0.08968602 0.8108 1.4000 0.04228405 0.04771488 0.8862 1.6000 0.02193504 0.02365162 0.9274 1.8000 0.01038111 0.01090950 0.9516 2.0000 0.00452090 0.00467773 0.9665 2.2000 0.00181828 0.00186285 0.9761 2.4000 0.00067646 0.00068851 0.9825 2.6000 0.00023294 0.00023603 0.9869 2.8000 0.00007426 0.00007501 0.9900 3.0000 0.00002192 0.00002209 0.9923 3.2000 0.00000599 0.00000603 0.9939 3.4000 0.00000151 0.00000152 0.9951 3.6000 0.00000035 0.00000036 0.9961 3.8000 0.00000008 0.00000008 0.9968 4.0000 0.00000002 0.00000002 0.9974 Using M = 2 0.0000 0.00000000 1.00000000 0.0000 0.2000 1239.30157851 0.77729741 1594.3725 0.4000 32.65859997 0.57160764 57.1346 0.6000 3.54138056 0.39614391 8.9396 0.8000 0.76225291 0.25789904 2.9556 1.0000 0.25944219 0.15729921 1.6494 1.2000 0.11300507 0.08968602 1.2600 1.4000 0.05336633 0.04771488 1.1184 1.6000 0.02505460 0.02365162 1.0593 1.8000 0.01125814 0.01090950 1.0320 2.0000 0.00476309 0.00467773 1.0182 2.2000 0.00188320 0.00186285 1.0109 2.4000 0.00069320 0.00068851 1.0068 2.6000 0.00023707 0.00023603 1.0044 2.8000 0.00007523 0.00007501 1.0029 3.0000 0.00002213 0.00002209 1.0020 3.2000 0.00000603 0.00000603 1.0014 3.4000 0.00000152 0.00000152 1.0010 3.6000 0.00000036 0.00000036 1.0007 3.8000 0.00000008 0.00000008 1.0005 4.0000 0.00000002 0.00000002 1.0004 Using M = 3 0.0000 0.00000000 1.00000000 0.0000 0.2000 -78165.10177390 0.77729741 -100560.0954 0.4000 -517.53974455 0.57160764 -905.4108 0.6000 -22.82324268 0.39614391 -57.6135 0.8000 -1.89754082 0.25789904 -7.3577 1.0000 -0.12972109 0.15729921 -0.8247 1.2000 0.04305735 0.08968602 0.4801 1.4000 0.03923077 0.04771488 0.8222 1.6000 0.02200816 0.02365162 0.9305 1.8000 0.01058142 0.01090950 0.9699 2.0000 0.00461172 0.00467773 0.9859 2.2000 0.00184967 0.00186285 0.9929 2.4000 0.00068594 0.00068851 0.9963 2.6000 0.00023554 0.00023603 0.9979 2.8000 0.00007492 0.00007501 0.9988 3.0000 0.00002207 0.00002209 0.9993 3.2000 0.00000602 0.00000603 0.9996 3.4000 0.00000152 0.00000152 0.9997 3.6000 0.00000036 0.00000036 0.9998 3.8000 0.00000008 0.00000008 0.9999 4.0000 0.00000002 0.00000002 0.9999 euler_mascheroni(): 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.5772156649015329 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.000000 1 0 0.000000 2 -1 -1.000000 4 5 5.000000 6 -61 -61.000000 8 1385 1385.000000 10 -50521 -50521.000000 12 2702765 2702765.000000 euler_poly_test(): euler_poly() evaluates Euler polynomials. N X F(X) 0 0.500000 1.000000 1 0.500000 0.000000 2 0.500000 -0.250000 3 0.500000 -0.000001 4 0.500000 0.312497 5 0.500000 -0.000003 6 0.500000 -0.953128 7 0.500000 -0.000002 8 0.500000 5.410155 9 0.500000 -0.000001 10 0.500000 -49.336915 11 0.500000 0.000001 12 0.500000 659.854737 13 0.500000 0.000005 14 0.500000 -12168.028571 15 0.500000 0.000219 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. 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 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() computes values of the Gegenbauer polynomial. N A X GPV GEGENBAUER 0 0.500000 0.200000 1.000000 1.000000 1 0.500000 0.200000 0.200000 0.200000 2 0.500000 0.200000 -0.440000 -0.440000 3 0.500000 0.200000 -0.280000 -0.280000 4 0.500000 0.200000 0.232000 0.232000 5 0.500000 0.200000 0.307520 0.307520 6 0.500000 0.200000 -0.080576 -0.080576 7 0.500000 0.200000 -0.293517 -0.293517 8 0.500000 0.200000 -0.039565 -0.039565 9 0.500000 0.200000 0.245971 0.245957 10 0.500000 0.200000 0.129072 0.129072 2 0.000000 0.400000 0.000000 0.000000 2 1.000000 0.400000 -0.360000 -0.360000 2 2.000000 0.400000 -0.080000 -0.080000 2 3.000000 0.400000 0.840000 0.840000 2 4.000000 0.400000 2.400000 2.400000 2 5.000000 0.400000 4.600000 4.600000 2 6.000000 0.400000 7.440000 7.440000 2 7.000000 0.400000 10.920000 10.920000 2 8.000000 0.400000 15.040000 15.040000 2 9.000000 0.400000 19.800000 19.800000 2 10.000000 0.400000 25.200000 25.200000 5 3.000000 -0.500000 -9.000000 9.000000 5 3.000000 -0.400000 -0.161280 -0.161280 5 3.000000 -0.300000 -6.672960 -6.672960 5 3.000000 -0.200000 -8.375040 -8.375040 5 3.000000 -0.100000 -5.526720 -5.526720 5 3.000000 0.000000 0.000000 0.000000 5 3.000000 0.100000 5.526720 5.526720 5 3.000000 0.200000 8.375040 8.375040 5 3.000000 0.300000 6.672960 6.672960 5 3.000000 0.400000 0.161280 0.161280 5 3.000000 0.500000 -9.000000 -9.000000 5 3.000000 0.600000 -15.425280 -15.425280 5 3.000000 0.700000 -9.696960 -9.696960 5 3.000000 0.800000 22.440960 22.440960 5 3.000000 0.900000 100.889280 100.889280 5 3.000000 1.000000 252.000000 252.000000 gen_hermite_poly_test(): gen_hermite_poly() evaluates the generalized Hermite polynomials. Table of L(N,MU)(X) for N(max) = 10 MU = 0.000000 X = 0.000000 0 1.000000 1 0.000000 2 -2.000000 3 -0.000000 4 12.000000 5 0.000000 6 -120.000000 7 -0.000000 8 1680.000000 9 0.000000 10 -30240.000000 Table of L(N,MU)(X) for N(max) = 10 MU = 0.000000 X = 1.000000 0 1.000000 1 2.000000 2 2.000000 3 -4.000000 4 -20.000000 5 -8.000000 6 184.000000 7 464.000000 8 -1648.000000 9 -10720.000000 10 8224.000000 Table of L(N,MU)(X) for N(max) = 10 MU = 0.100000 X = 0.000000 0 1.000000 1 0.000000 2 -2.400000 3 -0.000000 4 15.360000 5 0.000000 6 -159.744000 7 -0.000000 8 2300.313600 9 0.000000 10 -42325.770240 Table of L(N,MU)(X) for N(max) = 10 MU = 0.100000 X = 0.500000 0 1.000000 1 1.000000 2 -1.400000 3 -5.400000 4 3.560000 5 46.760000 6 9.736000 7 -551.384000 8 -691.582400 9 8130.561600 10 20855.677760 Table of L(N,MU)(X) for N(max) = 10 MU = 0.500000 X = 0.500000 0 1.000000 1 1.000000 2 -3.000000 3 -7.000000 4 17.000000 5 73.000000 6 -131.000000 7 -1007.000000 8 1089.000000 9 17201.000000 10 -4579.000000 Table of L(N,MU)(X) for N(max) = 10 MU = 1.000000 X = 0.500000 0 1.000000 1 1.000000 2 -5.000000 3 -9.000000 4 41.000000 5 113.000000 6 -461.000000 7 -1817.000000 8 6481.000000 9 35553.000000 10 -107029.000000 gen_laguerre_poly_test(): gen_laguerre_poly() evaluates the generalized Laguerre polynomials. Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 0.000000 X = 0.000000 0 1.000000 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 6 1.000000 7 1.000000 8 1.000000 9 1.000000 10 1.000000 Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 0.000000 X = 1.000000 0 1.000000 1 0.000000 2 -0.500000 3 -0.666667 4 -0.625000 5 -0.466667 6 -0.256944 7 -0.040476 8 0.153993 9 0.309744 10 0.418946 Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 0.100000 X = 0.000000 0 1.000000 1 1.100000 2 1.155000 3 1.193500 4 1.223337 5 1.247804 6 1.268601 7 1.286724 8 1.302808 9 1.317284 10 1.330456 Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 0.100000 X = 0.500000 0 1.000000 1 0.600000 2 0.230000 3 -0.067333 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.000000 1 1.000000 2 0.750000 3 0.416667 4 0.072917 5 -0.243750 6 -0.513715 7 -0.727703 8 -0.882836 9 -0.980303 10 -1.023882 Table of L(N,ALPHA)(X) for N(max) = 10 ALPHA = 1.000000 X = 0.500000 0 1.000000 1 1.500000 2 1.625000 3 1.479167 4 1.148438 5 0.702865 6 0.198720 7 -0.319620 8 -0.817983 9 -1.270902 10 -1.660277 gud_test(): gud() evaluates the Gudermannian function. X Exact F GUD(X) -2.000000 -1.301760 -1.301760 -1.000000 -0.865769 -0.865769 0.000000 0.000000 0.000000 0.100000 0.099834 0.099834 0.200000 0.198680 0.198680 0.500000 0.480381 0.480381 1.000000 0.865769 0.865769 1.500000 1.131728 1.131728 2.000000 1.301760 1.301760 2.500000 1.406994 1.406994 3.000000 1.471304 1.471304 3.500000 1.510420 1.510420 4.000000 1.534169 1.534169 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() 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() evaluates Harmonic numbers. N H(n) H(n) tabulated computed 1 1 1 2 1.5 1.5 3 1.833333333 1.833333333 4 2.083333333 2.083333333 5 2.283333333 2.283333333 6 2.45 2.45 7 2.592857143 2.592857143 8 2.717857143 2.717857143 9 2.828968254 2.828968254 10 2.928968254 2.928968254 11 3.019877345 3.019877345 12 3.103210678 3.103210678 13 3.180133755 3.180133755 14 3.251562327 3.251562327 15 3.318228993 3.318228993 16 3.380728993 3.380728993 17 3.439552523 3.439552523 18 3.495108078 3.495108078 19 3.547739657 3.547739657 20 3.597739657 3.597739657 21 3.645358705 3.645358705 22 3.69081325 3.69081325 23 3.734291511 3.734291511 24 3.775958178 3.775958178 25 3.815958178 3.815958178 26 3.854419716 3.854419716 27 3.891456753 3.891456753 28 3.927171039 3.927171039 29 3.961653798 3.961653798 30 3.994987131 3.994987131 31 4.027245195 4.027245195 32 4.058495195 4.058495195 33 4.088798226 4.088798226 34 4.11820999 4.11820999 35 4.146781419 4.146781419 36 4.174559197 4.174559197 37 4.201586224 4.201586224 38 4.227902013 4.227902013 39 4.253543039 4.253543039 40 4.278543039 4.278543039 harmonic_estimate_test(): harmonic_estimate() estimates Harmonic numbers. N H(n) H(n) H(n) estimated tabulated computed 1 1.002215665 1 1 2 1.500050345 1.5 1.5 3 1.833338242 1.833333333 1.833333333 4 2.083334245 2.083333333 2.083333333 5 2.283333577 2.283333333 2.283333333 6 2.450000083 2.45 2.45 7 2.592857176 2.592857143 2.592857143 8 2.717857158 2.717857143 2.717857143 9 2.828968261 2.828968254 2.828968254 10 2.928968258 2.928968254 2.928968254 11 3.019877347 3.019877345 3.019877345 12 3.10321068 3.103210678 3.103210678 13 3.180133756 3.180133755 3.180133755 14 3.251562327 3.251562327 3.251562327 15 3.318228994 3.318228993 3.318228993 16 3.380728993 3.380728993 3.380728993 17 3.439552523 3.439552523 3.439552523 18 3.495108078 3.495108078 3.495108078 19 3.547739657 3.547739657 3.547739657 20 3.597739657 3.597739657 3.597739657 21 3.645358705 3.645358705 3.645358705 22 3.69081325 3.69081325 3.69081325 23 3.734291511 3.734291511 3.734291511 24 3.775958178 3.775958178 3.775958178 25 3.815958178 3.815958178 3.815958178 26 3.854419716 3.854419716 3.854419716 27 3.891456753 3.891456753 3.891456753 28 3.927171039 3.927171039 3.927171039 29 3.961653798 3.961653798 3.961653798 30 3.994987131 3.994987131 3.994987131 31 4.027245195 4.027245195 4.027245195 32 4.058495195 4.058495195 4.058495195 33 4.088798226 4.088798226 4.088798226 34 4.11820999 4.11820999 4.11820999 35 4.146781419 4.146781419 4.146781419 36 4.174559197 4.174559197 4.174559197 37 4.201586224 4.201586224 4.201586224 38 4.227902013 4.227902013 4.227902013 39 4.253543039 4.253543039 4.253543039 40 4.278543039 4.278543039 4.278543039 hermite_poly_phys_test(): hermite_poly_phys() evaluates the Hermite physicist polynomials. N X Exact F H(N)(X) 0 5.00 1.000000e+00 1.000000e+00 1 5.00 1.000000e+01 1.000000e+01 2 5.00 9.800000e+01 9.800000e+01 3 5.00 9.400000e+02 9.400000e+02 4 5.00 8.812000e+03 8.812000e+03 5 5.00 8.060000e+04 8.060000e+04 6 5.00 7.178800e+05 7.178800e+05 7 5.00 6.211600e+06 6.211600e+06 8 5.00 5.206568e+08 5.206568e+07 9 5.00 4.212712e+08 4.212712e+08 10 5.00 3.275530e+09 3.275530e+09 11 5.00 2.432987e+10 2.432987e+10 12 5.00 1.712371e+11 1.712371e+11 5 0.50 4.100000e+01 4.100000e+01 5 1.00 -8.000000e+00 -8.000000e+00 5 3.00 3.816000e+03 3.816000e+03 5 10.00 3.041200e+06 3.041200e+06 hermite_poly_phys_coef_test(): hermite_poly_phys_coef() determines the Hermite physicist's polynomial coefficients. H(0) 1.000000 H(1) 2.000000 * x 0.000000 H(2) 4.000000 * x^2 0.000000 * x -2.000000 H(3) 8.000000 * x^3 0.000000 * x^2 -12.000000 * x -0.000000 H(4) 16.000000 * x^4 0.000000 * x^3 -48.000000 * x^2 -0.000000 * x 12.000000 H(5) 32.000000 * x^5 0.000000 * x^4 -160.000000 * x^3 -0.000000 * x^2 120.000000 * x 0.000000 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_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() returns T or F depending on whether I4 is a Fibonacci number. I4 T/F -13 False 0 False 1 True 8 True 10 False 50 False 55 True 100 False 144 True 200 False i4_is_prime_test(): i4_is_prime() reports whether an integer is prime. I I4_IS_PRIME(I) -2 0 -1 0 0 0 1 0 2 1 3 1 4 0 5 1 6 0 7 1 8 0 9 0 10 0 11 1 12 0 13 1 14 0 15 0 16 0 17 1 18 0 19 1 20 0 21 0 22 0 23 1 24 0 25 0 i4_is_triangular_test(): i4_is_triangular() returns T or F depending on whether I is triangular. I T/F 0 1 1 1 2 0 3 1 4 0 5 0 6 1 7 0 8 0 9 0 10 1 11 0 12 0 13 0 14 0 15 1 16 0 17 0 18 0 19 0 20 0 i4_partition_distinct_count_test(): i4_partition_distinct_count() computes the number of partitions of an integer into distinct parts. 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 i4_to_triangle_lower_test(): i4_to_triangle_lower() converts a linear index to a lower triangular one. K => I J 1 1 1 2 2 1 3 2 2 4 3 1 5 3 2 6 3 3 7 4 1 8 4 2 9 4 3 10 4 4 11 5 1 12 5 2 13 5 3 14 5 4 15 5 5 16 6 1 17 6 2 18 6 3 19 6 4 20 6 5 i4_to_triangle_upper_test(): i4_to_triangle_upper() converts a linear index to an upper triangular one. K => I J 1 1 1 2 1 2 3 2 2 4 1 3 5 2 3 6 3 3 7 1 4 8 2 4 9 3 4 10 4 4 11 1 5 12 2 5 13 3 5 14 4 5 15 5 5 16 1 6 17 2 6 18 3 6 19 4 6 20 5 6 jacobi_poly_test(): jacobi_poly() computes values of the Jacobi polynomial. N A B X JPV JACOBI 0 0.000000 1.000000 0.500000 1.000000 1.000000 1 0.000000 1.000000 0.500000 0.250000 0.250000 2 0.000000 1.000000 0.500000 -0.375000 -0.375000 3 0.000000 1.000000 0.500000 -0.484375 -0.484375 4 0.000000 1.000000 0.500000 -0.132812 -0.132812 5 0.000000 1.000000 0.500000 0.275391 0.275391 5 1.000000 1.000000 0.500000 -0.164062 -0.164062 5 2.000000 1.000000 0.500000 -1.174805 -1.174805 5 3.000000 1.000000 0.500000 -2.361328 -2.361328 5 4.000000 1.000000 0.500000 -2.616211 -2.616211 5 5.000000 1.000000 0.500000 0.117188 0.117188 5 0.000000 2.000000 0.500000 0.421875 0.421875 5 0.000000 3.000000 0.500000 0.504883 0.504883 5 0.000000 4.000000 0.500000 0.509766 0.509766 5 0.000000 5.000000 0.500000 0.430664 0.430664 5 0.000000 1.000000 -1.000000 -6.000000 -6.000000 5 0.000000 1.000000 -0.800000 0.038620 0.038620 5 0.000000 1.000000 -0.600000 0.811840 0.811840 5 0.000000 1.000000 -0.400000 0.036660 0.036660 5 0.000000 1.000000 -0.200000 -0.485120 -0.485120 5 0.000000 1.000000 0.000000 -0.312500 -0.312500 5 0.000000 1.000000 0.200000 0.189120 0.189120 5 0.000000 1.000000 0.400000 0.402340 0.402340 5 0.000000 1.000000 0.600000 0.012160 0.012160 5 0.000000 1.000000 0.800000 -0.439620 -0.439620 5 0.000000 1.000000 1.000000 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 rr = 5 pp = 3 qq = 5 10 3 -1 10 4 0 10 5 0 10 6 0 10 7 -1 rr = 5 pp = 3 qq = 5 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.250000 0.000000 5 1.000000 1 0.250000 0.000000 5 -1.250000 2 0.250000 0.000000 5 0.625000 3 0.250000 0.000000 5 -0.156250 4 0.250000 0.000000 5 0.019531 5 0.250000 0.000000 5 -0.000977 0 0.250000 0.500000 5 1.000000 1 0.250000 0.500000 5 -0.750000 2 0.250000 0.500000 5 0.000000 3 0.250000 0.500000 5 0.187500 4 0.250000 0.500000 5 -0.105469 5 0.250000 0.500000 5 0.043945 0 0.250000 1.000000 5 1.000000 1 0.250000 1.000000 5 -0.250000 2 0.250000 1.000000 5 -0.375000 3 0.250000 1.000000 5 0.218750 4 0.250000 1.000000 5 -0.042969 5 0.250000 1.000000 5 0.002930 0 0.250000 1.500000 5 1.000000 1 0.250000 1.500000 5 0.250000 2 0.250000 1.500000 5 -0.500000 3 0.250000 1.500000 5 0.062500 4 0.250000 1.500000 5 0.050781 5 0.250000 1.500000 5 -0.022461 0 0.250000 2.000000 5 1.000000 1 0.250000 2.000000 5 0.750000 2 0.250000 2.000000 5 -0.375000 3 0.250000 2.000000 5 -0.156250 4 0.250000 2.000000 5 0.082031 5 0.250000 2.000000 5 -0.008789 0 0.250000 2.500000 5 1.000000 1 0.250000 2.500000 5 1.250000 2 0.250000 2.500000 5 0.000000 3 0.250000 2.500000 5 -0.312500 4 0.250000 2.500000 5 0.019531 5 0.250000 2.500000 5 0.020508 0 0.500000 0.000000 5 1.000000 1 0.500000 0.000000 5 -2.500000 2 0.500000 0.000000 5 2.500000 3 0.500000 0.000000 5 -1.250000 4 0.500000 0.000000 5 0.312500 5 0.500000 0.000000 5 -0.031250 0 0.500000 0.500000 5 1.000000 1 0.500000 0.500000 5 -2.000000 2 0.500000 0.500000 5 1.375000 3 0.500000 0.500000 5 -0.250000 4 0.500000 0.500000 5 -0.132812 5 0.500000 0.500000 5 0.078125 0 0.500000 1.000000 5 1.000000 1 0.500000 1.000000 5 -1.500000 2 0.500000 1.000000 5 0.500000 3 0.500000 1.000000 5 0.250000 4 0.500000 1.000000 5 -0.187500 5 0.500000 1.000000 5 0.031250 0 0.500000 1.500000 5 1.000000 1 0.500000 1.500000 5 -1.000000 2 0.500000 1.500000 5 -0.125000 3 0.500000 1.500000 5 0.375000 4 0.500000 1.500000 5 -0.070312 5 0.500000 1.500000 5 -0.023438 0 0.500000 2.000000 5 1.000000 1 0.500000 2.000000 5 -0.500000 2 0.500000 2.000000 5 -0.500000 3 0.500000 2.000000 5 0.250000 4 0.500000 2.000000 5 0.062500 5 0.500000 2.000000 5 -0.031250 0 0.500000 2.500000 5 1.000000 1 0.500000 2.500000 5 0.000000 2 0.500000 2.500000 5 -0.625000 3 0.500000 2.500000 5 -0.000000 4 0.500000 2.500000 5 0.117188 5 0.500000 2.500000 5 0.000000 laguerre_associated_test(): laguerre_associated() evaluates the associated Laguerre polynomials. Table of L(N,M)(X) for N(max) = 6 M = 0 X = 0.000000 0 1.000000 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 6 1.000000 Table of L(N,M)(X) for N(max) = 6 M = 0 X = 1.000000 0 1.000000 1 0.000000 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.000000 0 1.000000 1 2.000000 2 3.000000 3 4.000000 4 5.000000 5 6.000000 6 7.000000 Table of L(N,M)(X) for N(max) = 6 M = 2 X = 0.500000 0 1.000000 1 2.500000 2 4.125000 3 5.604167 4 6.752604 5 7.455469 6 7.654188 Table of L(N,M)(X) for N(max) = 6 M = 3 X = 0.500000 0 1.000000 1 3.500000 2 7.625000 3 13.229167 4 19.981771 5 27.437240 6 35.091428 Table of L(N,M)(X) for N(max) = 6 M = 1 X = 0.500000 0 1.000000 1 1.500000 2 1.625000 3 1.479167 4 1.148438 5 0.702865 6 0.198720 laguerre_poly_test(): laguerre_poly() evaluates the Laguerre polynomial. N X Exact F L(N)(X) 0 1.000000 1.000000 1.000000 1 1.000000 0.000000 0.000000 2 1.000000 -0.500000 -0.500000 3 1.000000 -0.666667 -0.666667 4 1.000000 -0.625000 -0.625000 5 1.000000 -0.466667 -0.466667 6 1.000000 -0.256944 -0.256944 7 1.000000 -0.040476 -0.040476 8 1.000000 0.153993 0.153993 9 1.000000 0.309744 0.309744 10 1.000000 0.418946 0.418946 11 1.000000 0.480134 0.480134 12 1.000000 0.496212 0.496212 5 0.500000 -0.445573 -0.445573 5 3.000000 0.850000 0.850000 5 5.000000 -3.166667 -3.166667 5 10.000000 34.333333 34.333333 laguerre_poly_coef_test(): laguerre_poly_coef() determines the Laguerre polynomial coefficients. L(0) 1.000000 L(1) -1.000000 * x 1.000000 L(2) 0.500000 * x^2 -2.000000 * x 1.000000 L(3) -0.166667 * x^3 1.500000 * x^2 -3.000000 * x 1.000000 L(4) 0.041667 * x^4 -0.666667 * x^3 3.000000 * x^2 -4.000000 * x 1.000000 L(5) -0.008333 * x^5 0.208333 * x^4 -1.666667 * x^3 5.000000 * x^2 -5.000000 * x 1.000000 Factorially scaled L(0) 1.000000 Factorially scaled L(1) -1.000000 * x 1.000000 Factorially scaled L(2) 1.000000 * x^2 -4.000000 * x 2.000000 Factorially scaled L(3) -1.000000 * x^3 9.000000 * x^2 -18.000000 * x 6.000000 Factorially scaled L(4) 1.000000 * x^4 -16.000000 * x^3 72.000000 * x^2 -96.000000 * x 24.000000 Factorially scaled L(5) -1.000000 * x^5 25.000000 * x^4 -200.000000 * x^3 600.000000 * x^2 -600.000000 * x 120.000000 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_poly_test(): legendre_poly() evaluates the Legendre PN function. N X Exact F P(N)(X) 0 0.250000 1.000000 1.000000 1 0.250000 0.250000 0.250000 2 0.250000 -0.406250 -0.406250 3 0.250000 -0.335938 -0.335938 4 0.250000 0.157715 0.157715 5 0.250000 0.339722 0.339722 6 0.250000 0.024277 0.024277 7 0.250000 -0.279919 -0.279919 8 0.250000 -0.152454 -0.152454 9 0.250000 0.176824 0.176824 10 0.250000 0.221200 0.221200 3 0.000000 0.000000 -0.000000 3 0.100000 -0.147500 -0.147500 3 0.200000 -0.280000 -0.280000 3 0.300000 -0.382500 -0.382500 3 0.400000 -0.440000 -0.440000 3 0.500000 -0.437500 -0.437500 3 0.600000 -0.360000 -0.360000 3 0.700000 -0.192500 -0.192500 3 0.800000 0.080000 0.080000 3 0.900000 0.472500 0.472500 3 1.000000 1.000000 1.000000 legendre_poly_coef_test(): legendre_poly_coef() determines the Legendre P(N) polynomial coefficients. P(0) 1.000000 P(1) 1.000000 * x 0.000000 P(2) 1.500000 * x^2 0.000000 * x -0.500000 P(3) 2.500000 * x^3 0.000000 * x^2 -1.500000 * x -0.000000 P(4) 4.375000 * x^4 0.000000 * x^3 -3.750000 * x^2 -0.000000 * x 0.375000 P(5) 7.875000 * x^5 0.000000 * x^4 -8.750000 * x^3 -0.000000 * x^2 1.875000 * x 0.000000 legendre_associated_test(): legendre_associated() evaluates associated Legrendre 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 the associated Legrendre functions, using a normalization appropriate for spherical harmonics. 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.000000 0.000000 0.000000 1 0.000000 -1.000000 -1.000000 2 0.000000 0.000000 -0.000000 3 0.000000 0.666667 0.666667 9 0.000000 -0.406349 -0.406349 10 0.000000 0.000000 -0.000000 0 0.500000 0.549306 0.549306 1 0.500000 -0.725347 -0.725347 2 0.500000 -0.818663 -0.818663 3 0.500000 -0.198655 -0.198655 9 0.500000 -0.116163 -0.116163 10 0.500000 0.291658 0.291658 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 rr = 7 pp = 3 qq = 7 7 3 -1 7 4 1 rr = 7 pp = 5 qq = 7 7 5 -1 rr = 7 pp = 3 qq = 7 7 6 -1 7 7 0 Legendre Symbols for P = 11 11 0 0 11 1 1 11 2 -1 rr = 11 pp = 3 qq = 11 11 3 1 11 4 1 rr = 11 pp = 5 qq = 11 11 5 1 rr = 11 pp = 3 qq = 11 11 6 -1 rr = 11 pp = 7 qq = 11 11 7 -1 11 8 -1 11 9 1 rr = 11 pp = 5 qq = 11 11 10 -1 11 11 0 Legendre Symbols for P = 13 13 0 0 13 1 1 13 2 -1 rr = 13 pp = 3 qq = 13 13 3 1 13 4 1 rr = 13 pp = 5 qq = 13 rr = 5 pp = 3 qq = 5 13 5 -1 rr = 13 pp = 3 qq = 13 13 6 -1 rr = 13 pp = 7 qq = 13 rr = 7 pp = 3 qq = 7 13 7 -1 13 8 -1 13 9 1 rr = 13 pp = 5 qq = 13 rr = 5 pp = 3 qq = 5 13 10 1 rr = 13 pp = 11 qq = 13 13 11 -1 rr = 13 pp = 3 qq = 13 13 12 1 13 13 0 Legendre Symbols for P = 17 17 0 0 17 1 1 17 2 1 rr = 17 pp = 3 qq = 17 17 3 -1 17 4 1 rr = 17 pp = 5 qq = 17 17 5 -1 rr = 17 pp = 3 qq = 17 17 6 -1 rr = 17 pp = 7 qq = 17 rr = 7 pp = 3 qq = 7 17 7 -1 17 8 1 17 9 1 rr = 17 pp = 5 qq = 17 17 10 -1 rr = 17 pp = 11 qq = 17 rr = 11 pp = 3 qq = 11 17 11 -1 rr = 17 pp = 3 qq = 17 17 12 -1 rr = 17 pp = 13 qq = 17 17 13 1 rr = 17 pp = 7 qq = 17 rr = 7 pp = 3 qq = 7 17 14 -1 rr = 17 pp = 5 qq = 17 rr = 17 pp = 3 qq = 17 17 15 1 17 16 1 17 17 0 lerch_test(): lerch() evaluates the Lerch function. Z S A Lerch Lerch Tabulated Computed 1.000000 2 0.000000 1.644934e+00 1.644918e+00 1.000000 3 0.000000 1.202057e+00 1.202057e+00 1.000000 10 0.000000 1.000995e+00 1.000995e+00 0.500000 2 1.000000 1.164481e+00 1.164481e+00 0.500000 3 1.000000 1.074426e+00 1.074426e+00 0.500000 10 1.000000 1.000493e+00 1.000493e+00 0.333333 2 2.000000 2.959191e-01 2.959191e-01 0.333333 3 2.000000 1.394508e-01 1.394508e-01 0.333333 10 2.000000 9.823175e-04 9.823175e-04 0.100000 2 3.000000 1.177911e-01 1.177911e-01 0.100000 3 3.000000 3.868448e-02 3.868448e-02 0.100000 10 3.000000 1.703150e-05 1.703150e-05 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.500000 0.125000 0.000000 1.000000 1 0.500000 0.125000 0.000000 1.000000 2 0.500000 0.125000 0.000000 0.125000 3 0.500000 0.125000 0.000000 -0.684375 4 0.500000 0.125000 0.000000 -0.779297 5 0.500000 0.125000 0.000000 -0.181787 0 0.500000 0.125000 0.500000 1.000000 1 0.500000 0.125000 0.500000 -6.000000 2 0.500000 0.125000 0.500000 -3.666667 3 0.500000 0.125000 0.500000 2.050000 4 0.500000 0.125000 0.500000 4.900000 5 0.500000 0.125000 0.500000 2.669444 0 0.500000 0.125000 1.000000 1.000000 1 0.500000 0.125000 1.000000 -13.000000 2 0.500000 0.125000 1.000000 -3.375000 3 0.500000 0.125000 1.000000 8.459375 4 0.500000 0.125000 1.000000 9.086328 5 0.500000 0.125000 1.000000 -0.073703 0 0.500000 0.125000 1.500000 1.000000 1 0.500000 0.125000 1.500000 -20.000000 2 0.500000 0.125000 1.500000 1.000000 3 0.500000 0.125000 1.500000 16.400000 4 0.500000 0.125000 1.500000 9.100000 5 0.500000 0.125000 1.500000 -8.005556 0 0.500000 0.125000 2.000000 1.000000 1 0.500000 0.125000 2.000000 -27.000000 2 0.500000 0.125000 2.000000 9.458333 3 0.500000 0.125000 2.000000 23.728125 4 0.500000 0.125000 2.000000 3.333203 5 0.500000 0.125000 2.000000 -19.008415 0 0.500000 0.125000 2.500000 1.000000 1 0.500000 0.125000 2.500000 -34.000000 2 0.500000 0.125000 2.500000 22.000000 3 0.500000 0.125000 2.500000 28.300000 4 0.500000 0.125000 2.500000 -8.750000 5 0.500000 0.125000 2.500000 -29.773611 0 1.000000 0.250000 0.000000 1.000000 1 1.000000 0.250000 0.000000 1.000000 2 1.000000 0.250000 0.000000 0.250000 3 1.000000 0.250000 0.000000 -0.437500 4 1.000000 0.250000 0.000000 -0.625000 5 1.000000 0.250000 0.000000 -0.306250 0 1.000000 0.250000 0.500000 1.000000 1 1.000000 0.250000 0.500000 -0.500000 2 1.000000 0.250000 0.500000 -0.781250 3 1.000000 0.250000 0.500000 -0.285156 4 1.000000 0.250000 0.500000 0.327515 5 1.000000 0.250000 0.500000 0.547452 0 1.000000 0.250000 1.000000 1.000000 1 1.000000 0.250000 1.000000 -2.000000 2 1.000000 0.250000 1.000000 -1.250000 3 1.000000 0.250000 1.000000 0.500000 4 1.000000 0.250000 1.000000 1.343750 5 1.000000 0.250000 1.000000 0.809375 0 1.000000 0.250000 1.500000 1.000000 1 1.000000 0.250000 1.500000 -3.500000 2 1.000000 0.250000 1.500000 -1.156250 3 1.000000 0.250000 1.500000 1.707031 4 1.000000 0.250000 1.500000 2.094116 5 1.000000 0.250000 1.500000 0.362021 0 1.000000 0.250000 2.000000 1.000000 1 1.000000 0.250000 2.000000 -5.000000 2 1.000000 0.250000 2.000000 -0.500000 3 1.000000 0.250000 2.000000 3.125000 4 1.000000 0.250000 2.000000 2.328125 5 1.000000 0.250000 2.000000 -0.753906 0 1.000000 0.250000 2.500000 1.000000 1 1.000000 0.250000 2.500000 -6.500000 2 1.000000 0.250000 2.500000 0.718750 3 1.000000 0.250000 2.500000 4.542969 4 1.000000 0.250000 2.500000 1.874390 5 1.000000 0.250000 2.500000 -2.369162 0 2.000000 0.500000 0.000000 1.000000 1 2.000000 0.500000 0.000000 1.000000 2 2.000000 0.500000 0.000000 0.500000 3 2.000000 0.500000 0.000000 0.000000 4 2.000000 0.500000 0.000000 -0.300000 5 2.000000 0.500000 0.000000 -0.350000 0 2.000000 0.500000 0.500000 1.000000 1 2.000000 0.500000 0.500000 0.750000 2 2.000000 0.500000 0.500000 0.229167 3 2.000000 0.500000 0.500000 -0.160156 4 2.000000 0.500000 0.500000 -0.305664 5 2.000000 0.500000 0.500000 -0.237101 0 2.000000 0.500000 1.000000 1.000000 1 2.000000 0.500000 1.000000 0.500000 2 2.000000 0.500000 1.000000 0.000000 3 2.000000 0.500000 1.000000 -0.250000 4 2.000000 0.500000 1.000000 -0.250000 5 2.000000 0.500000 1.000000 -0.104167 0 2.000000 0.500000 1.500000 1.000000 1 2.000000 0.500000 1.500000 0.250000 2 2.000000 0.500000 1.500000 -0.187500 3 2.000000 0.500000 1.500000 -0.277344 4 2.000000 0.500000 1.500000 -0.150977 5 2.000000 0.500000 1.500000 0.027629 0 2.000000 0.500000 2.000000 1.000000 1 2.000000 0.500000 2.000000 0.000000 2 2.000000 0.500000 2.000000 -0.333333 3 2.000000 0.500000 2.000000 -0.250000 4 2.000000 0.500000 2.000000 -0.025000 5 2.000000 0.500000 2.000000 0.141667 0 2.000000 0.500000 2.500000 1.000000 1 2.000000 0.500000 2.500000 -0.250000 2 2.000000 0.500000 2.500000 -0.437500 3 2.000000 0.500000 2.500000 -0.175781 4 2.000000 0.500000 2.500000 0.113086 5 2.000000 0.500000 2.500000 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 motzkin_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 X NORMAL_01_CDF_INVERSE(FX) 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_big_test(): omega_big() counts the prime divisors of an integer N, allowing for multiplicity. N Exact omega_big(N) 1 1 1 2 1 1 3 1 1 4 2 2 5 1 1 6 2 2 7 1 1 8 3 3 9 2 2 10 2 2 30 3 3 101 1 1 210 4 4 1320 6 6 1764 6 6 2003 1 1 2310 5 5 2827 2 2 8717 2 2 12553 1 1 30030 6 6 510510 7 7 9699690 8 8 omega_little_test(): omega_little() counts the distinct prime divisors of an integer N. N Exact omega_little(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 Pi(n), the number of primes less than or equal to n. N Pi(n) Pi(n) Ratio estimated tabulated 10 4.3 4 1.0857 20 6.7 8 0.8345 30 8.8 10 0.8820 40 10.8 12 0.9036 50 12.8 15 0.8521 60 14.7 17 0.8620 70 16.5 19 0.8672 80 18.3 22 0.8298 90 20.0 24 0.8334 100 21.7 25 0.8686 1000 144.8 168 0.8617 10000 1085.7 1229 0.8834 100000 8685.9 9592 0.9055 1000000 72382.4 78498 0.9221 10000000 620420.7 664579 0.9336 100000000 5428681.0 5761455 0.9422 1000000000 48254942.4 50847534 0.9490 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 1 2 0 1 3 0 1 4 0 1 5 0 1 6 0 1 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_square_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.105e-15 83.000000 56.000000 68.8365300598585179 68.8365300598585179 0 42.000000 7.000000 20.6593011967340097 20.6593011967340061 3.553e-15 26.000000 11.000000 17.6968548737436500 17.6968548737436677 1.776e-14 4.000000 63.000000 23.8670497217533004 23.8670497217533040 3.553e-15 6.000000 45.000000 20.7170159828059930 20.7170159828059894 3.553e-15 40.000000 75.000000 56.1278422556166845 56.1278422556166845 0 80.000000 0.000000 0.0000000000000000 0.0000000000000000 0 90.000000 35.000000 59.2695650812296364 59.2695650812298851 2.487e-13 9.000000 1.000000 3.9362355036495553 3.9362355036495558 4.441e-16 53.000000 53.000000 53.0000000000000000 53.0000000000000000 0 1.000000 2.000000 1.4567910310469068 1.4567910310469068 0 1.000000 4.000000 2.2430285802876027 2.2430285802876027 0 1.000000 8.000000 3.6157561775973628 3.6157561775973628 0 r8_beta_test(): r8_beta() evaluates the Beta function. X Y Exact F R8_BETA(X,Y) 0.200000 1.000000 5.000000e+00 5.000000e+00 0.400000 1.000000 2.500000e+00 2.500000e+00 0.600000 1.000000 1.666667e+00 1.666667e+00 0.800000 1.000000 1.250000e+00 1.250000e+00 1.000000 0.200000 5.000000e+00 5.000000e+00 1.000000 0.400000 2.500000e+00 2.500000e+00 1.000000 1.000000 1.000000e+00 1.000000e+00 2.000000 2.000000 1.666667e-01 1.666667e-01 3.000000 3.000000 3.333330e-02 3.333333e-02 4.000000 4.000000 7.142857e-03 7.142857e-03 5.000000 5.000000 1.587302e-03 1.587302e-03 6.000000 2.000000 2.380950e-02 2.380952e-02 6.000000 3.000000 5.952381e-03 5.952381e-03 6.000000 4.000000 1.984127e-03 1.984127e-03 6.000000 5.000000 7.936508e-04 7.936508e-04 6.000000 6.000000 3.607504e-04 3.607504e-04 7.000000 7.000000 8.325008e-05 8.325008e-05 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 X R8_ERF_INVERSE(FX) 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_log_test(): r8_factorial_log() evaluates the logarithm of the factorial function. N Exact F R8_FACTORIAL_LOG(N) 0 0.000000 0.000000 1 0.000000 0.000000 2 0.693147 0.693147 3 1.791757 1.791759 4 3.178051 3.178054 5 4.787489 4.787492 6 6.579246 6.579251 7 8.525160 8.525161 8 10.604600 10.604603 9 12.801820 12.801827 10 15.104410 15.104413 11 17.502320 17.502308 12 19.987220 19.987214 13 22.552160 22.552164 14 25.191230 25.191221 15 27.899270 27.899271 16 30.671860 30.671860 17 33.505080 33.505073 18 36.395440 36.395445 19 39.339870 39.339884 20 42.335610 42.335616 25 58.003620 58.003605 50 148.477800 148.477767 100 363.739400 363.739376 150 605.020100 605.020106 500 2611.331000 2611.330458 1000 5912.128000 5912.128178 r8_hyper_2f1_test(): 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 7.2356129348997789e-01 7.2356129348997811e-01 2.2204e-16 -0.50 1.10 6.70 0.25 9.7911109345277958e-01 9.7911109345277969e-01 1.1102e-16 0.50 1.10 6.70 0.25 1.0216578140088564e+00 1.0216578140088564e+00 0.0000e+00 2.50 3.30 6.70 0.25 1.4051563200112127e+00 1.4051563200112123e+00 4.4409e-16 -2.50 3.30 6.70 0.55 4.6961431639821610e-01 4.6961431639821616e-01 5.5511e-17 -0.50 1.10 6.70 0.55 9.5296194977446325e-01 9.5296194977446358e-01 3.3307e-16 0.50 1.10 6.70 0.55 1.0512814213947987e+00 1.0512814213947979e+00 8.8818e-16 2.50 3.30 6.70 0.55 2.3999062904777859e+00 2.3999062904777841e+00 1.7764e-15 -2.50 3.30 6.70 0.85 2.9106095928414716e-01 2.9106095928414738e-01 2.2204e-16 -0.50 1.10 6.70 0.85 9.2536967910373180e-01 9.2536967910373180e-01 0.0000e+00 0.50 1.10 6.70 0.85 1.0865504094806997e+00 1.0865504094806997e+00 0.0000e+00 2.50 3.30 6.70 0.85 5.7381565526189044e+00 5.7381565526193867e+00 4.8228e-13 3.30 6.70 -5.50 0.25 1.5090669748704608e+04 1.5090669748704597e+04 1.0914e-11 1.10 6.70 -0.50 0.25 -1.0431170067364350e+02 -1.0431170067364347e+02 2.8422e-14 1.10 6.70 0.50 0.25 2.1175050707768811e+01 2.1175050707768801e+01 1.0658e-14 3.30 6.70 4.50 0.25 4.1946915819031920e+00 4.1946915819031911e+00 8.8818e-16 3.30 6.70 -5.50 0.55 1.0170777974048815e+10 1.0170777974048826e+10 1.1444e-05 1.10 6.70 -0.50 0.55 -2.4708635322489157e+04 -2.4708635322489139e+04 1.8190e-11 1.10 6.70 0.50 0.55 1.3722304548384989e+03 1.3722304548384966e+03 2.2737e-12 3.30 6.70 4.50 0.55 5.8092728706394652e+01 5.8092728706394624e+01 2.8422e-14 3.30 6.70 -5.50 0.85 5.8682087615124173e+18 5.8682087615123804e+18 3.6864e+04 1.10 6.70 -0.50 0.85 -4.4635010147296000e+08 -4.4635010147296047e+08 4.7684e-07 1.10 6.70 0.50 0.85 5.3835057561295731e+06 5.3835057561295815e+06 8.3819e-09 3.30 6.70 4.50 0.85 2.0396913776019661e+04 2.0396913776019646e+04 1.4552e-11 r8_mop_test(): r8_mop() evaluates (-1.0)^I4 as an R8. I4 R8_MOP(I4) 63 -1.0 82 1.0 -75 -1.0 83 -1.0 27 -1.0 -81 -1.0 -45 -1.0 9 -1.0 92 1.0 93 -1.0 r8_psi_test(): r8_psi() evaluates the Psi function. X Psi(X) Psi(X) DIFF (Tabulated) (R8_PSI) 1.00 -5.7721566490153287e-01 -5.7721566490153287e-01 0.0000e+00 1.10 -4.2375494041107681e-01 -4.2375494041107675e-01 5.5511e-17 1.20 -2.8903989659218832e-01 -2.8903989659218837e-01 5.5511e-17 1.30 -1.6919088886679970e-01 -1.6919088886679953e-01 1.6653e-16 1.40 -6.1384544585116149e-02 -6.1384544585116239e-02 9.0206e-17 1.50 3.6489973978576520e-02 3.6489973978576520e-02 0.0000e+00 1.60 1.2604745277347629e-01 1.2604745277347632e-01 2.7756e-17 1.70 2.0854787487349399e-01 2.0854787487349397e-01 2.7756e-17 1.80 2.8499143329386151e-01 2.8499143329386151e-01 0.0000e+00 1.90 3.5618416116405971e-01 3.5618416116405960e-01 1.1102e-16 2.00 4.2278433509846708e-01 4.2278433509846719e-01 1.1102e-16 r8poly_degree_test(): r8poly_degree() determines the degree of an R8POLY. The R8POLY: = +4.000000 * x^3 +3.000000 * x^2 +2.000000 * x +1.000000 Dimensioned degree = 3, Actual degree = 3 The R8POLY: = +3.000000 * x^2 +2.000000 * x +1.000000 Dimensioned degree = 3, Actual degree = 2 The R8POLY: = +4.000000 * x^3 +2.000000 * x +1.000000 Dimensioned degree = 3, Actual degree = 3 The R8POLY: = +1.000000 Dimensioned degree = 3, Actual degree = 0 The R8POLY: = 0 Dimensioned degree = 3, Actual degree = 0 r8poly_print_test(): r8poly_print() prints an R8POLY. The R8POLY: = +9.000000 * x^5 +0.780000 * x^4 +56.000000 * x^2 -3.400000 * x +12.000000 r8poly_value_horner_test(): r8poly_value_horner() evaluates a polynomial at one point, using Horner's method. The polynomial: = +1.000000 * x^4 -10.000000 * x^3 +35.000000 * x^2 -50.000000 * x +24.000000 I X P(X) 1 0.0000 24 2 0.3333 10.8642 3 0.6667 3.45679 4 1.0000 0 5 1.3333 -0.987654 6 1.6667 -0.691358 7 2.0000 0 8 2.3333 0.493827 9 2.6667 0.493827 10 3.0000 0 11 3.3333 -0.691358 12 3.6667 -0.987654 13 4.0000 0 14 4.3333 3.45679 15 4.6667 10.8642 16 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() returns values of the integral of SIN(X)^N from A to B. A B N Exact Computed 10.000000 20.000000 0 1.000000e+01 1.000000e+01 0.000000 1.000000 1 4.596977e-01 4.596977e-01 0.000000 1.000000 2 2.726756e-01 2.726756e-01 0.000000 1.000000 3 1.789406e-01 1.789406e-01 0.000000 1.000000 4 1.240256e-01 1.240256e-01 0.000000 1.000000 5 8.897440e-02 8.897440e-02 0.000000 2.000000 5 9.039312e-01 9.039312e-01 1.000000 2.000000 5 8.149568e-01 8.149568e-01 0.000000 1.000000 10 2.188752e-02 2.188752e-02 0.000000 1.000000 11 1.702344e-02 1.702344e-02 slices_test(): slices() 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 spherical_harmonic_test(): spherical_harmonic() evaluates the spherical harmonic function. L M THETA PHI YR YI 0 0 0.523599 1.047198 0.282095 0.000000 0.282095 0.000000 1 0 0.523599 1.047198 0.423142 0.000000 0.423142 0.000000 2 1 0.523599 1.047198 -0.167262 -0.289706 -0.167262 -0.289706 3 2 0.523599 1.047198 -0.110633 0.191622 -0.110633 0.191622 4 3 0.523599 1.047198 0.135497 0.000000 0.135497 0.000000 5 5 0.261799 0.628319 0.000539 0.000000 0.000539 -0.000000 5 4 0.261799 0.628319 -0.005147 0.003739 -0.005147 0.003739 5 3 0.261799 0.628319 0.013710 -0.042195 0.013710 -0.042195 5 2 0.261799 0.628319 0.060964 0.187626 0.060964 0.187626 5 1 0.261799 0.628319 -0.417040 -0.302997 -0.417040 -0.302997 4 2 0.628319 0.785398 0.000000 0.413939 0.000000 0.413939 4 2 1.884956 0.785398 0.000000 -0.100323 -0.000000 -0.100323 4 2 3.141593 0.785398 0.000000 0.000000 0.000000 0.000000 4 2 4.398230 0.785398 0.000000 -0.100323 -0.000000 -0.100323 4 2 5.654867 0.785398 0.000000 0.413939 0.000000 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.346397 0.089930 -0.394011 0.089930 -0.394011 3 -1 0.392699 1.795196 -0.089930 -0.394011 -0.089930 -0.394011 3 -1 0.392699 2.243995 -0.251979 -0.315972 -0.251979 -0.315972 stirling_estimate_test(): stirling_estimate() uses Stirling's approximation to estimate log(n!). Graphics saved as "stirling_estimate.png" stirling1_table_test(): stirling1_table() computes 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() computes Stirling numbers of second kind. 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 3 1 0 0 0 0 0 0 0 1 7 6 1 0 0 0 0 0 0 1 15 25 10 1 0 0 0 0 0 1 31 90 65 15 1 0 0 0 0 1 63 301 350 140 21 1 0 0 0 1 127 966 1701 1050 266 28 1 stirling2_row_test(): stirling2_row() computes the I-th row of the table of Stirling numbers of the second kind. We will get rows 1 through 8, one at a time. 1 1 2 1 1 3 1 3 1 4 1 7 6 1 5 1 15 25 10 1 6 1 31 90 65 15 1 7 1 63 301 350 140 21 1 8 1 127 966 1701 1050 266 28 1 stirling2_table_test(): stirling2_table() computes 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 i = 1 1 1 1 i = 2 2 1 2 i = 3 3 1 4 i = 4 4 1 7 triangle_upper_to_i4_test(): triangle_upper_to_i4() converts an upper triangular index to a linear one. I, J => K 1 1 1 1 2 2 1 3 4 1 4 7 2 2 3 2 3 5 2 4 8 3 3 6 3 4 9 4 4 10 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 2 0 3 1 4 1 5 2 6 4 7 7 8 13 9 24 10 44 11 81 12 149 13 274 14 504 15 927 16 1705 17 3136 18 5768 19 10609 20 19513 tribonacci_roots_test(): tribonacci_roots() computes the Tribonacci roots. alpha = 1.83929, p(alpha) = 2.22045e-16 beta = -0.419643+0.606291i, p(beta) = 0 gamma = -0.419643+-0.606291i, p(gamma) = 0 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. 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 3 6 0 -2 -2 7 -1 3 -1 8 -1 5 -3 9 -2 2 -2 10 -3 -3 1 11 -1 -1 1 12 2 -4 0 13 3 -3 1 14 -5 7 -1 15 8 10 2 16 13 3 1 17 5 -7 -3 18 -18 4 4 19 -13 11 -7 20 31 -7 -3 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.000000 1 0 0.000000 0.000000 1 1 0.000000 1.000000 2 0 -1.000000 0.000000 2.000000 2 1 0.000000 0.000000 0.000000 2 2 0.000000 0.000000 1.000000 3 0 0.000000 0.000000 0.000000 0.000000 3 1 0.000000 -2.000000 0.000000 3.000000 3 2 0.000000 0.000000 0.000000 0.000000 3 3 0.000000 0.000000 0.000000 1.000000 4 0 1.000000 0.000000 -6.000000 0.000000 6.000000 4 1 0.000000 0.000000 0.000000 0.000000 0.000000 4 2 0.000000 0.000000 -3.000000 0.000000 4.000000 4 3 0.000000 0.000000 0.000000 0.000000 0.000000 4 4 0.000000 0.000000 0.000000 0.000000 1.000000 5 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 5 1 0.000000 3.000000 0.000000 -12.000000 0.000000 10.000000 5 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 5 3 0.000000 0.000000 0.000000 -4.000000 0.000000 5.000000 5 4 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 5 5 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 Z1: Compute polynomial coefficients, then evaluate by Horner's method; Z2: Evaluate directly by recursion. N M Z1 Z2 0 0 1.000000 1.000000 1 0 0.000000 0.000000 1 1 0.987654 0.987654 2 0 0.950922 0.950922 2 1 0.000000 0.000000 2 2 0.975461 0.975461 3 0 0.000000 0.000000 3 1 0.914946 0.914946 3 2 0.000000 0.000000 3 3 0.963418 0.963418 4 0 0.856379 0.856379 4 1 0.000000 0.000000 4 2 0.879714 0.879714 4 3 0.000000 0.000000 4 4 0.951524 0.951524 5 0 0.000000 0.000000 5 1 0.799714 0.799714 5 2 0.000000 0.000000 5 3 0.845212 0.845212 5 4 0.000000 0.000000 5 5 0.939777 0.939777 zernike_poly_coef_test(): zernike_poly_coef() determines the Zernike polynomial coefficients. Zernike polynomial = 0 Zernike polynomial = +10.000000 * x^5 -12.000000 * x^3 +3.000000 * x Zernike polynomial = 0 Zernike polynomial = +5.000000 * x^5 -4.000000 * x^3 Zernike polynomial = 0 Zernike polynomial = +1.000000 * x^5 zeta_m1_test(): zeta_m1() evaluates the Riemann Zeta Minus One function. Requested tolerance = 1e-10 P Zeta_M1 Zeta_M1 exact computed 2.00 6.449341e-01 6.449341e-01 2.50 3.414873e-01 3.414873e-01 3.00 2.020569e-01 2.020569e-01 3.50 1.267339e-01 1.267339e-01 4.00 8.232323e-02 8.232323e-02 5.00 3.692776e-02 3.692776e-02 6.00 1.734306e-02 1.734306e-02 7.00 8.349277e-03 8.349277e-03 8.00 4.077356e-03 4.077356e-03 9.00 2.008393e-03 2.008393e-03 10.00 9.945751e-04 9.945751e-04 11.00 4.941886e-04 4.941886e-04 12.00 2.460866e-04 2.460866e-04 16.00 1.528226e-05 1.528226e-05 20.00 9.539620e-07 9.539620e-07 30.00 9.313274e-11 9.313274e-10 40.00 9.094948e-13 9.094948e-13 zeta_naive_test(): zeta_naive() evaluates the Riemann Zeta function. N Zeta Zeta exact computed 2 1.644934e+00 1.643935e+00 3 1.202057e+00 1.202056e+00 4 1.082323e+00 1.082323e+00 5 1.036928e+00 1.036928e+00 6 1.017343e+00 1.017343e+00 7 1.008349e+00 1.008349e+00 8 1.004077e+00 1.004077e+00 9 1.002008e+00 1.002008e+00 10 1.000995e+00 1.000995e+00 11 1.000494e+00 1.000494e+00 12 1.000246e+00 1.000246e+00 16 1.000015e+00 1.000015e+00 20 1.000001e+00 1.000001e+00 30 1.000000e+00 1.000000e+00 40 1.000000e+00 1.000000e+00 polpak_test(): Normal end of execution. 27-Mar-2024 10:46:41