13 TEST(BoysSingleResult) {
17 CHECK_CLOSE(0.007109579000859712, boys.result(5), 1e-9);
19 TEST(BoysIntermediateTest) {
21 boysIntermediate.updateResults();
23 CHECK_CLOSE(0.0002310081138823203, boysIntermediate.result(6, 10), 1e-9);
25 TEST(BoysfactorialFunctions)
42 rowvec xvec = linspace<rowvec>(0.01,50,20);
44 for(uint i = 0; i < 20; i++){
46 F0(i,0) = boys.result(0);
49 CHECK_CLOSE(F0(0,0), 9.9667664290336333e-01, 1e-10);
50 CHECK_CLOSE(F0(1,0), 5.3357683580906246e-01, 1e-10);
51 CHECK_CLOSE(F0(2,0), 3.8551956882369670e-01, 1e-10);
52 CHECK_CLOSE(F0(3,0), 3.1522027004511449e-01, 1e-10);
53 CHECK_CLOSE(F0(4,0), 2.7304989839411259e-01, 1e-10);
54 CHECK_CLOSE(F0(5,0), 2.4424745291117503e-01, 1e-10);
55 CHECK_CLOSE(F0(6,0), 2.2298057384240719e-01, 1e-10);
56 CHECK_CLOSE(F0(7,0), 2.0644923632081960e-01, 1e-10);
57 CHECK_CLOSE(F0(8,0), 1.9312212797082015e-01, 1e-10);
58 CHECK_CLOSE(F0(9,0), 1.8208209208151274e-01, 1e-10);
59 CHECK_CLOSE(F0(10,0), 1.7274188563417292e-01, 1e-10);
60 CHECK_CLOSE(F0(11,0), 1.6470576997839928e-01, 1e-10);
61 CHECK_CLOSE(F0(12,0), 1.5769603853464209e-01, 1e-10);
62 CHECK_CLOSE(F0(13,0), 1.5151129820345471e-01, 1e-10);
63 CHECK_CLOSE(F0(14,0), 1.4600146419605400e-01, 1e-10);
64 CHECK_CLOSE(F0(15,0), 1.4105209097756166e-01, 1e-10);
65 CHECK_CLOSE(F0(16,0), 1.3657418098484136e-01, 1e-10);
66 CHECK_CLOSE(F0(17,0), 1.3249734289737117e-01, 1e-10);
67 CHECK_CLOSE(F0(18,0), 1.2876507161025572e-01, 1e-10);
68 CHECK_CLOSE(F0(19,0), 1.2533141373155002e-01, 1e-10);
76 xvec = linspace<rowvec>(51,100,20);
78 for(uint i = 0; i < 20; i++){
81 F0(i,0) = boys.result(0);
84 CHECK_CLOSE(F0(0,0), 1.2409659136408727e-01, 1e-10);
85 CHECK_CLOSE(F0(1,0), 1.2107315290425182e-01, 1e-10);
86 CHECK_CLOSE(F0(2,0), 1.1826045114934411e-01, 1e-10);
87 CHECK_CLOSE(F0(3,0), 1.1563509029711123e-01, 1e-10);
88 CHECK_CLOSE(F0(4,0), 1.1317715652582763e-01, 1e-10);
89 CHECK_CLOSE(F0(5,0), 1.1086957884293665e-01, 1e-10);
90 CHECK_CLOSE(F0(6,0), 1.0869762771661817e-01, 1e-10);
91 CHECK_CLOSE(F0(7,0), 1.0664851770975842e-01, 1e-10);
92 CHECK_CLOSE(F0(8,0), 1.0471108954515591e-01, 1e-10);
93 CHECK_CLOSE(F0(9,0), 1.0287555349437555e-01, 1e-10);
94 CHECK_CLOSE(F0(10,0), 1.0113328058446551e-01, 1e-10);
95 CHECK_CLOSE(F0(11,0), 9.9476631436519997e-02, 1e-10);
96 CHECK_CLOSE(F0(12,0), 9.7898814974335960e-02, 1e-10);
97 CHECK_CLOSE(F0(13,0), 9.6393771031862641e-02, 1e-10);
98 CHECK_CLOSE(F0(14,0), 9.4956072224460661e-02, 1e-10);
99 CHECK_CLOSE(F0(15,0), 9.3580841456184838e-02, 1e-10);
100 CHECK_CLOSE(F0(16,0), 9.2263682201430275e-02, 1e-10);
101 CHECK_CLOSE(F0(17,0), 9.1000619287057175e-02, 1e-10);
102 CHECK_CLOSE(F0(18,0), 8.9788048355705335e-02, 1e-10);
103 CHECK_CLOSE(F0(19,0), 8.8622692545275800e-02, 1e-10);
106 TEST(BoysDownwardrecursionFunction)
113 rowvec Fn = zeros<rowvec>(20);
114 for(
int i = 0; i < 20; i++) {
115 Fn(i) = boysFn_0.result(i);
117 CHECK_CLOSE(Fn[0], 1.0000000000000000e+00, 1e-10);
118 CHECK_CLOSE(Fn[1], 3.3333333333333331e-01, 1e-10);
119 CHECK_CLOSE(Fn[2], 2.0000000000000001e-01, 1e-10);
120 CHECK_CLOSE(Fn[3], 1.4285714285714285e-01, 1e-10);
121 CHECK_CLOSE(Fn[4], 1.1111111111111110e-01, 1e-10);
122 CHECK_CLOSE(Fn[5], 9.0909090909090912e-02, 1e-10);
123 CHECK_CLOSE(Fn[6], 7.6923076923076927e-02, 1e-10);
124 CHECK_CLOSE(Fn[7], 6.6666666666666666e-02, 1e-10);
125 CHECK_CLOSE(Fn[8], 5.8823529411764705e-02, 1e-10);
126 CHECK_CLOSE(Fn[9], 5.2631578947368418e-02, 1e-10);
127 CHECK_CLOSE(Fn[10], 4.7619047619047616e-02, 1e-10);
128 CHECK_CLOSE(Fn[11], 4.3478260869565216e-02, 1e-10);
129 CHECK_CLOSE(Fn[12], 4.0000000000000001e-02, 1e-10);
130 CHECK_CLOSE(Fn[13], 3.7037037037037035e-02, 1e-10);
131 CHECK_CLOSE(Fn[14], 3.4482758620689655e-02, 1e-10);
132 CHECK_CLOSE(Fn[15], 3.2258064516129031e-02, 1e-10);
133 CHECK_CLOSE(Fn[16], 3.0303030303030304e-02, 1e-10);
134 CHECK_CLOSE(Fn[17], 2.8571428571428571e-02, 1e-10);
135 CHECK_CLOSE(Fn[18], 2.7027027027027029e-02, 1e-10);
136 CHECK_CLOSE(Fn[19], 2.5641025641025640e-02, 1e-10);
145 xvec = linspace<rowvec>(0.01,50,20);
147 for(uint i = 0; i < 20; i++){
148 BoysFunction boysF0_small(xvec[i], 15, &boysIntermediate);
150 F0(i,0) = boysF0_small.result(0);
153 CHECK_CLOSE(F0(0,0), 9.9667664290336333e-01, 1e-10);
154 CHECK_CLOSE(F0(1,0), 5.3357683580906246e-01, 1e-10);
155 CHECK_CLOSE(F0(2,0), 3.8551956882369670e-01, 1e-10);
156 CHECK_CLOSE(F0(3,0), 3.1522027004511449e-01, 1e-10);
157 CHECK_CLOSE(F0(4,0), 2.7304989839411259e-01, 1e-10);
158 CHECK_CLOSE(F0(5,0), 2.4424745291117503e-01, 1e-10);
159 CHECK_CLOSE(F0(6,0), 2.2298057384240719e-01, 1e-10);
160 CHECK_CLOSE(F0(7,0), 2.0644923632081960e-01, 1e-10);
161 CHECK_CLOSE(F0(8,0), 1.9312212797082015e-01, 1e-10);
162 CHECK_CLOSE(F0(9,0), 1.8208209208151274e-01, 1e-10);
163 CHECK_CLOSE(F0(10,0), 1.7274188563417292e-01, 1e-10);
164 CHECK_CLOSE(F0(11,0), 1.6470576997839928e-01, 1e-10);
165 CHECK_CLOSE(F0(12,0), 1.5769603853464209e-01, 1e-10);
166 CHECK_CLOSE(F0(13,0), 1.5151129820345471e-01, 1e-10);
167 CHECK_CLOSE(F0(14,0), 1.4600146419605400e-01, 1e-10);
168 CHECK_CLOSE(F0(15,0), 1.4105209097756166e-01, 1e-10);
169 CHECK_CLOSE(F0(16,0), 1.3657418098484136e-01, 1e-10);
170 CHECK_CLOSE(F0(17,0), 1.3249734289737117e-01, 1e-10);
171 CHECK_CLOSE(F0(18,0), 1.2876507161025572e-01, 1e-10);
172 CHECK_CLOSE(F0(19,0), 1.2533141373155002e-01, 1e-10);
177 xvec = linspace<rowvec>(51,100,20);
179 for(uint i = 0; i < 20; i++){
180 BoysFunction boysF0_large(xvec[i], 15, &boysIntermediate);
182 F0(i,0) = boysF0_large.result(0);
185 CHECK_CLOSE(F0(0,0), 1.2409659136408727e-01, 1e-9);
186 CHECK_CLOSE(F0(1,0), 1.2107315290425182e-01, 1e-10);
187 CHECK_CLOSE(F0(2,0), 1.1826045114934411e-01, 1e-10);
188 CHECK_CLOSE(F0(3,0), 1.1563509029711123e-01, 1e-10);
189 CHECK_CLOSE(F0(4,0), 1.1317715652582763e-01, 1e-10);
190 CHECK_CLOSE(F0(5,0), 1.1086957884293665e-01, 1e-10);
191 CHECK_CLOSE(F0(6,0), 1.0869762771661817e-01, 1e-10);
192 CHECK_CLOSE(F0(7,0), 1.0664851770975842e-01, 1e-10);
193 CHECK_CLOSE(F0(8,0), 1.0471108954515591e-01, 1e-10);
194 CHECK_CLOSE(F0(9,0), 1.0287555349437555e-01, 1e-10);
195 CHECK_CLOSE(F0(10,0), 1.0113328058446551e-01, 1e-10);
196 CHECK_CLOSE(F0(11,0), 9.9476631436519997e-02, 1e-10);
197 CHECK_CLOSE(F0(12,0), 9.7898814974335960e-02, 1e-10);
198 CHECK_CLOSE(F0(13,0), 9.6393771031862641e-02, 1e-10);
199 CHECK_CLOSE(F0(14,0), 9.4956072224460661e-02, 1e-10);
200 CHECK_CLOSE(F0(15,0), 9.3580841456184838e-02, 1e-10);
201 CHECK_CLOSE(F0(16,0), 9.2263682201430275e-02, 1e-10);
202 CHECK_CLOSE(F0(17,0), 9.1000619287057175e-02, 1e-10);
203 CHECK_CLOSE(F0(18,0), 8.9788048355705335e-02, 1e-10);
204 CHECK_CLOSE(F0(19,0), 8.8622692545275800e-02, 1e-10);