Sun Jun 23 17:28:32 2024 r8lib_test(): python version: 3.10.12 numpy version: 1.26.4 Test r8lib(). 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 gamma_values_test(): gamma_values() stores values of the Gamma function. X GAMMA(X) -0.500000 -3.5449077018110322 -0.010000 -100.5871979644108052 0.010000 99.4325851191506018 0.100000 9.5135076986687324 0.200000 4.5908437119988026 0.400000 2.2181595437576882 0.500000 1.7724538509055161 0.600000 1.4891922488128171 0.800000 1.1642297137253030 1.000000 1.0000000000000000 1.100000 0.9513507698668732 1.200000 0.9181687423997607 1.300000 0.8974706963062772 1.400000 0.8872638175030753 1.500000 0.8862269254527581 1.600000 0.8935153492876903 1.700000 0.9086387328532904 1.800000 0.9313837709802427 1.900000 0.9617658319073874 2.000000 1.0000000000000000 3.000000 2.0000000000000000 4.000000 6.0000000000000000 10.000000 362880.0000000000000000 20.000000 121645100408832000.0000000000000000 30.000000 8841761993739701898620088352768.0000000000000000 gamma_log_values(): gamma_log_values() stores values of the logarithm of the Gamma function. X gamma_log(X) 0.200000 1.5240638224307841 0.400000 0.7966778177017837 0.600000 0.3982338580692348 0.800000 0.1520596783998375 1.000000 0.0000000000000000 1.100000 -0.0498724412598397 1.200000 -0.0853740900033158 1.300000 -0.1081748095078604 1.400000 -0.1196129141723712 1.500000 -0.1207822376352452 1.600000 -0.1125917656967557 1.700000 -0.0958076974070659 1.800000 -0.0710838729143722 1.900000 -0.0389842759230833 2.000000 0.0000000000000000 3.000000 0.6931471805599453 4.000000 1.7917594692280550 10.000000 12.8018274800814691 20.000000 39.3398841871994946 30.000000 71.2570389671680147 i4_log_10_test(): i4_log_10(): whole part of log base 10, X, i4_log_10 0 0 1 0 2 0 3 0 9 0 10 1 11 1 99 1 101 2 -1 0 -2 0 -3 0 -9 0 i4_modp_test(): i4_modp() factors a number into a multiple M and a positive remainder R. Number Divisor Multiple Remainder 107 50 2 7 107 -50 -2 7 -107 50 -3 43 -107 -50 3 43 Repeat using Python % Operator: 107 50 2 7 107 -50 -3 -43 -107 50 -3 43 -107 -50 2 -7 i4_sign_test(): i4_sign() returns the sign of an I4. I4 i4_sign(I4) -10 -1 -7 -1 0 1 5 1 9 1 i4_uniform_ab_test(): i4_uniform_ab() computes pseudorandom values in an interval [A,B]. The lower endpoint A = -100 The upper endpoint B = 200 1 115 2 185 3 69 4 -9 5 152 6 142 7 9 8 112 9 26 10 -95 11 42 12 10 13 153 14 181 15 63 16 63 17 -33 18 131 19 -93 20 131 i4_wrap_test(): i4_wrap() forces an integer to lie within given limits. ILO = 4 IHI = 8 I i4_wrap(I) -10 5 -9 6 -8 7 -7 8 -6 4 -5 5 -4 6 -3 7 -2 8 -1 4 0 5 1 6 2 7 3 8 4 4 5 5 6 6 7 7 8 8 9 4 10 5 11 6 12 7 13 8 14 4 15 5 16 6 17 7 18 8 19 4 20 5 i4vec_indicator0_test(): i4vec_indicator0() returns an indicator vector. The indicator0 vector: 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 i4vec_indicator1_test(): i4vec_indicator1() returns an indicator vector. The indicator1 vector: 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 i4vec_print_test(): i4vec_print() prints an I4VEC. Here is an I4VEC: 0 91 1 92 2 93 3 94 i4vec_transpose_print_test(): i4vec_transpose_print() prints an I4VEC with 5 entries to a row, and an optional title. My array: 1 2 3 4 5 6 7 8 9 10 11 12 i4vec_uniform_ab_test(): i4vec_uniform_ab() computes pseudorandom values in an interval [A,B]. The lower endpoint A = -100 The upper endpoint B = 200 The random vector: 0 18 1 119 2 -65 3 90 4 119 5 30 6 47 7 -34 8 155 9 72 10 127 11 -65 12 15 13 98 14 180 15 -11 16 53 17 -92 18 39 19 -17 ksub_next4_test(): ksub_next4() generates K subsets of an N set. N = 5 K = 3 Rank Subset 1 1 2 3 2 1 2 4 3 1 3 4 4 2 3 4 5 1 2 5 6 1 3 5 7 2 3 5 8 1 4 5 9 2 4 5 10 3 4 5 perm0_check_test(): perm0_check() checks a permutation of 0,...,N-1. Permutation 1: 5 2 3 4 1 perm0_check - Warning! Permutation is missing the value 0. Permutation 2: 4 1 3 0 2 Permutation 3: 0 2 1 3 2 perm0_check - Warning! Permutation is missing the value 4. perm0_uniform_test(): perm0_uniform() randomly selects a permutation of 0,...,N-1. 5 3 8 1 7 4 0 6 9 2 5 0 2 3 6 4 8 9 7 1 8 3 7 9 0 6 4 5 2 1 9 0 2 3 5 6 8 1 7 4 9 0 6 5 8 2 4 1 7 3 perm1_check_test(): perm1_check() checks a permutation of 1,...,N. Permutation 1: 5 2 3 4 1 Permutation 2: 4 1 3 0 2 perm1_check - Warning! Permutation is missing the value 5. Permutation 3: 0 2 1 3 2 perm1_check - Warning! Permutation is missing the value 4. perm1_uniform_test(): perm1_uniform() randomly selects a permutation of 1, ..., N. 6 5 4 3 10 9 7 2 8 1 4 1 10 6 3 9 5 8 7 2 2 5 8 3 10 9 6 1 4 7 6 2 5 9 8 1 4 7 3 10 2 6 1 7 3 4 8 5 10 9 r8_abs_test(): r8_abs() returns the absolute value of an R8. X r8_abs(X) -1.769486 1.769486 -3.489900 3.489900 3.758689 3.758689 -2.664580 2.664580 -4.619227 4.619227 -2.492875 2.492875 0.294220 0.294220 -1.131433 1.131433 -1.841524 1.841524 0.112515 0.112515 r8_acos_test(): r8_acos computes the arc-cosine of an angle. C r8_ACOS(C) ACOS(C) -1.16667 3.14159 -1 3.14159 3.14159 -0.833333 2.55591 2.55591 -0.666667 2.30052 2.30052 -0.5 2.0944 2.0944 -0.333333 1.91063 1.91063 -0.166667 1.73824 1.73824 0 1.5708 1.5708 0.166667 1.40335 1.40335 0.333333 1.23096 1.23096 0.5 1.0472 1.0472 0.666667 0.841069 0.841069 0.833333 0.585686 0.585686 1 0 0 1.16667 0 r8_acosh_test(): r8_acosh() computes the arc-hyperbolic-cosine of an angle. X A=r8_ACOSH(X) COSH(A) 1 0 1 1.5 0.962424 1.5 2 1.31696 2 2.5 1.5668 2.5 3 1.76275 3 3.5 1.92485 3.5 4 2.06344 4 4.5 2.18464 4.5 5 2.29243 5 r8_add_test(): r8_add adds two R8's. R1 R2 R3 R4 R1+R2 r8_ADD(R1,R2) -325.315 -398.167 -723.482 -723.482 462.048 35.6568 497.705 497.705 -444.953 130.175 -314.778 -314.778 130.748 -359.2 -228.452 -228.452 122.563 -0.268367 122.294 122.294 r8_agm_test(): r8_agm() computes the arithmetic geometric mean. X Y AGM AGM Exact Computed 22.000000 96.000000 52.27464119870424 52.27464119870424 83.000000 56.000000 68.83653005985852 68.83653005985852 42.000000 7.000000 20.65930119673401 20.65930119673401 26.000000 11.000000 17.69685487374365 17.69685487374367 4.000000 63.000000 23.8670497217533 23.8670497217533 6.000000 45.000000 20.71701598280599 20.71701598280599 40.000000 75.000000 56.12784225561668 56.12784225561668 80.000000 0.000000 0 0 90.000000 35.000000 59.26956508122964 59.26956508122989 9.000000 1.000000 3.936235503649555 3.936235503649556 53.000000 53.000000 53 53 1.000000 2.000000 1.456791031046907 1.456791031046907 1.000000 4.000000 2.243028580287603 2.243028580287603 1.000000 8.000000 3.615756177597363 3.615756177597363 r8_aint_test(): r8_aint truncates a real number to its integer part. X r8_AINT(X) 2.671643 2.000000 -9.035083 -9.000000 9.342465 9.000000 0.563358 0.000000 -7.195297 -7.000000 -9.820687 -9.000000 -0.424955 0.000000 9.122107 9.000000 -8.795743 -8.000000 5.941396 5.000000 r8_asin_test(): r8_asin computes the arc-sine of an angle. S r8_ASIN(S) ARCSIN(S) -1.16667 -1.5708 -1 -1.5708 -1.5708 -0.833333 -0.985111 -0.985111 -0.666667 -0.729728 -0.729728 -0.5 -0.523599 -0.523599 -0.333333 -0.339837 -0.339837 -0.166667 -0.167448 -0.167448 0 0 0 0.166667 0.167448 0.167448 0.333333 0.339837 0.339837 0.5 0.523599 0.523599 0.666667 0.729728 0.729728 0.833333 0.985111 0.985111 1 1.5708 1.5708 1.16667 1.5708 r8_asinh_test(): r8_asinh() computes the inverse hyperbolic sine. x r8_asinh(x) sinh(r8_sinh(x)) 1.000000 0.881374 1.000000 1.200000 1.015973 1.200000 1.400000 1.137982 1.400000 1.600000 1.248983 1.600000 1.800000 1.350441 1.800000 2.000000 1.443635 2.000000 2.200000 1.529660 2.200000 2.400000 1.609438 2.400000 2.600000 1.683743 2.600000 2.800000 1.753229 2.800000 r8_atan_test(): r8_atan computes the arc-tangent given Y and X; ATAN2 is the system version of this routine. X Y ATAN2(Y,X) r8_ATAN(Y,X) 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.785398 0.785398 0.000000 1.000000 1.570796 1.570796 -1.000000 1.000000 2.356194 2.356194 -1.000000 0.000000 3.141593 3.141593 -1.000000 -1.000000 -2.356194 3.926991 0.000000 -1.000000 -1.570796 4.712389 1.000000 -1.000000 -0.785398 5.497787 r8_atanh_test(): r8_atanh computes the inverse hyperbolic tangent. X r8_ATANH(X) TANH(r8_TANH(X)) -0.200000 -0.202733 -0.200000 -0.100000 -0.100335 -0.100000 0.000000 0.000000 0.000000 0.100000 0.100335 0.100000 0.200000 0.202733 0.200000 0.300000 0.309520 0.300000 0.400000 0.423649 0.400000 0.500000 0.549306 0.500000 0.600000 0.693147 0.600000 0.700000 0.867301 0.700000 0.800000 1.098612 0.800000 0.900000 1.472219 0.900000 r8_big_test(): r8_big() returns a "big" R8; r8_big = 1e+30 r8_cas_test(): r8_cas() evaluates the casine of a number. X r8_cas ( X ) 0.000000 1.000000 0.261799 1.224745 0.523599 1.366025 0.785398 1.414214 1.047198 1.366025 1.308997 1.224745 1.570796 1.000000 1.832596 0.707107 2.094395 0.366025 2.356194 0.000000 2.617994 -0.366025 2.879793 -0.707107 3.141593 -1.000000 r8_ceiling_test(): r8_ceiling() rounds a value up. X r8_ceiling(X) -1.200000 -1 -1.000000 -1 -0.800000 0 -0.600000 0 -0.400000 0 -0.200000 0 0.000000 0 0.200000 1 0.400000 1 0.600000 1 0.800000 1 1.000000 1 1.200000 2 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_chop_test(): r8_chop() chops an R8 to IPLACE places PLACE X r8_chop 0 3.141592653589793 0 1 3.141592653589793 2 2 3.141592653589793 3 3 3.141592653589793 3 4 3.141592653589793 3 5 3.141592653589793 3.125 6 3.141592653589793 3.125 7 3.141592653589793 3.125 8 3.141592653589793 3.140625 9 3.141592653589793 3.140625 10 3.141592653589793 3.140625 11 3.141592653589793 3.140625 12 3.141592653589793 3.140625 13 3.141592653589793 3.14111328125 14 3.141592653589793 3.141357421875 15 3.141592653589793 3.1414794921875 16 3.141592653589793 3.14154052734375 17 3.141592653589793 3.141571044921875 18 3.141592653589793 3.141586303710938 19 3.141592653589793 3.141586303710938 20 3.141592653589793 3.141590118408203 21 3.141592653589793 3.141592025756836 22 3.141592653589793 3.141592025756836 23 3.141592653589793 3.141592502593994 24 3.141592653589793 3.141592502593994 25 3.141592653589793 3.141592621803284 26 3.141592653589793 3.141592621803284 27 3.141592653589793 3.141592651605606 28 3.141592653589793 3.141592651605606 29 3.141592653589793 3.141592651605606 30 3.141592653589793 3.141592651605606 31 3.141592653589793 3.141592653468251 32 3.141592653589793 3.141592653468251 r8_cosd_test(): r8_cosd() computes the cosine of an angle given in degrees. ANGLE r8_cosd(ANGLE) 0.00 1 15.00 0.965926 30.00 0.866025 45.00 0.707107 60.00 0.5 75.00 0.258819 90.00 6.12323e-17 105.00 -0.258819 120.00 -0.5 135.00 -0.707107 150.00 -0.866025 165.00 -0.965926 180.00 -1 195.00 -0.965926 210.00 -0.866025 225.00 -0.707107 240.00 -0.5 255.00 -0.258819 270.00 -1.83697e-16 285.00 0.258819 300.00 0.5 315.00 0.707107 330.00 0.866025 345.00 0.965926 360.00 1 r8_cotd_test(): r8_cotd() computes the cotangent of an angle given in degrees. ANGLE r8_cotd(ANGLE) 0.00 Undefined 15.00 3.73205 30.00 1.73205 45.00 1 60.00 0.57735 75.00 0.267949 90.00 6.12323e-17 105.00 -0.267949 120.00 -0.57735 135.00 -1 150.00 -1.73205 165.00 -3.73205 180.00 Undefined 195.00 3.73205 210.00 1.73205 225.00 1 240.00 0.57735 255.00 0.267949 270.00 1.83697e-16 285.00 -0.267949 300.00 -0.57735 315.00 -1 330.00 -1.73205 345.00 -3.73205 360.00 Undefined r8_csc_test(): r8_csc() computes the cosecant of an angle. ANGLE r8_csc(ANGLE) 0.00 Undefined 15.00 1.46037 30.00 -1.00194 45.00 1.29876 60.00 -8.05172 75.00 -1.69796 90.00 1.0177 105.00 -1.18588 120.00 4.05727 135.00 2.06607 150.00 -1.05049 165.00 1.10683 180.00 Undefined 195.00 -2.69119 210.00 1.10311 225.00 -1.05294 240.00 2.09321 255.00 3.94632 270.00 -1.18053 285.00 1.0191 300.00 -1.71484 315.00 -7.61642 330.00 1.29113 345.00 -1.00241 360.00 Undefined r8_cscd_test(): r8_cscd() computes the cosecant of an angle given in degrees. ANGLE r8_cscd(ANGLE) 0.00 Undefined 15.00 3.8637 30.00 2 45.00 1.41421 60.00 1.1547 75.00 1.03528 90.00 1 105.00 1.03528 120.00 1.1547 135.00 1.41421 150.00 2 165.00 3.8637 180.00 Undefined 195.00 -3.8637 210.00 -2 225.00 -1.41421 240.00 -1.1547 255.00 -1.03528 270.00 -1 285.00 -1.03528 300.00 -1.1547 315.00 -1.41421 330.00 -2 345.00 -3.8637 360.00 Undefined r8_cube_root_test(): r8_cube_root() computes the cube root of an R8. X Y Y^3 -7.1936 -1.93041 -7.1936 8.15867 2.01314 8.15867 7.87877 1.98985 7.87877 6.58424 1.87428 6.58424 -0.537396 -0.813014 -0.537396 8.2411 2.01989 8.2411 2.86035 1.41951 2.86035 -9.08528 -2.08663 -9.08528 -4.6441 -1.6684 -4.6441 -4.5899 -1.66189 -4.5899 r8_degrees_test(): r8_degrees() converts an angle from radians to degrees.. Radians Degrees 0.000000 0.000000 0.261799 15.000000 0.523599 30.000000 0.785398 45.000000 1.047198 60.000000 1.308997 75.000000 1.570796 90.000000 1.832596 105.000000 2.094395 120.000000 2.356194 135.000000 2.617994 150.000000 2.879793 165.000000 3.141593 180.000000 r8_diff_test(): r8_diff() computes a difference X-Y to a given number of binary places. For this test, we use 3 binary places. X Y X-Y r8_diff(X,Y) 1.000000 0.062500 0.937500 0.875000 1.000000 0.125000 0.875000 0.875000 1.000000 0.250000 0.750000 0.750000 1.000000 0.500000 0.500000 0.500000 1.000000 0.874000 0.126000 0.125000 1.000000 0.876000 0.124000 0.125000 1.000000 0.900000 0.100000 0.125000 1.000000 0.950000 0.050000 0.000000 1.000000 0.990000 0.010000 0.000000 1.000000 1.000000 0.000000 0.000000 1.000000 1.010000 -0.010000 0.000000 1.000000 1.050000 -0.050000 0.000000 1.000000 1.100000 -0.100000 -0.137500 1.000000 3.000000 -2.000000 -1.875000 1.000000 10.000000 -9.000000 -8.750000 r8_digit_test(): r8_digit() extracts decimal digits. Here, we get digits of 3.14159 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 r8_divide_i4_test(): r8_divide_i4() computes an integer ratio as a real number. I J I/J I//J r8_divide_i4(I,J) -3 -2 1 1 1.5 -3 -1 3 3 3 -3 1 -3 -3 -3 -3 2 -1 -2 -1.5 -3 3 -1 -1 -1 -3 4 0 -1 -0.75 -2 -2 1 1 1 -2 -1 2 2 2 -2 1 -2 -2 -2 -2 2 -1 -1 -1 -2 3 0 -1 -0.666667 -2 4 0 -1 -0.5 -1 -2 0 0 0.5 -1 -1 1 1 1 -1 1 -1 -1 -1 -1 2 0 -1 -0.5 -1 3 0 -1 -0.333333 -1 4 0 -1 -0.25 0 -2 0 0 -0 0 -1 0 0 -0 0 1 0 0 0 0 2 0 0 0 0 3 0 0 0 0 4 0 0 0 1 -2 0 -1 -0.5 1 -1 -1 -1 -1 1 1 1 1 1 1 2 0 0 0.5 1 3 0 0 0.333333 1 4 0 0 0.25 2 -2 -1 -1 -1 2 -1 -2 -2 -2 2 1 2 2 2 2 2 1 1 1 2 3 0 0 0.666667 2 4 0 0 0.5 3 -2 -1 -2 -1.5 3 -1 -3 -3 -3 3 1 3 3 3 3 2 1 1 1.5 3 3 1 1 1 3 4 0 0 0.75 4 -2 -2 -2 -2 4 -1 -4 -4 -4 4 1 4 4 4 4 2 2 2 2 4 3 1 1 1.33333 4 4 1 1 1 5 -2 -2 -3 -2.5 5 -1 -5 -5 -5 5 1 5 5 5 5 2 2 2 2.5 5 3 1 1 1.66667 5 4 1 1 1.25 6 -2 -3 -3 -3 6 -1 -6 -6 -6 6 1 6 6 6 6 2 3 3 3 6 3 2 2 2 6 4 1 1 1.5 7 -2 -3 -4 -3.5 7 -1 -7 -7 -7 7 1 7 7 7 7 2 3 3 3.5 7 3 2 2 2.33333 7 4 1 1 1.75 r8_e_test(): r8_e() returns the value of E. Compare E to (1+1/n)^n r8_e = 2.71828 N Estimate Error 1 2 0.718282 2 2.25 0.468282 4 2.44141 0.276876 8 2.56578 0.152497 16 2.63793 0.0803533 32 2.67699 0.0412917 64 2.69734 0.0209369 128 2.70774 0.0105428 256 2.71299 0.0052902 512 2.71563 0.00264983 1024 2.71696 0.0013261 2048 2.71762 0.000663346 4096 2.71795 0.000331747 8192 2.71812 0.000165892 16384 2.7182 8.29507e-05 32768 2.71824 4.14765e-05 65536 2.71826 2.07386e-05 131072 2.71827 1.03693e-05 262144 2.71828 5.18469e-06 524288 2.71828 2.59235e-06 1048576 2.71828 1.29618e-06 r8_epsilon_test(): r8_epsilon() produces the R8 roundoff unit. R = r8_epsilon() = 2.220446e-16 ( 1 + R ) - 1 = 2.220446e-16 ( 1 + (R/2) ) - 1 = 0.000000e+00 r8_epsilon_compute_test(): r8_epsilon_compute() computes the R8 roundoff unit. R = r8_epsilon_compute() = 2.220446e-16 ( 1 + R ) - 1 = 2.220446e-16 ( 1 + (R/2) ) - 1 = 0.000000e+00 r8_exp_test(): r8_exp() returns the exponential of a real number. X r8_exp(X) -80 0 -70 0 -60 8.75651e-27 -50 1.92875e-22 -40 4.24835e-18 -30 9.35762e-14 -20 2.06115e-09 -10 4.53999e-05 0 1 10 22026.5 20 4.85165e+08 30 1.06865e+13 40 2.35385e+17 50 5.18471e+21 60 1.14201e+26 70 1.79769e+308 80 1.79769e+308 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_stirling_test(): r8_factorial_stirling() computes Stirling's approximate factorial function N Factorial Factorial Stirling 1 1.00227 1 2 2.00065 2 3 6.0006 6 4 24.001 24 5 120.003 120 6 720.009 720 7 5040.04 5040 8 40320.2 40320 9 362881 362880 10 3.62881e+06 3.6288e+06 11 3.99169e+07 3.99168e+07 12 4.79002e+08 4.79002e+08 13 6.22703e+09 6.22702e+09 14 8.71784e+10 8.71783e+10 15 1.30768e+12 1.30767e+12 16 2.09228e+13 2.09228e+13 17 3.55688e+14 3.55687e+14 18 6.40238e+15 6.40237e+15 19 1.21645e+17 1.21645e+17 20 2.4329e+18 2.4329e+18 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_factorial2_test(): r8_factorial2() evaluates the double factorial function. N Exact Computed 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 r8_factorial2_values_test(): r8_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 2.02702e+06 r8_fall_test(): r8_fall() evaluates the falling factorial Fall(X,N). X N Exact Computed 5 4 120 120 5.25 4 163.16015625 163.16015625 5.5 4 216.5625 216.5625 5.75 4 281.66015625 281.66015625 6 4 360 360 7.5 0 1 1 7.5 1 7.5 7.5 7.5 2 48.75 48.75 7.5 3 268.125 268.125 7.5 4 1206.5625 1206.5625 7.5 5 4222.96875 4222.96875 7.5 6 10557.421875 10557.421875 7.5 7 15836.1328125 15836.1328125 7.5 8 7918.06640625 7918.06640625 7.5 9 -3959.033203125 -3959.033203125 r8_fall_values_test(): r8_fall_values() returns values of the falling factorial. X N r8_fall(X,N) 5.0000 4 120 5.2500 4 163.16015625 5.5000 4 216.5625 5.7500 4 281.66015625 6.0000 4 360 7.5000 0 1 7.5000 1 7.5 7.5000 2 48.75 7.5000 3 268.125 7.5000 4 1206.5625 7.5000 5 4222.96875 7.5000 6 10557.421875 7.5000 7 15836.1328125 7.5000 8 7918.06640625 7.5000 9 -3959.033203125 r8_floor_test(): r8_floor() returns the "floor" of a real number. X r8_floor(X) 7.175231 7.000000 -8.731922 -9.000000 5.153697 5.000000 -8.544782 -9.000000 -9.703045 -10.000000 6.424982 6.000000 -6.256680 -7.000000 -4.504187 -5.000000 1.269909 1.000000 6.407922 6.000000 r8_fraction_test(): r8_fraction() computes a ratio of integers using real arithmetic. I J I/J r8_fraction(I,J) 4 5 0 0.8 5 7 0 0.714286 7 20 0 0.35 4 10 0 0.4 8 9 0 0.888889 13 13 1 1 12 12 1 1 8 7 1 1.14286 14 10 1 1.4 3 18 0 0.166667 r8_fractional_test(): r8_fractional() returns the fractional part of an R8. X r8_fractional(X) -1.984851 0.984851 4.347303 0.347303 0.309159 0.309159 -1.320006 0.320006 -2.955711 0.955711 4.615259 0.615259 0.762725 0.762725 0.718492 0.718492 4.140207 0.140207 2.384610 0.384610 r8_gamma_test(): r8_gamma() evaluates the Gamma function. X GAMMA(X) r8_gamma(X) -0.5 -3.544907701811032 -3.544907701811032 -0.01 -100.5871979644108 -100.5871979644108 0.01 99.4325851191506 99.4325851191506 0.1 9.513507698668732 9.513507698668731 0.2 4.590843711998803 4.590843711998803 0.4 2.218159543757688 2.218159543757688 0.5 1.772453850905516 1.772453850905516 0.6 1.489192248812817 1.489192248812817 0.8 1.164229713725303 1.164229713725303 1 1 1 1.1 0.9513507698668732 0.9513507698668732 1.2 0.9181687423997607 0.9181687423997607 1.3 0.8974706963062772 0.8974706963062772 1.4 0.8872638175030753 0.8872638175030754 1.5 0.8862269254527581 0.8862269254527581 1.6 0.8935153492876903 0.8935153492876903 1.7 0.9086387328532904 0.9086387328532904 1.8 0.9313837709802427 0.9313837709802427 1.9 0.9617658319073874 0.9617658319073874 2 1 1 3 2 2 4 6 6 10 362880 362880 20 1.21645100408832e+17 1.216451004088321e+17 30 8.841761993739702e+30 8.841761993739751e+30 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 r8_heaviside_test(): r8_heaviside() evaluates the Heaviside step function. x heaviside(x) -1 0 -0.8 0 -0.6 0 -0.4 0 -0.2 0 0 0.5 0.2 1 0.4 1 0.6 1 0.8 1 1 1 r8_huge_test(): r8_huge() returns a "huge" R8; r8_huge = 1.79769e+308 r8_hypot_test(): r8_hypot() returns an accurate value for sqrt(A^2+B^2). A B r8_hypot sqrt(A^2+B^2) 1 1 1.414213562373095 1.414213562373095 1 0.5 1.118033988749895 1.118033988749895 1 0.25 1.030776406404415 1.030776406404415 1 0.125 1.007782218537319 1.007782218537319 1 0.0625 1.001951221367587 1.001951221367587 1 0.03125 1.000488162098883 1.000488162098883 1 0.015625 1.000122062862829 1.000122062862829 1 0.0078125 1.000030517112478 1.000030517112478 1 0.00390625 1.000007629365428 1.000007629365428 1 0.00195312 1.000001907346814 1.000001907346814 1 0.000976562 1.000000476837045 1.000000476837045 1 0.000488281 1.000000119209282 1.000000119209282 1 0.000244141 1.000000029802322 1.000000029802322 1 0.00012207 1.000000007450581 1.000000007450581 1 6.10352e-05 1.000000001862645 1.000000001862645 1 3.05176e-05 1.000000000465661 1.000000000465661 1 1.52588e-05 1.000000000116415 1.000000000116415 1 7.62939e-06 1.000000000029104 1.000000000029104 1 3.8147e-06 1.000000000007276 1.000000000007276 1 1.90735e-06 1.000000000001819 1.000000000001819 r8_is_in_01_test(): r8_is_in_01() reports whether an R8 is in [0,1]. R8 r8_is_in_01? 1.26 False 0.23 True 1.53 False -0.39 False 1.76 False -0.91 False -0.85 False -0.28 False -0.35 False -0.78 False r8_is_inf_test(): r8_is_inf() reports whether an R8 is infinite. These tests are wasted, since all the arithmetic operations return run time errors. r8_is_inf(1.0) = False In Python, 1.0/0.0 causes a run time error! In Python, 0.0/0.0 causes a run time error! r8_is_inf(0^0) = False In Python, arccos(-2.0) causes a run time error! In Python, exp(1000) causes a run time overflow warning! In Python, log(0) causes a run time error! In Python, sqrt(-1) causes a run time error! r8_is_insignificant_test(): r8_is_insignificant ( R, S ) is TRUE is S is insignificant compared to R. R S Insignificant? 1e-30 1e-30 False 2.22045e-16 1e-30 False 1 1e-30 True 1.79769e+308 1e-30 True 1e-30 2.22045e-16 False 2.22045e-16 2.22045e-16 False 1 2.22045e-16 True 1.79769e+308 2.22045e-16 True 1e-30 1 False 2.22045e-16 1 False 1 1 False 1.79769e+308 1 True 1e-30 1.79769e+308 False 2.22045e-16 1.79769e+308 False 1 1.79769e+308 False 8.98847e+307 8.98847e+307 False r8_is_integer_test(): r8_is_integer() reports whether an R8 stores an integer value. -1.1429 False -1.0000 True -0.8571 False -0.7143 False -0.5714 False -0.4286 False -0.2857 False -0.1429 False 0.0000 True 0.1429 False 0.2857 False 0.4286 False 0.5714 False 0.7143 False 0.8571 False 1.0000 True 1.1429 False 1.2857 False 1.4286 False 1.5714 False 1.7143 False 1.8571 False 2.0000 True 2.1429 False r8_is_nan_test(): r8_is_nan() reports whether an R8 is a NaN. These tests are wasted, since all the arithmetic operations return run time errors. r8_is_nan(1.0) = 0 In Python, 1.0/0.0 just sets a run time error. In Python, 0.0/0.0 just sets a run time error. r8_is_nan(0^0) = 0 In Python, arccos(-2.0) just sets a run time warning. In Python, exp(1000) just sets a run time warning. In Python, log(0.0) just sets a run time warning. In Python, sqrt(-1.0) just sets a run time warning. r8_log_10_test(): r8_log_10() computes the logarithm base 10. X r8_log_10 0.000000 -inf 1.000000 0.000000 2.000000 0.301030 3.000000 0.477121 9.000000 0.954243 10.000000 1.000000 11.000000 1.041393 99.000000 1.995635 101.000000 2.004321 -1.000000 0.000000 -2.000000 0.301030 -3.000000 0.477121 -9.000000 0.954243 0.500000 -0.301030 0.330000 -0.481486 0.250000 -0.602060 0.200000 -0.698970 0.010000 -2.000000 r8_log_2_test(): r8_log_2() computes the logarithm base 2. X r8_log_2 0.000000 -inf 1.000000 0.000000 2.000000 1.000000 3.000000 1.584963 9.000000 3.169925 10.000000 3.321928 11.000000 3.459432 99.000000 6.629357 101.000000 6.658211 -1.000000 0.000000 -2.000000 1.000000 -3.000000 1.584963 -9.000000 3.169925 0.500000 -1.000000 0.330000 -1.599462 0.250000 -2.000000 0.200000 -2.321928 0.010000 -6.643856 r8_log_b_test(): r8_log_b() computes the logarithm base B. X B r8_log_b 16.000000 2.000000 4.000000 16.000000 3.000000 2.523719 16.000000 4.000000 2.000000 16.000000 5.000000 1.722706 16.000000 6.000000 1.547411 16.000000 7.000000 1.424829 16.000000 8.000000 1.333333 16.000000 16.000000 1.000000 16.000000 32.000000 0.800000 16.000000 256.000000 0.500000 r8_mant_test(): r8_mant() decomposes a value. Number to be decomposed: -314.159 r8_mant: X = -1 * 1.227184 * 2^ 8 r8_max_test(): r8_max() computes the maximum of two R8's. A B C=r8_max(A,B) 8.01605 2.22966 8.01605 8.64978 6.99642 8.64978 1.45698 4.50897 4.50897 1.38508 -4.39725 1.38508 -0.00554538 0.755212 0.755212 3.92228 -6.45621 3.92228 8.99949 9.87702 9.87702 -7.72199 1.92711 1.92711 -5.8224 -7.69683 -5.8224 7.3263 9.11692 9.11692 r8_min_test(): r8_min() computes the minimum of two R8's. A B C=r8_min(A,B) 1.59919 7.08384 1.59919 -6.46484 5.59937 -6.46484 6.1511 7.253 6.1511 -0.62473 -7.49473 -7.49473 0.514992 8.0653 0.514992 8.37077 6.83665 6.83665 8.49741 3.75657 3.75657 2.53298 -1.04788 -1.04788 -6.23458 2.97506 -6.23458 -4.11382 -3.11012 -4.11382 r8_mod_test(): r8_mod() returns the remainder after division. X Y (X%Y) r8_mod(X,Y) -8.639594 -8.876634 -8.639594 -8.639594 -6.638123 -4.081838 -2.556285 -2.556285 -0.038584 3.180963 3.142379 -0.038584 6.865253 9.239378 6.865253 6.865253 -0.836782 4.837004 4.000222 -0.836782 -0.172431 -8.592184 -0.172431 -0.172431 9.539245 5.909021 3.630223 3.630223 -8.683734 -8.000099 -0.683636 -0.683636 2.834637 1.213506 0.407625 0.407625 -9.505376 -8.830894 -0.674482 -0.674482 r8_modp_test(): r8_modp() returns the remainder after division. Unlike the MATLAB MOD, r8_modp ( X, Y ) is positive. X Y MOD(X,Y) r8_modp(X,Y) -3.967765 4.242868 0.275102 0.275102 -2.243755 7.178151 4.934396 4.934396 -9.667623 5.326408 0.985192 0.985192 -8.493373 2.758675 2.541329 2.541329 -6.826366 8.633349 1.806982 1.806982 -1.611867 6.500815 4.888948 4.888948 9.905449 3.213031 0.266354 0.266354 4.254005 6.186856 4.254005 4.254005 4.473063 1.994717 0.483628 0.483628 -7.310340 -2.491889 -2.326562 0.165327 r8_mop_test(): r8_mop() evaluates (-1.0)^I4 as an R8. I4 r8_MOP(I4) 67 -1.0 69 -1.0 78 1.0 38 1.0 -36 1.0 38 1.0 11 -1.0 74 1.0 43 -1.0 15 -1.0 r8_nint_test(): r8_nint() produces the nearest integer. X r8_nint(X) -7.379562 -8 -4.562519 -5 5.401155 6 9.017376 10 -1.583391 -2 -1.434574 -2 1.585523 2 2.412434 3 9.539727 10 -5.128055 -6 r8_normal_01_test(): r8_normal_01() generates normally distributed random values. 1.162318 -0.183286 -0.412807 1.544730 -0.690454 -0.336197 -0.221181 0.662582 -0.226404 -1.578248 -1.321988 0.863657 -1.994686 0.042589 0.451509 -0.280835 -0.597454 -1.878912 0.275196 1.413408 r8_normal_ab_test(): r8_normal_ab() generates normally distributed values with given mean and standard deviation. MEAN = 100 STD = 10 119.874 99.8777 103.905 97.4838 85.1701 106.555 97.4539 103.352 105.308 108.029 112.53 103.037 85.0429 107.163 93.9737 116.066 91.4867 98.342 99.0978 88.2998 r8_nth_root_test(): r8_nth_root() computes the nth root of an R8. X -3 -2 -1 0 1 2 3 -3 -0.6934 -0.5774 -0.3333 1 -3 nan -1.442 -2 -0.7937 -0.7071 -0.5 1 -2 nan -1.26 -1 -1 -1 -1 1 -1 nan -1 0 inf inf inf 1 0 0 0 1 1 1 1 1 1 1 1 2 0.7937 0.7071 0.5 1 2 1.414 1.26 3 0.6934 0.5774 0.3333 1 3 1.732 1.442 r8_pi_test(): r8_pi() returns the value of PI. r8_pi = 3.1415926535897931 4 * Atan(1) = 3.1415926535897931 np.pi = 3.1415926535897931 r8_pi_sqrt_test(): r8_pi_sqrt() returns the square root of PI. r8_pi_sqrt = 1.7724538509055161 sqrt ( 4 * Atan(1) ) = 1.7724538509055159 sqrt ( NP.PI ) = 1.7724538509055159 NP.PI = 3.1415926535897931 r8_pi_sqrt ** 2 = 3.1415926535897936 r8_power_test(): r8_power() computes R^P. R P r8_power 2.000000 -5 0.031250 2.000000 -4 0.062500 2.000000 -3 0.125000 2.000000 -2 0.250000 2.000000 -1 0.500000 2.000000 0 1.000000 2.000000 1 2.000000 2.000000 2 4.000000 2.000000 3 8.000000 2.000000 4 16.000000 2.000000 5 32.000000 r8_power_fast_test(): r8_power_fast() computes R^P, economizing on multiplications. R P R^P Mults 2.000000 -10 0.000977 7 2.000000 -9 0.001953 7 2.000000 -8 0.003906 6 2.000000 -7 0.007812 7 2.000000 -6 0.015625 6 2.000000 -5 0.031250 6 2.000000 -4 0.062500 5 2.000000 -3 0.125000 5 2.000000 -2 0.250000 4 2.000000 -1 0.500000 1 2.000000 0 1.000000 0 2.000000 1 2.000000 0 2.000000 2 4.000000 3 2.000000 3 8.000000 4 2.000000 4 16.000000 4 2.000000 5 32.000000 5 2.000000 6 64.000000 5 2.000000 7 128.000000 6 2.000000 8 256.000000 5 2.000000 9 512.000000 6 2.000000 10 1024.000000 6 2.000000 11 2048.000000 7 2.000000 12 4096.000000 6 2.000000 13 8192.000000 7 2.000000 14 16384.000000 7 2.000000 15 32768.000000 8 2.000000 16 65536.000000 6 2.000000 17 131072.000000 7 2.000000 18 262144.000000 7 2.000000 19 524288.000000 8 2.000000 20 1048576.000000 7 2.000000 21 2097152.000000 8 2.000000 22 4194304.000000 8 2.000000 23 8388608.000000 9 2.000000 24 16777216.000000 7 2.000000 25 33554432.000000 8 2.000000 26 67108864.000000 8 2.000000 27 134217728.000000 9 2.000000 28 268435456.000000 8 2.000000 29 536870912.000000 9 2.000000 30 1073741824.000000 9 2.000000 31 2147483648.000000 10 2.000000 32 4294967296.000000 7 2.000000 33 8589934592.000000 8 2.000000 34 17179869184.000000 8 2.000000 35 34359738368.000000 9 2.000000 36 68719476736.000000 8 2.000000 37 137438953472.000000 9 2.000000 38 274877906944.000000 9 2.000000 39 549755813888.000000 10 2.000000 40 1099511627776.000000 8 r8_print_test(): r8_print() prints an R8 with a label. The value np.pi: 3.14159 The value 1.0: 1 The value -123456789: -1.23457e+08 The value 1.23456789: 1.23457 r8_radians_test(): r8_radians() converts an angle from degrees to radians. Degrees Radians 0.000000 0.000000 15.000000 0.261799 30.000000 0.523599 45.000000 0.785398 60.000000 1.047198 75.000000 1.308997 90.000000 1.570796 105.000000 1.832596 120.000000 2.094395 135.000000 2.356194 150.000000 2.617994 165.000000 2.879793 180.000000 3.141593 r8_relu_test(): r8_relu() evaluates the ReLU function of an R8. This is max(x,0). X r8_relu(X) -500 0 -50 0 -5 0 -4 0 -3 0 -2 0 -1 0 -0.5 0 -0.05 0 -0.005 0 -0.0005 0 0 0 0.0005 0.0005 0.005 0.005 0.05 0.05 0.5 0.5 1 1 2 2 3 3 4 4 5 5 50 50 500 500 5000 5000 50000 50000 r8_rise_test(): r8_rise() evaluates the rising factorial Rise(X,N). X N Exact Computed 5 4 1680 1680 5.25 4 1962.59765625 1962.59765625 5.5 4 2279.0625 2279.0625 5.75 4 2631.97265625 2631.97265625 6 4 3024 3024 7.5 0 1 1 7.5 1 7.5 7.5 7.5 2 63.75 63.75 7.5 3 605.625 605.625 7.5 4 6359.0625 6359.0625 7.5 5 73129.21875 73129.21875 7.5 6 914115.234375 914115.234375 7.5 7 12340555.6640625 12340555.6640625 7.5 8 178938057.1289063 178938057.1289062 7.5 9 2773539885.498047 2773539885.498047 r8_rise_values_test(): r8_rise_values() returns values of the rising factorial. X N r8_rise(X,N) 5.0000 4 1680 5.2500 4 1962.59765625 5.5000 4 2279.0625 5.7500 4 2631.97265625 6.0000 4 3024 7.5000 0 1 7.5000 1 7.5 7.5000 2 63.75 7.5000 3 605.625 7.5000 4 6359.0625 7.5000 5 73129.21875 7.5000 6 914115.234375 7.5000 7 12340555.6640625 7.5000 8 178938057.1289063 7.5000 9 2773539885.498047 r8_round_test(): r8_round() rounds a real number to a real number with integer value. X XROUND 60.043399 60.000000 -89.030326 -89.000000 91.693020 92.000000 -62.375061 -62.000000 46.971938 47.000000 -41.814698 -42.000000 71.798168 72.000000 -27.728550 -28.000000 53.823394 54.000000 -60.885341 -61.000000 r8_round2_test(): r8_round2() rounds a number to a specified number of base 2 digits. Test effect on PI. X = 3.141593 NPLACE XROUND 0 0.000000 1 2.000000 2 3.000000 3 3.000000 4 3.000000 5 3.125000 6 3.125000 7 3.125000 8 3.140625 9 3.140625 10 3.140625 11 3.140625 12 3.140625 13 3.141113 14 3.141357 15 3.141479 16 3.141541 17 3.141571 18 3.141586 19 3.141586 20 3.141590 r8_roundb_test(): r8_roundb() rounds a number to a specified number of base BASE digits. Here, we will use BASE = 3 Test effect on PI: X = 3.141593 NPLACE XROUND 0 0.000000 1 3.000000 2 3.000000 3 3.000000 4 3.111111 5 3.111111 6 3.135802 7 3.139918 8 3.141289 9 3.141289 10 3.141442 11 3.141543 12 3.141577 13 3.141589 14 3.141592 15 3.141592 16 3.141593 17 3.141593 18 3.141593 19 3.141593 20 3.141593 Try with a negative base: Input quantity is X = 121.000000 to be rounded in base -3 Output value to 1 places is 81.000000 Output value to 2 places is 108.000000 Output value to 3 places is 117.000000 Output value to 4 places is 120.000000 Output value to 5 places is 121.000000 r8_roundx_test(): r8_roundx() rounds a number to a specified number of decimal digits. Test effect on PI: X = 3.141593 NPLACE XROUND 0 0.000000 1 3.000000 2 3.100000 3 3.140000 4 3.141000 5 3.141500 6 3.141590 7 3.141592 8 3.141593 9 3.141593 10 3.141593 Test effect on random values: NPLACE X XROUND 0 0.839135 0.000000 2 0.839135 0.830000 4 0.839135 0.839100 6 0.839135 0.839135 8 0.839135 0.839135 10 0.839135 0.839135 0 0.215368 0.000000 2 0.215368 0.210000 4 0.215368 0.215300 6 0.215368 0.215367 8 0.215368 0.215368 10 0.215368 0.215368 0 0.720656 0.000000 2 0.720656 0.720000 4 0.720656 0.720600 6 0.720656 0.720655 8 0.720656 0.720656 10 0.720656 0.720656 0 0.585336 0.000000 2 0.585336 0.580000 4 0.585336 0.585300 6 0.585336 0.585336 8 0.585336 0.585336 10 0.585336 0.585336 0 0.146059 0.000000 2 0.146059 0.140000 4 0.146059 0.146000 6 0.146059 0.146058 8 0.146059 0.146059 10 0.146059 0.146059 r8_secd_test(): r8_secd() computes the secant of an angle given in degrees. ANGLE r8_secd(ANGLE) 0.00 1 15.00 1.03528 30.00 1.1547 45.00 1.41421 60.00 2 75.00 3.8637 90.00 Undefined 105.00 -3.8637 120.00 -2 135.00 -1.41421 150.00 -1.1547 165.00 -1.03528 180.00 -1 195.00 -1.03528 210.00 -1.1547 225.00 -1.41421 240.00 -2 255.00 -3.8637 270.00 Undefined 285.00 3.8637 300.00 2 315.00 1.41421 330.00 1.1547 345.00 1.03528 360.00 1 r8_sech_test(): r8_sech() computes the hyperbolic secant. X r8_sech(X) -1 0.648054 -0.9 0.697795 -0.8 0.7477 -0.7 0.796705 -0.6 0.843551 -0.5 0.886819 -0.4 0.925007 -0.3 0.956628 -0.2 0.980328 -0.1 0.995021 0 1 0.1 0.995021 0.2 0.980328 0.3 0.956628 0.4 0.925007 0.5 0.886819 0.6 0.843551 0.7 0.796705 0.8 0.7477 0.9 0.697795 1 0.648054 r8_sigmoid_test(): r8_sigmoid() evaluates the sigmoid function of R8. X r8_SIGMOID(L,B,M,X) -4 0.0179862 -2 0.119203 -1 0.268941 -0.5 0.377541 -0.25 0.437823 0 0.5 0.25 0.562177 0.5 0.622459 1 0.731059 2 0.880797 4 0.982014 r8_sign_test(): r8_sign() returns the sign of an R8. R8 r8_sign(R8) -1.2500 -1 -0.2500 -1 0.0000 1 0.5000 1 9.0000 1 r8_sign_char_test(): r8_sign_char() returns the sign of an R8 as a character. R8 r8_sign_CHAR(R8) 4.888784 + -4.924653 - 0.808924 + 1.105564 + -4.158138 - -4.886648 - -2.897313 - 1.096663 + -0.427659 - -1.164830 - r8_sign_match_test(): r8_sign_match() is TRUE if two R8's have matching signs. R1 R2 Match(R1,R2)? 0.0000 0.0000 True -0.2967 -7.7494 True 2.0241 -9.1366 False -8.5398 -4.7013 True 0.0000 -5.8226 True -7.2712 1.7335 False 3.2970 2.8961 True -7.6116 7.3324 False 0.0000 7.9003 True -8.8105 2.5746 False -2.3324 0.0000 True -3.6920 8.3953 False 0.0000 1.4563 True -4.1376 5.1740 False 1.3898 2.9955 True 8.4842 7.9326 True 0.0000 5.9784 True -6.1643 -9.6760 True 1.3781 9.2799 True 8.7836 5.4724 True 0.0000 0.0000 True r8_sign_match_strict_test(): r8_sign_match_strict() is TRUE if two R8's have matching signs. R1 R2 MatchStrict(R1,R2)? 0.0000 0.0000 True 0.7964 2.9244 True -9.3589 -7.1908 True 4.7876 3.6832 True 0.0000 4.9196 False -1.5973 -2.5172 True -7.3251 -2.9530 True 1.4905 -4.7929 False 0.0000 -0.8635 False -1.1408 8.0662 False 1.0643 0.0000 False 0.8868 -6.1937 False 0.0000 0.1804 False 5.3536 7.4984 True -7.2460 2.2006 False -1.7265 7.3704 False 0.0000 6.0777 False -1.6181 -2.4459 True -8.4008 3.8108 False -1.2444 8.6748 False 0.0000 0.0000 True r8_sign_opposite_test(): r8_sign_opposite() is TRUE if two R8's have opposite signs. R1 R2 Opposite(R1,R2)? 0.0000 0.0000 True 8.4594 -2.1257 True -0.0071 -7.9864 False 2.4472 -3.8462 True 0.0000 9.6976 True 7.7968 6.2908 False 4.2399 -1.1950 True 8.3646 6.3362 False 0.0000 -8.0953 True 1.1399 -3.4158 True -3.8826 0.0000 True -4.5888 -7.7747 False 0.0000 4.8127 True 4.9036 8.8831 False 3.8316 -9.8813 True -0.4471 6.9684 True 0.0000 8.3702 True 4.5545 -2.1370 True -1.2838 -2.8210 False 2.7260 6.2138 False 0.0000 0.0000 True r8_sign_opposite_strict_test(): r8_sign_opposite_strict() is TRUE if two R8's have opposite signs. R1 R2 OppositeStrict(R1,R2)? 0.0000 0.0000 False 1.9728 -7.7611 True 8.0943 0.6397 False 6.0783 -3.3878 True 0.0000 5.8675 False 3.6328 2.8277 False 0.0848 -3.5810 True -7.5944 4.0271 True 0.0000 8.6075 False 0.5719 9.7196 False 8.2942 0.0000 False 7.0767 8.5854 False 0.0000 -1.1429 False -8.8459 -1.9321 False 1.5620 5.8773 False 2.3974 9.3685 False 0.0000 5.4302 False 8.7295 -5.3233 True 5.8441 -3.1891 True 9.3580 -6.5015 True 0.0000 0.0000 False r8_sign3_test(): r8_sign3() returns the three-way sign of an R8. R8 r8_sign3(R8) -1.25 -1 -0.25 -1 0 0 0.5 1 9 1 r8_sincos_sum_test(): r8_sincos_sum() simplifies a linear sine and cosine sum -2.30591 * sin ( -4.44675 * x ) + 3.14622 * cos ( -4.44675 * x ) = 3.90076 * sin ( -4.44675 * x + 2.20327 ) = 3.90076 * cos ( -4.44675 * x + 0.632475 ) I X form 1 form 2 form 3 0 0.000000 3.14622 3.14622 3.14622 1 0.314159 2.81525 2.81525 2.81525 2 0.628319 -2.17252 -2.17252 -2.17252 3 0.942478 -3.56666 -3.56666 -3.56666 4 1.256637 0.938935 0.938935 0.938935 5 1.570796 3.8914 3.8914 3.8914 6 1.884956 0.406971 0.406971 0.406971 7 2.199115 -3.75065 -3.75065 -3.75065 8 2.513274 -1.70419 -1.70419 -1.70419 9 2.827433 3.16122 3.16122 3.16122 10 3.141593 2.79756 2.79756 2.79756 r8_sind_test(): r8_sind() computes the sine of an angle given in degrees. ANGLE r8_sind(ANGLE) 0.00 0 15.00 0.258819 30.00 0.5 45.00 0.707107 60.00 0.866025 75.00 0.965926 90.00 1 105.00 0.965926 120.00 0.866025 135.00 0.707107 150.00 0.5 165.00 0.258819 180.00 1.22465e-16 195.00 -0.258819 210.00 -0.5 225.00 -0.707107 240.00 -0.866025 255.00 -0.965926 270.00 -1 285.00 -0.965926 300.00 -0.866025 315.00 -0.707107 330.00 -0.5 345.00 -0.258819 360.00 -2.44929e-16 r8_softplus_test(): r8_softplus() evaluates the softplus function of an R8. This is a smoothed version of max(x,0). X r8_softplus(X) -500 0 -50 0 -5 0.00671535 -4 0.0181499 -3 0.0485874 -2 0.126928 -1 0.313262 -0.5 0.474077 -0.05 0.66846 -0.005 0.69065 -0.0005 0.692897 0 0.693147 0.0005 0.693397 0.005 0.69565 0.05 0.71846 0.5 0.974077 1 1.31326 2 2.12693 3 3.04859 4 4.01815 5 5.00672 50 50 500 500 5000 5000 50000 50000 r8_sqrt_i4_test(): r8_sqrt_i4() returns the square root of an I4 as an R8. I4 r8_sqrt_i4(I4) 991109 995.545 753746 868.185 831043 911.616 310835 557.526 858883 926.759 131328 362.392 533210 730.212 236489 486.301 391344 625.575 572314 756.514 r8_swap_test(): r8_swap() swaps two reals. Before swapping: X = 1.000000 Y = 3.141590 After swapping: X = 3.141590 Y = 1.000000 r8_swap3_test(): r8_swap3() swaps three reals. Before 1 3.14159 1952 Swap 0: 3.14159 1952 1 Swap 1: 1952 1 3.14159 Swap 2: 1 3.14159 1952 r8_tand_test(): r8_tand() computes the tangent of an angle in degrees. ANGLE r8_tand(ANGLE) 0.00 0 15.00 0.267949 30.00 0.57735 45.00 1 60.00 1.73205 75.00 3.73205 90.00 Undefined 105.00 -3.73205 120.00 -1.73205 135.00 -1 150.00 -0.57735 165.00 -0.267949 180.00 -1.22465e-16 195.00 0.267949 210.00 0.57735 225.00 1 240.00 1.73205 255.00 3.73205 270.00 Undefined 285.00 -3.73205 300.00 -1.73205 315.00 -1 330.00 -0.57735 345.00 -0.267949 360.00 -2.44929e-16 r8_tiny_test(): r8_tiny() returns a "tiny" R8; r8_tiny = 1e-30 r8_to_dhms_test(): r8_to_dhms() converts a real day measure into days, hours, minutes, seconds. X D H M S 7.13256 7 3 10 53.0629 9.45135 9 10 49 56.9567 3.66234 3 15 53 46.5532 5.04848 5 1 9 48.3907 3.50419 3 12 6 2.17553 8.10768 8 2 35 3.20995 -0.165138 0 -3 -57 -47.9195 9.15804 9 3 47 34.4244 -0.594243 0 -14 -15 -42.5937 -0.0258904 0 0 -37 -16.9292 r8_to_i4_test(): r8_to_i4() finds an integer IX in [IXMIN,IXMAX] corresponding to X in [XMIN,XMAX]. XMIN = 2.500000, X = 3.500000, XMAX = 5.500000 IXMIN = 10, IX = 20, IXMAX = 40 r8_to_r8_discrete_test(): r8_to_r8_discrete() maps numbers to a discrete set of equally spaced numbers in an interval. Number of discrete values = 19 Real interval: [1.000000, 10.000000] R RD -0.571805 1.000000 11.121107 10.000000 3.787581 3.842105 5.285316 5.263158 11.015717 10.000000 10.277871 10.000000 11.080904 10.000000 8.748431 8.578947 8.122393 8.105263 9.423945 9.526316 8.086417 8.105263 9.193397 9.052632 -0.242843 1.000000 10.533435 10.000000 1.587585 1.473684 r8_uniform_01_test(): r8_uniform_01() produces a sequence of random values. 0.040406 0.862378 0.185823 0.090393 0.172975 0.211650 0.115999 0.506683 0.285852 0.447595 r8_uniform_ab_test(): r8_uniform_ab() returns random values in a given range: [ A, B ] For this problem: A = 10.000000 B = 20.000000 14.835029 14.021970 14.797497 15.900697 16.920001 11.906769 14.909937 10.758345 17.048911 15.169670 r8_unswap3_test(): r8_unswap3() unswaps three reals. Data : 1 3.14159 1952 Swap : 3.14159 1952 1 Unswap : 1 3.14159 1952 r8_walsh_1d_test(): r8_walsh_1d() evaluates 1D Walsh functions: X W(+2) W(+1) W(0) W(-1) W(-2) W(-3) 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.250000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.500000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.750000 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.250000 0.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.500000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 1.750000 0.000000 0.000000 1.000000 1.000000 1.000000 0.000000 2.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 2.250000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 2.500000 0.000000 1.000000 0.000000 1.000000 0.000000 0.000000 2.750000 0.000000 1.000000 0.000000 1.000000 1.000000 0.000000 3.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 3.250000 0.000000 1.000000 1.000000 0.000000 1.000000 0.000000 3.500000 0.000000 1.000000 1.000000 1.000000 0.000000 0.000000 3.750000 0.000000 1.000000 1.000000 1.000000 1.000000 0.000000 4.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 4.250000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 4.500000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 4.750000 1.000000 0.000000 0.000000 1.000000 1.000000 0.000000 5.000000 1.000000 0.000000 1.000000 0.000000 0.000000 0.000000 5.250000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 5.500000 1.000000 0.000000 1.000000 1.000000 0.000000 0.000000 5.750000 1.000000 0.000000 1.000000 1.000000 1.000000 0.000000 6.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 6.250000 1.000000 1.000000 0.000000 0.000000 1.000000 0.000000 6.500000 1.000000 1.000000 0.000000 1.000000 0.000000 0.000000 6.750000 1.000000 1.000000 0.000000 1.000000 1.000000 0.000000 7.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 7.250000 1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 7.500000 1.000000 1.000000 1.000000 1.000000 0.000000 0.000000 7.750000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 8.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 r8_wrap_test(): r8_wrap "wraps" an R8 to lie within an interval: Wrapping interval is 3.000000, 6.500000 R r8_wrap ( R ) 5.91142 5.91142 5.88329 5.88329 9.30281 5.80281 11.8396 4.83962 11.2245 4.22445 6.24283 6.24283 3.63674 3.63674 4.36518 4.36518 0.371519 3.87152 1.99961 5.49961 4.13085 4.13085 8.94842 5.44842 9.70511 6.20511 -1.60023 5.39977 -1.459 5.541 0.64497 4.14497 -0.447546 3.05245 7.61165 4.11165 -0.0781177 3.42188 4.64773 4.64773 r82col_print_part_test(): r82col_print_part() prints an R82COL. Output with MAX_print = 2 0 11 12 1 21 22 ...more entries... Output with MAX_print = 5 0 11 12 1 21 22 2 31 32 .... .............. .............. 9 101 102 Output with MAX_print = 25 0 11 12 1 21 22 2 31 32 3 41 42 4 51 52 5 61 62 6 71 72 7 81 82 8 91 92 9 101 102 r82row_print_part_test(): r82row_print_part prints part of an R82ROW, a real array of 2 rows. Output with MAX_print = 2 0 11 21 1 12 22 ...more entries... Output with MAX_print = 5 0 11 21 1 12 22 2 13 23 .... .............. .............. 9 20 30 Output with MAX_print = 25 0 11 21 1 12 22 2 13 23 3 14 24 4 15 25 5 16 26 6 17 27 7 18 28 8 19 29 9 20 30 r82vec_print_part_test(): r82vec_print_part() prints an R8VEC. Output with MAX_print = 2 0 11.000000 21.000000 1 12.000000 22.000000 ...more entries... Output with MAX_print = 5 0 11.000000 21.000000 1 12.000000 22.000000 2 13.000000 23.000000 .... .............. .............. 9 20.000000 30.000000 Output with MAX_print = 25 0 11.000000 21.000000 1 12.000000 22.000000 2 13.000000 23.000000 3 14.000000 24.000000 4 15.000000 25.000000 5 16.000000 26.000000 6 17.000000 27.000000 7 18.000000 28.000000 8 19.000000 29.000000 9 20.000000 30.000000 r83col_print_part_test(): r83col_print_part() prints part of an R83COL. Output with MAX_print = 2 0 11 12 13 1 21 22 23 ...more entries... Output with MAX_print = 5 0 11 12 13 1 21 22 23 2 31 32 33 .... .............. .............. .............. 9 101 102 103 Output with MAX_print = 25 0 11 12 13 1 21 22 23 2 31 32 33 3 41 42 43 4 51 52 53 5 61 62 63 6 71 72 73 7 81 82 83 8 91 92 93 9 101 102 103 r83row_print_part_test(): r83row_print_part() prints part of an R83ROW, a real array of 3 rows. Output with MAX_print = 2 0 11 21 31 1 12 22 32 ...more entries... Output with MAX_print = 5 0 11 21 31 1 12 22 32 2 13 23 33 .... .............. .............. 9 20 30 40 Output with MAX_print = 25 0 11 21 31 1 12 22 32 2 13 23 33 3 14 24 34 4 15 25 35 5 16 26 36 6 17 27 37 7 18 28 38 8 19 29 39 9 20 30 40 r8block_print_test(): r8block_print() prints an R8BLOCK. The 3D array: K = 0 0 1 2 0: 1 1 1 1: 2 4 8 2: 3 9 27 3: 4 16 64 K = 1 0 1 2 0: 2 2 2 1: 4 8 16 2: 6 18 54 3: 8 32 128 r8col_flip_test(): r8col_flip() flips the columns of an R8COL. Matrix A: Col: 0 1 2 3 Row 0 : 0.859306 0.483168 0.0254786 0.645687 1 : 0.405039 0.477303 0.961053 0.420417 2 : 0.916414 0.909267 0.968953 0.0262653 3 : 0.423542 0.631287 0.374124 0.0255664 4 : 0.711232 0.151879 0.145581 0.195346 Matrix after column flipping: Col: 0 1 2 3 Row 0 : 0.711232 0.151879 0.145581 0.195346 1 : 0.423542 0.631287 0.374124 0.0255664 2 : 0.916414 0.909267 0.968953 0.0262653 3 : 0.405039 0.477303 0.961053 0.420417 4 : 0.859306 0.483168 0.0254786 0.645687 r8mat_add_test(): r8mat_add() computes C = alpha * A + beta * B for R8MATs. A: Col: 0 1 2 3 Row 0 : 11 12 13 14 1 : 21 22 23 24 2 : 31 32 33 34 3 : 41 42 43 44 B: Col: 0 1 2 3 Row 0 : 11 21 31 41 1 : 12 22 32 42 2 : 13 23 33 43 3 : 14 24 34 44 ALPHA = 3, BETA = 0.5 C = alpha * A + beta * B: Col: 0 1 2 3 Row 0 : 38.5 46.5 54.5 62.5 1 : 69 77 85 93 2 : 99.5 107.5 115.5 123.5 3 : 130 138 146 154 r8mat_cholesky_factor_test(): r8mat_cholesky_factor() determines the lower triangular Cholesky factorization of a symmetric positive definite matrix, Matrix to be factored: Col: 0 1 2 3 4 Row 0 : 2 -1 0 0 0 1 : -1 2 -1 0 0 2 : 0 -1 2 -1 0 3 : 0 0 -1 2 -1 4 : 0 0 0 -1 2 Cholesky factor L: Col: 0 1 2 3 4 Row 0 : 1.41421 0 0 0 0 1 : -0.707107 1.22474 0 0 0 2 : 0 -0.816497 1.1547 0 0 3 : 0 0 -0.866025 1.11803 0 4 : 0 0 0 -0.894427 1.09545 Product L * L': Col: 0 1 2 3 4 Row 0 : 2 -1 0 0 0 1 : -1 2 -1 0 0 2 : 0 -1 2 -1 0 3 : 0 0 -1 2 -1 4 : 0 0 0 -1 2 r8mat_cholesky_factor_upper_test(): r8mat_cholesky_factor_upper() determines the upper triangular Cholesky factorization of a positive definite symmetric matrix, Matrix to be factored: Col: 0 1 2 3 4 Row 0 : 2 -1 0 0 0 1 : -1 2 -1 0 0 2 : 0 -1 2 -1 0 3 : 0 0 -1 2 -1 4 : 0 0 0 -1 2 Cholesky factor R: Col: 0 1 2 3 4 Row 0 : 1.41421 -0.707107 0 0 0 1 : 0 1.22474 -0.816497 0 0 2 : 0 0 1.1547 -0.866025 0 3 : 0 0 0 1.11803 -0.894427 4 : 0 0 0 0 1.09545 Product R' * R: Col: 0 1 2 3 4 Row 0 : 2 -1 0 0 0 1 : -1 2 -1 0 0 2 : 0 -1 2 -1 0 3 : 0 0 -1 2 -1 4 : 0 0 0 -1 2 r8mat_cholesky_solve_test(): r8mat_cholesky_solve() solves a linear system using the lower triangular Cholesky factorization, for a positive definite symmetric matrix. Matrix to be factored: Col: 0 1 2 3 4 Row 0 : 2 -1 0 0 0 1 : -1 2 -1 0 0 2 : 0 -1 2 -1 0 3 : 0 0 -1 2 -1 4 : 0 0 0 -1 2 Cholesky factor L: Col: 0 1 2 3 4 Row 0 : 1.41421 0 0 0 0 1 : -0.707107 1.22474 0 0 0 2 : 0 -0.816497 1.1547 0 0 3 : 0 0 -0.866025 1.11803 0 4 : 0 0 0 -0.894427 1.09545 Product L * L': Col: 0 1 2 3 4 Row 0 : 2 -1 0 0 0 1 : -1 2 -1 0 0 2 : 0 -1 2 -1 0 3 : 0 0 -1 2 -1 4 : 0 0 0 -1 2 Right hand side b: 0: 0 1: 0 2: 0 3: 0 4: 6 Computed solution x: 0: 1 1: 2 2: 3 3: 4 4: 5 r8mat_column_append_test(): r8mat_column_append() appends a column to a 2D array. The original array x: Col: 0 1 Row 0 : 11 12 1 : 21 22 2 : 31 32 The vector y1 to be added: 0: 13 1: 23 2: 33 The array + y1 Col: 0 1 2 Row 0 : 11 12 13 1 : 21 22 23 2 : 31 32 33 The vector y2 to be added: 0: 14 1: 24 2: 34 The array + y1 + y2 Col: 0 1 2 3 Row 0 : 11 12 13 14 1 : 21 22 23 24 2 : 31 32 33 34 The vector y2 to be added: 0: 14 1: 24 2: 34 The array + y1 + y2 Col: 0 1 2 3 4 Row 0 : 11 12 13 14 14 1 : 21 22 23 24 24 2 : 31 32 33 34 34 r8mat_det_2d_test(): r8mat_det_2d(): determinant of a 2 by 2 matrix; Matrix: Col: 0 1 Row 0 : 1 1 1 : 1 10 r8mat_det_2d computes determinant: 9.0 Exact determinant is 9.0 r8mat_det_3d_test(): r8mat_det_3d(): determinant of a 3 by 3 matrix Matrix: Col: 0 1 2 Row 0 : 1 1 1 1 : 1 10 100 2 : 1 4 16 r8mat_det_3d computes determinant: -162 Exact determinant is -162 r8mat_det_4d_test(): r8mat_det_4d() determinant of a 4 by 4 matrix Matrix: Col: 0 1 2 3 Row 0 : 1 1 1 1 1 : 1 10 100 1000 2 : 1 4 16 64 3 : 1 2 4 8 r8mat_det_4d computes determinant: -2592 Exact determinant is -2592 r8mat_diag_get_vector_test(): r8mat_diag_get_vector() retrieves the diagonal from an R8MAT. Random R8MAT: Col: 0 1 2 3 4 Row 0 : 0.966482 0.952466 0.78261 0.0214943 0.933013 1 : 0.758417 0.726252 0.553186 0.0987251 0.0323783 2 : 0.901271 0.562258 0.425752 0.630953 0.666335 3 : 0.233086 0.790344 0.0900131 0.368425 0.927801 4 : 0.776552 0.965667 0.9002 0.282796 0.328005 Diagonal vector: 0: 0.966482 1: 0.726252 2: 0.425752 3: 0.368425 4: 0.328005 r8mat_house_axh_test(): r8mat_house_axh() multiplies a matrix A times a compact Householder matrix. Matrix A: Col: 0 1 2 3 4 Row 0 : 3.5798 -0.350615 4.7285 3.27667 -2.71603 1 : -4.54843 -2.84228 2.35523 2.49602 -3.27195 2 : -0.690006 2.81613 4.68588 1.579 -3.1578 3 : -3.83625 1.85893 -2.54313 3.45897 -3.79946 4 : -3.77052 -0.105027 -3.30959 4.17201 -3.57406 Compact vector V so column 3 of H*A is packed: 0: 0 1: 0 2: 0.934539 3: -0.216826 4: -0.282175 Householder matrix H: Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : 0 1 0 0 0 2 : 0 0 -0.746728 0.405266 0.527406 3 : 0 0 0.405266 0.905973 -0.122366 4 : 0 0 0.527406 -0.122366 0.840755 Indirect product A*H: Col: 0 1 2 3 4 Row 0 : 3.5798 -0.350615 -3.63543 5.21722 -0.190628 1 : -4.54843 -2.84228 -2.47281 3.6162 -1.81418 2 : -0.690006 2.81613 -4.52461 3.71597 -0.376789 3 : -3.83625 1.85893 1.29697 2.56802 -4.95894 4 : -3.77052 -0.105027 2.27715 2.8758 -5.26092 Direct product A*H: Col: 0 1 2 3 4 Row 0 : 3.5798 -0.350615 -3.63543 5.21722 -0.190628 1 : -4.54843 -2.84228 -2.47281 3.6162 -1.81418 2 : -0.690006 2.81613 -4.52461 3.71597 -0.376789 3 : -3.83625 1.85893 1.29697 2.56802 -4.95894 4 : -3.77052 -0.105027 2.27715 2.8758 -5.26092 H*A should pack column 3: Col: 0 1 2 3 4 Row 0 : 3.5798 -0.350615 4.7285 3.27667 -2.71603 1 : -4.54843 -2.84228 2.35523 2.49602 -3.27195 2 : -3.02805 -1.40492 -6.27523 2.42306 -1.06675 3 : -3.29379 2.83827 0 3.26314 -4.28462 4 : -3.06457 1.16948 0 3.91715 -4.20543 r8mat_house_form_test(): r8mat_house_form() forms a Householder matrix from its compact form. Compact vector form V: 0: 0 1: 0 2: 1 3: 2 4: 3 Householder matrix H: Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : 0 1 0 0 0 2 : 0 0 0.857143 -0.285714 -0.428571 3 : 0 0 -0.285714 0.428571 -0.857143 4 : 0 0 -0.428571 -0.857143 -0.285714 r8mat_identity_test(): r8mat_identity() creates an identity matrix. The identity matrix: Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : 0 1 0 0 0 2 : 0 0 1 0 0 3 : 0 0 0 1 0 4 : 0 0 0 0 1 r8mat_indicator_test(): r8mat_indicator() creates an "indicator" R8MAT. The indicator matrix: Col: 0 1 2 3 Row 0 : 11 12 13 14 1 : 21 22 23 24 2 : 31 32 33 34 3 : 41 42 43 44 4 : 51 52 53 54 r8mat_inverse_3d_test(): r8mat_inverse_3d inverts a 3 by 3 matrix. Matrix A to be inverted: Col: 0 1 2 Row 0 : 1 2 3 1 : 4 5 6 2 : 7 8 0 Inverse matrix B: Col: 0 1 2 Row 0 : -1.77778 0.888889 -0.111111 1 : 1.55556 -0.777778 0.222222 2 : -0.111111 0.222222 -0.111111 Product C = A * B: Col: 0 1 2 Row 0 : 1 -1.11022e-16 0 1 : 5.55112e-16 1 0 2 : 1.77636e-15 -8.88178e-16 1 r8mat_is_binary_test(): r8mat_is_binary() is TRUE if an R8MAT only contains 0 or 1 entries. X: Col: 0 1 2 Row 0 : 0 1 0 1 : 1 0 1 X is binary X: Col: 0 1 2 Row 0 : 1 1 1 1 : 1 1 1 X is binary X: Col: 0 1 2 Row 0 : 0 1 0 1 : 1 2 1 X is NOT binary. r8mat_l_solve_test(): r8mat_l_solve() solves a lower triangular system. Input matrix A: Col: 0 1 2 3 Row 0 : 1 0 0 0 1 : 2 3 0 0 2 : 4 5 6 0 3 : 7 8 9 10 Right hand side b: 0: 1 1: 8 2: 32 3: 90 Computed solution x: 0: 1 1: 2 2: 3 3: 4 Norm of A*x-b = 0 r8mat_l1_inverse_test(): r8mat_l1_inverse() inverts a unit lower triangular matrix. Matrix A to be inverted: Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : 2 1 0 0 0 2 : 0 0 1 0 0 3 : 5 0 3 1 0 4 : 0 0 0 0 1 5 : 75 0 0 6 4 Col: 5 Row 0 : 0 1 : 0 2 : 0 3 : 0 4 : 0 5 : 1 Inverse matrix B: Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : -2 1 0 0 0 2 : -0 -0 1 0 0 3 : -5 -0 -3 1 0 4 : -0 -0 -0 -0 1 5 : -45 -0 18 -6 -4 Col: 5 Row 0 : 0 1 : 0 2 : 0 3 : 0 4 : 0 5 : 1 Product C = A * B: Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : 0 1 0 0 0 2 : 0 0 1 0 0 3 : 0 0 0 1 0 4 : 0 0 0 0 1 5 : 0 0 0 0 0 Col: 5 Row 0 : 0 1 : 0 2 : 0 3 : 0 4 : 0 5 : 1 r8mat_lt_solve_test(): r8mat_lt_solve() solves a transposed lower triangular system. Input matrix A: Col: 0 1 2 3 Row 0 : 1 0 0 0 1 : 2 3 0 0 2 : 4 5 6 0 3 : 7 8 9 10 Right hand side b: 0: 45 1: 53 2: 54 3: 40 Computed solution x: 0: 1 1: 2 2: 3 3: 4 Norm of A'*x-b = 0 r8mat_mm_test(): r8mat_mm() computes a matrix-matrix product C = A * B; A: Col: 0 1 2 Row 0 : 1 0 0 1 : 1 1 0 2 : 1 2 1 3 : 1 3 3 B: Col: 0 1 2 3 Row 0 : 1 1 1 1 1 : 0 1 2 3 2 : 0 0 1 3 C = A*B: Col: 0 1 2 3 Row 0 : 1 1 1 1 1 : 1 2 3 4 2 : 1 3 6 10 3 : 1 4 10 19 r8mat_mtm_test(): r8mat_mtm() computes a matrix-matrix product C = A' * B; A: Col: 0 1 2 3 Row 0 : 1 0 0 0 1 : 1 1 0 0 2 : 1 2 1 0 B: Col: 0 1 2 3 Row 0 : 1 0 0 0 1 : 1 1 0 0 2 : 1 2 1 0 C = A'*B: Col: 0 1 2 3 Row 0 : 3 3 1 0 1 : 3 5 2 0 2 : 1 2 1 0 3 : 0 0 0 0 r8mat_mtv_test(): r8mat_mtv() computes a matrix-vector product b = A' * x; A: Col: 0 1 Row 0 : 1 1 1 : 2 1 2 : 3 1 3 : 4 1 X: 0: 1 1: 2 2: 3 3: 4 B = A'*X: 0: 30 1: 10 r8mat_mv_test(): r8mat_mv() computes a matrix-vector product b = A * x; A: Col: 0 1 Row 0 : 1 1 1 : 2 1 2 : 3 1 3 : 4 1 X: 0: 1 1: 2 B = A*X: 0: 3 1: 4 2: 5 3: 6 r8mat_nint_test(): r8mat_nint() rounds an R8MAT. Matrix A: Col: 0 1 2 3 Row 0 : 4.59958 1.19498 3.30244 -4.7819 1 : 4.02142 0.645283 -4.9222 3.13847 2 : -2.49018 4.66666 -3.58749 0.993233 3 : -2.8402 0.130581 -4.41671 3.89948 4 : -2.21095 4.74285 -0.152808 -0.431862 Rounded matrix A: Col: 0 1 2 3 Row 0 : 5 1 3 -5 1 : 4 1 -5 3 2 : -2 5 -4 1 3 : -3 0 -4 4 4 : -2 5 0 0 r8mat_nonzeros_test(): r8mat_nonzeros() counts nonzeros in an R8MAT. Matrix A: Col: 0 1 2 3 Row 0 : 1 0 1 0 1 : 0 0 0 0 2 : 1 0 1 0 3 : 0 0 0 0 4 : 1 0 1 0 Expected nonzeros = 6 Computed nonzeros = 6 r8mat_norm_fro_test(): r8mat_norm_fro() computes the Frobenius norm of an R8MAT; A: Col: 0 1 2 3 Row 0 : 1 2 3 4 1 : 5 6 7 8 2 : 9 10 11 12 3 : 13 14 15 16 4 : 17 18 19 20 Expected Frobenius norm = 53.5724 Computed Frobenius norm = 53.5724 r8mat_norm_fro_affine_test(): r8mat_norm_fro_affine() computes the Frobenius norm of the difference of two R8MAT's; Expected norm = 2.02505 Computed norm = 2.02505 r8mat_norm_l1_test(): r8mat_norm_l1() computes the L1 norm of an R8MAT; A: Col: 0 1 2 3 Row 0 : -3 2 -4 0 1 : 1 -3 -3 -1 2 : -2 5 0 -1 3 : 0 1 -1 4 4 : 0 2 5 4 Computed L1 norm = 13 r8mat_normal_01_test(): r8mat_normal_01() returns a matrix of Normal 01 values Matrix: Col: 0 1 2 3 Row 0 : 0.673602 0.0649109 -0.267058 1.98108 1 : -0.798048 0.360095 1.01631 0.999903 2 : -0.353698 -1.01008 1.48758 0.843414 3 : -0.283165 -1.90206 0.445969 -0.591453 4 : 0.00253196 -0.835303 -0.582091 -0.0869916 r8mat_print_test(): r8mat_print() prints an R8MAT. Here is an R8MAT: Col: 0 1 2 3 4 Row 0 : 11 12 13 14 15 1 : 21 22 23 24 25 2 : 31 32 33 34 35 3 : 41 42 43 44 45 Col: 5 Row 0 : 16 1 : 26 2 : 36 3 : 46 r8mat_print_some_python3_test(): r8mat_print_some_python3() prints some of an R8MAT. Here is an R8MAT: Col: 3 4 5 Row 0 : 14 15 16 1 : 24 25 26 2 : 34 35 36 r8mat_product_elementwise_test(): r8mat_product_elementwise() computes the elementwise product of two R8MATs. A: Col: 0 1 2 Row 0 : 1 2 3 1 : 4 5 6 B: Col: 0 1 2 Row 0 : 1 3 5 1 : 2 4 6 Elementwise product = 86 r8mat_ref_test(): r8mat_ref computes the row echelon form of a matrix. Input A: Col: 0 1 2 3 4 Row 0 : 1 3 0 2 6 1 : -2 -6 0 -2 -8 2 : 3 9 0 0 6 3 : -1 -3 0 1 0 Col: 5 6 Row 0 : 3 1 1 : 3 1 2 : 6 2 3 : 9 3 Pseudo-determinat = 48 REF form: Col: 0 1 2 3 4 Row 0 : 1 3 0 2 6 1 : 0 0 0 1 2 2 : 0 0 0 0 0 3 : 0 0 0 0 0 Col: 5 6 Row 0 : 3 1 1 : 4.5 1.5 2 : 1 0.333333 3 : 0 0 r8mat_rref_test(): r8mat_rref computes the reduced row echelon form of a matrix. Input A: Col: 0 1 2 3 4 Row 0 : 1 3 0 2 6 1 : -2 -6 0 -2 -8 2 : 3 9 0 0 6 3 : -1 -3 0 1 0 Col: 5 6 Row 0 : 3 1 1 : 3 1 2 : 6 2 3 : 9 3 Pseudo-determinant = 48 RREF form: Col: 0 1 2 3 4 Row 0 : 1 3 0 0 2 1 : 0 0 0 1 2 2 : 0 0 0 0 0 3 : 0 0 0 0 0 Col: 5 6 Row 0 : 0 0 1 : 0 0 2 : 1 0.333333 3 : 0 0 r8mat_rref_solve_binary_test(): r8mat_rref_solve_binary() seeks binary solutions of a Reduced Row Echelon Form linear system A*x=b. The RREF matrix A: Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : 0 1 0 0 0 2 : 0 0 1 0 0 3 : 0 0 0 1 0 4 : 0 0 0 0 1 5 : 0 0 0 0 0 6 : 0 0 0 0 0 7 : 0 0 0 0 0 8 : 0 0 0 0 0 Col: 5 6 7 8 9 Row 0 : 0 1 0 -1 0 1 : 0 0 0 1 0 2 : 0 1 0 -1 0 3 : 0 0 0 1 1 4 : 0 0 0 0 1 5 : 1 -1 0 1 0 6 : 0 0 1 0 -1 7 : 0 0 0 0 0 8 : 0 0 0 0 0 The RREF right hand side b: 0: 0 1: 1 2: 0 3: 1 4: 1 5: 1 6: 0 7: 0 8: 0 Binary solution vectors x: Col: 0 1 2 3 Row 0 : 0 0 1 0 1 : 1 1 0 0 2 : 0 0 1 0 3 : 1 0 0 0 4 : 1 0 1 1 5 : 1 1 0 1 6 : 0 0 0 1 7 : 0 1 0 0 8 : 0 0 1 1 9 : 0 1 0 0 r8mat_rref_solve_binary_nz_test(): r8mat_rref_solve_binary_nz() seeks binary solutions of a Reduced Row Echelon Form linear system A*x=b which have exactly NZ nonzeros. The RREF matrix A: Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : 0 1 0 0 0 2 : 0 0 1 0 0 3 : 0 0 0 1 0 4 : 0 0 0 0 1 5 : 0 0 0 0 0 6 : 0 0 0 0 0 7 : 0 0 0 0 0 8 : 0 0 0 0 0 Col: 5 6 7 8 9 Row 0 : 0 1 0 -1 0 1 : 0 0 0 1 0 2 : 0 1 0 -1 0 3 : 0 0 0 1 1 4 : 0 0 0 0 1 5 : 1 -1 0 1 0 6 : 0 0 1 0 -1 7 : 0 0 0 0 0 8 : 0 0 0 0 0 The RREF right hand side b: 0: 0 1: 1 2: 0 3: 1 4: 1 5: 1 6: 0 7: 0 8: 0 Only consider binary solutions with exactly 4 nonzeros. VERBOSE: System has 3 degrees of freedom. VERBOSE: Augmented Row-Reduced Echelon Form system matrix A and right hand side B: Columns associated with a free variable are headed with a "*" : : : : : : * : * * 1 0 0 0 0 0 1 0-1 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0-1 0 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 1-1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0-1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 VERBOSE: Tried 8 right hands sides, found 4 solutions. Binary solution vectors x: Col: 0 1 2 3 Row 0 : 0 1 0 0 1 : 1 0 1 0 2 : 0 1 0 0 3 : 1 0 0 0 4 : 1 1 0 1 5 : 1 0 1 1 6 : 0 0 0 1 7 : 0 0 1 0 8 : 0 1 0 1 9 : 0 0 1 0 r8mat_scale_01_test(): r8mat_scale_01() shifts and scales the columns of an R8MAT so they each have min 0 and max 1 Array X: Col: 0 1 2 Row 0 : -3.22798 7.65382 5.7065 1 : 4.55993 4.32612 13.0099 2 : 1.71501 9.4344 14.7676 3 : 12.4859 8.00092 -2.22208 4 : 12.7831 -1.20085 7.63234 mean(X): 5.66319 5.64288 7.77886 std(X): 6.21451 3.80921 6.00902 max(X): 12.7831 9.4344 14.7676 min(X): -3.22798 -1.20085 -2.22208 Array XS: Col: 0 1 2 Row 0 : 0 0.832578 0.466669 1 : 0.486408 0.519684 0.896541 2 : 0.308723 1 1 3 : 0.981439 0.865215 0 4 : 1 0 0.580023 mean(XS): 0.555314 0.643495 0.588646 std(XS): 0.388138 0.358168 0.353686 max(XS): 1 1 1 min(XS): 0 0 0 r8mat_scale_ab_test(): r8mat_scale_ab() shifts and scales the columns of an R8MAT so they each have min A and max B Array X: Col: 0 1 2 Row 0 : 3.68067 -2.79728 -3.1209 1 : -0.0613509 10.7799 -0.123269 2 : 0.0902451 4.7336 10.3405 3 : 3.44129 -2.46862 3.53784 4 : 13.4138 -0.140165 14.3801 mean(X): 4.11294 2.02148 5.00285 std(X): 4.91429 5.14041 6.49372 max(X): 13.4138 10.7799 14.3801 min(X): -0.0613509 -2.79728 -3.1209 Scaling data to [-1,1] Array XS: Col: 0 1 2 Row 0 : -0.444606 -1 -1 1 : -1 1 -0.657434 2 : -0.9775 0.109346 0.538352 3 : -0.480135 -0.951586 -0.239046 4 : 1 -0.60859 1 mean(XS): -0.380448 -0.290166 -0.0716254 std(XS): 0.729384 0.757215 0.742096 max(XS): 1 1 1 min(XS): -1 -1 -1 r8mat_solve_test(): r8mat_solve() solves linear systems. The linear system: Col: 0 1 2 3 4 Row 0 : 1 2 3 14 7 1 : 4 5 6 32 16 2 : 7 8 0 23 7 Factored matrix and solutions: Col: 0 1 2 3 4 Row 0 : 1 0 0 1 1 1 : 0 1 0 2 0 2 : 0 0 1 3 2 r8mat_standardize_test(): r8mat_standardize() shifts and scales an R8MAT so that each column has zero mean and unit standard deviation. Vector X: Col: 0 1 2 Row 0 : 11.5086 2.96948 -0.648972 1 : -1.06855 2.45589 5.33589 2 : -4.28259 9.28623 14.6865 3 : 1.28866 11.1224 10.7548 4 : 9.10766 -3.23333 3.08994 5 : 2.35095 10.1086 4.45537 6 : 10.9975 10.0327 4.03467 7 : 1.30769 4.19381 -1.30723 8 : 4.81536 10.1621 0.0908585 9 : -3.50325 2.39734 10.5024 mean(X) = 3.25221 5.94952 5.09943 std(X) = 5.71951 4.83873 5.35315 max(X) = 11.5086 11.1224 14.6865 min(X) = -4.28259 -3.23333 -1.30723 Vector XS: Col: 0 1 2 Row 0 : -0.568616 -1.22956 -0.952603 1 : -0.568616 -1.22956 -0.952603 2 : -0.568616 -1.22956 -0.952603 3 : -0.568616 -1.22956 -0.952603 4 : -0.568616 -1.22956 -0.952603 5 : -0.568616 -1.22956 -0.952603 6 : -0.568616 -1.22956 -0.952603 7 : -0.568616 -1.22956 -0.952603 8 : -0.568616 -1.22956 -0.952603 9 : -0.568616 -1.22956 -0.952603 mean(X) = -0.568616 -1.22956 -0.952603 std(X) = 1.17028e-16 2.34056e-16 1.17028e-16 max(X) = -0.568616 -1.22956 -0.952603 min(X) = -0.568616 -1.22956 -0.952603 r8mat_transpose_test(): r8mat_transpose() transposes an R8MAT. Matrix A: Col: 0 1 2 3 Row 0 : 11 12 13 14 1 : 21 22 23 24 2 : 31 32 33 34 3 : 41 42 43 44 4 : 51 52 53 54 Transposed matrix At: Col: 0 1 2 3 4 Row 0 : 11 21 31 41 51 1 : 12 22 32 42 52 2 : 13 23 33 43 53 3 : 14 24 34 44 54 r8mat_transpose_print_test(): r8mat_transpose_print() prints an R8MAT. Here is an R8MAT, transposed: Row: 0 1 2 3 Col 0 : 11 21 31 41 1 : 12 22 32 42 2 : 13 23 33 43 r8mat_transpose_print_some_test(): r8mat_transpose_print_some() prints some of an R8MAT, transposed. R8MAT, rows 0:2, cols 3:5: Row: 0 1 2 Col 3 : 14 24 34 4 : 15 25 35 5 : 16 26 36 r8mat_u_inverse_test(): r8mat_u_inverse inverts an upper triangular matrix. Input matrix A Col: 0 1 2 3 Row 0 : 1 2 4 7 1 : 0 3 5 8 2 : 0 0 6 9 3 : 0 0 0 10 Inverse matrix B: Col: 0 1 2 3 Row 0 : 1 -0.666667 -0.111111 -0.0666667 1 : 0 0.333333 -0.277778 -0.0166667 2 : 0 0 0.166667 -0.15 3 : 0 0 0 0.1 Product C = A * B: Col: 0 1 2 3 Row 0 : 1 0 0 -2.77556e-17 1 : 0 1 2.77556e-17 0 2 : 0 0 1 1.38778e-16 3 : 0 0 0 1 r8mat_u_solve_test(): r8mat_u_solve() solves an upper triangular system. Input matrix A: Col: 0 1 2 3 Row 0 : 1 2 4 7 1 : 0 3 5 8 2 : 0 0 6 9 3 : 0 0 0 10 Right hand side b: 0: 45 1: 53 2: 54 3: 40 Computed solution x: 0: 1 1: 2 2: 3 3: 4 Norm of A*x-b = 0 r8mat_uniform_01_test(): r8mat_uniform_01() computes a random R8MAT. 0 <= X <= 1 Random R8MAT: Col: 0 1 2 3 Row 0 : 0.921962 0.650664 0.333402 0.923178 1 : 0.0695649 0.94464 0.717483 0.235427 2 : 0.0757744 0.776641 0.264463 0.649158 3 : 0.528064 0.930602 0.11636 0.093434 4 : 0.257994 0.425146 0.561915 0.983971 r8mat_uniform_ab_test(): r8mat_uniform_ab() computes a random R8MAT. -1 <= X <= 5 Random R8MAT: Col: 0 1 2 3 Row 0 : 3.45459 -0.806867 0.230742 2.1994 1 : 2.02976 4.77783 4.86599 -0.678779 2 : 4.88724 1.25903 -0.92985 3.15734 3 : 1.28528 0.018704 2.48424 0.97308 4 : 3.05213 1.68527 -0.839011 2.24202 r8mat_uniform_abvec_test(): r8mat_uniform_abvec() computes a random R8MAT. Lower and upper row limits: 0: 2 10 1: 0 1 2: -1 0 3: 100 110 4: 0.1 0.2 Random R8MAT: Col: 0 1 2 3 Row 0 : 3.59022 5.35225 4.80332 3.70579 1 : 0.71056 0.390735 0.483481 0.309802 2 : -0.414952 -0.989118 -0.842497 -0.48453 3 : 100.166 109.397 105.24 107.173 4 : 0.16878 0.197953 0.126315 0.117494 r8mat_ut_solve_test(): r8mat_ut_solve() solves a transposed upper triangular system. Input matrix A: Col: 0 1 2 3 Row 0 : 1 2 4 7 1 : 0 3 5 8 2 : 0 0 6 9 3 : 0 0 0 10 Right hand side b: 0: 1 1: 8 2: 32 3: 90 Computed solution x: 0: 1 1: 2 2: 3 3: 4 Norm of A'*x-b = 0 r8mat_vand2_test(): r8mat_vand2() returns a row Vandermonde matrix. The factor vector X: 0: 1 1: 2 2: 3 3: 4 4: 5 The row Vandermonde matrix: Col: 0 1 2 3 Row 0 : 1 1 1 1 1 : 1 2 4 8 2 : 1 3 9 27 3 : 1 4 16 64 4 : 1 5 25 125 r8rows_to_r8mat_test(): r8rows_to_r8mat() allows an R8MAT to be initialized by data stored ROW-WISE in a vector. The data vector: 0: 11 1: 12 2: 13 3: 14 4: 21 5: 22 6: 23 7: 24 8: 31 9: 32 10: 33 11: 34 The data copied into an array: Col: 0 1 2 3 Row 0 : 11 12 13 14 1 : 21 22 23 24 2 : 31 32 33 34 r8vec_amax_test(): r8vec_amax() computes the maximum absolute value entry in an R8VEC. Input vector: 0: -2.96243 1: 3.51266 2: -3.90438 3: 4.09766 4: 3.32752 5: 2.45517 6: 1.76816 7: 6.63587 8: 6.39019 9: 1.02451 Max Abs = 6.63587 r8vec_amax_index_test(): r8vec_amax_index() computes the index of the entry of maximum absolute value in an R8VEC. Input vector: 0: -7.2404 1: -8.68479 2: 6.98769 3: -9.81444 4: -1.04026 5: -7.34992 6: 3.3933 7: 2.97895 8: -3.00442 9: -2.30525 AMAX = A[3] = -9.81444 r8vec_amin_test(): r8vec_amin() computes the minimum absolute entry in an R8VEC. Input vector: 0: -1.1896 1: -1.93074 2: 7.21139 3: 1.94296 4: 6.42989 5: -1.85826 6: 6.19239 7: 6.00344 8: -9.95538 9: 3.12722 Min Abs = 1.1896 r8vec_amin_index_test(): r8vec_amin_index() computes the index of the entry of minimum absolute value in an R8VEC. Input vector: 0: -8.72375 1: -0.00743219 2: 7.21383 3: -2.79609 4: 0.580401 5: -2.04431 6: -2.86263 7: 2.10129 8: -3.67516 9: -4.74291 AMIN = A[1] = -0.00743219 r8vec_asum_test(): r8vec_asum() sums the absolute values of the entries in an R8VEC. Input vector: 0: -9.88805 1: -1.44773 2: 0.175028 3: 9.18787 4: -2.55579 5: 0.634699 6: -9.37282 7: 0.0580103 8: 6.05279 9: -5.38083 Sum of absolute values of entries = 44.7536 r8vec_binary_next_test(): r8vec_binary_next() generates the next binary vector. 000 001 010 011 100 101 110 111 r8vec_bracket_test(): r8vec_bracket() finds, for a given value R, the nearest interval [low,high] in a sorted R8VEC that "brackets" the value. Sorted R8VEC: 0: 0 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 R = -0.0296951 is bracketed by ( S[0] = 0, S[1] = 1 R = 7.84087 is bracketed by ( S[7] = 7, S[8] = 8 R = 6.02634 is bracketed by ( S[6] = 6, S[7] = 7 R = 3.10762 is bracketed by ( S[3] = 3, S[4] = 4 R = 8.37515 is bracketed by ( S[8] = 8, S[9] = 9 R = 7.15297 is bracketed by ( S[7] = 7, S[8] = 8 R = 8.98422 is bracketed by ( S[8] = 8, S[9] = 9 R = 3.37716 is bracketed by ( S[3] = 3, S[4] = 4 R = 3.45518 is bracketed by ( S[3] = 3, S[4] = 4 R = 9.21466 is bracketed by ( S[9] = 9, S[10] = 10 R = 8.62172 is bracketed by ( S[8] = 8, S[9] = 9 R = 10.5372 is bracketed by ( S[9] = 9, S[10] = 10 R = 8.07148 is bracketed by ( S[8] = 8, S[9] = 9 R = 9.83826 is bracketed by ( S[9] = 9, S[10] = 10 R = 0.305162 is bracketed by ( S[0] = 0, S[1] = 1 r8vec_bracket5_test(): r8vec_bracket5 finds a pair of entries in a sorted R8VEC which bracket a value. Sorted array: 0: 1 1: 2 2: 3 3: 4 4: 5 5: 5 6: 7 7: 8 8: 9 9: 10 LEFT RIGHT X(LEFT) XVAL X(RIGHT) -1 -10.0000 (Not bracketed!) 0 1 1.0000 1.0000 2.0000 3 4 4.0000 4.5000 5.0000 5 6 5.0000 5.0000 7.0000 8 9 9.0000 10.0000 10.0000 -1 12.0000 (Not bracketed!) r8vec_cheby_extreme_test(): r8vec_cheby_extreme() returns Chebyshev Extreme values between A and B. The vector: 0: 10 1: 11.4645 2: 15 3: 18.5355 4: 20 r8vec_cheby_zero_test(): r8vec_cheby_zero() returns Chebyshev Zero values between A and B. The vector: 0: 10.2447 1: 12.0611 2: 15 3: 17.9389 4: 19.7553 r8vec_cheby1space_test(): r8vec_cheby1space() returns Type 1 Chebyshev values in [A,B]. The vector: 0: 10 1: 11.4645 2: 15 3: 18.5355 4: 20 r8vec_concatenate_test(): r8vec_concatenate() concatenates two R8VECs Array 1: 0: 91.1 1: 31.2 2: 71.3 3: 51.4 4: 31.5 Array 2: 0: 42.6 1: 22.7 2: 12.8 Array 3 = Array 1 + Array 2: 0: 91.1 1: 31.2 2: 71.3 3: 51.4 4: 31.5 5: 42.6 6: 22.7 7: 12.8 r8vec_copy_test(): r8vec_copy() copies an R8VEC. Array 1: 0: 91.1 1: 31.2 2: 71.3 3: 51.4 4: 31.5 Array 2: 0: 91.1 1: 31.2 2: 71.3 3: 51.4 4: 31.5 r8vec_correlation_test(): r8vec_correlation computes the correlation of two R8VEC's. Vector V1: 0: 43 1: 21 2: 25 3: 42 4: 57 5: 59 Vector V2: 0: 99 1: 65 2: 79 3: 75 4: 87 5: 81 V1 V2 Correlation coefficient r = 0.5298089018901744 r8vec_covariance_test(): r8vec_covariance() computes the covariance of two R8VECs. Vector V1:10 Vector V2:0.8496110 Covariance(V1,V2) = 0.424806 Vector V2:0.3566960.205938 Covariance(V1,V2) = 0.0753787 Vector V2:0.3778790.654506 Covariance(V1,V2) = -0.138313 Vector V2:4.30189e-170.702553 Covariance(V1,V2) = -0.351276 Vector V2:-0.3837160.664616 Covariance(V1,V2) = -0.524166 Vector V2:-0.3319860.191672 Covariance(V1,V2) = -0.261829 Vector V2:-0.5973557.31549e-17 Covariance(V1,V2) = -0.298677 Vector V2:-0.117878-0.0680569 Covariance(V1,V2) = -0.0249106 Vector V2:-0.419912-0.727309 Covariance(V1,V2) = 0.153699 Vector V2:-8.81175e-17-0.479689 Covariance(V1,V2) = 0.239845 Vector V2:0.25581-0.443076 Covariance(V1,V2) = 0.349443 Vector V2:0.462277-0.266896 Covariance(V1,V2) = 0.364586 r8vec_diff_norm_test(): r8vec_diff_norm(): L2 norm of the difference of two R8VECs. I V[I] W[I] 0 0.000000 1.000000 1 1.000000 2.000000 2 2.000000 3.000000 3 3.000000 5.000000 4 4.000000 5.000000 5 5.000000 6.000000 L2 norm of vector difference ||V-W|| is 3 r8vec_diff_norm_li_test(): r8vec_diff_norm_li(): L-infinity norm of the difference of two R8VEC's. Vector V1: 0: 5.86613 1: 0.839532 2: 3.26314 3: -3.52424 4: -6.51818 Vector V2: 0: 3.33494 1: -0.238503 2: 5.36449 3: -9.30923 4: 7.11805 L-Infinity norm of V1-V2: 13.6362 r8vec_direct_product_test(): r8vec_direct_product() forms the entries of a direct product of a given number of R8VEC factors. Matrix (transposed) Row: 0 1 2 Col 0 : 1 50 800 1 : 2 50 800 2 : 3 50 800 3 : 4 50 800 4 : 1 60 800 5 : 2 60 800 6 : 3 60 800 7 : 4 60 800 8 : 1 70 800 9 : 2 70 800 10 : 3 70 800 11 : 4 70 800 12 : 1 50 900 13 : 2 50 900 14 : 3 50 900 15 : 4 50 900 16 : 1 60 900 17 : 2 60 900 18 : 3 60 900 19 : 4 60 900 20 : 1 70 900 21 : 2 70 900 22 : 3 70 900 23 : 4 70 900 r8vec_dot_product_test(): r8vec_dot_product() computes the dot product of two R8VEC's. V1 and V2: 0: 0.875544 0.0344401 1: 0.942859 0.925425 2: 0.181135 0.664839 3: 0.146296 0.886913 4: 0.102376 0.295418 5: 0.705062 0.463497 6: 0.0960627 0.774829 7: 0.936874 0.822813 8: 0.14538 0.435305 9: 0.252575 0.627711 V1 dot V2 = 2.57705 r8vec_eq_test(): r8vec_eq() is TRUE if two R8VECs are equal. Vectors A and B: 0: 1.1 1.1 1: 3.2 3.2 2: 2.3 2.3 3: 4.4 4.4 r8vec_eq(A,B) = True Vectors A and B: 0: 2.1 2.1 1: 2.2 2.2 2: 2.3 1.3 3: 2.4 2.4 r8vec_eq(A,B) = False Vectors A and B: 0: 1.1 4.1 1: 2.2 1.2 2: 2.3 1.3 3: 4.4 3.4 r8vec_eq(A,B) = False Vectors A and B: 0: 1.1 1.1 1: 2.2 2.2 2: 3.3 3.3 3: 4.4 4.4 r8vec_eq(A,B) = True r8vec_even_test(): r8vec_even computes N evenly spaced values between XLO and XHI. XLO = 0.000000 XHI = 99.000000 while N = 10 Resulting array: 0: 0 1: 11 2: 22 3: 33 4: 44 5: 55 6: 66 7: 77 8: 88 9: 99 r8vec_even_select_test(): r8vec_even_select returns the I-th of N evenly spaced values between XLO and XHI. XLO = 0.000000 XHI = 99.000000 while N = 10 X(2) = 11 X(5) = 44 X(8) = 77 r8vec_fill_test(): r8vec_fill() sets all entries of an array to a given value. x=r8vec_fill(5,1.2): 0: 1.2 1: 1.2 2: 1.2 3: 1.2 4: 1.2 x=r8vec_fill(3,123.456): 0: -123.456 1: -123.456 2: -123.456 r8vec_frac_test(): r8vec_frac(): K-th smallest real vector entry; The real array to search: 0: 0.953704 1: 8.68329 2: 8.89901 3: 2.50405 4: 3.41612 5: 2.45496 6: 0.261519 7: 9.01266 8: 0.909879 9: 8.38217 Frac r8vec_frac 1 0.261519 2 0.909879 3 0.953704 4 2.454965 5 2.504051 6 3.416118 7 8.382166 8 8.683291 9 8.899011 10 9.012660 r8vec_house_column_test(): r8vec_house_column() returns the compact form of a Householder matrix that "packs" a column of a matrix. Matrix A: Col: 0 1 2 3 Row 0 : 0.98404 4.93696 4.37231 0.37183 1 : 3.04475 4.95353 3.84567 1.52975 2 : 3.92931 3.05498 4.4998 4.25233 3 : 2.02238 3.56047 3.43683 3.31274 Working on column K = 0 Householder matrix H: Col: 0 1 2 3 Row 0 : -0.180358 -0.558051 -0.720177 -0.370668 1 : -0.558051 0.736164 -0.340486 -0.175245 2 : -0.720177 -0.340486 0.560595 -0.226158 3 : -0.370668 -0.175245 -0.226158 0.883599 Product H*A: Col: 0 1 2 3 Row 0 : -5.45604 -7.17462 -7.44924 -5.2111 1 : 5.55112e-16 -0.772596 -1.74334 -1.10975 2 : 2.77556e-16 -4.33471 -2.71293 0.845994 3 : 4.44089e-16 -0.242938 -0.275495 1.55953 Working on column K = 1 Householder matrix H: Col: 0 1 2 3 Row 0 : 1 0 0 0 1 : 0 -0.175203 -0.98299 -0.0550914 2 : 0 -0.98299 0.177785 -0.0460808 3 : 0 -0.0550914 -0.0460808 0.997417 Product H*A: Col: 0 1 2 3 Row 0 : -5.45604 -7.17462 -7.44924 -5.2111 1 :-3.94557e-16 4.40972 2.9874 -0.723088 2 :-5.16788e-16 8.69096e-16 1.24406 1.16942 3 : 3.9957e-16 2.77556e-17 -0.0537267 1.57765 Working on column K = 2 Householder matrix H: Col: 0 1 2 3 Row 0 : 1 0 0 0 1 : 0 1 0 0 2 : 0 0 -0.999069 0.0431463 3 : 0 0 0.0431463 0.999069 Product H*A: Col: 0 1 2 3 Row 0 : -5.45604 -7.17462 -7.44924 -5.2111 1 :-3.94557e-16 4.40972 2.9874 -0.723088 2 : 5.33546e-16 -8.6709e-16 -1.24522 -1.10026 3 : 3.76901e-16 6.52281e-17 6.93889e-18 1.62664 r8vec_identity_row_test(): r8vec_identity_row() returns a row of the identity matrix. -1: 0 0 0 0 0 0: 1 0 0 0 0 1: 0 1 0 0 0 2: 0 0 1 0 0 3: 0 0 0 1 0 4: 0 0 0 0 1 5: 0 0 0 0 0 r8vec_indicator0_test(): r8vec_indicator0() returns an indicator matrix. The indicator0 vector: 0: 0 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 r8vec_indicator1_test(): r8vec_indicator1() returns the 1-based indicator matrix. The 1-based indicator vector: 0: 1 1: 2 2: 3 3: 4 4: 5 5: 6 6: 7 7: 8 8: 9 9: 10 r8vec_is_ascending_test(): r8vec_is_ascending() is TRUE if the entries of an R8VEC are ascending. X: 1 2 0 9 X is NOT ascending. X: 1 2 2 9 X is ascending. X: 1 2 4 9 X is ascending. r8vec_is_ascending_strictly_test(): r8vec_is_ascending_strictly() is TRUE if the entries of an R8VEC are strictly ascending. X: 1 2 0 9 X is NOT strictly ascending. X: 1 2 2 9 X is NOT strictly ascending. X: 1 2 4 9 X is strictly ascending. r8vec_is_binary_test(): r8vec_is_binary() is TRUE if an R8VEC only contains 0 or 1 entries. X: 0 0 0 X is binary X: 1 0 1 X is binary X: 0 2 1 X is NOT binary. r8vec_is_distinct_test(): r8vec_is_distinct() computes the maximum entry in an R8VEC. Input vector: 0: 1 1: 2 2: 5 3: 3 4: 4 Array entries are distinct. Input vector: 0: 1 1: 2 2: 5 3: 2 4: 4 Array entries are NOT distinct. r8vec_is_in_01_test(): r8vec_is_in_01() is TRUE if an R8VEC only contains entries in [0,1]. X: 0 1 2 At least one entry is NOT in [0,1]. X: 0.5 0.1 0.9 All entries are in [0,1]. X: -0.5 0.5 0.4 At least one entry is NOT in [0,1]. r8vec_is_in_ab_test(): r8vec_is_in_ab() is TRUE if an R8VEC only contains entries in [A,B]. X: 0 1 2 At least one entry is NOT in [0.500000,2.000000]. X: 0.5 1.1 0.9 All entries are in [0.500000,2.000000]. X: -0.5 0.5 0.4 At least one entry is NOT in [0.500000,2.000000]. r8vec_is_insignificant_test(): r8vec_is_insignificant() is TRUE if an R8VEC only contains negative entries. X: 1 2 100 Y: 2.22045e-11 4.44089e-11 2.22045e-09 Y is NOT insignificant compared to X. X: 1 2 100 Y: 2.22045e-15 0 0 Y is NOT insignificant compared to X. X: 1 2 100 Y: 2.22045e-20 4.44089e-20 2.22045e-18 Y is insignificant compared to X. r8vec_is_integer_test(): r8vec_is_integer() is TRUE if an R8VEC contains only integer entries. X: 0 1 100 X contains only integer entries. X: 1 2.5 3 X contains at least one noninteger entry. X: -3 -99 -87.3 X contains at least one noninteger entry. r8vec_is_negative_test(): r8vec_is_negative() is TRUE if an R8VEC only contains negative entries. X: 0 1 2 X does NOT contain only negative entries. X: -1 0 1 X does NOT contain only negative entries. X: -3 -99 -87.3 X contains only negative entries. r8vec_is_negative_any_test(): r8vec_is_negative_any() is TRUE if an R8VEC contains any negative entries. X: 0 1 2 X does NOT contain any negative entries. X: -1 0 1 X contains at least one negative entry. X: -3 -99 -87.3 X contains at least one negative entry. r8vec_is_nonnegative_test(): r8vec_is_nonnegative() is TRUE if an R8VEC only contains nonnegative entries. X: 0 1 2 X contains only nonnegative entries. X: -1 0 1 X does NOT contain only nonnegative entries. X: -3 -99 -87.3 X does NOT contain only nonnegative entries. r8vec_is_nonpositive_test(): r8vec_is_nonpositive() is TRUE if an R8VEC only contains nonpositive entries. X: 0 1 2 X does NOT contain only nonpositive entries. X: -2 -1 0 X contains only nonpositive entries. X: -3 -99 -87.3 X contains only nonpositive entries. r8vec_is_nonzero_any_test(): r8vec_is_nonzero_any() is TRUE if an R8VEC contains any nonzero entry. X: 0 1 0 X contains at least one nonzero entry. X: 0 0 0 X contains NO nonzero entries. X: -3 -99 -87.3 X contains at least one nonzero entry. r8vec_is_one_test(): r8vec_is_one() is TRUE if an R8VEC contains only one entries. X: 0 1 0 X contains at least one nonone entry. X: 1 1 1 X contains only one entries. X: -3 -99 -87.3 X contains at least one nonone entry. r8vec_is_positive_test(): r8vec_is_positive() is TRUE if an R8VEC only contains strictly positive entries. X: 1 2 3 X contains only positive entries. X: 2 1 0 X does NOT contain only positive entries. X: -3 -99 -87.3 X does NOT contain only positive entries. r8vec_is_zero_test(): r8vec_is_zero() is TRUE if an R8VEC contains only zero entries. X: 0 1 0 X contains at least one nonzero entry. X: 0 0 0 X contains only zero entries. X: -3 -99 -87.3 X contains at least one nonzero entry. r8vec_linspace_test(): r8vec_linspace() returns evenly spaced values between A and B. The linspace vector: 0: 10 1: 12.5 2: 15 3: 17.5 4: 20 r8vec_linspace2_test(): r8vec_linspace2() returns evenly spaced values between A and B omitting the endpoints. The linspace2 vector: 0: 12 1: 14 2: 16 3: 18 r8vec_max_test(): r8vec_max() computes the maximum entry in an R8VEC. Input vector: 0: -4.47203 1: 8.57798 2: -9.56652 3: 5.31391 4: -0.853727 5: 8.74561 6: -9.58812 7: 4.15784 8: -5.86993 9: -0.821555 Max = 8.74561 r8vec_max_abs_index_test(): r8vec_max_abs_index(): index of entry of maximum absolute value Input vector: 0: 2.88535 1: 2.94203 2: -8.85543 3: 4.23198 4: 5.98694 5: -3.02311 6: 6.31202 7: -7.90506 8: -8.11835 9: -5.00805 Maximum index: 2 r8vec_max_index_test(): r8vec_max_index(): index of maximum entry Input vector: 0: 9.42409 1: 4.86321 2: 7.3431 3: 8.22425 4: 1.66137 5: -7.24968 6: 6.73574 7: -0.422881 8: -0.0622382 9: 8.35992 Maximum index: 0 r8vec_mean_test(): r8vec_mean() computes the mean of an R8VEC. Input vector: 0: -4.81043 1: 1.23602 2: 2.53998 3: -1.34516 4: -4.75689 5: -4.5404 6: 1.41669 7: 2.9782 8: 4.75939 9: -4.471 Value = -0.699361 r8vec_mean_geometric_test(): r8vec_mean_geometric() computes the geometric mean of an R8VEC. Input vector: 0: 1.93003 1: 1.05174 2: 4.4394 3: 4.20766 4: 1.36137 5: 2.07698 6: 4.70727 7: 4.06565 8: 3.53343 9: 0.406985 Geometric mean = 2.22327 r8vec_mean_running_test(): r8vec_mean_running() returns the running means of an R8VEC. Random R8VEC: 0: -4.03813 1: 8.13996 2: 2.64341 3: 3.90591 4: -2.76289 5: 8.54858 6: 1.67034 7: 0.748246 8: 4.1649 9: 8.77798 Running means: 0: 0 1: -4.03813 2: 2.05091 3: 2.24841 4: 2.66279 5: 1.57765 6: 2.73947 7: 2.58674 8: 2.35693 9: 2.55781 10: 3.17983 r8vec_mean_update_test(): r8vec_mean_update() updates the mean of a vector when one more element is added. N R MEAN MEAN_update 1 0.336835 0.336835 0.336835 2 0.147332 0.242083 0.242083 3 0.732659 0.405609 0.405609 4 0.369545 0.396593 0.396593 5 0.990631 0.5154 0.5154 6 0.448709 0.504285 0.504285 7 0.412654 0.491195 0.491195 8 0.293499 0.466483 0.466483 9 0.433571 0.462826 0.462826 r8vec_midspace_test(): r8vec_midspace() returns the midpoints of N intervals in [A,B]. The midspace vector: 0: 11 1: 13 2: 15 3: 17 4: 19 r8vec_min_test(): r8vec_min() computes the minimum entry in an R8VEC. Input vector: 0: 5.98429 1: -3.96965 2: 9.07746 3: 4.28107 4: 2.30687 5: -2.95173 6: -3.91382 7: 2.03233 8: 4.3842 9: 6.67796 Min = -3.96965 r8vec_mirror_next_test(): r8vec_mirror_next() generates all sign variations of a real vector. 0 1 2 3 0 -1 2 3 0 1 -2 3 0 -1 -2 3 0 1 2 -3 0 -1 2 -3 0 1 -2 -3 0 -1 -2 -3 Done. 0 1 0 3 0 -1 0 3 0 1 -0 -3 0 -1 -0 -3 Done. r8vec_mirror_ab_next_test(): r8vec_mirror_ab_next() generates all versions of of a real vector X mirrored by A and B. Case 1: 3x3x3 possibilities: A: -0.5 -0.5 -0.5 X: 0 0 0 B: 0.5 0.5 0.5 1 -1 -1 -1 2 -1 -1 0 3 -1 -1 1 4 -1 0 -1 5 -1 0 0 6 -1 0 1 7 -1 1 -1 8 -1 1 0 9 -1 1 1 10 0 -1 -1 11 0 -1 0 12 0 -1 1 13 0 0 -1 14 0 0 0 15 0 0 1 16 0 1 -1 17 0 1 0 18 0 1 1 19 1 -1 -1 20 1 -1 0 21 1 -1 1 22 1 0 -1 23 1 0 0 24 1 0 1 25 1 1 -1 26 1 1 0 27 1 1 1 Done. Case 2: 3x2x3 possibilities: A: -0.5 -0.5 -0.5 X: 0 0.5 0 B: 0.5 0.5 0.5 1 -1 -1.5 -1 2 -1 -1.5 0 3 -1 -1.5 1 4 -1 0.5 -1 5 -1 0.5 0 6 -1 0.5 1 7 0 -1.5 -1 8 0 -1.5 0 9 0 -1.5 1 10 0 0.5 -1 11 0 0.5 0 12 0 0.5 1 13 1 -1.5 -1 14 1 -1.5 0 15 1 -1.5 1 16 1 0.5 -1 17 1 0.5 0 18 1 0.5 1 Done. Case 3: 1x3x3 possibilities: A: 0 -0.5 -0.5 X: 0 0 0 B: 0 0.5 0.5 1 0 -1 -1 2 0 -1 0 3 0 -1 1 4 0 0 -1 5 0 0 0 6 0 0 1 7 0 1 -1 8 0 1 0 9 0 1 1 Done. r8vec_nint_test(): r8vec_nint() rounds an R8VEC. Vector A: 0: 1.90005 1: -3.47418 2: 4.3202 3: 1.21304 4: 4.81256 Rounded vector A: 0: 2 1: -3 2: 4 3: 1 4: 5 r8vec_norm_test(): r8vec_norm() computes the L2 norm of an R8VEC. Input vector: 0: 0.952387 1: 0.683008 2: 0.536045 3: 0.838961 4: 0.516447 5: 0.207887 6: 0.439455 7: 0.0946117 8: 0.449619 9: 0.455877 L2 norm = 1.81293 r8vec_norm_affine_test(): r8vec_norm_affine() computes the L2 norm of the difference of two R8VECs. r8vec_norm_affine(X,Y) = 1.45347 r8vec_norm (X-Y): 1.45347 r8vec_norm_l0_test(): r8vec_norm_l0() computes the L0 "norm" of an R8VEC. Input vector: 0: 1 1: -1 2: 1 3: 0 4: -1 5: 2 6: 1 7: -1 8: 1 9: 2 L0 norm = 9 r8vec_norm_l1_test(): r8vec_norm_l1() computes the L1 norm of an R8VEC. Input vector: 0: 2.28284 1: 3.41385 2: 9.25017 3: 5.47257 4: 8.21517 5: -3.84448 6: -5.61878 7: 2.33867 8: -3.8989 9: -6.3006 L1 norm = 50.636 r8vec_norm_l2_test(): r8vec_norm_l2() computes the L2 norm of an R8VEC. Input vector: 0: 0.530651 1: 7.51212 2: -1.02399 3: 3.43081 4: -6.1248 5: -4.32686 6: -9.66342 7: -7.64428 8: -9.63346 9: 0.480574 L2 norm = 19.2515 r8vec_norm_li_test(): r8vec_norm_li() computes the Loo norm of an R8VEC. Input vector: 0: -3.76383 1: 4.80589 2: -0.221087 3: 4.93895 4: 2.8765 5: -2.33557 6: 0.443337 7: -0.0271857 8: 1.91349 9: -2.99563 Loo norm = 4.93895 r8vec_norm_rms_test(): r8vec_norm_rms() computes the RMS norm of an R8VEC. Input vector: 0: -6 1: -4 2: -2 3: 0 4: 2 5: 4 6: 6 7: 8 8: 10 RMS norm = 5.53775 r8vec_normal_01_test(): r8vec_normal_01() returns a vector of Normal 01 values Vector: 0: -0.805886 1: -0.813189 2: 0.0756695 3: 0.485207 4: -1.30993 5: 1.43018 6: 0.810042 7: 0.487391 8: -0.406225 9: -0.552003 r8vec_normal_ab_test(): r8vec_normal_ab() returns a vector of Normal AB values Mean = 15 Standard deviation = 0.25 Vector: 0: 14.8974 1: 15.0751 2: 15.1281 3: 14.8364 4: 14.9423 5: 14.6234 6: 15.1017 7: 15.2311 8: 15.4351 9: 14.8987 r8vec_normalize_l1_test(): r8vec_normalize_l1() normalizes an R8VEC in the L1 norm. Input vector: 0: 5.21029 1: -7.62446 2: -1.50482 3: 4.77183 4: 6.9427 5: -3.25538 6: 4.70122 7: -9.57956 8: 0.912614 9: 7.77398 After calling r8vec_normalize_l1: 0: 0.0996672 1: -0.145848 2: -0.0287856 3: 0.09128 4: 0.132806 5: -0.062272 6: 0.0899293 7: -0.183247 8: 0.0174573 9: 0.148708 r8vec_permute_test(): r8vec_permute() permutes an R8VEC. Original array X[]: 0: 1.1 1: 2.2 2: 3.3 3: 4.4 4: 5.5 Permutation vector P[]: 0 1 1 3 2 4 3 0 4 2 Permuted array X[P[*]]: 0: 2.2 1: 4.4 2: 5.5 3: 1.1 4: 3.3 r8vec_permute_cyclic_test(): r8vec_permute_cyclic() performa a cyclic permutation of K positions on an R8VEC. K = 4 Original array X: 0: 1 1: 2 2: 3 3: 4 4: 5 5: 6 6: 7 7: 8 8: 9 9: 10 Array after permutation: 0: 5 1: 6 2: 7 3: 8 4: 9 5: 10 6: 1 7: 2 8: 3 9: 4 r8vec_permute_uniform_test(): r8vec_permute_uniform() randomly reorders an R8VEC. A, before rearrangement: 0: 101 1: 102 2: 103 3: 104 4: 105 5: 106 6: 107 7: 108 8: 109 9: 110 10: 111 11: 112 A, after rearrangement: 0: 103 1: 107 2: 102 3: 109 4: 111 5: 101 6: 106 7: 112 8: 104 9: 110 10: 105 11: 108 r8vec_print_test(): Test r8vec_print(), which prints an R8VEC. Use r8vec_print(): 0: 123.456 1: 5e-06 2: -1e+06 3: 3.14159 Use python print(): [ 1.23456000e+02 5.00000000e-06 -1.00000000e+06 3.14159265e+00] r8vec_print_part_test(): r8vec_print_part() prints part of an R8VEC. Lines 10:20 of the vector: 10: 11 11: 12 12: 13 13: 14 14: 15 15: 16 16: 17 17: 18 18: 19 19: 20 20: 21 r8vec_print_some_test(): r8vec_print_some() prints some of an R8VEC. No more than 10 lines of this vector: 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 ...... .............. 99 100 r8vec_product_test(): r8vec_product() computes the product of the entries in an R8VEC. Input vector: 0: 1.76333 1: 3.02835 2: -5.49921 3: -2.73306 4: -9.67986 5: 8.42866 6: -4.25659 7: -9.45523 8: -9.89205 9: 3.21784 Product of entries = 8.38882e+06 r8vec_reverse_test(): r8vec_reverse() reverses an R8VEC. Original array: 0: 1 1: 2 2: 3 3: 4 4: 5 Reversed array: 0: 5 1: 4 2: 3 3: 2 4: 1 r8vec_rotate_test(): r8vec_rotate() rotates an R8VEC in place. Rotate entries 2 places to the right Original array: 0: 1 1: 2 2: 3 3: 4 4: 5 Rotated array: 0: 4 1: 5 2: 1 3: 2 4: 3 r8vec_rsquared_test(): r8vec_rsquared() computes the R^2 goodness-of-fit statistic. Data and model: 0: 0 0 1: 9.58 9 2: 16.76 16 3: 21.52 21 4: 24.38 24 5: 24.97 25 6: 22.9 24 7: 20.45 21 8: 12.4 16 9: 7.65 9 10: -3.82 0 Computed R^2 is 0.967402 r8vec_scale_01_test(): r8vec_scale_01() shifts and scales an R8VEC so that it has min 0 and max 1 Vector X: 0: 7.40561 1: 7.05775 2: 8.43275 3: -2.40299 4: 6.83987 5: 6.01762 6: 0.0480234 7: 6.54227 8: 10.4925 9: 12.7481 mean(X) = 6.31815 std(X) = 4.25155 max(X) = 12.7481 min(X) = -2.40299 Vector XS: 0: 0.647384 1: 0.624425 2: 0.715177 3: 0 4: 0.610045 5: 0.555775 6: 0.161771 7: 0.590403 8: 0.851124 9: 1 mean(XS) = 0.57561 std(XS) = 0.280609 max(XS) = 1 min(XS) = 0 r8vec_scale_ab_test(): r8vec_scale_ab() shifts and scales an R8VEC so that it has min A and max B Vector X: 0: 9.73684 1: 2.43996 2: -0.531953 3: 4.83633 4: 1.06715 5: -1.59641 6: 1.29443 7: 8.48237 8: 8.83463 9: -1.09319 mean(X) = 3.34702 std(X) = 4.11055 max(X) = 9.73684 min(X) = -1.59641 Rescale to [-1,1] Vector XS: 0: 1 1: -0.287694 2: -0.812154 3: 0.135198 4: -0.529956 5: -1 6: -0.489848 7: 0.778621 8: 0.840785 9: -0.911197 mean(XS) = -0.127624 std(XS) = 0.725398 max(XS) = 1 min(XS) = -1 r8vec_shift_circular_test(): r8vec_shift_circular() circularly shifts a vector by K positions. The vector: 0: 1 1: 2 2: 3 3: 4 4: 5 5: 6 6: 7 7: 8 8: 9 9: 10 Using a circular shift of K = 3 Shifted vector: 0: 8 1: 9 2: 10 3: 1 4: 2 5: 3 6: 4 7: 5 8: 6 9: 7 r8vec_sign3_running_test(): r8vec_sign3_running() returns the running sign3 of an R8VEC. Random R8VEC: 0: 2.63692 1: -1.07675 2: 8.9659 3: -3.6168 4: -2.26858 5: 2.3433 6: 2.53401 7: -3.6737 8: -0.992014 9: 6.63758 Running sign3: 0: 0 1: 1 2: 1 3: 1 4: 1 5: 1 6: 1 7: 1 8: 1 9: 1 10: 1 r8vec_smooth_test(): r8vec_smooth smooths an R8VEC. The vector X: 0: 1 1: 2 2: 3 3: 4 4: 5 5: 6 6: 7 7: 8 8: 9 9: 10 Vector X using smoothing S = 2 0: 1 1: 2 2: 3 3: 4 4: 5 5: 6 6: 7 7: 8 8: 9 9: 10 The vector X: 0: 1 1: 4 2: 9 3: 16 4: 25 5: 36 6: 49 7: 64 8: 81 9: 100 Vector X using smoothing S = 1 0: 1 1: 4.66667 2: 9.66667 3: 16.6667 4: 25.6667 5: 36.6667 6: 49.6667 7: 64.6667 8: 81.6667 9: 100 r8vec_softmax_test(): r8vec_softmax() evaluates the softmax function. X, Softmax(X): 0: -7.09555 6.60115e-07 1: -3.56132 2.26212e-05 2: 2.7613 0.0126008 3: -1.05176 0.000278231 4: -5.99996 1.97436e-06 5: -3.11769 3.52518e-05 6: -5.01158 5.3049e-06 7: 1.36036 0.00310438 8: 7.11912 0.98395 9: -6.52393 1.16915e-06 r8vec_sorted_nearest_test(): r8vec_sorted_nearest() finds, for a given value R, the nearest element in a sorted R8VEC. Sorted R8VEC: 0: 0 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 R = 3.97494 is nearest S[4] = 4 R = 5.45876 is nearest S[5] = 5 R = 10.6125 is nearest S[10] = 10 R = 4.6851 is nearest S[5] = 5 R = 4.47103 is nearest S[4] = 4 R = 3.74081 is nearest S[4] = 4 R = 9.9649 is nearest S[10] = 10 R = -0.0827857 is nearest S[0] = 0 R = 2.1692 is nearest S[2] = 2 R = 9.13442 is nearest S[9] = 9 R = 9.35893 is nearest S[9] = 9 R = 9.07764 is nearest S[9] = 9 R = 2.00437 is nearest S[2] = 2 R = 7.0412 is nearest S[7] = 7 R = 1.67015 is nearest S[2] = 2 r8vec_standardize_test(): r8vec_standardize() shifts and scales an R8VEC so that it has zero mean and unit standard deviation. Vector X: 0: -4.59939 1: 14.7082 2: 5.7997 3: 1.55738 4: -3.59632 5: 9.07689 6: 0.0670106 7: -1.02714 8: -3.75158 9: 5.41845 mean(X) = 2.36532 std(X) = 6.30182 max(X) = 14.7082 min(X) = -4.59939 Vector XS: 0: -1.10519 1: 1.95862 2: 0.544982 3: -0.128207 4: -0.946018 5: 1.06502 6: -0.364706 7: -0.538329 8: -0.970655 9: 0.484485 mean(XS) = 8.32667e-17 std(XS) = 1 max(XS) = 1.95862 min(XS) = -1.10519 r8vec_std_test() r8vec_std() computes the standard deviation of an R8VEC. Input vector: 0: 0.204278 1: -2.56252 2: -4.15895 3: 0.960525 4: 0.282289 5: 0.13192 6: 4.67223 7: -0.87816 8: 3.73895 9: -1.71492 Value = 2.53773 r8vec_std_sample_test(): r8vec_std_sample() computes the sample standard deviation of an R8VEC. Input vector: 0: -1.09988 1: -2.25691 2: -4.17429 3: -4.08599 4: 0.110553 5: -0.730272 6: 0.846025 7: 1.8593 8: 3.83361 9: 1.32439 Value = 2.57508 r8vec_std_sample_update_test(): r8vec_std_sample_update() updates sample standard deviation when one more element is added. N R STD STD_update 1 0.894502 0 0 2 0.558463 0.237616 0.237616 3 0.523055 0.205 0.205 4 0.126818 0.31422 0.31422 5 0.295766 0.290905 0.290905 6 0.741614 0.281303 0.281303 7 0.174862 0.288607 0.288607 8 0.887471 0.304644 0.304644 9 0.491263 0.285194 0.285194 r8vec_std_update_test(): r8vec_std_update() updates the standard deviation of a vector when one more element is added. N R STD STD_update 1 0.818159 0 0 2 0.833329 0.00758512 0.00758512 3 0.721467 0.0495454 0.0495454 4 0.512882 0.127838 0.127838 5 0.101232 0.273172 0.273172 6 0.871862 0.269532 0.269532 7 0.921425 0.267864 0.267864 8 0.989408 0.270291 0.270291 9 0.816545 0.256587 0.256587 r8vec_std_updates_test(): r8vec_std_updates() computes the standard deviation of V12 = V1 + V2 where V1 and V2 are vectors whose length, mean and standard deviation are given. 5 0.8384195112406644 0.7727961625350074 7 -0.04464349626589904 0.7817847054062752 12 0.3232994235285024 0.870234924309581 Recompute directly from V12: 12 0.3232994235285023 0.8702349243095812 r8vec_step_test(): r8vec_step() evaluates a step function. X0 X STEP(X0,X) Step function with X0 = 0.31 0: 0 0 1: 0.05 0 2: 0.1 0 3: 0.15 0 4: 0.2 0 5: 0.25 0 6: 0.3 0 7: 0.35 1 8: 0.4 1 9: 0.45 1 10: 0.5 1 11: 0.55 1 12: 0.6 1 13: 0.65 1 14: 0.7 1 15: 0.75 1 16: 0.8 1 17: 0.85 1 18: 0.9 1 19: 0.95 1 20: 1 1 r8vec_sum_test(): r8vec_sum() sums the entries in an R8VEC. Input vector: 0: 3.22213 1: -2.94756 2: 8.42968 3: -1.96987 4: -9.21738 5: -4.45019 6: -3.13042 7: -0.0547374 8: 8.91883 9: 2.53798 Sum of entries = 1.33847 r8vec_sum_running_test(): r8vec_sum_running() returns the running sums of an R8VEC. Random R8VEC: 0: 9.32962 1: 9.97457 2: 6.41793 3: 0.328769 4: -0.112313 5: -2.28399 6: 8.22712 7: 2.34779 8: -4.90076 9: -4.98289 Running sums: 0: 0 1: 9.32962 2: 19.3042 3: 25.7221 4: 26.0509 5: 25.9386 6: 23.6546 7: 31.8817 8: 34.2295 9: 29.3287 10: 24.3458 r8vec_transpose_print_test(): r8vec_transpose_print() prints an R8VEC "tranposed", that is, placing multiple entries on a line. The vector X: 1 2.1 3.2 4.3 5.4 6.5 7.6 8.7 9.8 10.9 11 r8vec_uniform_01_test(): r8vec_uniform_01() computes a random R8VEC. Random R8VEC: 0: 0.460572 1: 0.247243 2: 0.0928812 3: 0.909152 4: 0.394262 5: 0.720528 6: 0.551396 7: 0.000165471 8: 0.758891 9: 0.443143 r8vec_uniform_ab_test(): r8vec_uniform_ab() computes a random R8VEC. -1 <= X <= 5 Random R8VEC: 0: 1.55734 1: -0.47046 2: 0.517983 3: -0.271891 4: 2.46901 5: 0.524349 6: 3.17888 7: 0.751587 8: 0.595732 9: 3.19437 r8vec_uniform_unit_test(): r8vec_uniform_unit() returns a random R8VEC on the surface of the unit M sphere. Vector: 0: 0.106688 1: -0.75089 2: 0.604138 3: 0.0716648 4: -0.233803 Vector: 0: -0.646642 1: -0.196942 2: -0.0925995 3: 0.168303 4: 0.711455 Vector: 0: 0.196443 1: -0.0685597 2: -0.13214 3: 0.27673 4: 0.9288 Vector: 0: -0.444097 1: 0.261051 2: -0.462195 3: -0.603809 4: -0.395502 Vector: 0: -0.467315 1: -0.0453427 2: 0.765613 3: -0.0748398 4: 0.433355 r8vec_variance_test(): r8vec_variance() computes the variance of an R8VEC. Input vector: 0: 0.323112 1: 3.3836 2: 4.45993 3: 2.07763 4: -3.82534 5: -3.08948 6: 4.3629 7: 1.32455 8: -0.402637 9: 1.88826 Value = 7.34255 r8vec_variance_circular_test(): r8vec_variance_circular() computes the circular variance of an R8VEC. Uniform Vector in [-PI,+PI]: 0: -1.90458 1: 0.783149 2: 0.613287 3: -0.609677 4: 2.46554 5: 2.62256 6: 2.41499 7: 0.0417307 8: -2.94138 9: 0.159469 Circular variance: 0.832584 Normal vector, mean 0, variance 1 0: 0.189963 1: 0.134078 2: -0.613242 3: 0.827722 4: 0.393315 5: -1.03473 6: -0.643759 7: 0.597429 8: 0.212381 9: -0.651772 Circular variance: 0.16881 r8vec_variance_sample_test(): r8vec_variance_sample() computes the sample variance of an R8VEC. Input vector: 0: -1.2465 1: -2.1058 2: -1.50581 3: -3.96204 4: 3.39722 5: 1.83261 6: 0.163116 7: 2.43033 8: 2.90665 9: -1.18108 Sample variance = 6.06406 r8vec_variance_sample_update_test(): r8vec_variance_sample_update() updates the sample variance of a vector when one more element is added. N R VARIANCE VARIANCE_update 1 0.302597 0 0 2 0.467089 0.0135289 0.0135289 3 0.286511 0.00998751 0.00998751 4 0.374565 0.00678489 0.00678489 5 0.400901 0.00546209 0.00546209 6 0.0657383 0.0194291 0.0194291 7 0.235195 0.0171291 0.0171291 8 0.0124931 0.0253521 0.0253521 9 0.184838 0.022954 0.022954 r8vec_variance_update_test(): r8vec_variance_update() updates the variance of a vector when one more element is added. N R VARIANCE VARIANCE_update 1 0.494572 0 0 2 0.402971 0.00209765 0.00209765 3 0.151928 0.0209798 0.0209798 4 0.231281 0.0183697 0.0183697 5 0.318064 0.0146964 0.0146964 6 0.914277 0.0613369 0.0613369 7 0.958736 0.0882657 0.0882657 8 0.510287 0.0772549 0.0772549 9 0.724499 0.0737484 0.0737484 r8vec2_print_test(): r8vec2_print() prints a pair of R8VEC's. Print a pair of R8VEC's: 0: 0 0 1: 0.2 0.04 2: 0.4 0.16 3: 0.6 0.36 4: 0.8 0.64 5: 1 1 r8vec2_print_some_test(): r8vec2_print_some() prints some of a pair of R8VEC's. Square and square root: 0: 1 1 1: 4 1.41421 2: 9 1.73205 3: 16 2 4: 25 2.23607 5: 36 2.44949 6: 49 2.64575 7: 64 2.82843 ...... .............. .............. 99: 10000 10 r8vec3_print_test(): r8vec3_print() prints an R8VEC. X, X^2, X+X^2's: 0: 0 0 0 1: 0.2 0.04 0.24 2: 0.4 0.16 0.56 3: 0.6 0.36 0.96 4: 0.8 0.64 1.44 5: 1 1 2 sort_heap_external_test(): sort_heap_external() sorts objects externally. Unsorted array: 0 2 1 18 2 13 3 12 4 20 5 20 6 14 7 15 8 13 9 7 10 11 11 20 12 8 13 11 14 4 15 10 16 15 17 15 18 5 19 17 Sorted array: 0 2 1 4 2 5 3 7 4 8 5 10 6 11 7 11 8 12 9 13 10 13 11 14 12 15 13 15 14 15 15 17 16 18 17 20 18 20 19 20 r8lib_test(): Normal end of execution. Sun Jun 23 17:28:32 2024