Wed Mar 27 16:16:48 2024 polpak_test(): Python version: 3.8.10 Test polpak(). agm_values_test(): agm_values() stores values of the arithmetic geometric mean function. A B AGM(A,B) 22.000000 96.000000 52.2746411987042379 83.000000 56.000000 68.8365300598585179 42.000000 7.000000 20.6593011967340097 26.000000 11.000000 17.6968548737436500 4.000000 63.000000 23.8670497217533004 6.000000 45.000000 20.7170159828059930 40.000000 75.000000 56.1278422556166845 80.000000 0.000000 0.0000000000000000 90.000000 35.000000 59.2695650812296364 9.000000 1.000000 3.9362355036495553 53.000000 53.000000 53.0000000000000000 1.000000 2.000000 1.4567910310469068 1.000000 4.000000 2.2430285802876027 1.000000 8.000000 3.6157561775973628 bell_values_test(): bell_values() returns values of the Bell numbers. N BELL(N) 0 1 1 1 2 2 3 5 4 15 5 52 6 203 7 877 8 4140 9 21147 10 115975 bernoulli_number_values_test(): bernoulli_number_values() returns values of the Bernoulli numbers. N bernoulli_number(N) 0 1 1 -0.5 2 0.166667 3 0 4 -0.0333333 6 -0.0238095 8 -0.0333333 10 0.0757576 20 -529.124 30 6.01581e+08 bernstein_poly_01_values_test(): bernstein_poly_01_values() stores values of Bernstein polynomials. N K X F 0 0 0.250000 1 1 0 0.250000 0.75 1 1 0.250000 0.25 2 0 0.250000 0.5625 2 1 0.250000 0.375 2 2 0.250000 0.0625 3 0 0.250000 0.421875 3 1 0.250000 0.421875 3 2 0.250000 0.140625 3 3 0.250000 0.015625 4 0 0.250000 0.31640625 4 1 0.250000 0.421875 4 2 0.250000 0.2109375 4 3 0.250000 0.046875 4 4 0.250000 0.00390625 catalan_values_test(): catalan_values() returns values of the Catalan numbers. N C(N) 0 1 1 1 2 2 3 5 4 14 5 42 6 132 7 429 8 1430 9 4862 10 16796 cheby_t_poly_values_test(): cheby_t_poly_values() stores values of the Bernoulli polynomials. N X FX 0 0.800000 1 1 0.800000 0.8 2 0.800000 0.28 3 0.800000 -0.352 4 0.800000 -0.8431999999999999 5 0.800000 -0.99712 6 0.800000 -0.752192 7 0.800000 -0.2063872 8 0.800000 0.42197248 9 0.800000 0.881543168 10 0.800000 0.9884965888 11 0.800000 0.70005137408 12 0.800000 0.131585609728 cheby_u_poly_values_test(): cheby_u_poly_values() stores values of the Chebyshev U polynomials. N X FX 0 0.800000 1 1 0.800000 1.6 2 0.800000 1.56 3 0.800000 0.896 4 0.800000 -0.1264 5 0.800000 -1.09824 6 0.800000 -1.630784 7 0.800000 -1.5110144 8 0.800000 -0.78683904 9 0.800000 0.252071936 10 0.800000 1.1901541376 11 0.800000 1.65217468416 12 0.800000 1.453325357056 collatz_count_values_test(): collatz_count_values() returns values of the length of the Collatz sequence that starts at N. N Count 1 1 2 2 3 8 4 3 5 6 6 9 7 17 8 4 9 20 10 7 27 112 50 25 100 26 200 27 300 17 400 28 500 111 600 18 700 83 800 29 cos_power_int_values_test(): cos_power_int_values() stores values of the cosine power integral. A B N F 0.000000 3.141593 0 3.141592653589793 0.000000 3.141593 1 0 0.000000 3.141593 2 1.570796326794897 0.000000 3.141593 3 0 0.000000 3.141593 4 1.178097245096172 0.000000 3.141593 5 0 0.000000 3.141593 6 0.9817477042468103 0.000000 3.141593 7 0 0.000000 3.141593 8 0.8590292412159591 0.000000 3.141593 9 0 0.000000 3.141593 10 0.7731263170943632 erf_values_test(): erf_values() stores values of the error function. X ERF(X) 0.000000 0.0000000000000000 0.100000 0.1124629160182849 0.200000 0.2227025892104785 0.300000 0.3286267594591274 0.400000 0.4283923550466685 0.500000 0.5204998778130465 0.600000 0.6038560908479259 0.700000 0.6778011938374185 0.800000 0.7421009647076605 0.900000 0.7969082124228321 1.000000 0.8427007929497149 1.100000 0.8802050695740817 1.200000 0.9103139782296354 1.300000 0.9340079449406524 1.400000 0.9522851197626488 1.500000 0.9661051464753106 1.600000 0.9763483833446440 1.700000 0.9837904585907746 1.800000 0.9890905016357306 1.900000 0.9927904292352575 2.000000 0.9953222650189527 euler_number_values_test(): euler_number_values() returns values of the Euler numbers. N euler_number(N) 0 1 1 0 2 -1 4 5 6 -61 8 1385 10 -50521 12 2702765 gegenbauer_poly_values_test(): gegenbauer_poly_values() stores values of the Gegenbauer polynomials. N A X FX 0 0.500000 0.200000 1 1 0.500000 0.200000 0.2 2 0.500000 0.200000 -0.44 3 0.500000 0.200000 -0.28 4 0.500000 0.200000 0.232 5 0.500000 0.200000 0.30752 6 0.500000 0.200000 -0.08057599999999999 7 0.500000 0.200000 -0.2935168 8 0.500000 0.200000 -0.0395648 9 0.500000 0.200000 0.2459712 10 0.500000 0.200000 0.1290720256 2 0.000000 0.400000 0 2 1.000000 0.400000 -0.36 2 2.000000 0.400000 -0.08 2 3.000000 0.400000 0.84 2 4.000000 0.400000 2.4 2 5.000000 0.400000 4.6 2 6.000000 0.400000 7.44 2 7.000000 0.400000 10.92 2 8.000000 0.400000 15.04 2 9.000000 0.400000 19.8 2 10.000000 0.400000 25.2 5 3.000000 -0.500000 -9 5 3.000000 -0.400000 -0.16128 5 3.000000 -0.300000 -6.67296 5 3.000000 -0.200000 -8.37504 5 3.000000 -0.100000 -5.52672 5 3.000000 0.000000 0 5 3.000000 0.100000 5.52672 5 3.000000 0.200000 8.37504 5 3.000000 0.300000 6.67296 5 3.000000 0.400000 0.16128 5 3.000000 0.500000 -9 5 3.000000 0.600000 -15.42528 5 3.000000 0.700000 -9.696960000000001 5 3.000000 0.800000 22.44096 5 3.000000 0.900000 100.88928 5 3.000000 1.000000 252 gud_values: gud_values() stores values of the Gudermannian function. X GUD(X) -2.000000 -1.3017603360460150 -1.000000 -0.8657694832396586 0.000000 0.0000000000000000 0.100000 0.0998337487934866 0.200000 0.1986798470079397 0.500000 0.4803810791337294 1.000000 0.8657694832396586 1.500000 1.1317283452505089 2.000000 1.3017603360460150 2.500000 1.4069935689361539 3.000000 1.4713043411171931 3.500000 1.5104199075457001 4.000000 1.5341691443347329 harmonic_values_test(): harmonic_values() stores values of the Harmonic number sequence. N H(N) 1 1.0000000000000000 2 1.5000000000000000 3 1.8333333333333330 4 2.0833333333333330 5 2.2833333333333332 6 2.4500000000000002 7 2.5928571428571430 8 2.7178571428571430 9 2.8289682539682541 10 2.9289682539682542 11 3.0198773448773450 12 3.1032106782106781 13 3.1801337551337552 14 3.2515623265623268 15 3.3182289932289928 16 3.3807289932289928 17 3.4395525226407582 18 3.4951080781963131 19 3.5477396571436821 20 3.5977396571436819 21 3.6453587047627298 22 3.6908132502172748 23 3.7342915110868402 24 3.7759581777535072 25 3.8159581777535072 26 3.8544197162150451 27 3.8914567532520818 28 3.9271710389663679 29 3.9616537975870578 30 3.9949871309203910 31 4.0272451954365200 32 4.0584951954365200 33 4.0887982257395503 34 4.1182099904454326 35 4.1467814190168610 36 4.1745591967946387 37 4.2015862238216659 38 4.2279020132953500 39 4.2535430389363764 40 4.2785430389363759 hermite_poly_phys_values_test(): hermite_poly_phys_values() stores values of the Hermite physicist polynomials. N X FX 0 5.000000 1 1 5.000000 10 2 5.000000 98 3 5.000000 940 4 5.000000 8812 5 5.000000 80600 6 5.000000 717880 7 5.000000 6211600 8 5.000000 52065680 9 5.000000 421271200 10 5.000000 3275529760 11 5.000000 24329873600 12 5.000000 171237081280 5 0.000000 0 5 0.500000 41 5 1.000000 -8 5 3.000000 3816 5 10.000000 3041200 hyper_2f1_values_test(): hyper_2f1_values() stores values of the hypergeometric function 2f1 A B C X F -2 3 6.700000 0.250000 0.7235612934899779 0 1 6.700000 0.250000 0.9791110934527796 0 1 6.700000 0.250000 1.021657814008856 2 3 6.700000 0.250000 1.405156320011213 -2 3 6.700000 0.550000 0.4696143163982161 0 1 6.700000 0.550000 0.9529619497744632 0 1 6.700000 0.550000 1.051281421394799 2 3 6.700000 0.550000 2.399906290477786 -2 3 6.700000 0.850000 0.2910609592841472 0 1 6.700000 0.850000 0.9253696791037318 0 1 6.700000 0.850000 1.0865504094807 2 3 6.700000 0.850000 5.738156552618904 3 6 -5.500000 0.250000 15090.66974870461 1 6 -0.500000 0.250000 -104.3117006736435 1 6 0.500000 0.250000 21.17505070776881 3 6 4.500000 0.250000 4.194691581903192 3 6 -5.500000 0.550000 10170777974.04881 1 6 -0.500000 0.550000 -24708.63532248916 1 6 0.500000 0.550000 1372.230454838499 3 6 4.500000 0.550000 58.09272870639465 3 6 -5.500000 0.850000 5.868208761512417e+18 1 6 -0.500000 0.850000 -446350101.47296 1 6 0.500000 0.850000 5383505.756129573 3 6 4.500000 0.850000 20396.91377601966 i4_factorial2_values_test(): i4_factorial2_values() returns values of the double factorial function. N N!! 0 1 1 1 2 2 3 3 4 8 5 15 6 48 7 105 8 384 9 945 10 3840 11 10395 12 46080 13 135135 14 645120 15 2027025 i4mat_print_test(): i4mat_print() prints an I4MAT. A 5 x 6 integer matrix: Col: 0 1 2 3 4 5 Row 0: 11 12 13 14 15 16 1: 21 22 23 24 25 26 2: 31 32 33 34 35 36 3: 41 42 43 44 45 46 4: 51 52 53 54 55 56 i4mat_print_some_test(): i4mat_print_some() prints some of an I4MAT. Here is I4MAT, rows 0:2, cols 3:5: Col: 3 4 5 Row 0: 14 15 16 1: 24 25 26 2: 34 35 36 i4vec_print_test(): i4vec_print() prints an I4VEC. Here is an I4VEC: 0 91 1 92 2 93 3 94 jacobi_poly_values_test(): jacobi_poly_values() stores values of the Jacobi polynomials. N A B X F 0 0.000000 1.000000 0.500000 1 1 0.000000 1.000000 0.500000 0.25 2 0.000000 1.000000 0.500000 -0.375 3 0.000000 1.000000 0.500000 -0.484375 4 0.000000 1.000000 0.500000 -0.1328125 5 0.000000 1.000000 0.500000 0.275390625 5 1.000000 1.000000 0.500000 -0.1640625 5 2.000000 1.000000 0.500000 -1.1748046875 5 3.000000 1.000000 0.500000 -2.361328125 5 4.000000 1.000000 0.500000 -2.6162109375 5 5.000000 1.000000 0.500000 0.1171875 5 0.000000 2.000000 0.500000 0.421875 5 0.000000 3.000000 0.500000 0.5048828125 5 0.000000 4.000000 0.500000 0.509765625 5 0.000000 5.000000 0.500000 0.4306640625 5 0.000000 1.000000 -1.000000 -6 5 0.000000 1.000000 -0.800000 0.03862 5 0.000000 1.000000 -0.600000 0.81184 5 0.000000 1.000000 -0.400000 0.03666 5 0.000000 1.000000 -0.200000 -0.48512 5 0.000000 1.000000 0.000000 -0.3125 5 0.000000 1.000000 0.200000 0.18912 5 0.000000 1.000000 0.400000 0.40234 5 0.000000 1.000000 0.600000 0.01216 5 0.000000 1.000000 0.800000 -0.43962 5 0.000000 1.000000 1.000000 1 laguerre_polynomial_values_test(): laguerre_polynomial_values() stores values of the Laguerre polynomials. N X L(N)(X) 0 1.000000 1.0000000000000000 1 1.000000 0.0000000000000000 2 1.000000 -0.5000000000000000 3 1.000000 -0.6666666666666667 4 1.000000 -0.6250000000000000 5 1.000000 -0.4666666666666667 6 1.000000 -0.2569444444444444 7 1.000000 -0.0404761904761905 8 1.000000 0.1539930555555556 9 1.000000 0.3097442680776014 10 1.000000 0.4189459325396825 11 1.000000 0.4801341790925124 12 1.000000 0.4962122235082305 5 0.500000 -0.4455729166666667 5 3.000000 0.8500000000000000 5 5.000000 -3.1666666666666670 5 10.000000 34.3333333333333286 legendre_associated_values_test(): legendre_associated_values() stores values of the associated Legendre function. N M X F 1 0 0.000000 0 2 0 0.000000 -0.5 3 0 0.000000 0 4 0 0.000000 0.375 5 0 0.000000 0 1 1 0.500000 -0.8660254037844386 2 1 0.500000 -1.299038105676658 3 1 0.500000 -0.3247595264191645 4 1 0.500000 1.353164693413185 3 0 0.200000 -0.28 3 1 0.200000 1.175755076535925 3 2 0.200000 2.88 3 3 0.200000 -14.10906091843111 4 2 0.250000 -3.955078125 5 2 0.250000 -9.99755859375 6 3 0.250000 82.65311444100485 7 3 0.250000 20.24442836815152 8 4 0.250000 -423.7997531890869 9 4 0.250000 1638.320624828339 10 5 0.250000 -20256.87389227225 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_normalized_sphere_values_test(): legendre_associated_normalized_sphere_values() stores values of the associated Legendre function normalized for the surface of a sphere. N M X F 0 0 0.500000 0.2820947917738781 1 0 0.500000 0.24430125595146 1 1 0.500000 -0.2992067103010745 2 0 0.500000 -0.07884789131313 2 1 0.500000 -0.3345232717786446 2 2 0.500000 0.2897056515173922 3 0 0.500000 -0.326529291016351 3 1 0.500000 -0.06997056236064664 3 2 0.500000 0.3832445536624809 3 3 0.500000 -0.2709948227475519 4 0 0.500000 -0.24462907724141 4 1 0.500000 0.2560660384200185 4 2 0.500000 0.1881693403754876 4 3 0.500000 -0.4064922341213279 4 4 0.500000 0.2489246395003027 5 0 0.500000 0.0840580442633982 5 1 0.500000 0.3293793022891428 5 2 0.500000 -0.1588847984307093 5 3 0.500000 -0.2808712959945307 5 4 0.500000 0.4127948151484925 5 5 0.500000 -0.2260970318780046 legendre_function_q_values_test(): legendre_function_q_values() stores values of the Legendre Q function N X F 0 0.250000 0.2554128118829953 1 0.250000 -0.9361467970292512 2 0.250000 -0.4787614548274669 3 0.250000 0.4246139251747229 4 0.250000 0.5448396833845414 5 0.250000 -0.0945132826167347 6 0.250000 -0.4973516573531213 7 0.250000 -0.1499018843853194 8 0.250000 0.3649161918783626 9 0.250000 0.3055676545072885 10 0.250000 -0.1832799367995643 3 0.000000 0.6666666666666667 3 0.100000 0.626867202876333 3 0.200000 0.5099015515315237 3 0.300000 0.3232754180589764 3 0.400000 0.08026113738148187 3 0.500000 -0.1986547714794823 3 0.600000 -0.4828663183349136 3 0.700000 -0.7252886849144387 3 0.800000 -0.8454443502398846 3 0.900000 -0.6627096245052618 legendre_poly_values_test(): legendre_poly_values() stores values of the Legendre polynomials. N X F 0 0.250000 1 1 0.250000 0.25 2 0.250000 -0.40625 3 0.250000 -0.3359375 4 0.250000 0.15771484375 5 0.250000 0.3397216796875 6 0.250000 0.0242767333984375 7 0.250000 -0.2799186706542969 8 0.250000 -0.1524540185928345 9 0.250000 0.1768244206905365 10 0.250000 0.2212002165615559 3 0.000000 0 3 0.100000 -0.1475 3 0.200000 -0.28 3 0.300000 -0.3825 3 0.400000 -0.44 3 0.500000 -0.4375 3 0.600000 -0.36 3 0.700000 -0.1925 3 0.800000 0.08 3 0.900000 0.4725 3 1.000000 1 lerch_values_test(): lerch_values() stores values of the Lerch function. Z S A F 1.000000 2 0.000000 1.6449340668482260 1.000000 3 0.000000 1.2020569031595940 1.000000 10 0.000000 1.0009945751278180 0.500000 2 1.000000 1.1644810529300249 0.500000 3 1.000000 1.0744263872160800 0.500000 10 1.000000 1.0004926412120141 0.333333 2 2.000000 0.2959190697935714 0.333333 3 2.000000 0.1394507503935608 0.333333 10 2.000000 0.0009823175058446 0.100000 2 3.000000 0.1177910993911311 0.100000 3 3.000000 0.0386844792229896 0.100000 10 3.000000 0.0000170314961419 mertens_values_test(): mertens_values() stores values of the Mertens function. N MERTENS(N) 1 1 2 0 3 -1 4 -1 5 -2 6 -1 7 -2 8 -2 9 -2 10 -1 11 -2 12 -2 100 1 1000 2 10000 -23 moebius_values_test(): moebius_values() stores values of the MOEBIUS function. N MOEBIUS(N) 1 1 2 -1 3 -1 4 0 5 -1 6 1 7 -1 8 0 9 0 10 1 11 -1 12 0 13 -1 14 1 15 1 16 0 17 -1 18 0 19 -1 20 0 normal_01_cdf_inverse_test(): normal_01_cdf_inverse() inverts the error function. FX X normal_01_cdf_inverse(FX) 0.5 0 0 0.539828 0.1 0.09999999999999999 0.57926 0.2 0.1999999999999999 0.617911 0.3 0.2999999999999998 0.655422 0.4 0.4 0.691462 0.5 0.4999999999999998 0.725747 0.6 0.6000000000000016 0.758036 0.7 0.6999999999999998 0.788145 0.8 0.7999999999999998 0.81594 0.9 0.9 0.841345 1 1 0.933193 1.5 1.5 0.97725 2 2 0.99379 2.5 2.500000000000004 0.99865 3 2.999999999999997 0.999767 3.5 3.499999999999983 0.999968 4 4 normal_01_cdf_values_test(): normal_01_cdf_values() stores values of the unit normal CDF. X normal_01_cdf(X) 0.000000 0.5000000000000000 0.100000 0.5398278372770290 0.200000 0.5792597094391030 0.300000 0.6179114221889526 0.400000 0.6554217416103242 0.500000 0.6914624612740131 0.600000 0.7257468822499270 0.700000 0.7580363477769270 0.800000 0.7881446014166033 0.900000 0.8159398746532405 1.000000 0.8413447460685429 1.500000 0.9331927987311419 2.000000 0.9772498680518208 2.500000 0.9937903346742240 3.000000 0.9986501019683699 3.500000 0.9997673709209645 4.000000 0.9999683287581669 omega_values_test(): omega_values() stores values of the OMEGA function. N OMEGA(N) 1 0 2 1 3 1 4 1 5 1 6 2 7 1 8 1 9 1 10 2 30 3 101 1 210 4 1320 4 1764 3 2003 1 2310 5 2827 2 8717 2 12553 1 30030 6 510510 7 9699690 8 partition_distinct_count_values_test(): partition_distinct_count_values() returns values of the integer partition count function for distinct parts N P(N) 0 1 1 1 2 1 3 2 4 2 5 3 6 4 7 5 8 6 9 8 10 10 11 12 12 15 13 18 14 22 15 27 16 32 17 38 18 46 19 54 20 64 phi_values_test(): phi_values() stores values of the PHI function. N PHI(N) 1 1 2 1 3 2 4 2 5 4 6 2 7 6 8 4 9 6 10 4 20 8 30 8 40 16 50 20 60 16 100 40 149 148 500 200 750 200 999 648 psi_values_test(): psi_values() stores values of the PSI function. X PSI(X) 0.100000 -10.4237549404110794 0.200000 -5.2890398965921879 0.300000 -3.5025242222001332 0.400000 -2.5613845445851160 0.500000 -1.9635100260214231 0.600000 -1.5406192138931900 0.700000 -1.2200235536979349 0.800000 -0.9650085667061385 0.900000 -0.7549269499470515 1.000000 -0.5772156649015329 1.100000 -0.4237549404110768 1.200000 -0.2890398965921883 1.300000 -0.1691908888667997 1.400000 -0.0613845445851161 1.500000 0.0364899739785765 1.600000 0.1260474527734763 1.700000 0.2085478748734940 1.800000 0.2849914332938615 1.900000 0.3561841611640597 2.000000 0.4227843350984671 r8_factorial_values_test(): r8_factorial_values() returns values of the real factorial function. N r8_factorial(N) 0 1 1 1 2 2 3 6 4 24 5 120 6 720 7 5040 8 40320 9 362880 10 3.6288e+06 11 3.99168e+07 12 4.79002e+08 13 6.22702e+09 14 8.71783e+10 15 1.30767e+12 16 2.09228e+13 17 3.55687e+14 18 6.40237e+15 19 1.21645e+17 20 2.4329e+18 25 1.55112e+25 50 3.04141e+64 100 9.33262e+157 150 5.71338e+262 r8_factorial_log_values_test(): r8_factorial_log_values() returns values of the log factorial function. N r8_factorial_log(N) 0 0 1 0 2 0.693147 3 1.79176 4 3.17805 5 4.78749 6 6.57925 7 8.52516 8 10.6046 9 12.8018 10 15.1044 11 17.5023 12 19.9872 13 22.5522 14 25.1912 15 27.8993 16 30.6719 17 33.5051 18 36.3954 19 39.3399 20 42.3356 25 58.0036 50 148.478 100 363.739 150 605.02 500 2611.33 1000 5912.13 r8_mop_test(): r8_mop evaluates (-1.0)^I4 as an R8. I4 r8_mop(I4) 33 -1.0 48 1.0 79 -1.0 -58 1.0 -94 1.0 0 1.0 -51 -1.0 -72 1.0 29 -1.0 59 -1.0 r8_nint_test(): r8_nint() produces the nearest integer. X r8_nint(X) 7.591685 8 -7.436172 -8 5.016922 6 1.749331 2 5.183016 6 -3.507766 -4 -4.545888 -5 4.626339 5 6.754244 7 -0.491316 -1 r8poly_degree_test(): r8poly_degree() determines the degree of an R8POLY. The R8POLY: p(x) = 4 * x^3 + 3 * x^2 + 2 * x + 1 Dimensioned degree = 3, Actual degree = 3 The R8POLY: p(x) = 0 * x^3 + 3 * x^2 + 2 * x + 1 Dimensioned degree = 3, Actual degree = 2 The R8POLY: p(x) = 4 * x^3 + 2 * x + 1 Dimensioned degree = 3, Actual degree = 3 The R8POLY: p(x) = 0 * x^3 + 1 Dimensioned degree = 3, Actual degree = 0 The R8POLY: p(x) = 0 * x^3 Dimensioned degree = 3, Actual degree = 0 r8poly_print_test(): r8poly_print() prints an R8POLY. The R8POLY: p(x) = 9 * x^5 + 0.78 * x^4 + 56 * x^2 - 3.4 * x + 12 r8poly_value_horner_test(): r8poly_value_horner() evaluates a polynomial at a point using Horner's method. The polynomial coefficients: p(x) = 1 * x^4 - 10 * x^3 + 35 * x^2 - 50 * x + 24 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_values_test(): sigma_values() stores values of the SIGMA function. N SIGMA(N) 1 1 2 3 3 4 4 7 5 6 6 12 7 8 8 15 9 13 10 18 30 72 127 128 128 255 129 176 210 576 360 1170 617 618 815 984 816 2232 1000 2340 sin_power_int_values_test(): sin_power_int_values() stores values of the cosine power integral. A B N F 10.000000 20.000000 0 10 0.000000 1.000000 1 0.4596976941318603 0.000000 1.000000 2 0.2726756432935796 0.000000 1.000000 3 0.1789405625488581 0.000000 1.000000 4 0.1240255653152068 0.000000 1.000000 5 0.08897439645157594 0.000000 2.000000 5 0.9039312384814995 1.000000 2.000000 5 0.8149568420299235 0.000000 1.000000 10 0.02188752242172985 0.000000 1.000000 11 0.01702343937406933 spherical_harmonic_values_test(): spherical_harmonic_values() stores values of the spherical_harmonic function. L M THETA PHI YR YI 0 0 0.523599 1.047198 0.2820947917738781 0.0000000000000000 1 0 0.523599 1.047198 0.4231421876608172 0.0000000000000000 2 1 0.523599 1.047198 -0.1672616358893223 -0.2897056515173922 3 2 0.523599 1.047198 -0.1106331731112457 0.1916222768312404 4 3 0.523599 1.047198 0.1354974113737760 0.0000000000000000 5 5 0.261799 0.628319 0.0005390423109044 0.0000000000000000 5 4 0.261799 0.628319 -0.0051466904429519 0.0037392894852833 5 3 0.261799 0.628319 0.0137100436134949 -0.0421951755232080 5 2 0.261799 0.628319 0.0609635202226554 0.1876264225575173 5 1 0.261799 0.628319 -0.4170400640977983 -0.3029973424491321 4 2 0.628319 0.785398 0.0000000000000000 0.4139385503112256 4 2 1.884956 0.785398 0.0000000000000000 -0.1003229830187463 4 2 3.141593 0.785398 0.0000000000000000 0.0000000000000000 4 2 4.398230 0.785398 0.0000000000000000 -0.1003229830187463 4 2 5.654867 0.785398 0.0000000000000000 0.4139385503112256 3 -1 0.392699 0.448799 0.3641205966137958 -0.1753512375142586 3 -1 0.392699 0.897598 0.2519792711195075 -0.3159720118970196 3 -1 0.392699 1.346397 0.0899303606570430 -0.3940106541811563 3 -1 0.392699 1.795196 -0.0899303606570430 -0.3940106541811563 3 -1 0.392699 2.243995 -0.2519792711195075 -0.3159720118970196 agud_test(): agud() evaluates the inverse Gudermannian function. 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 polyomial 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.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 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 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() computes Bernoulli polynomials; X = 0.2 I B(I,X) 1 -0.3 2 0.00666667 3 0.048 4 -0.00773333 5 -0.02368 6 0.00691352 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 bernoulli_poly2_test(): bernoulli_poly2() computes Bernoulli polynomials; X = 0.2 I B(I,X) 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() computes 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() computes Bernstein polynomials; The Bernstein polynomials of degree 10 based on the interval [0.000000,1.000000] evaluated at X = 0.3 I Bern(I,X) 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 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 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 polyomial 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.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 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.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 -0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 -0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 -0.00 0.00 1.00 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.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 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 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 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 chebyshev_discrete_test(): cheby_discrete evaluates the discrete Chebyshev polynomial. 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 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 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 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.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; I Exact Euler 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; I Exact Euler 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() computes Euler polynomials; X = 0.5 N X F(X) 1 0.500000 2.77556e-17 2 0.500000 -0.25 3 0.500000 -1.45953e-06 4 0.500000 0.312497 5 0.500000 -3.32929e-06 6 0.500000 -0.953128 7 0.500000 -1.73264e-06 8 0.500000 5.41016 9 0.500000 -1.02449e-06 10 0.500000 -49.3369 11 0.500000 6.47439e-07 12 0.500000 659.855 13 0.500000 5.22754e-06 14 0.500000 -12168 15 0.500000 0.000218677 eulerian_test(): eulerian() computes 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() computes a Fibonacci number directly; I F(I) 0 0 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 N. N Fibonacci Index 0 0 0 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 Fibonacci numbers recursively; The Fibonacci numbers: 0 0 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.5 0.2 1 1 1 0.5 0.2 0.2 0.2 2 0.5 0.2 -0.44 -0.1 3 0.5 0.2 -0.28 0.0666667 4 0.5 0.2 0.232 -0.05 5 0.5 0.2 0.30752 0.04 6 0.5 0.2 -0.080576 -0.0333333 7 0.5 0.2 -0.293517 0.0285714 8 0.5 0.2 -0.0395648 -0.025 9 0.5 0.2 0.245971 0.0222222 10 0.5 0.2 0.129072 -0.02 2 0 0.4 0 0 2 1 0.4 -0.36 -0.8 2 2 0.4 -0.08 -3.2 2 3 0.4 0.84 -7.2 2 4 0.4 2.4 -12.8 2 5 0.4 4.6 -20 2 6 0.4 7.44 -28.8 2 7 0.4 10.92 -39.2 2 8 0.4 15.04 -51.2 2 9 0.4 19.8 -64.8 2 10 0.4 25.2 -80 5 3 -0.5 -9 -75.6 5 3 -0.4 -0.16128 -60.48 5 3 -0.3 -6.67296 -45.36 5 3 -0.2 -8.37504 -30.24 5 3 -0.1 -5.52672 -15.12 5 3 0 0 0 5 3 0.1 5.52672 15.12 5 3 0.2 8.37504 30.24 5 3 0.3 6.67296 45.36 5 3 0.4 0.16128 60.48 5 3 0.5 -9 75.6 5 3 0.6 -15.4253 90.72 5 3 0.7 -9.69696 105.84 5 3 0.8 22.441 120.96 5 3 0.9 100.889 136.08 5 3 1 252 151.2 gen_hermite_poly_test(): gen_hermite_poly() evaluates the generalized Hermite polynomial. Table of H(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 H(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 H(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 H(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 H(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 H(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 polynomial. 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 0.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.000000 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 0.000000 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.000000 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 0.000000 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 0.000000 gud_test(): gud() evaluates the Gudermannian function. X Exact F GUD(X) -2.000000 -1.3017603360460150 -1.3017603360460150 0 -1.000000 -0.8657694832396586 -0.8657694832396586 0 0.000000 0.0000000000000000 0.0000000000000000 0 0.100000 0.0998337487934866 0.0998337487934866 1.388e-17 0.200000 0.1986798470079397 0.1986798470079397 2.776e-17 0.500000 0.4803810791337294 0.4803810791337295 5.551e-17 1.000000 0.8657694832396586 0.8657694832396586 0 1.500000 1.1317283452505089 1.1317283452505091 2.22e-16 2.000000 1.3017603360460150 1.3017603360460150 0 2.500000 1.4069935689361539 1.4069935689361537 2.22e-16 3.000000 1.4713043411171931 1.4713043411171929 2.22e-16 3.500000 1.5104199075457001 1.5104199075457003 2.22e-16 4.000000 1.5341691443347329 1.5341691443347332 2.22e-16 h_hofstadter_test(): h_hofstadter() evaluates Hofstadter's recursive G function. N G(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)) 0 0 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 a harmonic sequence number. N H(N) H(N) tabulate computed 1 1 1 2 1.5 1.5 3 1.833333333333333 1.833333333333333 4 2.083333333333333 2.083333333333333 5 2.283333333333333 2.283333333333333 6 2.45 2.45 7 2.592857142857143 2.592857142857143 8 2.717857142857143 2.717857142857143 9 2.828968253968254 2.828968253968254 10 2.928968253968254 2.928968253968254 11 3.019877344877345 3.019877344877345 12 3.103210678210678 3.103210678210678 13 3.180133755133755 3.180133755133755 14 3.251562326562327 3.251562326562327 15 3.318228993228993 3.318228993228994 16 3.380728993228993 3.380728993228994 17 3.439552522640758 3.439552522640758 18 3.495108078196313 3.495108078196314 19 3.547739657143682 3.547739657143682 20 3.597739657143682 3.597739657143682 21 3.64535870476273 3.645358704762729 22 3.690813250217275 3.690813250217275 23 3.73429151108684 3.73429151108684 24 3.775958177753507 3.775958177753507 25 3.815958177753507 3.815958177753507 26 3.854419716215045 3.854419716215045 27 3.891456753252082 3.891456753252082 28 3.927171038966368 3.927171038966368 29 3.961653797587058 3.961653797587057 30 3.994987130920391 3.994987130920391 31 4.02724519543652 4.02724519543652 32 4.05849519543652 4.05849519543652 33 4.08879822573955 4.08879822573955 34 4.118209990445433 4.118209990445433 35 4.146781419016861 4.146781419016861 36 4.174559196794639 4.174559196794639 37 4.201586223821666 4.201586223821666 38 4.22790201329535 4.22790201329535 39 4.253543038936376 4.253543038936376 40 4.278543038936376 4.278543038936376 harmonic_estimate_test(): harmonic_estimate() estimates a harmonic sequence number. N H(N) H(N) H(N) estimated tabulated computed 1 1.002215664901533 1 1 2 1.500050345461478 1.5 1.5 3 1.833338241635486 1.833333333333333 1.833333333333333 4 2.083334244771423 2.083333333333333 2.083333333333333 5 2.283333577335633 2.283333333333333 2.283333333333333 6 2.450000082689259 2.45 2.45 7 2.592857175889375 2.592857142857143 2.592857142857143 8 2.717857157753243 2.717857142857143 2.717857142857143 9 2.828968261340531 2.828968253968254 2.828968253968254 10 2.928968257895578 2.928968253968254 2.928968253968254 11 3.019877347098169 3.019877344877345 3.019877344877345 12 3.103210679530068 3.103210678210678 3.103210678210678 13 3.180133755950829 3.180133755133755 3.180133755133755 14 3.251562327086554 3.251562326562327 3.251562326562327 15 3.318228993575759 3.318228993228993 3.318228993228994 16 3.380728993464556 3.380728993228993 3.380728993228994 17 3.439552522804565 3.439552522640758 3.439552522640758 18 3.495108078312609 3.495108078196313 3.495108078196314 19 3.547739657227786 3.547739657143682 3.547739657143682 20 3.597739657205524 3.597739657143682 3.597739657143682 21 3.645358704808888 3.64535870476273 3.645358704762729 22 3.690813250252199 3.690813250217275 3.690813250217275 23 3.734291511113593 3.73429151108684 3.73429151108684 24 3.775958177774234 3.775958177753507 3.775958177753507 25 3.815958177769733 3.815958177753507 3.815958177753507 26 3.854419716227871 3.854419716215045 3.854419716215045 27 3.891456753262311 3.891456753252082 3.891456753252082 28 3.927171038974592 3.927171038966368 3.927171038966368 29 3.96165379759372 3.961653797587058 3.961653797587057 30 3.994987130925828 3.994987130920391 3.994987130920391 31 4.027245195440988 4.02724519543652 4.02724519543652 32 4.058495195440213 4.05849519543652 4.05849519543652 33 4.088798225742621 4.08879822573955 4.08879822573955 34 4.118209990447999 4.118209990445433 4.118209990445433 35 4.146781419019018 4.146781419016861 4.146781419016861 36 4.174559196796461 4.174559196794639 4.174559196794639 37 4.201586223823211 4.201586223821666 4.201586223821666 38 4.227902013296667 4.22790201329535 4.22790201329535 39 4.253543038937503 4.253543038936376 4.253543038936376 40 4.278543038937345 4.278543038936376 4.278543038936376 hermite_poly_phys_test(): hermite_poly_phys() computes the Hermite physicist polynomials; N X Exact F H(N)(X) 0 5.000000 1 1 1 5.000000 10 10 2 5.000000 98 98 3 5.000000 940 940 4 5.000000 8812 8812 5 5.000000 80600 80600 6 5.000000 717880 717880 7 5.000000 6.2116e+06 6.2116e+06 8 5.000000 5.20657e+07 5.20657e+07 9 5.000000 4.21271e+08 4.21271e+08 10 5.000000 3.27553e+09 3.27553e+09 11 5.000000 2.43299e+10 2.43299e+10 12 5.000000 1.71237e+11 1.71237e+11 5 0.000000 0 0 5 0.500000 41 41 5 1.000000 -8 -8 5 3.000000 3816 3816 5 10.000000 3.0412e+06 3.0412e+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_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_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 I4 is prime. I i4_is_prime(I) -2 False -1 False 0 False 1 False 2 True 3 True 4 False 5 True 6 False 7 True 8 False 9 False 10 False 11 True 12 False 13 True 14 False 15 False 16 False 17 True 18 False 19 True 20 False 21 False 22 False 23 True 24 False 25 False i4_is_triangular_test(): i4_is_triangular() reports whether an I4 is prime. I i4_is_triangular(I) 0 True 1 True 2 False 3 True 4 False 5 False 6 True 7 False 8 False 9 False 10 True 11 False 12 False 13 False 14 False 15 True 16 False 17 False 18 False 19 False 20 False 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 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 GPV JACOBI 0 0 1 0.5 1 1 1 0 1 0.5 0.25 0.25 2 0 1 0.5 -0.375 -0.375 3 0 1 0.5 -0.484375 -0.484375 4 0 1 0.5 -0.132812 -0.132812 5 0 1 0.5 0.275391 0.275391 5 1 1 0.5 -0.164062 -0.164062 5 2 1 0.5 -1.1748 -1.1748 5 3 1 0.5 -2.36133 -2.36133 5 4 1 0.5 -2.61621 -2.61621 5 5 1 0.5 0.117188 0.117188 5 0 2 0.5 0.421875 0.421875 5 0 3 0.5 0.504883 0.504883 5 0 4 0.5 0.509766 0.509766 5 0 5 0.5 0.430664 0.430664 5 0 1 -1 -6 -6 5 0 1 -0.8 0.03862 0.03862 5 0 1 -0.6 0.81184 0.81184 5 0 1 -0.4 0.03666 0.03666 5 0 1 -0.2 -0.48512 -0.48512 5 0 1 0 -0.3125 -0.3125 5 0 1 0.2 0.18912 0.18912 5 0 1 0.4 0.40234 0.40234 5 0 1 0.6 0.01216 0.01216 5 0 1 0.8 -0.43962 -0.43962 5 0 1 1 1 1 jacobi_symbol_test(): jacobi_symbol() computes the Jacobi symbol (Q/P) which records whether 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() computes 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 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.000000 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.000000 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.500000 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.500000 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.500000 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() computes Laguerre polynomials; 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 legendre_associated_test(): legendre_associated() evaluates the associated Legendre functions; N M X Exact F PNM(X) 1 0 0.000000 0.000000 0.000000 2 0 0.000000 -0.500000 -0.500000 3 0 0.000000 0.000000 -0.000000 4 0 0.000000 0.375000 0.375000 5 0 0.000000 0.000000 0.000000 1 1 0.500000 -0.866025 -0.866025 2 1 0.500000 -1.299038 -1.299038 3 1 0.500000 -0.324760 -0.324760 4 1 0.500000 1.353165 1.353165 3 0 0.200000 -0.280000 -0.280000 3 1 0.200000 1.175755 1.175755 3 2 0.200000 2.880000 2.880000 3 3 0.200000 -14.109061 -14.109061 4 2 0.250000 -3.955078 -3.955078 5 2 0.250000 -9.997559 -9.997559 6 3 0.250000 82.653114 82.653114 7 3 0.250000 20.244428 20.244428 8 4 0.250000 -423.799753 -423.799753 9 4 0.250000 1638.320625 1638.320625 10 5 0.250000 -20256.873892 -20256.873892 legendre_associated_normalized_test(): legendre_associated_normalized() evaluates the 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() computes Legendre QN functions N X Exact F Q(N)(X) 0 0.250000 0.255413 0.255413 1 0.250000 -0.936147 -0.936147 2 0.250000 -0.478761 0.468073 3 0.250000 0.424614 -0.312049 4 0.250000 0.544840 0.234037 5 0.250000 -0.094513 -0.187229 6 0.250000 -0.497352 0.156024 7 0.250000 -0.149902 -0.133735 8 0.250000 0.364916 0.117018 9 0.250000 0.305568 -0.104016 10 0.250000 -0.183280 0.093615 3 0.000000 0.666667 -0.333333 3 0.100000 0.626867 -0.329989 3 0.200000 0.509902 -0.319818 3 0.300000 0.323275 -0.302381 3 0.400000 0.080261 -0.276847 3 0.500000 -0.198655 -0.241782 3 0.600000 -0.482866 -0.194704 3 0.700000 -0.725289 -0.130963 3 0.800000 -0.845444 -0.040370 3 0.900000 -0.662710 0.108333 legendre_poly_test(): legendre_poly() computes Legendre polynomials; N X Exact F L(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 polynomial coefficients. L(0) 1.000000 L(1) 1.000000 * x 0.000000 L(2) 1.500000 * x^2 0.000000 * x -0.500000 L(3) 2.500000 * x^3 0.000000 * x^2 -1.500000 * x -0.000000 L(4) 4.375000 * x^4 0.000000 * x^3 -3.750000 * x^2 -0.000000 * x 0.375000 L(5) 7.875000 * x^5 0.000000 * x^4 -8.750000 * x^3 -0.000000 * x^2 1.875000 * x 0.000000 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 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 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 omega_test(): omega() counts the distinct prime divisors of an integer N. N Exact OMEGA(N) 1 0 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. N pentagon_num(N) 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.3429448190325175 4 1.0857362047581294 20 6.676164013906681 8 0.8345205017383351 30 8.820423113856181 10 0.8820423113856182 40 10.843401227272672 12 0.9036167689393894 50 12.781110931766573 15 0.8520740621177716 60 14.654360200558338 17 0.8620211882681376 70 16.47642188866708 19 0.8671800994035305 80 18.256392913493496 22 0.8298360415224316 90 20.000845945422935 24 0.8333685810592889 100 21.71472409516259 25 0.8685889638065036 1000 144.76482730108395 168 0.8616954006016903 10000 1085.7362047581294 1229 0.88343059785039 100000 8685.889638065037 9592 0.9055347829509004 1000000 72382.41365054197 78498 0.9220924565026112 10000000 620420.6884332169 664579 0.9335544584364189 100000000 5428681.023790647 5761455 0.9422413303220536 1000000000 48254942.433694646 50847534 0.9490124424459728 plane_partition_num_test(): plane_partition_num() computes 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 BETA(X,Y) r8_beta(X,Y) 0.2 1 5 5 0.4 1 2.5 2.5 0.6 1 1.666666666666667 1.666666666666667 0.8 1 1.25 1.25 1 0.2 5 5 1 0.4 2.5 2.5 1 1 1 1 2 2 0.1666666666666667 0.1666666666666667 3 3 0.03333333333333333 0.03333333333333333 4 4 0.007142857142857143 0.007142857142857143 5 5 0.001587301587301587 0.001587301587301587 6 2 0.02380952380952381 0.02380952380952381 6 3 0.005952380952380952 0.005952380952380952 6 4 0.001984126984126984 0.001984126984126984 6 5 0.0007936507936507937 0.0007936507936507937 6 6 0.0003607503607503608 0.0003607503607503608 7 7 8.325008325008325e-05 8.325008325008325e-05 r8_choose_test(): r8_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 5 0 1 5 1 5 5 2 10 5 3 10 5 4 5 5 5 1 r8_erf_test(): r8_erf() evaluates the error function. X ERF(X) r8_erf(X) 0 0 0 0.1 0.1124629160182849 0.1124629160182849 0.2 0.2227025892104785 0.2227025892104785 0.3 0.3286267594591274 0.3286267594591273 0.4 0.4283923550466685 0.4283923550466684 0.5 0.5204998778130465 0.5204998778130465 0.6 0.6038560908479259 0.6038560908479259 0.7 0.6778011938374185 0.6778011938374184 0.8 0.7421009647076605 0.7421009647076605 0.9 0.7969082124228321 0.7969082124228322 1 0.8427007929497149 0.8427007929497148 1.1 0.8802050695740817 0.8802050695740817 1.2 0.9103139782296354 0.9103139782296354 1.3 0.9340079449406524 0.9340079449406524 1.4 0.9522851197626488 0.9522851197626487 1.5 0.9661051464753106 0.9661051464753108 1.6 0.976348383344644 0.976348383344644 1.7 0.9837904585907746 0.9837904585907746 1.8 0.9890905016357306 0.9890905016357308 1.9 0.9927904292352575 0.9927904292352574 2 0.9953222650189527 0.9953222650189527 r8_erf_inverse_test(): r8_erf_inverse inverts the error function. FX X r8_erf_inverse(FX) 0 0 0 0.112463 0.1 0.09999999999999995 0.222703 0.2 0.2000000000000001 0.328627 0.3 0.2999999999999999 0.428392 0.4 0.4000000000000002 0.5205 0.5 0.5 0.603856 0.6 0.6 0.677801 0.7 0.7000000000000002 0.742101 0.8 0.8 0.796908 0.9 0.8999999999999996 0.842701 1 1 0.880205 1.1 1.1 0.910314 1.2 1.2 0.934008 1.3 1.3 0.952285 1.4 1.400000000000001 0.966105 1.5 1.5 0.976348 1.6 1.6 0.98379 1.7 1.700000000000001 0.989091 1.8 1.800000000000001 0.99279 1.9 1.899999999999997 0.995322 2 2.000000000000004 r8_factorial_test(): r8_factorial() evaluates the factorial function. N Exact Computed 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 13 6227020800 6227020800 14 87178291200 87178291200 15 1307674368000 1307674368000 16 20922789888000 20922789888000 17 355687428096000 355687428096000 18 6402373705728000 6402373705728000 19 1.21645100408832e+17 1.21645100408832e+17 20 2.43290200817664e+18 2.43290200817664e+18 25 1.551121004333099e+25 1.551121004333099e+25 50 3.041409320171338e+64 3.041409320171338e+64 100 9.332621544394415e+157 9.33262154439441e+157 150 5.713383956445855e+262 5.71338395644585e+262 r8_factorial_log_test(): r8_factorial_log() evaluates the factorial log function. N Exact Computed 0 0 0 1 0 0 2 0.6931471805599453 0.6931471805599453 3 1.791759469228055 1.791759469228055 4 3.178053830347946 3.178053830347946 5 4.787491742782046 4.787491742782046 6 6.579251212010101 6.579251212010101 7 8.525161361065415 8.525161361065415 8 10.60460290274525 10.60460290274525 9 12.80182748008147 12.80182748008147 10 15.10441257307552 15.10441257307552 11 17.50230784587389 17.50230784587389 12 19.98721449566189 19.98721449566188 13 22.55216385312342 22.55216385312342 14 25.19122118273868 25.19122118273868 15 27.89927138384089 27.89927138384089 16 30.67186010608067 30.67186010608068 17 33.50507345013689 33.50507345013689 18 36.39544520803305 36.39544520803305 19 39.33988418719949 39.33988418719949 20 42.33561646075349 42.33561646075349 25 58.00360522298052 58.00360522298052 50 148.477766951773 148.477766951773 100 363.7393755555635 363.7393755555635 150 605.0201058494237 605.0201058494238 500 2611.330458460156 2611.330458460156 1000 5912.128178488163 5912.128178488164 r8_hyper_2f1_test(): r8_hyper_2f1() evaluates the hypergeometric 2f1 function. A B C X 2f1 2f1 DIFF (tabulated) (computed) -2.5 3.3 6.7 0.25 0.723561 0.723561 2.22045e-16 -0.5 1.1 6.7 0.25 0.979111 0.979111 1.11022e-16 0.5 1.1 6.7 0.25 1.02166 1.02166 0 2.5 3.3 6.7 0.25 1.40516 1.40516 4.44089e-16 -2.5 3.3 6.7 0.55 0.469614 0.469614 5.55112e-17 -0.5 1.1 6.7 0.55 0.952962 0.952962 3.33067e-16 0.5 1.1 6.7 0.55 1.05128 1.05128 8.88178e-16 2.5 3.3 6.7 0.55 2.39991 2.39991 1.77636e-15 -2.5 3.3 6.7 0.85 0.291061 0.291061 2.77556e-16 -0.5 1.1 6.7 0.85 0.92537 0.92537 0 0.5 1.1 6.7 0.85 1.08655 1.08655 2.22045e-16 2.5 3.3 6.7 0.85 5.73816 5.73816 1.98064e-13 3.3 6.7 -5.5 0.25 15090.7 15090.7 1.09139e-11 1.1 6.7 -0.5 0.25 -104.312 -104.312 2.84217e-14 1.1 6.7 0.5 0.25 21.1751 21.1751 1.06581e-14 3.3 6.7 4.5 0.25 4.19469 4.19469 8.88178e-16 3.3 6.7 -5.5 0.55 1.01708e+10 1.01708e+10 1.14441e-05 1.1 6.7 -0.5 0.55 -24708.6 -24708.6 1.81899e-11 1.1 6.7 0.5 0.55 1372.23 1372.23 2.27374e-12 3.3 6.7 4.5 0.55 58.0927 58.0927 2.84217e-14 3.3 6.7 -5.5 0.85 5.86821e+18 5.86821e+18 16384 1.1 6.7 -0.5 0.85 -4.4635e+08 -4.4635e+08 1.78814e-07 1.1 6.7 0.5 0.85 5.38351e+06 5.38351e+06 2.79397e-09 3.3 6.7 4.5 0.85 20396.9 20396.9 2.54659e-11 r8_psi_test(): r8_psi() evaluates the Psi() function. X PSI(X) r8_psi(X) 0.1 -10.42375494041108 -10.42375494041108 0.2 -5.289039896592188 -5.289039896592188 0.3 -3.502524222200133 -3.502524222200133 0.4 -2.561384544585116 -2.561384544585116 0.5 -1.963510026021423 -1.963510026021424 0.6 -1.54061921389319 -1.540619213893191 0.7 -1.220023553697935 -1.220023553697935 0.8 -0.9650085667061385 -0.9650085667061382 0.9 -0.7549269499470515 -0.7549269499470511 1 -0.5772156649015329 -0.5772156649015329 1.1 -0.4237549404110768 -0.4237549404110768 1.2 -0.2890398965921883 -0.2890398965921884 1.3 -0.1691908888667997 -0.1691908888667995 1.4 -0.06138454458511615 -0.06138454458511624 1.5 0.03648997397857652 0.03648997397857652 1.6 0.1260474527734763 0.1260474527734763 1.7 0.208547874873494 0.208547874873494 1.8 0.2849914332938615 0.2849914332938615 1.9 0.3561841611640597 0.3561841611640596 2 0.4227843350984671 0.4227843350984672 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 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. SLICES 1 2 3 4 5 6 7 8 DIM 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 n!. Graphics saved as "stirling_estimate.png" stirling1_table_test(): stirling1_table() tabulates Stirling numbers of the first kind. Table of stirling1 numbers: Col: 0 1 2 3 4 5 6 7 Row 0: 1 0 0 0 0 0 0 0 1: -1 1 0 0 0 0 0 0 2: 2 -3 1 0 0 0 0 0 3: -6 11 -6 1 0 0 0 0 4: 24 -50 35 -10 1 0 0 0 5: -120 274 -225 85 -15 1 0 0 6: 720 -1764 1624 -735 175 -21 1 0 7: -5040 13068 -13132 6769 -1960 322 -28 1 stirling2_number_test(): stirling2_number() calculates a Stirling number S2(n,k) of the second kind. 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 3 1 0 0 0 0 0 0 1 7 6 1 0 0 0 0 0 1 15 25 10 1 0 0 0 0 1 31 90 65 15 1 0 0 0 1 63 301 350 140 21 1 0 0 1 127 966 1701 1050 266 28 1 stirling2_table_test(): stirling2_table() tabulates Stirling numbers of the second kind. Table of Stirling2 numbers: Col: 0 1 2 3 4 5 6 7 Row 0: 1 0 0 0 0 0 0 0 1: 1 1 0 0 0 0 0 0 2: 1 3 1 0 0 0 0 0 3: 1 7 6 1 0 0 0 0 4: 1 15 25 10 1 0 0 0 5: 1 31 90 65 15 1 0 0 6: 1 63 301 350 140 21 1 0 7: 1 127 966 1701 1050 266 28 1 tau_test(): tau() computes the TAU function. N Exact TAU(N) 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 tetrahedral 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 1 1 1 2 1 2 2 2 3 3 1 4 3 2 5 3 3 6 4 1 7 4 2 8 4 3 9 4 4 10 triangle_upper_to_i4_test(): triangle_upper_to_i4() converts an upper triangular index to a linear one. ( I, J ) ==> K 1 1 1 2 1 2 2 2 3 3 1 3 3 2 4 3 3 6 4 1 4 4 2 5 4 3 7 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 Tribonacci numbers recursively; The Tribonacci numbers: 0 1 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.8392867552141612 , p(alpha) = 2.220446049250313e-16 beta = (-0.4196433776070806+0.6062907292071995j) , p(beta) = (4.440892098500626e-16+0j) gamma = (-0.4196433776070806-0.6062907292071995j) , p(gamma) = (4.440892098500626e-16+0j) 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. Compute the sequence 3 times. 0: 1 1 1 1: 1 1 1 2: 0 0 0 3: 1 1 -1 4: 1 -1 -1 5: 0 0 0 6: -1 -1 -1 7: 1 1 -1 8: 2 -2 0 9: 3 3 1 10: 1 -5 -1 11: 4 2 2 12: -5 7 3 13: 9 9 1 14: -14 16 4 15: -5 -25 -3 16: 19 41 7 17: -14 -66 10 18: -5 -25 17 19: -19 -91 7 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: p(x) = 0 * x^5 Zernike polynomial: p(x) = 10 * x^5 - 12 * x^3 + 3 * x Zernike polynomial: p(x) = 0 * x^5 Zernike polynomial: p(x) = 5 * x^5 - 4 * x^3 Zernike polynomial: p(x) = 0 * x^5 Zernike polynomial: p(x) = 1 * x^5 zeta_m1_test(): zeta_m1() evaluates the Riemann Zeta function minus 1. Relative accuracy requested is TOL = 1e-10 P zeta_M1(P) zeta_M1(P) tabulated computed 2 6.4493406684822641e-01 6.4493406682176657e-01 2.5 3.4148725730000001e-01 3.4148725723309625e-01 3 2.0205690315959429e-01 2.0205690314033142e-01 3.5 1.2673386730000000e-01 1.2673386730311337e-01 4 8.2323233711138186e-02 8.2323233700504289e-02 5 3.6927755143369927e-02 3.6927755139800719e-02 6 1.7343061984449140e-02 1.7343061981036332e-02 7 8.3492773819228271e-03 8.3492773801574424e-03 8 4.0773561979443396e-03 4.0773561976435498e-03 9 2.0083929260822143e-03 2.0083928260336546e-03 10 9.9457512781808526e-04 9.9457512781058409e-04 11 4.9418860411946453e-04 4.9418860411834780e-04 12 2.4608655330804832e-04 2.4608655330788710e-04 16 1.5282259408651871e-05 1.5282259408651813e-05 20 9.5396203387280002e-07 9.5396203387279621e-07 30 9.3132743242000005e-11 9.3132743241966817e-10 40 9.0949477999999997e-13 9.0949478402638904e-13 zeta_naive_test(): zeta() evaluates the Riemann Zeta function using a naive approach. N ZETA(N) zeta_naive(N) tabulate computed 2 1.644934066848226 1.644834071848065 3 1.202056903159594 1.202056898160098 4 1.082323233711138 1.082323233710861 5 1.03692775514337 1.036927755143338 6 1.017343061984449 1.017343061984441 7 1.008349277381923 1.008349277381921 8 1.004077356197944 1.004077356197943 9 1.002008392926082 1.002008392826082 10 1.000994575127818 1.000994575127818 11 1.000494188604119 1.000494188604119 12 1.000246086553308 1.000246086553308 16 1.000015282259409 1.000015282259408 20 1.000000953962034 1.000000953962034 30 1.000000000931327 1.000000000931327 40 1.000000000000909 1.000000000000909 polpak_test(): Normal end of execution. Wed Mar 27 16:16:50 2024