1 // { dg-do run { target c++11 } }
2 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__ -ffp-contract=off" }
4 // Copyright (C) 2016-2017 Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
22 // Compare against values generated by the GNU Scientific Library.
23 // The GSL can be found on the web: http://www.gnu.org/software/gsl/
26 #if defined(__TEST_DEBUG)
31 std::cout << "line " << __LINE__ \
32 << " max_abs_frac = " << max_abs_frac \
36 # include <testsuite_hooks.h>
38 #include <specfun_testcase.h>
40 // Test data for l=0, m=0.
41 // max(|f - f_GSL|): 0.0000000000000000 at index 0
42 // max(|f - f_GSL| / |f_GSL|): 0.0000000000000000
43 // mean(f - f_GSL): 0.0000000000000000
44 // variance(f - f_GSL): 0.0000000000000000
45 // stddev(f - f_GSL): 0.0000000000000000
46 const testcase_assoc_legendre<double>
49 { 1.0000000000000000, 0, 0,
50 -1.0000000000000000, 0.0 },
51 { 1.0000000000000000, 0, 0,
52 -0.90000000000000002, 0.0 },
53 { 1.0000000000000000, 0, 0,
54 -0.80000000000000004, 0.0 },
55 { 1.0000000000000000, 0, 0,
56 -0.69999999999999996, 0.0 },
57 { 1.0000000000000000, 0, 0,
58 -0.59999999999999998, 0.0 },
59 { 1.0000000000000000, 0, 0,
60 -0.50000000000000000, 0.0 },
61 { 1.0000000000000000, 0, 0,
62 -0.39999999999999991, 0.0 },
63 { 1.0000000000000000, 0, 0,
64 -0.29999999999999993, 0.0 },
65 { 1.0000000000000000, 0, 0,
66 -0.19999999999999996, 0.0 },
67 { 1.0000000000000000, 0, 0,
68 -0.099999999999999978, 0.0 },
69 { 1.0000000000000000, 0, 0,
70 0.0000000000000000, 0.0 },
71 { 1.0000000000000000, 0, 0,
72 0.10000000000000009, 0.0 },
73 { 1.0000000000000000, 0, 0,
74 0.20000000000000018, 0.0 },
75 { 1.0000000000000000, 0, 0,
76 0.30000000000000004, 0.0 },
77 { 1.0000000000000000, 0, 0,
78 0.40000000000000013, 0.0 },
79 { 1.0000000000000000, 0, 0,
80 0.50000000000000000, 0.0 },
81 { 1.0000000000000000, 0, 0,
82 0.60000000000000009, 0.0 },
83 { 1.0000000000000000, 0, 0,
84 0.70000000000000018, 0.0 },
85 { 1.0000000000000000, 0, 0,
86 0.80000000000000004, 0.0 },
87 { 1.0000000000000000, 0, 0,
88 0.90000000000000013, 0.0 },
89 { 1.0000000000000000, 0, 0,
90 1.0000000000000000, 0.0 },
92 const double toler001 = 2.5000000000000020e-13;
94 // Test data for l=1, m=0.
95 // max(|f - f_GSL|): 0.0000000000000000 at index 0
96 // max(|f - f_GSL| / |f_GSL|): 0.0000000000000000
97 // mean(f - f_GSL): 0.0000000000000000
98 // variance(f - f_GSL): 0.0000000000000000
99 // stddev(f - f_GSL): 0.0000000000000000
100 const testcase_assoc_legendre<double>
103 { -1.0000000000000000, 1, 0,
104 -1.0000000000000000, 0.0 },
105 { -0.90000000000000002, 1, 0,
106 -0.90000000000000002, 0.0 },
107 { -0.80000000000000004, 1, 0,
108 -0.80000000000000004, 0.0 },
109 { -0.69999999999999996, 1, 0,
110 -0.69999999999999996, 0.0 },
111 { -0.59999999999999998, 1, 0,
112 -0.59999999999999998, 0.0 },
113 { -0.50000000000000000, 1, 0,
114 -0.50000000000000000, 0.0 },
115 { -0.39999999999999991, 1, 0,
116 -0.39999999999999991, 0.0 },
117 { -0.29999999999999993, 1, 0,
118 -0.29999999999999993, 0.0 },
119 { -0.19999999999999996, 1, 0,
120 -0.19999999999999996, 0.0 },
121 { -0.099999999999999978, 1, 0,
122 -0.099999999999999978, 0.0 },
123 { 0.0000000000000000, 1, 0,
124 0.0000000000000000, 0.0 },
125 { 0.10000000000000009, 1, 0,
126 0.10000000000000009, 0.0 },
127 { 0.20000000000000018, 1, 0,
128 0.20000000000000018, 0.0 },
129 { 0.30000000000000004, 1, 0,
130 0.30000000000000004, 0.0 },
131 { 0.40000000000000013, 1, 0,
132 0.40000000000000013, 0.0 },
133 { 0.50000000000000000, 1, 0,
134 0.50000000000000000, 0.0 },
135 { 0.60000000000000009, 1, 0,
136 0.60000000000000009, 0.0 },
137 { 0.70000000000000018, 1, 0,
138 0.70000000000000018, 0.0 },
139 { 0.80000000000000004, 1, 0,
140 0.80000000000000004, 0.0 },
141 { 0.90000000000000013, 1, 0,
142 0.90000000000000013, 0.0 },
143 { 1.0000000000000000, 1, 0,
144 1.0000000000000000, 0.0 },
146 const double toler002 = 2.5000000000000020e-13;
148 // Test data for l=1, m=1.
149 // max(|f - f_GSL|): 2.2204460492503131e-16 at index 12
150 // max(|f - f_GSL| / |f_GSL|): 2.4227052612512390e-16
151 // mean(f - f_GSL): 1.0573552615477681e-17
152 // variance(f - f_GSL): 5.8695007828944331e-36
153 // stddev(f - f_GSL): 2.4227052612512388e-18
154 const testcase_assoc_legendre<double>
157 { -0.0000000000000000, 1, 1,
158 -1.0000000000000000, 0.0 },
159 { -0.43588989435406728, 1, 1,
160 -0.90000000000000002, 0.0 },
161 { -0.59999999999999987, 1, 1,
162 -0.80000000000000004, 0.0 },
163 { -0.71414284285428509, 1, 1,
164 -0.69999999999999996, 0.0 },
165 { -0.80000000000000004, 1, 1,
166 -0.59999999999999998, 0.0 },
167 { -0.86602540378443860, 1, 1,
168 -0.50000000000000000, 0.0 },
169 { -0.91651513899116799, 1, 1,
170 -0.39999999999999991, 0.0 },
171 { -0.95393920141694555, 1, 1,
172 -0.29999999999999993, 0.0 },
173 { -0.97979589711327120, 1, 1,
174 -0.19999999999999996, 0.0 },
175 { -0.99498743710661997, 1, 1,
176 -0.099999999999999978, 0.0 },
177 { -1.0000000000000000, 1, 1,
178 0.0000000000000000, 0.0 },
179 { -0.99498743710661997, 1, 1,
180 0.10000000000000009, 0.0 },
181 { -0.97979589711327120, 1, 1,
182 0.20000000000000018, 0.0 },
183 { -0.95393920141694577, 1, 1,
184 0.30000000000000004, 0.0 },
185 { -0.91651513899116788, 1, 1,
186 0.40000000000000013, 0.0 },
187 { -0.86602540378443860, 1, 1,
188 0.50000000000000000, 0.0 },
189 { -0.79999999999999993, 1, 1,
190 0.60000000000000009, 0.0 },
191 { -0.71414284285428475, 1, 1,
192 0.70000000000000018, 0.0 },
193 { -0.59999999999999987, 1, 1,
194 0.80000000000000004, 0.0 },
195 { -0.43588989435406711, 1, 1,
196 0.90000000000000013, 0.0 },
197 { -0.0000000000000000, 1, 1,
198 1.0000000000000000, 0.0 },
200 const double toler003 = 2.5000000000000020e-13;
202 // Test data for l=2, m=0.
203 // max(|f - f_GSL|): 1.1102230246251565e-16 at index 17
204 // max(|f - f_GSL| / |f_GSL|): 1.3877787807814482e-15
205 // mean(f - f_GSL): 1.8503717077085941e-17
206 // variance(f - f_GSL): 1.7975346147614202e-35
207 // stddev(f - f_GSL): 4.2397342071896678e-18
208 const testcase_assoc_legendre<double>
211 { 1.0000000000000000, 2, 0,
212 -1.0000000000000000, 0.0 },
213 { 0.71500000000000008, 2, 0,
214 -0.90000000000000002, 0.0 },
215 { 0.46000000000000019, 2, 0,
216 -0.80000000000000004, 0.0 },
217 { 0.23499999999999988, 2, 0,
218 -0.69999999999999996, 0.0 },
219 { 0.039999999999999925, 2, 0,
220 -0.59999999999999998, 0.0 },
221 { -0.12500000000000000, 2, 0,
222 -0.50000000000000000, 0.0 },
223 { -0.26000000000000012, 2, 0,
224 -0.39999999999999991, 0.0 },
225 { -0.36500000000000005, 2, 0,
226 -0.29999999999999993, 0.0 },
227 { -0.44000000000000006, 2, 0,
228 -0.19999999999999996, 0.0 },
229 { -0.48499999999999999, 2, 0,
230 -0.099999999999999978, 0.0 },
231 { -0.50000000000000000, 2, 0,
232 0.0000000000000000, 0.0 },
233 { -0.48499999999999999, 2, 0,
234 0.10000000000000009, 0.0 },
235 { -0.43999999999999989, 2, 0,
236 0.20000000000000018, 0.0 },
237 { -0.36499999999999999, 2, 0,
238 0.30000000000000004, 0.0 },
239 { -0.25999999999999984, 2, 0,
240 0.40000000000000013, 0.0 },
241 { -0.12500000000000000, 2, 0,
242 0.50000000000000000, 0.0 },
243 { 0.040000000000000147, 2, 0,
244 0.60000000000000009, 0.0 },
245 { 0.23500000000000032, 2, 0,
246 0.70000000000000018, 0.0 },
247 { 0.46000000000000019, 2, 0,
248 0.80000000000000004, 0.0 },
249 { 0.71500000000000030, 2, 0,
250 0.90000000000000013, 0.0 },
251 { 1.0000000000000000, 2, 0,
252 1.0000000000000000, 0.0 },
254 const double toler004 = 2.5000000000000020e-13;
256 // Test data for l=2, m=1.
257 // max(|f - f_GSL|): 2.2204460492503131e-16 at index 3
258 // max(|f - f_GSL| / |f_GSL|): 3.7770554319736585e-16
259 // mean(f - f_GSL): -1.0573552615477681e-17
260 // variance(f - f_GSL): 5.8695007828944331e-36
261 // stddev(f - f_GSL): 2.4227052612512388e-18
262 const testcase_assoc_legendre<double>
265 { 0.0000000000000000, 2, 1,
266 -1.0000000000000000, 0.0 },
267 { 1.1769027147559816, 2, 1,
268 -0.90000000000000002, 0.0 },
269 { 1.4399999999999999, 2, 1,
270 -0.80000000000000004, 0.0 },
271 { 1.4996999699939983, 2, 1,
272 -0.69999999999999996, 0.0 },
273 { 1.4399999999999999, 2, 1,
274 -0.59999999999999998, 0.0 },
275 { 1.2990381056766580, 2, 1,
276 -0.50000000000000000, 0.0 },
277 { 1.0998181667894014, 2, 1,
278 -0.39999999999999991, 0.0 },
279 { 0.85854528127525076, 2, 1,
280 -0.29999999999999993, 0.0 },
281 { 0.58787753826796263, 2, 1,
282 -0.19999999999999996, 0.0 },
283 { 0.29849623113198592, 2, 1,
284 -0.099999999999999978, 0.0 },
285 { -0.0000000000000000, 2, 1,
286 0.0000000000000000, 0.0 },
287 { -0.29849623113198626, 2, 1,
288 0.10000000000000009, 0.0 },
289 { -0.58787753826796330, 2, 1,
290 0.20000000000000018, 0.0 },
291 { -0.85854528127525132, 2, 1,
292 0.30000000000000004, 0.0 },
293 { -1.0998181667894018, 2, 1,
294 0.40000000000000013, 0.0 },
295 { -1.2990381056766580, 2, 1,
296 0.50000000000000000, 0.0 },
297 { -1.4400000000000002, 2, 1,
298 0.60000000000000009, 0.0 },
299 { -1.4996999699939983, 2, 1,
300 0.70000000000000018, 0.0 },
301 { -1.4399999999999999, 2, 1,
302 0.80000000000000004, 0.0 },
303 { -1.1769027147559812, 2, 1,
304 0.90000000000000013, 0.0 },
305 { -0.0000000000000000, 2, 1,
306 1.0000000000000000, 0.0 },
308 const double toler005 = 2.5000000000000020e-13;
310 // Test data for l=2, m=2.
311 // max(|f - f_GSL|): 1.3322676295501878e-15 at index 12
312 // max(|f - f_GSL| / |f_GSL|): 5.2867763077388426e-16
313 // mean(f - f_GSL): -8.4588420923821446e-17
314 // variance(f - f_GSL): 3.7564805010524372e-34
315 // stddev(f - f_GSL): 1.9381642090009910e-17
316 const testcase_assoc_legendre<double>
319 { 0.0000000000000000, 2, 2,
320 -1.0000000000000000, 0.0 },
321 { 0.56999999999999984, 2, 2,
322 -0.90000000000000002, 0.0 },
323 { 1.0799999999999996, 2, 2,
324 -0.80000000000000004, 0.0 },
325 { 1.5300000000000005, 2, 2,
326 -0.69999999999999996, 0.0 },
327 { 1.9200000000000004, 2, 2,
328 -0.59999999999999998, 0.0 },
329 { 2.2500000000000000, 2, 2,
330 -0.50000000000000000, 0.0 },
331 { 2.5200000000000000, 2, 2,
332 -0.39999999999999991, 0.0 },
333 { 2.7299999999999995, 2, 2,
334 -0.29999999999999993, 0.0 },
335 { 2.8799999999999999, 2, 2,
336 -0.19999999999999996, 0.0 },
337 { 2.9700000000000002, 2, 2,
338 -0.099999999999999978, 0.0 },
339 { 3.0000000000000000, 2, 2,
340 0.0000000000000000, 0.0 },
341 { 2.9700000000000002, 2, 2,
342 0.10000000000000009, 0.0 },
343 { 2.8799999999999999, 2, 2,
344 0.20000000000000018, 0.0 },
345 { 2.7300000000000004, 2, 2,
346 0.30000000000000004, 0.0 },
347 { 2.5199999999999991, 2, 2,
348 0.40000000000000013, 0.0 },
349 { 2.2500000000000000, 2, 2,
350 0.50000000000000000, 0.0 },
351 { 1.9199999999999997, 2, 2,
352 0.60000000000000009, 0.0 },
353 { 1.5299999999999989, 2, 2,
354 0.70000000000000018, 0.0 },
355 { 1.0799999999999996, 2, 2,
356 0.80000000000000004, 0.0 },
357 { 0.56999999999999929, 2, 2,
358 0.90000000000000013, 0.0 },
359 { 0.0000000000000000, 2, 2,
360 1.0000000000000000, 0.0 },
362 const double toler006 = 2.5000000000000020e-13;
364 // Test data for l=5, m=0.
365 // max(|f - f_GSL|): 2.0122792321330962e-16 at index 19
366 // max(|f - f_GSL| / |f_GSL|): 4.8911475274405560e-15
367 // mean(f - f_GSL): -2.3129646346357427e-18
368 // variance(f - f_GSL): 2.8086478355647191e-37
369 // stddev(f - f_GSL): 5.2996677589870847e-19
370 const testcase_assoc_legendre<double>
373 { -1.0000000000000000, 5, 0,
374 -1.0000000000000000, 0.0 },
375 { 0.041141250000000087, 5, 0,
376 -0.90000000000000002, 0.0 },
377 { 0.39951999999999993, 5, 0,
378 -0.80000000000000004, 0.0 },
379 { 0.36519874999999991, 5, 0,
380 -0.69999999999999996, 0.0 },
381 { 0.15263999999999994, 5, 0,
382 -0.59999999999999998, 0.0 },
383 { -0.089843750000000000, 5, 0,
384 -0.50000000000000000, 0.0 },
385 { -0.27064000000000010, 5, 0,
386 -0.39999999999999991, 0.0 },
387 { -0.34538624999999995, 5, 0,
388 -0.29999999999999993, 0.0 },
389 { -0.30751999999999996, 5, 0,
390 -0.19999999999999996, 0.0 },
391 { -0.17882874999999995, 5, 0,
392 -0.099999999999999978, 0.0 },
393 { 0.0000000000000000, 5, 0,
394 0.0000000000000000, 0.0 },
395 { 0.17882875000000015, 5, 0,
396 0.10000000000000009, 0.0 },
397 { 0.30752000000000013, 5, 0,
398 0.20000000000000018, 0.0 },
399 { 0.34538625000000001, 5, 0,
400 0.30000000000000004, 0.0 },
401 { 0.27063999999999988, 5, 0,
402 0.40000000000000013, 0.0 },
403 { 0.089843750000000000, 5, 0,
404 0.50000000000000000, 0.0 },
405 { -0.15264000000000016, 5, 0,
406 0.60000000000000009, 0.0 },
407 { -0.36519875000000024, 5, 0,
408 0.70000000000000018, 0.0 },
409 { -0.39951999999999993, 5, 0,
410 0.80000000000000004, 0.0 },
411 { -0.041141249999999151, 5, 0,
412 0.90000000000000013, 0.0 },
413 { 1.0000000000000000, 5, 0,
414 1.0000000000000000, 0.0 },
416 const double toler007 = 2.5000000000000020e-13;
418 // Test data for l=5, m=1.
419 // max(|f - f_GSL|): 6.6613381477509392e-16 at index 14
420 // max(|f - f_GSL| / |f_GSL|): 5.5186908001167120e-16
421 // mean(f - f_GSL): -1.0573552615477681e-17
422 // variance(f - f_GSL): 5.8695007828944331e-36
423 // stddev(f - f_GSL): 2.4227052612512388e-18
424 const testcase_assoc_legendre<double>
427 { 0.0000000000000000, 5, 1,
428 -1.0000000000000000, 0.0 },
429 { -2.8099369608350981, 5, 1,
430 -0.90000000000000002, 0.0 },
431 { -0.72180000000000089, 5, 1,
432 -0.80000000000000004, 0.0 },
433 { 1.0951826834447254, 5, 1,
434 -0.69999999999999996, 0.0 },
435 { 1.9775999999999998, 5, 1,
436 -0.59999999999999998, 0.0 },
437 { 1.9282596881137892, 5, 1,
438 -0.50000000000000000, 0.0 },
439 { 1.2070504380513671, 5, 1,
440 -0.39999999999999991, 0.0 },
441 { 0.16079837663884300, 5, 1,
442 -0.29999999999999993, 0.0 },
443 { -0.87005875663658538, 5, 1,
444 -0.19999999999999996, 0.0 },
445 { -1.6083350053680323, 5, 1,
446 -0.099999999999999978, 0.0 },
447 { -1.8750000000000000, 5, 1,
448 0.0000000000000000, 0.0 },
449 { -1.6083350053680314, 5, 1,
450 0.10000000000000009, 0.0 },
451 { -0.87005875663658327, 5, 1,
452 0.20000000000000018, 0.0 },
453 { 0.16079837663884422, 5, 1,
454 0.30000000000000004, 0.0 },
455 { 1.2070504380513694, 5, 1,
456 0.40000000000000013, 0.0 },
457 { 1.9282596881137892, 5, 1,
458 0.50000000000000000, 0.0 },
459 { 1.9775999999999998, 5, 1,
460 0.60000000000000009, 0.0 },
461 { 1.0951826834447216, 5, 1,
462 0.70000000000000018, 0.0 },
463 { -0.72180000000000089, 5, 1,
464 0.80000000000000004, 0.0 },
465 { -2.8099369608350999, 5, 1,
466 0.90000000000000013, 0.0 },
467 { 0.0000000000000000, 5, 1,
468 1.0000000000000000, 0.0 },
470 const double toler008 = 2.5000000000000020e-13;
472 // Test data for l=5, m=2.
473 // max(|f - f_GSL|): 3.5527136788005009e-15 at index 12
474 // max(|f - f_GSL| / |f_GSL|): 5.4136589391245733e-16
475 // mean(f - f_GSL): 0.0000000000000000
476 // variance(f - f_GSL): 0.0000000000000000
477 // stddev(f - f_GSL): 0.0000000000000000
478 const testcase_assoc_legendre<double>
481 { 0.0000000000000000, 5, 2,
482 -1.0000000000000000, 0.0 },
483 { -12.837825000000000, 5, 2,
484 -0.90000000000000002, 0.0 },
485 { -13.910400000000001, 5, 2,
486 -0.80000000000000004, 0.0 },
487 { -8.8089749999999967, 5, 2,
488 -0.69999999999999996, 0.0 },
489 { -1.6128000000000000, 5, 2,
490 -0.59999999999999998, 0.0 },
491 { 4.9218750000000000, 5, 2,
492 -0.50000000000000000, 0.0 },
493 { 9.1728000000000005, 5, 2,
494 -0.39999999999999991, 0.0 },
495 { 10.462724999999997, 5, 2,
496 -0.29999999999999993, 0.0 },
497 { 8.8703999999999983, 5, 2,
498 -0.19999999999999996, 0.0 },
499 { 5.0415749999999990, 5, 2,
500 -0.099999999999999978, 0.0 },
501 { -0.0000000000000000, 5, 2,
502 0.0000000000000000, 0.0 },
503 { -5.0415750000000044, 5, 2,
504 0.10000000000000009, 0.0 },
505 { -8.8704000000000054, 5, 2,
506 0.20000000000000018, 0.0 },
507 { -10.462725000000001, 5, 2,
508 0.30000000000000004, 0.0 },
509 { -9.1727999999999970, 5, 2,
510 0.40000000000000013, 0.0 },
511 { -4.9218750000000000, 5, 2,
512 0.50000000000000000, 0.0 },
513 { 1.6128000000000047, 5, 2,
514 0.60000000000000009, 0.0 },
515 { 8.8089750000000109, 5, 2,
516 0.70000000000000018, 0.0 },
517 { 13.910400000000001, 5, 2,
518 0.80000000000000004, 0.0 },
519 { 12.837824999999990, 5, 2,
520 0.90000000000000013, 0.0 },
521 { 0.0000000000000000, 5, 2,
522 1.0000000000000000, 0.0 },
524 const double toler009 = 2.5000000000000020e-13;
526 // Test data for l=5, m=5.
527 // max(|f - f_GSL|): 1.0231815394945443e-12 at index 12
528 // max(|f - f_GSL| / |f_GSL|): 1.1990652164995755e-15
529 // mean(f - f_GSL): 3.1128538899966297e-14
530 // variance(f - f_GSL): 5.0871761537452526e-29
531 // stddev(f - f_GSL): 7.1324442891236469e-15
532 const testcase_assoc_legendre<double>
535 { -0.0000000000000000, 5, 5,
536 -1.0000000000000000, 0.0 },
537 { -14.870165800941818, 5, 5,
538 -0.90000000000000002, 0.0 },
539 { -73.483199999999925, 5, 5,
540 -0.80000000000000004, 0.0 },
541 { -175.53238298794764, 5, 5,
542 -0.69999999999999996, 0.0 },
543 { -309.65760000000006, 5, 5,
544 -0.59999999999999998, 0.0 },
545 { -460.34662869916559, 5, 5,
546 -0.50000000000000000, 0.0 },
547 { -611.12496255819883, 5, 5,
548 -0.39999999999999991, 0.0 },
549 { -746.50941479523703, 5, 5,
550 -0.29999999999999993, 0.0 },
551 { -853.31600434671316, 5, 5,
552 -0.19999999999999996, 0.0 },
553 { -921.55189181724734, 5, 5,
554 -0.099999999999999978, 0.0 },
555 { -945.00000000000000, 5, 5,
556 0.0000000000000000, 0.0 },
557 { -921.55189181724734, 5, 5,
558 0.10000000000000009, 0.0 },
559 { -853.31600434671316, 5, 5,
560 0.20000000000000018, 0.0 },
561 { -746.50941479523760, 5, 5,
562 0.30000000000000004, 0.0 },
563 { -611.12496255819838, 5, 5,
564 0.40000000000000013, 0.0 },
565 { -460.34662869916559, 5, 5,
566 0.50000000000000000, 0.0 },
567 { -309.65759999999989, 5, 5,
568 0.60000000000000009, 0.0 },
569 { -175.53238298794724, 5, 5,
570 0.70000000000000018, 0.0 },
571 { -73.483199999999925, 5, 5,
572 0.80000000000000004, 0.0 },
573 { -14.870165800941789, 5, 5,
574 0.90000000000000013, 0.0 },
575 { -0.0000000000000000, 5, 5,
576 1.0000000000000000, 0.0 },
578 const double toler010 = 2.5000000000000020e-13;
580 // Test data for l=10, m=0.
581 // max(|f - f_GSL|): 3.8857805861880479e-16 at index 19
582 // max(|f - f_GSL| / |f_GSL|): 1.4766655123690915e-15
583 // mean(f - f_GSL): -2.5112187461759493e-17
584 // variance(f - f_GSL): 3.3107652853513909e-35
585 // stddev(f - f_GSL): 5.7539249954716919e-18
586 const testcase_assoc_legendre<double>
589 { 1.0000000000000000, 10, 0,
590 -1.0000000000000000, 0.0 },
591 { -0.26314561785585960, 10, 0,
592 -0.90000000000000002, 0.0 },
593 { 0.30052979560000004, 10, 0,
594 -0.80000000000000004, 0.0 },
595 { 0.085805795531640333, 10, 0,
596 -0.69999999999999996, 0.0 },
597 { -0.24366274560000001, 10, 0,
598 -0.59999999999999998, 0.0 },
599 { -0.18822860717773438, 10, 0,
600 -0.50000000000000000, 0.0 },
601 { 0.096839064400000258, 10, 0,
602 -0.39999999999999991, 0.0 },
603 { 0.25147634951601561, 10, 0,
604 -0.29999999999999993, 0.0 },
605 { 0.12907202559999983, 10, 0,
606 -0.19999999999999996, 0.0 },
607 { -0.12212499738710943, 10, 0,
608 -0.099999999999999978, 0.0 },
609 { -0.24609375000000000, 10, 0,
610 0.0000000000000000, 0.0 },
611 { -0.12212499738710922, 10, 0,
612 0.10000000000000009, 0.0 },
613 { 0.12907202560000042, 10, 0,
614 0.20000000000000018, 0.0 },
615 { 0.25147634951601561, 10, 0,
616 0.30000000000000004, 0.0 },
617 { 0.096839064399999633, 10, 0,
618 0.40000000000000013, 0.0 },
619 { -0.18822860717773438, 10, 0,
620 0.50000000000000000, 0.0 },
621 { -0.24366274559999984, 10, 0,
622 0.60000000000000009, 0.0 },
623 { 0.085805795531641277, 10, 0,
624 0.70000000000000018, 0.0 },
625 { 0.30052979560000004, 10, 0,
626 0.80000000000000004, 0.0 },
627 { -0.26314561785586010, 10, 0,
628 0.90000000000000013, 0.0 },
629 { 1.0000000000000000, 10, 0,
630 1.0000000000000000, 0.0 },
632 const double toler011 = 2.5000000000000020e-13;
634 // Test data for l=10, m=1.
635 // max(|f - f_GSL|): 1.3322676295501878e-15 at index 14
636 // max(|f - f_GSL| / |f_GSL|): 5.3672431731635395e-16
637 // mean(f - f_GSL): 6.3441315692866085e-17
638 // variance(f - f_GSL): 2.1130202818419960e-34
639 // stddev(f - f_GSL): 1.4536231567507432e-17
640 const testcase_assoc_legendre<double>
643 { -0.0000000000000000, 10, 1,
644 -1.0000000000000000, 0.0 },
645 { -3.0438748781479039, 10, 1,
646 -0.90000000000000002, 0.0 },
647 { -0.87614260800000254, 10, 1,
648 -0.80000000000000004, 0.0 },
649 { 2.9685359952934527, 10, 1,
650 -0.69999999999999996, 0.0 },
651 { 1.2511825919999997, 10, 1,
652 -0.59999999999999998, 0.0 },
653 { -2.0066877394361260, 10, 1,
654 -0.50000000000000000, 0.0 },
655 { -2.4822196173476647, 10, 1,
656 -0.39999999999999991, 0.0 },
657 { -0.12309508907433593, 10, 1,
658 -0.29999999999999993, 0.0 },
659 { 2.2468221751958413, 10, 1,
660 -0.19999999999999996, 0.0 },
661 { 2.2472659777983512, 10, 1,
662 -0.099999999999999978, 0.0 },
663 { -0.0000000000000000, 10, 1,
664 0.0000000000000000, 0.0 },
665 { -2.2472659777983535, 10, 1,
666 0.10000000000000009, 0.0 },
667 { -2.2468221751958377, 10, 1,
668 0.20000000000000018, 0.0 },
669 { 0.12309508907433910, 10, 1,
670 0.30000000000000004, 0.0 },
671 { 2.4822196173476669, 10, 1,
672 0.40000000000000013, 0.0 },
673 { 2.0066877394361260, 10, 1,
674 0.50000000000000000, 0.0 },
675 { -1.2511825920000037, 10, 1,
676 0.60000000000000009, 0.0 },
677 { -2.9685359952934505, 10, 1,
678 0.70000000000000018, 0.0 },
679 { 0.87614260800000254, 10, 1,
680 0.80000000000000004, 0.0 },
681 { 3.0438748781478981, 10, 1,
682 0.90000000000000013, 0.0 },
683 { 0.0000000000000000, 10, 1,
684 1.0000000000000000, 0.0 },
686 const double toler012 = 2.5000000000000020e-13;
688 // Test data for l=10, m=2.
689 // max(|f - f_GSL|): 1.2434497875801753e-14 at index 12
690 // max(|f - f_GSL| / |f_GSL|): 1.9632900580960751e-15
691 // mean(f - f_GSL): -8.4588420923821446e-17
692 // variance(f - f_GSL): 3.7564805010524372e-34
693 // stddev(f - f_GSL): 1.9381642090009910e-17
694 const testcase_assoc_legendre<double>
697 { 0.0000000000000000, 10, 2,
698 -1.0000000000000000, 0.0 },
699 { 16.376387762496137, 10, 2,
700 -0.90000000000000002, 0.0 },
701 { -35.394657804000005, 10, 2,
702 -0.80000000000000004, 0.0 },
703 { -3.6191429423788648, 10, 2,
704 -0.69999999999999996, 0.0 },
705 { 28.679675904000014, 10, 2,
706 -0.59999999999999998, 0.0 },
707 { 18.388023376464844, 10, 2,
708 -0.50000000000000000, 0.0 },
709 { -12.818955996000021, 10, 2,
710 -0.39999999999999991, 0.0 },
711 { -27.739821675972646, 10, 2,
712 -0.29999999999999993, 0.0 },
713 { -13.280661503999987, 10, 2,
714 -0.19999999999999996, 0.0 },
715 { 13.885467170308601, 10, 2,
716 -0.099999999999999978, 0.0 },
717 { 27.070312500000000, 10, 2,
718 0.0000000000000000, 0.0 },
719 { 13.885467170308573, 10, 2,
720 0.10000000000000009, 0.0 },
721 { -13.280661504000051, 10, 2,
722 0.20000000000000018, 0.0 },
723 { -27.739821675972664, 10, 2,
724 0.30000000000000004, 0.0 },
725 { -12.818955995999961, 10, 2,
726 0.40000000000000013, 0.0 },
727 { 18.388023376464844, 10, 2,
728 0.50000000000000000, 0.0 },
729 { 28.679675904000000, 10, 2,
730 0.60000000000000009, 0.0 },
731 { -3.6191429423789856, 10, 2,
732 0.70000000000000018, 0.0 },
733 { -35.394657804000005, 10, 2,
734 0.80000000000000004, 0.0 },
735 { 16.376387762496201, 10, 2,
736 0.90000000000000013, 0.0 },
737 { 0.0000000000000000, 10, 2,
738 1.0000000000000000, 0.0 },
740 const double toler013 = 2.5000000000000020e-13;
742 // Test data for l=10, m=5.
743 // max(|f - f_GSL|): 2.9103830456733704e-11 at index 12
744 // max(|f - f_GSL| / |f_GSL|): 1.4825078449301893e-15
745 // mean(f - f_GSL): 2.4253192047278085e-12
746 // variance(f - f_GSL): 3.0881409535313035e-25
747 // stddev(f - f_GSL): 5.5571044200476413e-13
748 const testcase_assoc_legendre<double>
751 { 0.0000000000000000, 10, 5,
752 -1.0000000000000000, 0.0 },
753 { 21343.618518164680, 10, 5,
754 -0.90000000000000002, 0.0 },
755 { 40457.016407807983, 10, 5,
756 -0.80000000000000004, 0.0 },
757 { 20321.279317331315, 10, 5,
758 -0.69999999999999996, 0.0 },
759 { -14410.820616192004, 10, 5,
760 -0.59999999999999998, 0.0 },
761 { -30086.169706116176, 10, 5,
762 -0.50000000000000000, 0.0 },
763 { -17177.549337582834, 10, 5,
764 -0.39999999999999991, 0.0 },
765 { 9272.5119495412546, 10, 5,
766 -0.29999999999999993, 0.0 },
767 { 26591.511184414714, 10, 5,
768 -0.19999999999999996, 0.0 },
769 { 21961.951238504211, 10, 5,
770 -0.099999999999999978, 0.0 },
771 { -0.0000000000000000, 10, 5,
772 0.0000000000000000, 0.0 },
773 { -21961.951238504229, 10, 5,
774 0.10000000000000009, 0.0 },
775 { -26591.511184414703, 10, 5,
776 0.20000000000000018, 0.0 },
777 { -9272.5119495412364, 10, 5,
778 0.30000000000000004, 0.0 },
779 { 17177.549337582877, 10, 5,
780 0.40000000000000013, 0.0 },
781 { 30086.169706116176, 10, 5,
782 0.50000000000000000, 0.0 },
783 { 14410.820616191972, 10, 5,
784 0.60000000000000009, 0.0 },
785 { -20321.279317331391, 10, 5,
786 0.70000000000000018, 0.0 },
787 { -40457.016407807983, 10, 5,
788 0.80000000000000004, 0.0 },
789 { -21343.618518164636, 10, 5,
790 0.90000000000000013, 0.0 },
791 { 0.0000000000000000, 10, 5,
792 1.0000000000000000, 0.0 },
794 const double toler014 = 2.5000000000000020e-13;
796 // Test data for l=10, m=10.
797 // max(|f - f_GSL|): 1.1920928955078125e-06 at index 12
798 // max(|f - f_GSL| / |f_GSL|): 2.3944993944674592e-15
799 // mean(f - f_GSL): -1.5610740298316593e-08
800 // variance(f - f_GSL): 1.2793998664727994e-17
801 // stddev(f - f_GSL): 3.5768699535666649e-09
802 const testcase_assoc_legendre<double>
805 { 0.0000000000000000, 10, 10,
806 -1.0000000000000000, 0.0 },
807 { 162117.40078784220, 10, 10,
808 -0.90000000000000002, 0.0 },
809 { 3958896.3481267113, 10, 10,
810 -0.80000000000000004, 0.0 },
811 { 22589806.343887307, 10, 10,
812 -0.69999999999999996, 0.0 },
813 { 70300999.121633321, 10, 10,
814 -0.59999999999999998, 0.0 },
815 { 155370278.54003900, 10, 10,
816 -0.50000000000000000, 0.0 },
817 { 273815518.20150518, 10, 10,
818 -0.39999999999999991, 0.0 },
819 { 408571989.13158852, 10, 10,
820 -0.29999999999999993, 0.0 },
821 { 533848212.07990247, 10, 10,
822 -0.19999999999999996, 0.0 },
823 { 622640835.70523083, 10, 10,
824 -0.099999999999999978, 0.0 },
825 { 654729075.00000000, 10, 10,
826 0.0000000000000000, 0.0 },
827 { 622640835.70523083, 10, 10,
828 0.10000000000000009, 0.0 },
829 { 533848212.07990247, 10, 10,
830 0.20000000000000018, 0.0 },
831 { 408571989.13158917, 10, 10,
832 0.30000000000000004, 0.0 },
833 { 273815518.20150483, 10, 10,
834 0.40000000000000013, 0.0 },
835 { 155370278.54003900, 10, 10,
836 0.50000000000000000, 0.0 },
837 { 70300999.121633217, 10, 10,
838 0.60000000000000009, 0.0 },
839 { 22589806.343887202, 10, 10,
840 0.70000000000000018, 0.0 },
841 { 3958896.3481267113, 10, 10,
842 0.80000000000000004, 0.0 },
843 { 162117.40078784159, 10, 10,
844 0.90000000000000013, 0.0 },
845 { 0.0000000000000000, 10, 10,
846 1.0000000000000000, 0.0 },
848 const double toler015 = 2.5000000000000020e-13;
850 // Test data for l=20, m=0.
851 // max(|f - f_GSL|): 3.6082248300317588e-16 at index 19
852 // max(|f - f_GSL| / |f_GSL|): 2.4166281401316513e-15
853 // mean(f - f_GSL): 0.0000000000000000
854 // variance(f - f_GSL): 4.9424644697959907e-65
855 // stddev(f - f_GSL): 7.0302663319365015e-33
856 const testcase_assoc_legendre<double>
859 { 1.0000000000000000, 20, 0,
860 -1.0000000000000000, 0.0 },
861 { -0.14930823530984835, 20, 0,
862 -0.90000000000000002, 0.0 },
863 { 0.22420460541741347, 20, 0,
864 -0.80000000000000004, 0.0 },
865 { -0.20457394463834172, 20, 0,
866 -0.69999999999999996, 0.0 },
867 { 0.15916752910098109, 20, 0,
868 -0.59999999999999998, 0.0 },
869 { -0.048358381067373557, 20, 0,
870 -0.50000000000000000, 0.0 },
871 { -0.10159261558628112, 20, 0,
872 -0.39999999999999991, 0.0 },
873 { 0.18028715947998047, 20, 0,
874 -0.29999999999999993, 0.0 },
875 { -0.098042194344594796, 20, 0,
876 -0.19999999999999996, 0.0 },
877 { -0.082077130944527663, 20, 0,
878 -0.099999999999999978, 0.0 },
879 { 0.17619705200195312, 20, 0,
880 0.0000000000000000, 0.0 },
881 { -0.082077130944528023, 20, 0,
882 0.10000000000000009, 0.0 },
883 { -0.098042194344594089, 20, 0,
884 0.20000000000000018, 0.0 },
885 { 0.18028715947998042, 20, 0,
886 0.30000000000000004, 0.0 },
887 { -0.10159261558628192, 20, 0,
888 0.40000000000000013, 0.0 },
889 { -0.048358381067373557, 20, 0,
890 0.50000000000000000, 0.0 },
891 { 0.15916752910098075, 20, 0,
892 0.60000000000000009, 0.0 },
893 { -0.20457394463834136, 20, 0,
894 0.70000000000000018, 0.0 },
895 { 0.22420460541741347, 20, 0,
896 0.80000000000000004, 0.0 },
897 { -0.14930823530984758, 20, 0,
898 0.90000000000000013, 0.0 },
899 { 1.0000000000000000, 20, 0,
900 1.0000000000000000, 0.0 },
902 const double toler016 = 2.5000000000000020e-13;
904 // Test data for l=20, m=1.
905 // max(|f - f_GSL|): 1.3322676295501878e-15 at index 12
906 // max(|f - f_GSL| / |f_GSL|): 1.0752784502271902e-15
907 // mean(f - f_GSL): 1.4274296030894871e-16
908 // variance(f - f_GSL): 1.0697165176825104e-33
909 // stddev(f - f_GSL): 3.2706521026891724e-17
910 const testcase_assoc_legendre<double>
913 { 0.0000000000000000, 20, 1,
914 -1.0000000000000000, 0.0 },
915 { 4.3838334818220499, 20, 1,
916 -0.90000000000000002, 0.0 },
917 { -0.63138296146340844, 20, 1,
918 -0.80000000000000004, 0.0 },
919 { 0.72274871413391395, 20, 1,
920 -0.69999999999999996, 0.0 },
921 { -2.3203528743824910, 20, 1,
922 -0.59999999999999998, 0.0 },
923 { 3.7399919228791405, 20, 1,
924 -0.50000000000000000, 0.0 },
925 { -3.1692202279270085, 20, 1,
926 -0.39999999999999991, 0.0 },
927 { 0.15804468835345031, 20, 1,
928 -0.29999999999999993, 0.0 },
929 { 3.0366182393271171, 20, 1,
930 -0.19999999999999996, 0.0 },
931 { -3.2115523815580209, 20, 1,
932 -0.099999999999999978, 0.0 },
933 { 0.0000000000000000, 20, 1,
934 0.0000000000000000, 0.0 },
935 { 3.2115523815580169, 20, 1,
936 0.10000000000000009, 0.0 },
937 { -3.0366182393271259, 20, 1,
938 0.20000000000000018, 0.0 },
939 { -0.15804468835344135, 20, 1,
940 0.30000000000000004, 0.0 },
941 { 3.1692202279269970, 20, 1,
942 0.40000000000000013, 0.0 },
943 { -3.7399919228791405, 20, 1,
944 0.50000000000000000, 0.0 },
945 { 2.3203528743824995, 20, 1,
946 0.60000000000000009, 0.0 },
947 { -0.72274871413393793, 20, 1,
948 0.70000000000000018, 0.0 },
949 { 0.63138296146340844, 20, 1,
950 0.80000000000000004, 0.0 },
951 { -4.3838334818220686, 20, 1,
952 0.90000000000000013, 0.0 },
953 { 0.0000000000000000, 20, 1,
954 1.0000000000000000, 0.0 },
956 const double toler017 = 2.5000000000000020e-13;
958 // Test data for l=20, m=2.
959 // max(|f - f_GSL|): 2.4868995751603507e-14 at index 5
960 // max(|f - f_GSL| / |f_GSL|): 1.0097407175524082e-15
961 // mean(f - f_GSL): -2.0301221021717147e-15
962 // variance(f - f_GSL): 2.1637327686062039e-31
963 // stddev(f - f_GSL): 4.6515941016023782e-16
964 const testcase_assoc_legendre<double>
967 { 0.0000000000000000, 20, 2,
968 -1.0000000000000000, 0.0 },
969 { 80.812425587310102, 20, 2,
970 -0.90000000000000002, 0.0 },
971 { -95.849622172549374, 20, 2,
972 -0.80000000000000004, 0.0 },
973 { 87.337927630325510, 20, 2,
974 -0.69999999999999996, 0.0 },
975 { -70.330891533985834, 20, 2,
976 -0.59999999999999998, 0.0 },
977 { 24.629090735179489, 20, 2,
978 -0.50000000000000000, 0.0 },
979 { 39.902576338912247, 20, 2,
980 -0.39999999999999991, 0.0 },
981 { -75.621201471396546, 20, 2,
982 -0.29999999999999993, 0.0 },
983 { 42.417415829726494, 20, 2,
984 -0.19999999999999996, 0.0 },
985 { 33.826848678871293, 20, 2,
986 -0.099999999999999978, 0.0 },
987 { -74.002761840820312, 20, 2,
988 0.0000000000000000, 0.0 },
989 { 33.826848678871464, 20, 2,
990 0.10000000000000009, 0.0 },
991 { 42.417415829726188, 20, 2,
992 0.20000000000000018, 0.0 },
993 { -75.621201471396603, 20, 2,
994 0.30000000000000004, 0.0 },
995 { 39.902576338912553, 20, 2,
996 0.40000000000000013, 0.0 },
997 { 24.629090735179489, 20, 2,
998 0.50000000000000000, 0.0 },
999 { -70.330891533985721, 20, 2,
1000 0.60000000000000009, 0.0 },
1001 { 87.337927630325453, 20, 2,
1002 0.70000000000000018, 0.0 },
1003 { -95.849622172549374, 20, 2,
1004 0.80000000000000004, 0.0 },
1005 { 80.812425587309747, 20, 2,
1006 0.90000000000000013, 0.0 },
1007 { 0.0000000000000000, 20, 2,
1008 1.0000000000000000, 0.0 },
1010 const double toler018 = 2.5000000000000020e-13;
1012 // Test data for l=20, m=5.
1013 // max(|f - f_GSL|): 1.2805685400962830e-09 at index 14
1014 // max(|f - f_GSL| / |f_GSL|): 2.0861530799041223e-15
1015 // mean(f - f_GSL): 1.1641532182693481e-10
1016 // variance(f - f_GSL): 7.1150767569361226e-22
1017 // stddev(f - f_GSL): 2.6674101216228678e-11
1018 const testcase_assoc_legendre<double>
1021 { -0.0000000000000000, 20, 5,
1022 -1.0000000000000000, 0.0 },
1023 { -315702.32715134218, 20, 5,
1024 -0.90000000000000002, 0.0 },
1025 { 503060.91484852589, 20, 5,
1026 -0.80000000000000004, 0.0 },
1027 { -298127.28360361955, 20, 5,
1028 -0.69999999999999996, 0.0 },
1029 { -114444.61447464029, 20, 5,
1030 -0.59999999999999998, 0.0 },
1031 { 543428.40914592845, 20, 5,
1032 -0.50000000000000000, 0.0 },
1033 { -613842.07728185481, 20, 5,
1034 -0.39999999999999991, 0.0 },
1035 { 143765.42411271061, 20, 5,
1036 -0.29999999999999993, 0.0 },
1037 { 472600.45321372285, 20, 5,
1038 -0.19999999999999996, 0.0 },
1039 { -563861.76771496492, 20, 5,
1040 -0.099999999999999978, 0.0 },
1041 { 0.0000000000000000, 20, 5,
1042 0.0000000000000000, 0.0 },
1043 { 563861.76771496458, 20, 5,
1044 0.10000000000000009, 0.0 },
1045 { -472600.45321372483, 20, 5,
1046 0.20000000000000018, 0.0 },
1047 { -143765.42411270936, 20, 5,
1048 0.30000000000000004, 0.0 },
1049 { 613842.07728185353, 20, 5,
1050 0.40000000000000013, 0.0 },
1051 { -543428.40914592845, 20, 5,
1052 0.50000000000000000, 0.0 },
1053 { 114444.61447464178, 20, 5,
1054 0.60000000000000009, 0.0 },
1055 { 298127.28360361519, 20, 5,
1056 0.70000000000000018, 0.0 },
1057 { -503060.91484852589, 20, 5,
1058 0.80000000000000004, 0.0 },
1059 { 315702.32715133618, 20, 5,
1060 0.90000000000000013, 0.0 },
1061 { 0.0000000000000000, 20, 5,
1062 1.0000000000000000, 0.0 },
1064 const double toler019 = 2.5000000000000020e-13;
1066 // Test data for l=20, m=10.
1067 // max(|f - f_GSL|): 0.0039062500000000000 at index 12
1068 // max(|f - f_GSL| / |f_GSL|): 2.6634565089260680e-15
1069 // mean(f - f_GSL): -0.00043596540178571431
1070 // variance(f - f_GSL): 9.9784562846311215e-09
1071 // stddev(f - f_GSL): 9.9892223344117843e-05
1072 const testcase_assoc_legendre<double>
1075 { -0.0000000000000000, 20, 10,
1076 -1.0000000000000000, 0.0 },
1077 { 990017476694.99084, 20, 10,
1078 -0.90000000000000002, 0.0 },
1079 { 2392757933281.0498, 20, 10,
1080 -0.80000000000000004, 0.0 },
1081 { -1548364524949.5808, 20, 10,
1082 -0.69999999999999996, 0.0 },
1083 { -424471915195.05627, 20, 10,
1084 -0.59999999999999998, 0.0 },
1085 { 1744502295946.2073, 20, 10,
1086 -0.50000000000000000, 0.0 },
1087 { -899973487310.55530, 20, 10,
1088 -0.39999999999999991, 0.0 },
1089 { -1092420454297.7119, 20, 10,
1090 -0.29999999999999993, 0.0 },
1091 { 1466609267659.8816, 20, 10,
1092 -0.19999999999999996, 0.0 },
1093 { 356041756390.71674, 20, 10,
1094 -0.099999999999999978, 0.0 },
1095 { -1612052956674.3164, 20, 10,
1096 0.0000000000000000, 0.0 },
1097 { 356041756390.71985, 20, 10,
1098 0.10000000000000009, 0.0 },
1099 { 1466609267659.8796, 20, 10,
1100 0.20000000000000018, 0.0 },
1101 { -1092420454297.7161, 20, 10,
1102 0.30000000000000004, 0.0 },
1103 { -899973487310.54810, 20, 10,
1104 0.40000000000000013, 0.0 },
1105 { 1744502295946.2073, 20, 10,
1106 0.50000000000000000, 0.0 },
1107 { -424471915195.05896, 20, 10,
1108 0.60000000000000009, 0.0 },
1109 { -1548364524949.5730, 20, 10,
1110 0.70000000000000018, 0.0 },
1111 { 2392757933281.0498, 20, 10,
1112 0.80000000000000004, 0.0 },
1113 { 990017476694.98828, 20, 10,
1114 0.90000000000000013, 0.0 },
1115 { 0.0000000000000000, 20, 10,
1116 1.0000000000000000, 0.0 },
1118 const double toler020 = 2.5000000000000020e-13;
1120 // Test data for l=20, m=20.
1121 // max(|f - f_GSL|): 838860800.00000000 at index 12
1122 // max(|f - f_GSL| / |f_GSL|): 4.3488507135833189e-15
1123 // mean(f - f_GSL): -2855497.1428571427
1124 // variance(f - f_GSL): inf
1125 // stddev(f - f_GSL): inf
1126 const testcase_assoc_legendre<double>
1129 { 0.0000000000000000, 20, 20,
1130 -1.0000000000000000, 0.0 },
1131 { 19609049712023808., 20, 20,
1132 -0.90000000000000002, 0.0 },
1133 { 1.1693527616833221e+19, 20, 20,
1134 -0.80000000000000004, 0.0 },
1135 { 3.8073455880620691e+20, 20, 20,
1136 -0.69999999999999996, 0.0 },
1137 { 3.6874002249007927e+21, 20, 20,
1138 -0.59999999999999998, 0.0 },
1139 { 1.8010806978179592e+22, 20, 20,
1140 -0.50000000000000000, 0.0 },
1141 { 5.5938832584012466e+22, 20, 20,
1142 -0.39999999999999991, 0.0 },
1143 { 1.2454734132297759e+23, 20, 20,
1144 -0.29999999999999993, 0.0 },
1145 { 2.1263407800797497e+23, 20, 20,
1146 -0.19999999999999996, 0.0 },
1147 { 2.8924941146976873e+23, 20, 20,
1148 -0.099999999999999978, 0.0 },
1149 { 3.1983098677287775e+23, 20, 20,
1150 0.0000000000000000, 0.0 },
1151 { 2.8924941146976873e+23, 20, 20,
1152 0.10000000000000009, 0.0 },
1153 { 2.1263407800797497e+23, 20, 20,
1154 0.20000000000000018, 0.0 },
1155 { 1.2454734132297811e+23, 20, 20,
1156 0.30000000000000004, 0.0 },
1157 { 5.5938832584012366e+22, 20, 20,
1158 0.40000000000000013, 0.0 },
1159 { 1.8010806978179592e+22, 20, 20,
1160 0.50000000000000000, 0.0 },
1161 { 3.6874002249007807e+21, 20, 20,
1162 0.60000000000000009, 0.0 },
1163 { 3.8073455880620343e+20, 20, 20,
1164 0.70000000000000018, 0.0 },
1165 { 1.1693527616833221e+19, 20, 20,
1166 0.80000000000000004, 0.0 },
1167 { 19609049712023672., 20, 20,
1168 0.90000000000000013, 0.0 },
1169 { 0.0000000000000000, 20, 20,
1170 1.0000000000000000, 0.0 },
1172 const double toler021 = 2.5000000000000020e-13;
1174 // Test data for l=50, m=0.
1175 // max(|f - f_GSL|): 1.6653345369377348e-16 at index 2
1176 // max(|f - f_GSL| / |f_GSL|): 1.6665460706897444e-15
1177 // mean(f - f_GSL): -8.0953762212251003e-18
1178 // variance(f - f_GSL): 3.4405935985667807e-36
1179 // stddev(f - f_GSL): 1.8548837156454796e-18
1180 const testcase_assoc_legendre<double>
1183 { 1.0000000000000000, 50, 0,
1184 -1.0000000000000000, 0.0 },
1185 { -0.17003765994383671, 50, 0,
1186 -0.90000000000000002, 0.0 },
1187 { 0.13879737345093113, 50, 0,
1188 -0.80000000000000004, 0.0 },
1189 { -0.014572731645892852, 50, 0,
1190 -0.69999999999999996, 0.0 },
1191 { -0.058860798844002096, 50, 0,
1192 -0.59999999999999998, 0.0 },
1193 { -0.031059099239609811, 50, 0,
1194 -0.50000000000000000, 0.0 },
1195 { 0.041569033381824674, 50, 0,
1196 -0.39999999999999991, 0.0 },
1197 { 0.10911051574714790, 50, 0,
1198 -0.29999999999999993, 0.0 },
1199 { 0.083432272204197494, 50, 0,
1200 -0.19999999999999996, 0.0 },
1201 { -0.038205812661313600, 50, 0,
1202 -0.099999999999999978, 0.0 },
1203 { -0.11227517265921705, 50, 0,
1204 0.0000000000000000, 0.0 },
1205 { -0.038205812661314155, 50, 0,
1206 0.10000000000000009, 0.0 },
1207 { 0.083432272204196564, 50, 0,
1208 0.20000000000000018, 0.0 },
1209 { 0.10911051574714797, 50, 0,
1210 0.30000000000000004, 0.0 },
1211 { 0.041569033381826007, 50, 0,
1212 0.40000000000000013, 0.0 },
1213 { -0.031059099239609811, 50, 0,
1214 0.50000000000000000, 0.0 },
1215 { -0.058860798844001430, 50, 0,
1216 0.60000000000000009, 0.0 },
1217 { -0.014572731645890737, 50, 0,
1218 0.70000000000000018, 0.0 },
1219 { 0.13879737345093113, 50, 0,
1220 0.80000000000000004, 0.0 },
1221 { -0.17003765994383679, 50, 0,
1222 0.90000000000000013, 0.0 },
1223 { 1.0000000000000000, 50, 0,
1224 1.0000000000000000, 0.0 },
1226 const double toler022 = 2.5000000000000020e-13;
1228 // Test data for l=50, m=1.
1229 // max(|f - f_GSL|): 4.4408920985006262e-15 at index 3
1230 // max(|f - f_GSL| / |f_GSL|): 6.6657627150738456e-16
1231 // mean(f - f_GSL): 6.3441315692866085e-17
1232 // variance(f - f_GSL): 2.1130202818419960e-34
1233 // stddev(f - f_GSL): 1.4536231567507432e-17
1234 const testcase_assoc_legendre<double>
1237 { 0.0000000000000000, 50, 1,
1238 -1.0000000000000000, 0.0 },
1239 { -0.13424149984449490, 50, 1,
1240 -0.90000000000000002, 0.0 },
1241 { 2.2011219672413018, 50, 1,
1242 -0.80000000000000004, 0.0 },
1243 { 6.6622414993232004, 50, 1,
1244 -0.69999999999999996, 0.0 },
1245 { 5.5772846936919249, 50, 1,
1246 -0.59999999999999998, 0.0 },
1247 { 5.8787148815607608, 50, 1,
1248 -0.50000000000000000, 0.0 },
1249 { 5.5473459458634080, 50, 1,
1250 -0.39999999999999991, 0.0 },
1251 { 1.8444956647620248, 50, 1,
1252 -0.29999999999999993, 0.0 },
1253 { -3.8722014306642127, 50, 1,
1254 -0.19999999999999996, 0.0 },
1255 { -5.3488751322285628, 50, 1,
1256 -0.099999999999999978, 0.0 },
1257 { -0.0000000000000000, 50, 1,
1258 0.0000000000000000, 0.0 },
1259 { 5.3488751322285522, 50, 1,
1260 0.10000000000000009, 0.0 },
1261 { 3.8722014306642620, 50, 1,
1262 0.20000000000000018, 0.0 },
1263 { -1.8444956647619930, 50, 1,
1264 0.30000000000000004, 0.0 },
1265 { -5.5473459458633814, 50, 1,
1266 0.40000000000000013, 0.0 },
1267 { -5.8787148815607608, 50, 1,
1268 0.50000000000000000, 0.0 },
1269 { -5.5772846936919453, 50, 1,
1270 0.60000000000000009, 0.0 },
1271 { -6.6622414993232182, 50, 1,
1272 0.70000000000000018, 0.0 },
1273 { -2.2011219672413018, 50, 1,
1274 0.80000000000000004, 0.0 },
1275 { 0.13424149984438935, 50, 1,
1276 0.90000000000000013, 0.0 },
1277 { 0.0000000000000000, 50, 1,
1278 1.0000000000000000, 0.0 },
1280 const double toler023 = 2.5000000000000020e-13;
1282 // Test data for l=50, m=2.
1283 // max(|f - f_GSL|): 3.0553337637684308e-13 at index 3
1284 // max(|f - f_GSL| / |f_GSL|): 6.0837685805857877e-15
1285 // mean(f - f_GSL): -3.3835368369528578e-16
1286 // variance(f - f_GSL): 6.0103688016838995e-33
1287 // stddev(f - f_GSL): 7.7526568360039641e-17
1288 const testcase_assoc_legendre<double>
1291 { 0.0000000000000000, 50, 2,
1292 -1.0000000000000000, 0.0 },
1293 { 433.04168483713511, 50, 2,
1294 -0.90000000000000002, 0.0 },
1295 { -348.06364372056424, 50, 2,
1296 -0.80000000000000004, 0.0 },
1297 { 50.221071418108444, 50, 2,
1298 -0.69999999999999996, 0.0 },
1299 { 158.46096409274352, 50, 2,
1300 -0.59999999999999998, 0.0 },
1301 { 85.988858299721457, 50, 2,
1302 -0.50000000000000000, 0.0 },
1303 { -101.15891460879088, 50, 2,
1304 -0.39999999999999991, 0.0 },
1305 { -277.07168105316526, 50, 2,
1306 -0.29999999999999993, 0.0 },
1307 { -214.33311373510401, 50, 2,
1308 -0.19999999999999996, 0.0 },
1309 { 96.349657930951665, 50, 2,
1310 -0.099999999999999978, 0.0 },
1311 { 286.30169028100346, 50, 2,
1312 0.0000000000000000, 0.0 },
1313 { 96.349657930953242, 50, 2,
1314 0.10000000000000009, 0.0 },
1315 { -214.33311373510165, 50, 2,
1316 0.20000000000000018, 0.0 },
1317 { -277.07168105316617, 50, 2,
1318 0.30000000000000004, 0.0 },
1319 { -101.15891460879435, 50, 2,
1320 0.40000000000000013, 0.0 },
1321 { 85.988858299721457, 50, 2,
1322 0.50000000000000000, 0.0 },
1323 { 158.46096409274153, 50, 2,
1324 0.60000000000000009, 0.0 },
1325 { 50.221071418103143, 50, 2,
1326 0.70000000000000018, 0.0 },
1327 { -348.06364372056424, 50, 2,
1328 0.80000000000000004, 0.0 },
1329 { 433.04168483713596, 50, 2,
1330 0.90000000000000013, 0.0 },
1331 { 0.0000000000000000, 50, 2,
1332 1.0000000000000000, 0.0 },
1334 const double toler024 = 5.0000000000000039e-13;
1336 // Test data for l=50, m=5.
1337 // max(|f - f_GSL|): 7.4505805969238281e-08 at index 14
1338 // max(|f - f_GSL| / |f_GSL|): 2.0088060426072767e-15
1339 // mean(f - f_GSL): -6.3862119402204238e-09
1340 // variance(f - f_GSL): 2.1411444046342303e-18
1341 // stddev(f - f_GSL): 1.4632649810045447e-09
1342 const testcase_assoc_legendre<double>
1345 { -0.0000000000000000, 50, 5,
1346 -1.0000000000000000, 0.0 },
1347 { -27340473.952132829, 50, 5,
1348 -0.90000000000000002, 0.0 },
1349 { 27753716.768532373, 50, 5,
1350 -0.80000000000000004, 0.0 },
1351 { 40808153.913493633, 50, 5,
1352 -0.69999999999999996, 0.0 },
1353 { 32071189.035790090, 50, 5,
1354 -0.59999999999999998, 0.0 },
1355 { 36265736.218529105, 50, 5,
1356 -0.50000000000000000, 0.0 },
1357 { 37089596.700204931, 50, 5,
1358 -0.39999999999999991, 0.0 },
1359 { 14562029.629244687, 50, 5,
1360 -0.29999999999999993, 0.0 },
1361 { -23686895.217517190, 50, 5,
1362 -0.19999999999999996, 0.0 },
1363 { -34878992.965676002, 50, 5,
1364 -0.099999999999999978, 0.0 },
1365 { -0.0000000000000000, 50, 5,
1366 0.0000000000000000, 0.0 },
1367 { 34878992.965675958, 50, 5,
1368 0.10000000000000009, 0.0 },
1369 { 23686895.217517529, 50, 5,
1370 0.20000000000000018, 0.0 },
1371 { -14562029.629244499, 50, 5,
1372 0.30000000000000004, 0.0 },
1373 { -37089596.700204782, 50, 5,
1374 0.40000000000000013, 0.0 },
1375 { -36265736.218529105, 50, 5,
1376 0.50000000000000000, 0.0 },
1377 { -32071189.035790242, 50, 5,
1378 0.60000000000000009, 0.0 },
1379 { -40808153.913493834, 50, 5,
1380 0.70000000000000018, 0.0 },
1381 { -27753716.768532373, 50, 5,
1382 0.80000000000000004, 0.0 },
1383 { 27340473.952132136, 50, 5,
1384 0.90000000000000013, 0.0 },
1385 { 0.0000000000000000, 50, 5,
1386 1.0000000000000000, 0.0 },
1388 const double toler025 = 2.5000000000000020e-13;
1390 // Test data for l=50, m=10.
1391 // max(|f - f_GSL|): 22.000000000000000 at index 3
1392 // max(|f - f_GSL| / |f_GSL|): 2.2163032493360465e-15
1393 // mean(f - f_GSL): -1.9821428571428572
1394 // variance(f - f_GSL): inf
1395 // stddev(f - f_GSL): inf
1396 const testcase_assoc_legendre<double>
1399 { -0.0000000000000000, 50, 10,
1400 -1.0000000000000000, 0.0 },
1401 { -8994661710093155.0, 50, 10,
1402 -0.90000000000000002, 0.0 },
1403 { 932311375306569.62, 50, 10,
1404 -0.80000000000000004, 0.0 },
1405 { 12153535011507012., 50, 10,
1406 -0.69999999999999996, 0.0 },
1407 { 12176690755542240., 50, 10,
1408 -0.59999999999999998, 0.0 },
1409 { 9180035388465754.0, 50, 10,
1410 -0.50000000000000000, 0.0 },
1411 { 889201701866984.00, 50, 10,
1412 -0.39999999999999991, 0.0 },
1413 { -9451384032851544.0, 50, 10,
1414 -0.29999999999999993, 0.0 },
1415 { -9926439446673564.0, 50, 10,
1416 -0.19999999999999996, 0.0 },
1417 { 2794368162749970.5, 50, 10,
1418 -0.099999999999999978, 0.0 },
1419 { 11452238249246346., 50, 10,
1420 0.0000000000000000, 0.0 },
1421 { 2794368162750031.0, 50, 10,
1422 0.10000000000000009, 0.0 },
1423 { -9926439446673506.0, 50, 10,
1424 0.20000000000000018, 0.0 },
1425 { -9451384032851604.0, 50, 10,
1426 0.30000000000000004, 0.0 },
1427 { 889201701866835.25, 50, 10,
1428 0.40000000000000013, 0.0 },
1429 { 9180035388465754.0, 50, 10,
1430 0.50000000000000000, 0.0 },
1431 { 12176690755542214., 50, 10,
1432 0.60000000000000009, 0.0 },
1433 { 12153535011506908., 50, 10,
1434 0.70000000000000018, 0.0 },
1435 { 932311375306569.62, 50, 10,
1436 0.80000000000000004, 0.0 },
1437 { -8994661710093013.0, 50, 10,
1438 0.90000000000000013, 0.0 },
1439 { 0.0000000000000000, 50, 10,
1440 1.0000000000000000, 0.0 },
1442 const double toler026 = 2.5000000000000020e-13;
1444 // Test data for l=50, m=20.
1445 // max(|f - f_GSL|): 3.6028797018963968e+18 at index 14
1446 // max(|f - f_GSL| / |f_GSL|): 5.0227025739283085e-15
1447 // mean(f - f_GSL): -1.8529095609752899e+17
1448 // variance(f - f_GSL): inf
1449 // stddev(f - f_GSL): inf
1450 const testcase_assoc_legendre<double>
1453 { 0.0000000000000000, 50, 20,
1454 -1.0000000000000000, 0.0 },
1455 { 1.6630925158645501e+33, 50, 20,
1456 -0.90000000000000002, 0.0 },
1457 { 1.0622676657892052e+33, 50, 20,
1458 -0.80000000000000004, 0.0 },
1459 { 8.6022521164717112e+32, 50, 20,
1460 -0.69999999999999996, 0.0 },
1461 { 4.0860128756808466e+32, 50, 20,
1462 -0.59999999999999998, 0.0 },
1463 { -4.0169860814274459e+32, 50, 20,
1464 -0.50000000000000000, 0.0 },
1465 { -8.2324325279773994e+32, 50, 20,
1466 -0.39999999999999991, 0.0 },
1467 { -4.0054067236247267e+31, 50, 20,
1468 -0.29999999999999993, 0.0 },
1469 { 7.9309266056434309e+32, 50, 20,
1470 -0.19999999999999996, 0.0 },
1471 { 5.4151358290898977e+31, 50, 20,
1472 -0.099999999999999978, 0.0 },
1473 { -7.8735935697332210e+32, 50, 20,
1474 0.0000000000000000, 0.0 },
1475 { 5.4151358290894924e+31, 50, 20,
1476 0.10000000000000009, 0.0 },
1477 { 7.9309266056434453e+32, 50, 20,
1478 0.20000000000000018, 0.0 },
1479 { -4.0054067236243731e+31, 50, 20,
1480 0.30000000000000004, 0.0 },
1481 { -8.2324325279773893e+32, 50, 20,
1482 0.40000000000000013, 0.0 },
1483 { -4.0169860814274459e+32, 50, 20,
1484 0.50000000000000000, 0.0 },
1485 { 4.0860128756807846e+32, 50, 20,
1486 0.60000000000000009, 0.0 },
1487 { 8.6022521164716291e+32, 50, 20,
1488 0.70000000000000018, 0.0 },
1489 { 1.0622676657892052e+33, 50, 20,
1490 0.80000000000000004, 0.0 },
1491 { 1.6630925158645541e+33, 50, 20,
1492 0.90000000000000013, 0.0 },
1493 { 0.0000000000000000, 50, 20,
1494 1.0000000000000000, 0.0 },
1496 const double toler027 = 5.0000000000000039e-13;
1498 // Test data for l=50, m=50.
1499 // max(|f - f_GSL|): 1.0695779622587839e+64 at index 12
1500 // max(|f - f_GSL| / |f_GSL|): 1.1061123055945194e-14
1501 // mean(f - f_GSL): -2.0817504896587826e+62
1502 // variance(f - f_GSL): inf
1503 // stddev(f - f_GSL): inf
1504 const testcase_assoc_legendre<double>
1507 { 0.0000000000000000, 50, 50,
1508 -1.0000000000000000, 0.0 },
1509 { 2.5366994974431341e+60, 50, 50,
1510 -0.90000000000000002, 0.0 },
1511 { 2.2028834403101213e+67, 50, 50,
1512 -0.80000000000000004, 0.0 },
1513 { 1.3325496559566651e+71, 50, 50,
1514 -0.69999999999999996, 0.0 },
1515 { 3.8898096431781969e+73, 50, 50,
1516 -0.59999999999999998, 0.0 },
1517 { 2.0509760257037188e+75, 50, 50,
1518 -0.50000000000000000, 0.0 },
1519 { 3.4866724533443283e+76, 50, 50,
1520 -0.39999999999999991, 0.0 },
1521 { 2.5790740224149893e+77, 50, 50,
1522 -0.29999999999999993, 0.0 },
1523 { 9.8222237931680989e+77, 50, 50,
1524 -0.19999999999999996, 0.0 },
1525 { 2.1198682190366617e+78, 50, 50,
1526 -0.099999999999999978, 0.0 },
1527 { 2.7253921397507295e+78, 50, 50,
1528 0.0000000000000000, 0.0 },
1529 { 2.1198682190366617e+78, 50, 50,
1530 0.10000000000000009, 0.0 },
1531 { 9.8222237931680989e+77, 50, 50,
1532 0.20000000000000018, 0.0 },
1533 { 2.5790740224150207e+77, 50, 50,
1534 0.30000000000000004, 0.0 },
1535 { 3.4866724533443123e+76, 50, 50,
1536 0.40000000000000013, 0.0 },
1537 { 2.0509760257037188e+75, 50, 50,
1538 0.50000000000000000, 0.0 },
1539 { 3.8898096431781724e+73, 50, 50,
1540 0.60000000000000009, 0.0 },
1541 { 1.3325496559566344e+71, 50, 50,
1542 0.70000000000000018, 0.0 },
1543 { 2.2028834403101213e+67, 50, 50,
1544 0.80000000000000004, 0.0 },
1545 { 2.5366994974430855e+60, 50, 50,
1546 0.90000000000000013, 0.0 },
1547 { 0.0000000000000000, 50, 50,
1548 1.0000000000000000, 0.0 },
1550 const double toler028 = 1.0000000000000008e-12;
1552 // Test data for l=100, m=0.
1553 // max(|f - f_GSL|): 3.4694469519536142e-16 at index 2
1554 // max(|f - f_GSL| / |f_GSL|): 6.8214063779431592e-15
1555 // mean(f - f_GSL): -4.1385545784018113e-17
1556 // variance(f - f_GSL): 8.9920078491655612e-35
1557 // stddev(f - f_GSL): 9.4826198116161765e-18
1558 const testcase_assoc_legendre<double>
1561 { 1.0000000000000000, 100, 0,
1562 -1.0000000000000000, 0.0 },
1563 { 0.10226582055871893, 100, 0,
1564 -0.90000000000000002, 0.0 },
1565 { 0.050861167913584228, 100, 0,
1566 -0.80000000000000004, 0.0 },
1567 { -0.077132507199778641, 100, 0,
1568 -0.69999999999999996, 0.0 },
1569 { -0.023747023905133141, 100, 0,
1570 -0.59999999999999998, 0.0 },
1571 { -0.060518025961861198, 100, 0,
1572 -0.50000000000000000, 0.0 },
1573 { -0.072258202125685025, 100, 0,
1574 -0.39999999999999991, 0.0 },
1575 { 0.057127392202801046, 100, 0,
1576 -0.29999999999999993, 0.0 },
1577 { 0.014681835355659706, 100, 0,
1578 -0.19999999999999996, 0.0 },
1579 { -0.063895098434750205, 100, 0,
1580 -0.099999999999999978, 0.0 },
1581 { 0.079589237387178727, 100, 0,
1582 0.0000000000000000, 0.0 },
1583 { -0.063895098434749761, 100, 0,
1584 0.10000000000000009, 0.0 },
1585 { 0.014681835355657875, 100, 0,
1586 0.20000000000000018, 0.0 },
1587 { 0.057127392202801566, 100, 0,
1588 0.30000000000000004, 0.0 },
1589 { -0.072258202125684082, 100, 0,
1590 0.40000000000000013, 0.0 },
1591 { -0.060518025961861198, 100, 0,
1592 0.50000000000000000, 0.0 },
1593 { -0.023747023905134217, 100, 0,
1594 0.60000000000000009, 0.0 },
1595 { -0.077132507199780501, 100, 0,
1596 0.70000000000000018, 0.0 },
1597 { 0.050861167913584228, 100, 0,
1598 0.80000000000000004, 0.0 },
1599 { 0.10226582055872063, 100, 0,
1600 0.90000000000000013, 0.0 },
1601 { 1.0000000000000000, 100, 0,
1602 1.0000000000000000, 0.0 },
1604 const double toler029 = 5.0000000000000039e-13;
1606 // Test data for l=100, m=1.
1607 // max(|f - f_GSL|): 1.1546319456101628e-14 at index 3
1608 // max(|f - f_GSL| / |f_GSL|): 2.1111954004946762e-15
1609 // mean(f - f_GSL): -8.0358999877630379e-16
1610 // variance(f - f_GSL): 3.3902236521998243e-32
1611 // stddev(f - f_GSL): 1.8412559985509414e-16
1612 const testcase_assoc_legendre<double>
1615 { -0.0000000000000000, 100, 1,
1616 -1.0000000000000000, 0.0 },
1617 { 6.5200167187780345, 100, 1,
1618 -0.90000000000000002, 0.0 },
1619 { 9.0065170007027486, 100, 1,
1620 -0.80000000000000004, 0.0 },
1621 { -5.4690908541180976, 100, 1,
1622 -0.69999999999999996, 0.0 },
1623 { -8.6275439170430790, 100, 1,
1624 -0.59999999999999998, 0.0 },
1625 { -6.0909031663448454, 100, 1,
1626 -0.50000000000000000, 0.0 },
1627 { 4.1160338699560395, 100, 1,
1628 -0.39999999999999991, 0.0 },
1629 { 5.8491043010758634, 100, 1,
1630 -0.29999999999999993, 0.0 },
1631 { -7.9435138723089826, 100, 1,
1632 -0.19999999999999996, 0.0 },
1633 { 4.7996285823989355, 100, 1,
1634 -0.099999999999999978, 0.0 },
1635 { 0.0000000000000000, 100, 1,
1636 0.0000000000000000, 0.0 },
1637 { -4.7996285823990101, 100, 1,
1638 0.10000000000000009, 0.0 },
1639 { 7.9435138723090155, 100, 1,
1640 0.20000000000000018, 0.0 },
1641 { -5.8491043010758013, 100, 1,
1642 0.30000000000000004, 0.0 },
1643 { -4.1160338699562162, 100, 1,
1644 0.40000000000000013, 0.0 },
1645 { 6.0909031663448454, 100, 1,
1646 0.50000000000000000, 0.0 },
1647 { 8.6275439170430470, 100, 1,
1648 0.60000000000000009, 0.0 },
1649 { 5.4690908541178693, 100, 1,
1650 0.70000000000000018, 0.0 },
1651 { -9.0065170007027486, 100, 1,
1652 0.80000000000000004, 0.0 },
1653 { -6.5200167187777787, 100, 1,
1654 0.90000000000000013, 0.0 },
1655 { 0.0000000000000000, 100, 1,
1656 1.0000000000000000, 0.0 },
1658 const double toler030 = 2.5000000000000020e-13;
1660 // Test data for l=100, m=2.
1661 // max(|f - f_GSL|): 6.8212102632969618e-13 at index 5
1662 // max(|f - f_GSL| / |f_GSL|): 2.0632212207447263e-15
1663 // mean(f - f_GSL): 8.2558298821649733e-14
1664 // variance(f - f_GSL): 3.5783331697705263e-28
1665 // stddev(f - f_GSL): 1.8916482679849673e-14
1666 const testcase_assoc_legendre<double>
1669 { 0.0000000000000000, 100, 2,
1670 -1.0000000000000000, 0.0 },
1671 { -1005.9604880761002, 100, 2,
1672 -0.90000000000000002, 0.0 },
1673 { -489.68041725865947, 100, 2,
1674 -0.80000000000000004, 0.0 },
1675 { 768.31676011669924, 100, 2,
1676 -0.69999999999999996, 0.0 },
1677 { 226.90362556627937, 100, 2,
1678 -0.59999999999999998, 0.0 },
1679 { 604.19889304940341, 100, 2,
1680 -0.50000000000000000, 0.0 },
1681 { 733.40061037838518, 100, 2,
1682 -0.39999999999999991, 0.0 },
1683 { -573.30774483995629, 100, 2,
1684 -0.29999999999999993, 0.0 },
1685 { -151.52946305080880, 100, 2,
1686 -0.19999999999999996, 0.0 },
1687 { 646.30525583587985, 100, 2,
1688 -0.099999999999999978, 0.0 },
1689 { -803.85129761050518, 100, 2,
1690 0.0000000000000000, 0.0 },
1691 { 646.30525583587439, 100, 2,
1692 0.10000000000000009, 0.0 },
1693 { -151.52946305079013, 100, 2,
1694 0.20000000000000018, 0.0 },
1695 { -573.30774483996390, 100, 2,
1696 0.30000000000000004, 0.0 },
1697 { 733.40061037837552, 100, 2,
1698 0.40000000000000013, 0.0 },
1699 { 604.19889304940341, 100, 2,
1700 0.50000000000000000, 0.0 },
1701 { 226.90362556629168, 100, 2,
1702 0.60000000000000009, 0.0 },
1703 { 768.31676011671766, 100, 2,
1704 0.70000000000000018, 0.0 },
1705 { -489.68041725865947, 100, 2,
1706 0.80000000000000004, 0.0 },
1707 { -1005.9604880761161, 100, 2,
1708 0.90000000000000013, 0.0 },
1709 { 0.0000000000000000, 100, 2,
1710 1.0000000000000000, 0.0 },
1712 const double toler031 = 2.5000000000000020e-13;
1714 // Test data for l=100, m=5.
1715 // max(|f - f_GSL|): 1.4305114746093750e-06 at index 14
1716 // max(|f - f_GSL| / |f_GSL|): 3.7628882298853693e-15
1717 // mean(f - f_GSL): -5.1089695521763390e-08
1718 // variance(f - f_GSL): 1.3703324189659077e-16
1719 // stddev(f - f_GSL): 1.1706119848036358e-08
1720 const testcase_assoc_legendre<double>
1723 { 0.0000000000000000, 100, 5,
1724 -1.0000000000000000, 0.0 },
1725 { 900551126.09653807, 100, 5,
1726 -0.90000000000000002, 0.0 },
1727 { 988567431.55756140, 100, 5,
1728 -0.80000000000000004, 0.0 },
1729 { -645646451.90344620, 100, 5,
1730 -0.69999999999999996, 0.0 },
1731 { -897114585.29920685, 100, 5,
1732 -0.59999999999999998, 0.0 },
1733 { -661710744.42483854, 100, 5,
1734 -0.50000000000000000, 0.0 },
1735 { 380163158.51424754, 100, 5,
1736 -0.39999999999999991, 0.0 },
1737 { 617391071.36633193, 100, 5,
1738 -0.29999999999999993, 0.0 },
1739 { -805288801.85509109, 100, 5,
1740 -0.19999999999999996, 0.0 },
1741 { 481041740.16728652, 100, 5,
1742 -0.099999999999999978, 0.0 },
1743 { 0.0000000000000000, 100, 5,
1744 0.0000000000000000, 0.0 },
1745 { -481041740.16729391, 100, 5,
1746 0.10000000000000009, 0.0 },
1747 { 805288801.85509515, 100, 5,
1748 0.20000000000000018, 0.0 },
1749 { -617391071.36632574, 100, 5,
1750 0.30000000000000004, 0.0 },
1751 { -380163158.51426536, 100, 5,
1752 0.40000000000000013, 0.0 },
1753 { 661710744.42483854, 100, 5,
1754 0.50000000000000000, 0.0 },
1755 { 897114585.29920483, 100, 5,
1756 0.60000000000000009, 0.0 },
1757 { 645646451.90342283, 100, 5,
1758 0.70000000000000018, 0.0 },
1759 { -988567431.55756140, 100, 5,
1760 0.80000000000000004, 0.0 },
1761 { -900551126.09651637, 100, 5,
1762 0.90000000000000013, 0.0 },
1763 { 0.0000000000000000, 100, 5,
1764 1.0000000000000000, 0.0 },
1766 const double toler032 = 2.5000000000000020e-13;
1768 // Test data for l=100, m=10.
1769 // max(|f - f_GSL|): 14336.000000000000 at index 14
1770 // max(|f - f_GSL| / |f_GSL|): 3.4905902237930355e-15
1771 // mean(f - f_GSL): 341.33333333333331
1772 // variance(f - f_GSL): inf
1773 // stddev(f - f_GSL): inf
1774 const testcase_assoc_legendre<double>
1777 { 0.0000000000000000, 100, 10,
1778 -1.0000000000000000, 0.0 },
1779 { 2.5643395957658602e+17, 100, 10,
1780 -0.90000000000000002, 0.0 },
1781 { 1.5778673545673485e+18, 100, 10,
1782 -0.80000000000000004, 0.0 },
1783 { 4.4355048487496801e+18, 100, 10,
1784 -0.69999999999999996, 0.0 },
1785 { -9.5936111659124288e+17, 100, 10,
1786 -0.59999999999999998, 0.0 },
1787 { 4.2387123021963438e+18, 100, 10,
1788 -0.50000000000000000, 0.0 },
1789 { 8.2370834618426767e+18, 100, 10,
1790 -0.39999999999999991, 0.0 },
1791 { -4.9089358388051978e+18, 100, 10,
1792 -0.29999999999999993, 0.0 },
1793 { -2.3468810358091274e+18, 100, 10,
1794 -0.19999999999999996, 0.0 },
1795 { 6.8627855225034568e+18, 100, 10,
1796 -0.099999999999999978, 0.0 },
1797 { -8.2494597181670380e+18, 100, 10,
1798 0.0000000000000000, 0.0 },
1799 { 6.8627855225034056e+18, 100, 10,
1800 0.10000000000000009, 0.0 },
1801 { -2.3468810358089518e+18, 100, 10,
1802 0.20000000000000018, 0.0 },
1803 { -4.9089358388052941e+18, 100, 10,
1804 0.30000000000000004, 0.0 },
1805 { 8.2370834618426112e+18, 100, 10,
1806 0.40000000000000013, 0.0 },
1807 { 4.2387123021963438e+18, 100, 10,
1808 0.50000000000000000, 0.0 },
1809 { -9.5936111659112640e+17, 100, 10,
1810 0.60000000000000009, 0.0 },
1811 { 4.4355048487499668e+18, 100, 10,
1812 0.70000000000000018, 0.0 },
1813 { 1.5778673545673485e+18, 100, 10,
1814 0.80000000000000004, 0.0 },
1815 { 2.5643395957630058e+17, 100, 10,
1816 0.90000000000000013, 0.0 },
1817 { 0.0000000000000000, 100, 10,
1818 1.0000000000000000, 0.0 },
1820 const double toler033 = 2.5000000000000020e-13;
1822 // Test data for l=100, m=20.
1823 // max(|f - f_GSL|): 3.9290089137475448e+24 at index 14
1824 // max(|f - f_GSL| / |f_GSL|): 5.1615589395022552e-15
1825 // mean(f - f_GSL): -5.0371909150609551e+23
1826 // variance(f - f_GSL): inf
1827 // stddev(f - f_GSL): inf
1828 const testcase_assoc_legendre<double>
1831 { 0.0000000000000000, 100, 20,
1832 -1.0000000000000000, 0.0 },
1833 { 7.1604344878780134e+37, 100, 20,
1834 -0.90000000000000002, 0.0 },
1835 { -8.3963895116962231e+38, 100, 20,
1836 -0.80000000000000004, 0.0 },
1837 { 7.9022236853110145e+38, 100, 20,
1838 -0.69999999999999996, 0.0 },
1839 { 8.2680005574121013e+38, 100, 20,
1840 -0.59999999999999998, 0.0 },
1841 { 3.0750497039999552e+38, 100, 20,
1842 -0.50000000000000000, 0.0 },
1843 { -7.6120586043843556e+38, 100, 20,
1844 -0.39999999999999991, 0.0 },
1845 { 1.1474496891900921e+38, 100, 20,
1846 -0.29999999999999993, 0.0 },
1847 { 4.3966251307444241e+38, 100, 20,
1848 -0.19999999999999996, 0.0 },
1849 { -7.0503266451702591e+38, 100, 20,
1850 -0.099999999999999978, 0.0 },
1851 { 7.7727439836159581e+38, 100, 20,
1852 0.0000000000000000, 0.0 },
1853 { -7.0503266451702213e+38, 100, 20,
1854 0.10000000000000009, 0.0 },
1855 { 4.3966251307442783e+38, 100, 20,
1856 0.20000000000000018, 0.0 },
1857 { 1.1474496891901797e+38, 100, 20,
1858 0.30000000000000004, 0.0 },
1859 { -7.6120586043844176e+38, 100, 20,
1860 0.40000000000000013, 0.0 },
1861 { 3.0750497039999552e+38, 100, 20,
1862 0.50000000000000000, 0.0 },
1863 { 8.2680005574120394e+38, 100, 20,
1864 0.60000000000000009, 0.0 },
1865 { 7.9022236853108422e+38, 100, 20,
1866 0.70000000000000018, 0.0 },
1867 { -8.3963895116962231e+38, 100, 20,
1868 0.80000000000000004, 0.0 },
1869 { 7.1604344878751847e+37, 100, 20,
1870 0.90000000000000013, 0.0 },
1871 { 0.0000000000000000, 100, 20,
1872 1.0000000000000000, 0.0 },
1874 const double toler034 = 5.0000000000000039e-13;
1876 // Test data for l=100, m=50.
1877 // max(|f - f_GSL|): 6.8296953242310788e+83 at index 14
1878 // max(|f - f_GSL| / |f_GSL|): 2.0345950516284159e-14
1879 // mean(f - f_GSL): 7.0103750947133818e+82
1880 // variance(f - f_GSL): inf
1881 // stddev(f - f_GSL): inf
1882 const testcase_assoc_legendre<double>
1885 { 0.0000000000000000, 100, 50,
1886 -1.0000000000000000, 0.0 },
1887 { 9.3231278516893716e+96, 100, 50,
1888 -0.90000000000000002, 0.0 },
1889 { -1.1029797977454281e+98, 100, 50,
1890 -0.80000000000000004, 0.0 },
1891 { 1.8089333903465606e+97, 100, 50,
1892 -0.69999999999999996, 0.0 },
1893 { 5.9364045925669405e+97, 100, 50,
1894 -0.59999999999999998, 0.0 },
1895 { -8.2252620339727118e+97, 100, 50,
1896 -0.50000000000000000, 0.0 },
1897 { 7.1431385093740728e+97, 100, 50,
1898 -0.39999999999999991, 0.0 },
1899 { -3.3520602067479935e+97, 100, 50,
1900 -0.29999999999999993, 0.0 },
1901 { -2.7791149588121382e+97, 100, 50,
1902 -0.19999999999999996, 0.0 },
1903 { 9.0119338550180417e+97, 100, 50,
1904 -0.099999999999999978, 0.0 },
1905 { -1.1712145031578381e+98, 100, 50,
1906 0.0000000000000000, 0.0 },
1907 { 9.0119338550181207e+97, 100, 50,
1908 0.10000000000000009, 0.0 },
1909 { -2.7791149588123644e+97, 100, 50,
1910 0.20000000000000018, 0.0 },
1911 { -3.3520602067479344e+97, 100, 50,
1912 0.30000000000000004, 0.0 },
1913 { 7.1431385093738816e+97, 100, 50,
1914 0.40000000000000013, 0.0 },
1915 { -8.2252620339727118e+97, 100, 50,
1916 0.50000000000000000, 0.0 },
1917 { 5.9364045925668024e+97, 100, 50,
1918 0.60000000000000009, 0.0 },
1919 { 1.8089333903469005e+97, 100, 50,
1920 0.70000000000000018, 0.0 },
1921 { -1.1029797977454281e+98, 100, 50,
1922 0.80000000000000004, 0.0 },
1923 { 9.3231278516892938e+96, 100, 50,
1924 0.90000000000000013, 0.0 },
1925 { 0.0000000000000000, 100, 50,
1926 1.0000000000000000, 0.0 },
1928 const double toler035 = 2.5000000000000015e-12;
1930 // Test data for l=100, m=100.
1931 // max(|f - f_GSL|): 1.9201920817492002e+172 at index 12
1932 // max(|f - f_GSL| / |f_GSL|): 2.3348104188683898e-14
1933 // mean(f - f_GSL): -4.0709851490379341e+170
1934 // variance(f - f_GSL): inf
1935 // stddev(f - f_GSL): inf
1936 const testcase_assoc_legendre<double>
1939 { 0.0000000000000000, 100, 100,
1940 -1.0000000000000000, 0.0 },
1941 { 5.7751792255758316e+150, 100, 100,
1942 -0.90000000000000002, 0.0 },
1943 { 4.3552236041585515e+164, 100, 100,
1944 -0.80000000000000004, 0.0 },
1945 { 1.5936546850595123e+172, 100, 100,
1946 -0.69999999999999996, 0.0 },
1947 { 1.3579510590289176e+177, 100, 100,
1948 -0.59999999999999998, 0.0 },
1949 { 3.7752749682889513e+180, 100, 100,
1950 -0.50000000000000000, 0.0 },
1951 { 1.0910627330458913e+183, 100, 100,
1952 -0.39999999999999991, 0.0 },
1953 { 5.9697347526821064e+184, 100, 100,
1954 -0.29999999999999993, 0.0 },
1955 { 8.6585879147526714e+185, 100, 100,
1956 -0.19999999999999996, 0.0 },
1957 { 4.0331571908057011e+186, 100, 100,
1958 -0.099999999999999978, 0.0 },
1959 { 6.6663086700729543e+186, 100, 100,
1960 0.0000000000000000, 0.0 },
1961 { 4.0331571908057011e+186, 100, 100,
1962 0.10000000000000009, 0.0 },
1963 { 8.6585879147526714e+185, 100, 100,
1964 0.20000000000000018, 0.0 },
1965 { 5.9697347526822483e+184, 100, 100,
1966 0.30000000000000004, 0.0 },
1967 { 1.0910627330458797e+183, 100, 100,
1968 0.40000000000000013, 0.0 },
1969 { 3.7752749682889513e+180, 100, 100,
1970 0.50000000000000000, 0.0 },
1971 { 1.3579510590289000e+177, 100, 100,
1972 0.60000000000000009, 0.0 },
1973 { 1.5936546850594382e+172, 100, 100,
1974 0.70000000000000018, 0.0 },
1975 { 4.3552236041585515e+164, 100, 100,
1976 0.80000000000000004, 0.0 },
1977 { 5.7751792255756128e+150, 100, 100,
1978 0.90000000000000013, 0.0 },
1979 { 0.0000000000000000, 100, 100,
1980 1.0000000000000000, 0.0 },
1982 const double toler036 = 2.5000000000000015e-12;
1984 template<typename Ret, unsigned int Num>
1986 test(const testcase_assoc_legendre<Ret> (&data)[Num], Ret toler)
1988 bool test __attribute__((unused)) = true;
1989 const Ret eps = std::numeric_limits<Ret>::epsilon();
1990 Ret max_abs_diff = -Ret(1);
1991 Ret max_abs_frac = -Ret(1);
1992 unsigned int num_datum = Num;
1993 for (unsigned int i = 0; i < num_datum; ++i)
1995 const Ret f = std::tr1::assoc_legendre(data[i].l, data[i].m,
1997 const Ret f0 = data[i].f0;
1998 const Ret diff = f - f0;
1999 if (std::abs(diff) > max_abs_diff)
2000 max_abs_diff = std::abs(diff);
2001 if (std::abs(f0) > Ret(10) * eps
2002 && std::abs(f) > Ret(10) * eps)
2004 const Ret frac = diff / f0;
2005 if (std::abs(frac) > max_abs_frac)
2006 max_abs_frac = std::abs(frac);
2009 VERIFY(max_abs_frac < toler);
2015 test(data001, toler001);
2016 test(data002, toler002);
2017 test(data003, toler003);
2018 test(data004, toler004);
2019 test(data005, toler005);
2020 test(data006, toler006);
2021 test(data007, toler007);
2022 test(data008, toler008);
2023 test(data009, toler009);
2024 test(data010, toler010);
2025 test(data011, toler011);
2026 test(data012, toler012);
2027 test(data013, toler013);
2028 test(data014, toler014);
2029 test(data015, toler015);
2030 test(data016, toler016);
2031 test(data017, toler017);
2032 test(data018, toler018);
2033 test(data019, toler019);
2034 test(data020, toler020);
2035 test(data021, toler021);
2036 test(data022, toler022);
2037 test(data023, toler023);
2038 test(data024, toler024);
2039 test(data025, toler025);
2040 test(data026, toler026);
2041 test(data027, toler027);
2042 test(data028, toler028);
2043 test(data029, toler029);
2044 test(data030, toler030);
2045 test(data031, toler031);
2046 test(data032, toler032);
2047 test(data033, toler033);
2048 test(data034, toler034);
2049 test(data035, toler035);
2050 test(data036, toler036);