01-Mar-2019 13:09:48 toms515_test MATLAB version Test toms515. 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_CHOOSE_CHECK_TEST I4_CHOOSE_CHECK checks whether C(N,K) can be computed with integer arithmetic or not. N K CHECK? I4_CHOOSE 10 3 1 120 1000 999 1 1000 100 3 1 161700 100 10 0 Not computable I4_UNIFORM_AB_TEST I4_UNIFORM_AB computes pseudorandom values in an interval [A,B]. The lower endpoint A = -100.000000 The upper endpoint B = 200.000000 The initial seed is 123456789 1 -35 2 187 3 149 4 69 5 25 6 -81 7 -23 8 -67 9 -87 10 90 11 -82 12 35 13 20 14 127 15 139 16 -100 17 170 18 5 19 -72 20 -96 R8_GAMMA_LOG_TEST: R8_GAMMA_LOG evaluates the logarithm of the Gamma function. X GAMMA_LOG(X) R8_GAMMA_LOG(X) 0.2 1.524063822430784 1.524063822430784 0.4 0.7966778177017837 0.7966778177017837 0.6 0.3982338580692348 0.3982338580692349 0.8 0.1520596783998375 0.1520596783998376 1 0 0 1.1 -0.04987244125983972 -0.04987244125983976 1.2 -0.08537409000331583 -0.08537409000331585 1.3 -0.1081748095078604 -0.1081748095078605 1.4 -0.1196129141723712 -0.1196129141723713 1.5 -0.1207822376352452 -0.1207822376352453 1.6 -0.1125917656967557 -0.1125917656967558 1.7 -0.09580769740706586 -0.09580769740706586 1.8 -0.07108387291437215 -0.07108387291437215 1.9 -0.03898427592308333 -0.03898427592308337 2 0 0 3 0.6931471805599453 0.6931471805599454 4 1.791759469228055 1.791759469228055 10 12.80182748008147 12.80182748008147 20 39.33988418719949 39.33988418719949 30 71.25703896716801 71.257038967168 TOMS515_TEST01 Generate all K-subsets of an N set. K = 3 N = 5 LMAX = 10 1: 1 2 3 2: 1 2 4 3: 1 2 5 4: 1 3 4 5: 1 3 5 6: 1 4 5 7: 2 3 4 8: 2 3 5 9: 2 4 5 10: 3 4 5 ;TOMS515_TEST02 Generate all K-subsets of an N set. K = 3 N = 5 LMAX = 10 3: 1 2 5 10: 3 4 5 9: 2 4 5 6: 1 4 5 5: 1 3 5 1: 1 2 3 3: 1 2 5 2: 1 2 4 1: 1 2 3 7: 2 3 4 TOMS515_TEST03 Generate 10 random K-subsets of an N set. K = 3 N = 25 LMAX = 2300 503: 2 18 20 2200: 16 19 24 1908: 11 17 25 1292: 6 16 22 956: 4 20 21 153: 1 9 22 593: 3 7 11 253: 1 18 23 101: 1 6 21 1459: 7 18 21 lmax = 161700 TOMS515_TEST04 Generate 10 random K-subsets of an N set. K = 3 N = 100 LMAX = 161700 35319: 8 60 79 154637: 65 68 78 134132: 45 48 93 90827: 24 66 88 67156: 17 27 65 10692: 3 16 18 41651: 10 28 87 17781: 4 54 96 7088: 2 29 69 102513: 29 36 84 TOMS515_TEST05 Generate 10 random K-subsets of an N set. K = 10 N = 100 LMAX = 17310309456440 Note that this function is already failing because LMAX is negative. The combinatorial coefficient C(100,10) is too large to store in an integer. Although the program continues to give results, they cannot be relied on! TOMS515_TEST05 - Warning! The binomial coefficient cannot be computed in integer arithmetic for this choice of parameters. toms515_test Normal end of execution. 01-Mar-2019 13:09:48