2016-01-14 Edward Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / libstdc++-v3 / testsuite / special_functions / 10_cyl_neumann / check_value.cc
blob5d320f67e44986b82d40a8018226080cc4966c71
1 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
2 //
3 // Copyright (C) 2016 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
20 // cyl_neumann
21 // Compare against values generated by the GNU Scientific Library.
22 // The GSL can be found on the web: http://www.gnu.org/software/gsl/
23 #include <limits>
24 #include <cmath>
25 #if defined(__TEST_DEBUG)
26 # include <iostream>
27 # define VERIFY(A) \
28 if (!(A)) \
29 { \
30 std::cout << "line " << __LINE__ \
31 << " max_abs_frac = " << max_abs_frac \
32 << std::endl; \
34 #else
35 # include <testsuite_hooks.h>
36 #endif
37 #include <specfun_testcase.h>
40 // Test data for nu=0.0000000000000000.
41 // max(|f - f_GSL|): 1.6653345369377348e-16
42 // max(|f - f_GSL| / |f_GSL|): 2.6623873675138176e-15
43 const testcase_cyl_neumann<double>
44 data001[20] =
46 { -0.93157302493005878, 0.0000000000000000, 0.25000000000000000 },
47 { -0.44451873350670656, 0.0000000000000000, 0.50000000000000000 },
48 { -0.13717276938577236, 0.0000000000000000, 0.75000000000000000 },
49 { 0.088256964215676942, 0.0000000000000000, 1.0000000000000000 },
50 { 0.25821685159454072, 0.0000000000000000, 1.2500000000000000 },
51 { 0.38244892379775886, 0.0000000000000000, 1.5000000000000000 },
52 { 0.46549262864690610, 0.0000000000000000, 1.7500000000000000 },
53 { 0.51037567264974493, 0.0000000000000000, 2.0000000000000000 },
54 { 0.52006476245727862, 0.0000000000000000, 2.2500000000000000 },
55 { 0.49807035961523194, 0.0000000000000000, 2.5000000000000000 },
56 { 0.44865872156913222, 0.0000000000000000, 2.7500000000000000 },
57 { 0.37685001001279045, 0.0000000000000000, 3.0000000000000000 },
58 { 0.28828690267308710, 0.0000000000000000, 3.2500000000000000 },
59 { 0.18902194392082688, 0.0000000000000000, 3.5000000000000000 },
60 { 0.085256756977362638, 0.0000000000000000, 3.7500000000000000 },
61 { -0.016940739325064763, 0.0000000000000000, 4.0000000000000000 },
62 { -0.11191885116160770, 0.0000000000000000, 4.2500000000000000 },
63 { -0.19470500862950454, 0.0000000000000000, 4.5000000000000000 },
64 { -0.26123250323497549, 0.0000000000000000, 4.7500000000000000 },
65 { -0.30851762524903359, 0.0000000000000000, 5.0000000000000000 },
67 const double toler001 = 2.5000000000000020e-13;
69 // Test data for nu=0.33333333333333331.
70 // max(|f - f_GSL|): 5.8286708792820718e-16
71 // max(|f - f_GSL| / |f_GSL|): 1.7769445360534625e-14
72 const testcase_cyl_neumann<double>
73 data002[20] =
75 { -1.3461842332051077, 0.33333333333333331, 0.25000000000000000 },
76 { -0.84062782604337771, 0.33333333333333331, 0.50000000000000000 },
77 { -0.52488281484097077, 0.33333333333333331, 0.75000000000000000 },
78 { -0.27880164127599205, 0.33333333333333331, 1.0000000000000000 },
79 { -0.074321349727836453, 0.33333333333333331, 1.2500000000000000 },
80 { 0.096610087766627981, 0.33333333333333331, 1.5000000000000000 },
81 { 0.23582564494922068, 0.33333333333333331, 1.7500000000000000 },
82 { 0.34319996626034494, 0.33333333333333331, 2.0000000000000000 },
83 { 0.41835668452349323, 0.33333333333333331, 2.2500000000000000 },
84 { 0.46145947419129157, 0.33333333333333331, 2.5000000000000000 },
85 { 0.47358926135786023, 0.33333333333333331, 2.7500000000000000 },
86 { 0.45689303457230640, 0.33333333333333331, 3.0000000000000000 },
87 { 0.41458485697347386, 0.33333333333333331, 3.2500000000000000 },
88 { 0.35084133277859947, 0.33333333333333331, 3.5000000000000000 },
89 { 0.27061914527820891, 0.33333333333333331, 3.7500000000000000 },
90 { 0.17941676634394862, 0.33333333333333331, 4.0000000000000000 },
91 { 0.083000434191526043, 0.33333333333333331, 4.2500000000000000 },
92 { -0.012886361627105348, 0.33333333333333331, 4.5000000000000000 },
93 { -0.10281143123935124, 0.33333333333333331, 4.7500000000000000 },
94 { -0.18192321129343850, 0.33333333333333331, 5.0000000000000000 },
96 const double toler002 = 1.0000000000000008e-12;
98 // Test data for nu=0.50000000000000000.
99 // max(|f - f_GSL|): 4.4408920985006262e-16
100 // max(|f - f_GSL| / |f_GSL|): 5.7217850214577088e-15
101 const testcase_cyl_neumann<double>
102 data003[20] =
104 { -1.5461605241060765, 0.50000000000000000, 0.25000000000000000 },
105 { -0.99024588024340454, 0.50000000000000000, 0.50000000000000000 },
106 { -0.67411792914454460, 0.50000000000000000, 0.75000000000000000 },
107 { -0.43109886801837594, 0.50000000000000000, 1.0000000000000000 },
108 { -0.22502969244466481, 0.50000000000000000, 1.2500000000000000 },
109 { -0.046083165893097265, 0.50000000000000000, 1.5000000000000000 },
110 { 0.10750804524368722, 0.50000000000000000, 1.7500000000000000 },
111 { 0.23478571040624849, 0.50000000000000000, 2.0000000000000000 },
112 { 0.33414002338271825, 0.50000000000000000, 2.2500000000000000 },
113 { 0.40427830223905686, 0.50000000000000000, 2.5000000000000000 },
114 { 0.44472115119490507, 0.50000000000000000, 2.7500000000000000 },
115 { 0.45604882079463316, 0.50000000000000000, 3.0000000000000000 },
116 { 0.43998859501924370, 0.50000000000000000, 3.2500000000000000 },
117 { 0.39938682536304909, 0.50000000000000000, 3.5000000000000000 },
118 { 0.33809163836693340, 0.50000000000000000, 3.7500000000000000 },
119 { 0.26076607667717877, 0.50000000000000000, 4.0000000000000000 },
120 { 0.17264962544644955, 0.50000000000000000, 4.2500000000000000 },
121 { 0.079285862862978548, 0.50000000000000000, 4.5000000000000000 },
122 { -0.013765943019498003, 0.50000000000000000, 4.7500000000000000 },
123 { -0.10121770918510846, 0.50000000000000000, 5.0000000000000000 },
125 const double toler003 = 5.0000000000000039e-13;
127 // Test data for nu=0.66666666666666663.
128 // max(|f - f_GSL|): 1.4988010832439613e-15
129 // max(|f - f_GSL| / |f_GSL|): 6.3663053018318525e-15
130 const testcase_cyl_neumann<double>
131 data004[20] =
133 { -1.8021638417426857, 0.66666666666666663, 0.25000000000000000 },
134 { -1.1316060101031435, 0.66666666666666663, 0.50000000000000000 },
135 { -0.80251156358450737, 0.66666666666666663, 0.75000000000000000 },
136 { -0.56270321497463327, 0.66666666666666663, 1.0000000000000000 },
137 { -0.36007453643432208, 0.66666666666666663, 1.2500000000000000 },
138 { -0.18017937469615020, 0.66666666666666663, 1.5000000000000000 },
139 { -0.019885608758103752, 0.66666666666666663, 1.7500000000000000 },
140 { 0.11989345361903521, 0.66666666666666663, 2.0000000000000000 },
141 { 0.23690889836358039, 0.66666666666666663, 2.2500000000000000 },
142 { 0.32882045742954535, 0.66666666666666663, 2.5000000000000000 },
143 { 0.39385133784531856, 0.66666666666666663, 2.7500000000000000 },
144 { 0.43115101690935642, 0.66666666666666663, 3.0000000000000000 },
145 { 0.44098127351445843, 0.66666666666666663, 3.2500000000000000 },
146 { 0.42477631413456485, 0.66666666666666663, 3.5000000000000000 },
147 { 0.38510384155620386, 0.66666666666666663, 3.7500000000000000 },
148 { 0.32554526794354366, 0.66666666666666663, 4.0000000000000000 },
149 { 0.25051080073878446, 0.66666666666666663, 4.2500000000000000 },
150 { 0.16500507211842136, 0.66666666666666663, 4.5000000000000000 },
151 { 0.074359649728861360, 0.66666666666666663, 4.7500000000000000 },
152 { -0.016050662643389627, 0.66666666666666663, 5.0000000000000000 },
154 const double toler004 = 5.0000000000000039e-13;
156 // Test data for nu=1.0000000000000000.
157 // max(|f - f_GSL|): 9.1593399531575415e-16
158 // max(|f - f_GSL| / |f_GSL|): 3.3683879467319323e-14
159 const testcase_cyl_neumann<double>
160 data005[13] =
162 { -0.10703243154093699, 1.0000000000000000, 2.0000000000000000 },
163 { 0.027192057738017056, 1.0000000000000000, 2.2500000000000000 },
164 { 0.14591813796678599, 1.0000000000000000, 2.5000000000000000 },
165 { 0.24601900149738354, 1.0000000000000000, 2.7500000000000000 },
166 { 0.32467442479180003, 1.0000000000000000, 3.0000000000000000 },
167 { 0.37977777371708382, 1.0000000000000000, 3.2500000000000000 },
168 { 0.41018841788751170, 1.0000000000000000, 3.5000000000000000 },
169 { 0.41586877934522715, 1.0000000000000000, 3.7500000000000000 },
170 { 0.39792571055709991, 1.0000000000000000, 4.0000000000000000 },
171 { 0.35856889308385076, 1.0000000000000000, 4.2500000000000000 },
172 { 0.30099732306965449, 1.0000000000000000, 4.5000000000000000 },
173 { 0.22922559673872217, 1.0000000000000000, 4.7500000000000000 },
174 { 0.14786314339122700, 1.0000000000000000, 5.0000000000000000 },
176 const double toler005 = 2.5000000000000015e-12;
178 // Test data for nu=2.0000000000000000.
179 // max(|f - f_GSL|): 6.1062266354383610e-16
180 // max(|f - f_GSL| / |f_GSL|): 1.2540693630135021e-14
181 const testcase_cyl_neumann<double>
182 data006[20] =
184 { -20.701268809592200, 2.0000000000000000, 0.25000000000000000 },
185 { -5.4413708371742668, 2.0000000000000000, 0.50000000000000000 },
186 { -2.6297460326656559, 2.0000000000000000, 0.75000000000000000 },
187 { -1.6506826068162548, 2.0000000000000000, 1.0000000000000000 },
188 { -1.1931993101785539, 2.0000000000000000, 1.2500000000000000 },
189 { -0.93219375976297369, 2.0000000000000000, 1.5000000000000000 },
190 { -0.75574746972832973, 2.0000000000000000, 1.7500000000000000 },
191 { -0.61740810419068193, 2.0000000000000000, 2.0000000000000000 },
192 { -0.49589404446793012, 2.0000000000000000, 2.2500000000000000 },
193 { -0.38133584924180314, 2.0000000000000000, 2.5000000000000000 },
194 { -0.26973581138921693, 2.0000000000000000, 2.7500000000000000 },
195 { -0.16040039348492377, 2.0000000000000000, 3.0000000000000000 },
196 { -0.054577503462573951, 2.0000000000000000, 3.2500000000000000 },
197 { 0.045371437729179787, 2.0000000000000000, 3.5000000000000000 },
198 { 0.13653992534009185, 2.0000000000000000, 3.7500000000000000 },
199 { 0.21590359460361472, 2.0000000000000000, 4.0000000000000000 },
200 { 0.28065715378930217, 2.0000000000000000, 4.2500000000000000 },
201 { 0.32848159666046206, 2.0000000000000000, 4.5000000000000000 },
202 { 0.35774854396706901, 2.0000000000000000, 4.7500000000000000 },
203 { 0.36766288260552438, 2.0000000000000000, 5.0000000000000000 },
205 const double toler006 = 1.0000000000000008e-12;
207 // Test data for nu=5.0000000000000000.
208 // max(|f - f_GSL|): 8.8817841970012523e-15
209 // max(|f - f_GSL| / |f_GSL|): 1.6846903979704834e-15
210 const testcase_cyl_neumann<double>
211 data007[13] =
213 { -9.9359891284819675, 5.0000000000000000, 2.0000000000000000 },
214 { -5.9446343848076424, 5.0000000000000000, 2.2500000000000000 },
215 { -3.8301760007407522, 5.0000000000000000, 2.5000000000000000 },
216 { -2.6287042009459087, 5.0000000000000000, 2.7500000000000000 },
217 { -1.9059459538286738, 5.0000000000000000, 3.0000000000000000 },
218 { -1.4498157389142654, 5.0000000000000000, 3.2500000000000000 },
219 { -1.1494603169763686, 5.0000000000000000, 3.5000000000000000 },
220 { -0.94343105151431672, 5.0000000000000000, 3.7500000000000000 },
221 { -0.79585142111419982, 5.0000000000000000, 4.0000000000000000 },
222 { -0.68479288173907016, 5.0000000000000000, 4.2500000000000000 },
223 { -0.59631936513587558, 5.0000000000000000, 4.5000000000000000 },
224 { -0.52130838331747587, 5.0000000000000000, 4.7500000000000000 },
225 { -0.45369482249110193, 5.0000000000000000, 5.0000000000000000 },
227 const double toler007 = 2.5000000000000020e-13;
229 // Test data for nu=10.000000000000000.
230 // max(|f - f_GSL|): 2.3841857910156250e-07
231 // max(|f - f_GSL| / |f_GSL|): 1.4991559422183497e-15
232 const testcase_cyl_neumann<double>
233 data008[20] =
235 { -124241617095379.48, 10.000000000000000, 0.25000000000000000 },
236 { -121963623349.56966, 10.000000000000000, 0.50000000000000000 },
237 { -2133501638.9057348, 10.000000000000000, 0.75000000000000000 },
238 { -121618014.27868921, 10.000000000000000, 1.0000000000000000 },
239 { -13265210.158452792, 10.000000000000000, 1.2500000000000000 },
240 { -2183993.0260864049, 10.000000000000000, 1.5000000000000000 },
241 { -478274.82386541169, 10.000000000000000, 1.7500000000000000 },
242 { -129184.54220803917, 10.000000000000000, 2.0000000000000000 },
243 { -40993.254794381690, 10.000000000000000, 2.2500000000000000 },
244 { -14782.847716021070, 10.000000000000000, 2.5000000000000000 },
245 { -5916.5330998776262, 10.000000000000000, 2.7500000000000000 },
246 { -2582.6071294842995, 10.000000000000000, 3.0000000000000000 },
247 { -1213.3423564023892, 10.000000000000000, 3.2500000000000000 },
248 { -607.27437834125760, 10.000000000000000, 3.5000000000000000 },
249 { -321.17461059752202, 10.000000000000000, 3.7500000000000000 },
250 { -178.33055590796428, 10.000000000000000, 4.0000000000000000 },
251 { -103.40496587570090, 10.000000000000000, 4.2500000000000000 },
252 { -62.345024619781434, 10.000000000000000, 4.5000000000000000 },
253 { -38.944510430296937, 10.000000000000000, 4.7500000000000000 },
254 { -25.129110095610095, 10.000000000000000, 5.0000000000000000 },
256 const double toler008 = 2.5000000000000020e-13;
258 // Test data for nu=20.000000000000000.
259 // max(|f - f_GSL|): 6442450944.0000000
260 // max(|f - f_GSL| / |f_GSL|): 1.6458221996165416e-15
261 const testcase_cyl_neumann<double>
262 data009[20] =
264 { -4.4678815064152581e+34, 20.000000000000000, 0.25000000000000000 },
265 { -4.2714301215659088e+28, 20.000000000000000, 0.50000000000000000 },
266 { -1.2898357375834223e+25, 20.000000000000000, 0.75000000000000000 },
267 { -4.1139703148355065e+22, 20.000000000000000, 1.0000000000000000 },
268 { -4.7783533372148580e+20, 20.000000000000000, 1.2500000000000000 },
269 { -1.2577301772964241e+19, 20.000000000000000, 1.5000000000000000 },
270 { -5.8251041176649626e+17, 20.000000000000000, 1.7500000000000000 },
271 { -40816513889983640., 20.000000000000000, 2.0000000000000000 },
272 { -3925339868516418.5, 20.000000000000000, 2.2500000000000000 },
273 { -484776559582090.25, 20.000000000000000, 2.5000000000000000 },
274 { -73320655044814.469, 20.000000000000000, 2.7500000000000000 },
275 { -13113540041757.449, 20.000000000000000, 3.0000000000000000 },
276 { -2700669268882.7139, 20.000000000000000, 3.2500000000000000 },
277 { -627339518240.21240, 20.000000000000000, 3.5000000000000000 },
278 { -161695236802.71753, 20.000000000000000, 3.7500000000000000 },
279 { -45637199262.220100, 20.000000000000000, 4.0000000000000000 },
280 { -13953299213.925377, 20.000000000000000, 4.2500000000000000 },
281 { -4580215756.5691023, 20.000000000000000, 4.5000000000000000 },
282 { -1602110715.5159132, 20.000000000000000, 4.7500000000000000 },
283 { -593396529.69143200, 20.000000000000000, 5.0000000000000000 },
285 const double toler009 = 2.5000000000000020e-13;
287 // Test data for nu=50.000000000000000.
288 // max(|f - f_GSL|): 6.4703872001161536e+68
289 // max(|f - f_GSL| / |f_GSL|): 3.7730746786493403e-15
290 const testcase_cyl_neumann<double>
291 data010[20] =
293 { -2.7643487471155969e+107, 50.000000000000000, 0.25000000000000000 },
294 { -2.4575848224461092e+92, 50.000000000000000, 0.50000000000000000 },
295 { -3.8604508467683829e+83, 50.000000000000000, 0.75000000000000000 },
296 { -2.1911428126053411e+77, 50.000000000000000, 1.0000000000000000 },
297 { -3.1362926828833165e+72, 50.000000000000000, 1.2500000000000000 },
298 { -3.4584216846550566e+68, 50.000000000000000, 1.5000000000000000 },
299 { -1.5607714080312795e+65, 50.000000000000000, 1.7500000000000000 },
300 { -1.9761505765184128e+62, 50.000000000000000, 2.0000000000000000 },
301 { -5.5023640499231188e+59, 50.000000000000000, 2.2500000000000000 },
302 { -2.8530384545826849e+57, 50.000000000000000, 2.5000000000000000 },
303 { -2.4467169322684809e+55, 50.000000000000000, 2.7500000000000000 },
304 { -3.1793891461005181e+53, 50.000000000000000, 3.0000000000000000 },
305 { -5.8573901231568658e+51, 50.000000000000000, 3.2500000000000000 },
306 { -1.4528262197760965e+50, 50.000000000000000, 3.5000000000000000 },
307 { -4.6566569870478635e+48, 50.000000000000000, 3.7500000000000000 },
308 { -1.8661134361400254e+47, 50.000000000000000, 4.0000000000000000 },
309 { -9.1005883612255402e+45, 50.000000000000000, 4.2500000000000000 },
310 { -5.2813777542386141e+44, 50.000000000000000, 4.5000000000000000 },
311 { -3.5795477722116469e+43, 50.000000000000000, 4.7500000000000000 },
312 { -2.7888370175838930e+42, 50.000000000000000, 5.0000000000000000 },
314 const double toler010 = 2.5000000000000020e-13;
316 // Test data for nu=100.00000000000000.
317 // max(|f - f_GSL|): 1.6136484921850493e+233
318 // max(|f - f_GSL| / |f_GSL|): 3.7090973947899002e-13
319 const testcase_cyl_neumann<double>
320 data011[20] =
322 { -6.0523080585856754e+245, 100.00000000000000, 0.25000000000000000 },
323 { -4.7766903780412668e+215, 100.00000000000000, 0.50000000000000000 },
324 { -1.1758283017660654e+198, 100.00000000000000, 0.75000000000000000 },
325 { -3.7752878101091316e+185, 100.00000000000000, 1.0000000000000000 },
326 { -7.7013290730008304e+175, 100.00000000000000, 1.2500000000000000 },
327 { -9.3152624794288802e+167, 100.00000000000000, 1.5000000000000000 },
328 { -1.8854163374247264e+161, 100.00000000000000, 1.7500000000000000 },
329 { -3.0008260488569689e+155, 100.00000000000000, 2.0000000000000000 },
330 { -2.3075650873777408e+150, 100.00000000000000, 2.2500000000000000 },
331 { -6.1476258561369381e+145, 100.00000000000000, 2.5000000000000000 },
332 { -4.4758816234829593e+141, 100.00000000000000, 2.7500000000000000 },
333 { -7.4747961023547846e+137, 100.00000000000000, 3.0000000000000000 },
334 { -2.5067022766900123e+134, 100.00000000000000, 3.2500000000000000 },
335 { -1.5222488313431896e+131, 100.00000000000000, 3.5000000000000000 },
336 { -1.5422392812241397e+128, 100.00000000000000, 3.7500000000000000 },
337 { -2.4400857387551062e+125, 100.00000000000000, 4.0000000000000000 },
338 { -5.7118153392422278e+122, 100.00000000000000, 4.2500000000000000 },
339 { -1.8915420905194465e+120, 100.00000000000000, 4.5000000000000000 },
340 { -8.5357945104770158e+117, 100.00000000000000, 4.7500000000000000 },
341 { -5.0848639160196196e+115, 100.00000000000000, 5.0000000000000000 },
343 const double toler011 = 2.5000000000000014e-11;
344 // cyl_neumann
346 // Test data for nu=0.0000000000000000.
347 // max(|f - f_GSL|): 7.1245093158367467e-15
348 // max(|f - f_GSL| / |f_GSL|): 1.5215931554460198e-12
349 const testcase_cyl_neumann<double>
350 data012[20] =
352 { -0.30851762524903359, 0.0000000000000000, 5.0000000000000000 },
353 { 0.055671167283599457, 0.0000000000000000, 10.000000000000000 },
354 { 0.20546429603891822, 0.0000000000000000, 15.000000000000000 },
355 { 0.062640596809384053, 0.0000000000000000, 20.000000000000000 },
356 { -0.12724943226800617, 0.0000000000000000, 25.000000000000000 },
357 { -0.11729573168666413, 0.0000000000000000, 30.000000000000000 },
358 { 0.045797987195155689, 0.0000000000000000, 35.000000000000000 },
359 { 0.12593641705826092, 0.0000000000000000, 40.000000000000000 },
360 { 0.027060469763313333, 0.0000000000000000, 45.000000000000000 },
361 { -0.098064995470077118, 0.0000000000000000, 50.000000000000000 },
362 { -0.077569178730412594, 0.0000000000000000, 55.000000000000000 },
363 { 0.047358952209449426, 0.0000000000000000, 60.000000000000000 },
364 { 0.097183557740181920, 0.0000000000000000, 65.000000000000000 },
365 { 0.0093096664589409992, 0.0000000000000000, 70.000000000000000 },
366 { -0.085369047647775656, 0.0000000000000000, 75.000000000000000 },
367 { -0.055620339089770016, 0.0000000000000000, 80.000000000000000 },
368 { 0.049567884951494251, 0.0000000000000000, 85.000000000000000 },
369 { 0.079776475854877751, 0.0000000000000000, 90.000000000000000 },
370 { -0.0028230995861232107, 0.0000000000000000, 95.000000000000000 },
371 { -0.077244313365083153, 0.0000000000000000, 100.00000000000000 },
373 const double toler012 = 1.0000000000000006e-10;
375 // Test data for nu=0.33333333333333331.
376 // max(|f - f_GSL|): 6.4392935428259079e-15
377 // max(|f - f_GSL| / |f_GSL|): 4.0229312517518102e-13
378 const testcase_cyl_neumann<double>
379 data013[20] =
381 { -0.18192321129343850, 0.33333333333333331, 5.0000000000000000 },
382 { 0.17020111788268760, 0.33333333333333331, 10.000000000000000 },
383 { 0.18540507541540796, 0.33333333333333331, 15.000000000000000 },
384 { -0.028777707635715043, 0.33333333333333331, 20.000000000000000 },
385 { -0.15829741864944163, 0.33333333333333331, 25.000000000000000 },
386 { -0.058645772316705209, 0.33333333333333331, 30.000000000000000 },
387 { 0.10294930308870617, 0.33333333333333331, 35.000000000000000 },
388 { 0.10547870367098922, 0.33333333333333331, 40.000000000000000 },
389 { -0.034334228816010816, 0.33333333333333331, 45.000000000000000 },
390 { -0.11283489933031279, 0.33333333333333331, 50.000000000000000 },
391 { -0.030007358986895105, 0.33333333333333331, 55.000000000000000 },
392 { 0.086699173295718121, 0.33333333333333331, 60.000000000000000 },
393 { 0.074875579668878658, 0.33333333333333331, 65.000000000000000 },
394 { -0.039323246374552680, 0.33333333333333331, 70.000000000000000 },
395 { -0.091263539574475236, 0.33333333333333331, 75.000000000000000 },
396 { -0.013358849535984318, 0.33333333333333331, 80.000000000000000 },
397 { 0.078373575537830198, 0.33333333333333331, 85.000000000000000 },
398 { 0.055812482883955940, 0.33333333333333331, 90.000000000000000 },
399 { -0.043310380106990683, 0.33333333333333331, 95.000000000000000 },
400 { -0.076900504962136559, 0.33333333333333331, 100.00000000000000 },
402 const double toler013 = 2.5000000000000014e-11;
404 // Test data for nu=0.50000000000000000.
405 // max(|f - f_GSL|): 6.5988881026157742e-15
406 // max(|f - f_GSL| / |f_GSL|): 6.0282403975230169e-13
407 const testcase_cyl_neumann<double>
408 data014[20] =
410 { -0.10121770918510846, 0.50000000000000000, 5.0000000000000000 },
411 { 0.21170886633139810, 0.50000000000000000, 10.000000000000000 },
412 { 0.15650551590730855, 0.50000000000000000, 15.000000000000000 },
413 { -0.072806904785061938, 0.50000000000000000, 20.000000000000000 },
414 { -0.15817308404205055, 0.50000000000000000, 25.000000000000000 },
415 { -0.022470290598831138, 0.50000000000000000, 30.000000000000000 },
416 { 0.12187835265849535, 0.50000000000000000, 35.000000000000000 },
417 { 0.084138655676395377, 0.50000000000000000, 40.000000000000000 },
418 { -0.062482641933003201, 0.50000000000000000, 45.000000000000000 },
419 { -0.10888475635053954, 0.50000000000000000, 50.000000000000000 },
420 { -0.0023805454010949376, 0.50000000000000000, 55.000000000000000 },
421 { 0.098104683735037918, 0.50000000000000000, 60.000000000000000 },
422 { 0.055663470218594434, 0.50000000000000000, 65.000000000000000 },
423 { -0.060396767883824871, 0.50000000000000000, 70.000000000000000 },
424 { -0.084922578922046868, 0.50000000000000000, 75.000000000000000 },
425 { 0.0098472271924441284, 0.50000000000000000, 80.000000000000000 },
426 { 0.085190643574343625, 0.50000000000000000, 85.000000000000000 },
427 { 0.037684970437156268, 0.50000000000000000, 90.000000000000000 },
428 { -0.059772904856097500, 0.50000000000000000, 95.000000000000000 },
429 { -0.068803091468728109, 0.50000000000000000, 100.00000000000000 },
431 const double toler014 = 5.0000000000000028e-11;
433 // Test data for nu=0.66666666666666663.
434 // max(|f - f_GSL|): 7.2442052356791464e-15
435 // max(|f - f_GSL| / |f_GSL|): 4.1296144775547441e-13
436 const testcase_cyl_neumann<double>
437 data015[20] =
439 { -0.016050662643389627, 0.66666666666666663, 5.0000000000000000 },
440 { 0.23937232657540733, 0.66666666666666663, 10.000000000000000 },
441 { 0.11762106604241235, 0.66666666666666663, 15.000000000000000 },
442 { -0.11182254014899558, 0.66666666666666663, 20.000000000000000 },
443 { -0.14756582982938804, 0.66666666666666663, 25.000000000000000 },
444 { 0.015078692908077713, 0.66666666666666663, 30.000000000000000 },
445 { 0.13260911815705795, 0.66666666666666663, 35.000000000000000 },
446 { 0.057217565989652698, 0.66666666666666663, 40.000000000000000 },
447 { -0.086373755152382006, 0.66666666666666663, 45.000000000000000 },
448 { -0.097624139208051616, 0.66666666666666663, 50.000000000000000 },
449 { 0.025354902147023392, 0.66666666666666663, 55.000000000000000 },
450 { 0.10288136476351206, 0.66666666666666663, 60.000000000000000 },
451 { 0.032728379560128203, 0.66666666666666663, 65.000000000000000 },
452 { -0.077363672735747818, 0.66666666666666663, 70.000000000000000 },
453 { -0.072855870458293961, 0.66666666666666663, 75.000000000000000 },
454 { 0.032358106046953543, 0.66666666666666663, 80.000000000000000 },
455 { 0.086240651537394228, 0.66666666666666663, 85.000000000000000 },
456 { 0.017029601697285190, 0.66666666666666663, 90.000000000000000 },
457 { -0.072173520560584681, 0.66666666666666663, 95.000000000000000 },
458 { -0.056057339204073887, 0.66666666666666663, 100.00000000000000 },
460 const double toler015 = 2.5000000000000014e-11;
462 // Test data for nu=1.0000000000000000.
463 // max(|f - f_GSL|): 7.6640083168655337e-15
464 // max(|f - f_GSL| / |f_GSL|): 4.2719333494531163e-13
465 const testcase_cyl_neumann<double>
466 data016[20] =
468 { 0.14786314339122700, 1.0000000000000000, 5.0000000000000000 },
469 { 0.24901542420695386, 1.0000000000000000, 10.000000000000000 },
470 { 0.021073628036873522, 1.0000000000000000, 15.000000000000000 },
471 { -0.16551161436252115, 1.0000000000000000, 20.000000000000000 },
472 { -0.098829964783237412, 1.0000000000000000, 25.000000000000000 },
473 { 0.084425570661747135, 1.0000000000000000, 30.000000000000000 },
474 { 0.12751273354559009, 1.0000000000000000, 35.000000000000000 },
475 { -0.0057935058215497536, 1.0000000000000000, 40.000000000000000 },
476 { -0.11552517964639945, 1.0000000000000000, 45.000000000000000 },
477 { -0.056795668562014692, 1.0000000000000000, 50.000000000000000 },
478 { 0.073846265432577926, 1.0000000000000000, 55.000000000000000 },
479 { 0.091869609369866892, 1.0000000000000000, 60.000000000000000 },
480 { -0.017940374275377362, 1.0000000000000000, 65.000000000000000 },
481 { -0.094844652625716230, 1.0000000000000000, 70.000000000000000 },
482 { -0.035213785160580421, 1.0000000000000000, 75.000000000000000 },
483 { 0.069395913784588037, 1.0000000000000000, 80.000000000000000 },
484 { 0.071233187582749768, 1.0000000000000000, 85.000000000000000 },
485 { -0.026187238607768244, 1.0000000000000000, 90.000000000000000 },
486 { -0.081827958724501215, 1.0000000000000000, 95.000000000000000 },
487 { -0.020372312002759834, 1.0000000000000000, 100.00000000000000 },
489 const double toler016 = 2.5000000000000014e-11;
491 // Test data for nu=2.0000000000000000.
492 // max(|f - f_GSL|): 7.1193051454088163e-15
493 // max(|f - f_GSL| / |f_GSL|): 3.9371586401654762e-12
494 const testcase_cyl_neumann<double>
495 data017[20] =
497 { 0.36766288260552438, 2.0000000000000000, 5.0000000000000000 },
498 { -0.0058680824422086830, 2.0000000000000000, 10.000000000000000 },
499 { -0.20265447896733507, 2.0000000000000000, 15.000000000000000 },
500 { -0.079191758245636165, 2.0000000000000000, 20.000000000000000 },
501 { 0.11934303508534717, 2.0000000000000000, 25.000000000000000 },
502 { 0.12292410306411394, 2.0000000000000000, 30.000000000000000 },
503 { -0.038511545278264829, 2.0000000000000000, 35.000000000000000 },
504 { -0.12622609234933840, 2.0000000000000000, 40.000000000000000 },
505 { -0.032194922192042195, 2.0000000000000000, 45.000000000000000 },
506 { 0.095793168727596537, 2.0000000000000000, 50.000000000000000 },
507 { 0.080254497473415426, 2.0000000000000000, 55.000000000000000 },
508 { -0.044296631897120527, 2.0000000000000000, 60.000000000000000 },
509 { -0.097735569256347382, 2.0000000000000000, 65.000000000000000 },
510 { -0.012019513676818605, 2.0000000000000000, 70.000000000000000 },
511 { 0.084430013376826846, 2.0000000000000000, 75.000000000000000 },
512 { 0.057355236934384719, 2.0000000000000000, 80.000000000000000 },
513 { -0.047891809949547198, 2.0000000000000000, 85.000000000000000 },
514 { -0.080358414490605934, 2.0000000000000000, 90.000000000000000 },
515 { 0.0011004057182389746, 2.0000000000000000, 95.000000000000000 },
516 { 0.076836867125027963, 2.0000000000000000, 100.00000000000000 },
518 const double toler017 = 2.5000000000000017e-10;
520 // Test data for nu=5.0000000000000000.
521 // max(|f - f_GSL|): 7.8097792989562098e-15
522 // max(|f - f_GSL| / |f_GSL|): 3.2731037832632215e-11
523 const testcase_cyl_neumann<double>
524 data018[20] =
526 { -0.45369482249110193, 5.0000000000000000, 5.0000000000000000 },
527 { 0.13540304768936234, 5.0000000000000000, 10.000000000000000 },
528 { 0.16717271575940015, 5.0000000000000000, 15.000000000000000 },
529 { -0.10003576788953220, 5.0000000000000000, 20.000000000000000 },
530 { -0.14705799311372267, 5.0000000000000000, 25.000000000000000 },
531 { 0.031627359289264301, 5.0000000000000000, 30.000000000000000 },
532 { 0.13554781474770028, 5.0000000000000000, 35.000000000000000 },
533 { 0.031869448780850247, 5.0000000000000000, 40.000000000000000 },
534 { -0.10426932700176872, 5.0000000000000000, 45.000000000000000 },
535 { -0.078548413913081594, 5.0000000000000000, 50.000000000000000 },
536 { 0.055257033062858375, 5.0000000000000000, 55.000000000000000 },
537 { 0.099464632840450887, 5.0000000000000000, 60.000000000000000 },
538 { 0.00023860469499595305, 5.0000000000000000, 65.000000000000000 },
539 { -0.091861802216406052, 5.0000000000000000, 70.000000000000000 },
540 { -0.048383671296970042, 5.0000000000000000, 75.000000000000000 },
541 { 0.060293667104896316, 5.0000000000000000, 80.000000000000000 },
542 { 0.077506166682733996, 5.0000000000000000, 85.000000000000000 },
543 { -0.015338764062239767, 5.0000000000000000, 90.000000000000000 },
544 { -0.081531504045514361, 5.0000000000000000, 95.000000000000000 },
545 { -0.029480196281661937, 5.0000000000000000, 100.00000000000000 },
547 const double toler018 = 2.5000000000000013e-09;
549 // Test data for nu=10.000000000000000.
550 // max(|f - f_GSL|): 1.7763568394002505e-14
551 // max(|f - f_GSL| / |f_GSL|): 2.7466153115234563e-12
552 const testcase_cyl_neumann<double>
553 data019[20] =
555 { -25.129110095610095, 10.000000000000000, 5.0000000000000000 },
556 { -0.35981415218340279, 10.000000000000000, 10.000000000000000 },
557 { 0.21997141360195577, 10.000000000000000, 15.000000000000000 },
558 { -0.043894653515658105, 10.000000000000000, 20.000000000000000 },
559 { -0.14871839049980651, 10.000000000000000, 25.000000000000000 },
560 { 0.075056702122397012, 10.000000000000000, 30.000000000000000 },
561 { 0.12222473135000546, 10.000000000000000, 35.000000000000000 },
562 { -0.046723877232677985, 10.000000000000000, 40.000000000000000 },
563 { -0.11739339009322181, 10.000000000000000, 45.000000000000000 },
564 { 0.0057238971820535930, 10.000000000000000, 50.000000000000000 },
565 { 0.10733910125831631, 10.000000000000000, 55.000000000000000 },
566 { 0.036290350559545478, 10.000000000000000, 60.000000000000000 },
567 { -0.083239127691715667, 10.000000000000000, 65.000000000000000 },
568 { -0.069639384138314858, 10.000000000000000, 70.000000000000000 },
569 { 0.045798335061325066, 10.000000000000000, 75.000000000000000 },
570 { 0.086269195064844456, 10.000000000000000, 80.000000000000000 },
571 { -0.0018234674126248740, 10.000000000000000, 85.000000000000000 },
572 { -0.082067762371231284, 10.000000000000000, 90.000000000000000 },
573 { -0.038798074754578089, 10.000000000000000, 95.000000000000000 },
574 { 0.058331574236414913, 10.000000000000000, 100.00000000000000 },
576 const double toler019 = 2.5000000000000017e-10;
578 // Test data for nu=20.000000000000000.
579 // max(|f - f_GSL|): 7.1525573730468750e-07
580 // max(|f - f_GSL| / |f_GSL|): 1.7017552833615218e-12
581 const testcase_cyl_neumann<double>
582 data020[20] =
584 { -593396529.69143200, 20.000000000000000, 5.0000000000000000 },
585 { -1597.4838482696259, 20.000000000000000, 10.000000000000000 },
586 { -3.3087330924737621, 20.000000000000000, 15.000000000000000 },
587 { -0.28548945860020319, 20.000000000000000, 20.000000000000000 },
588 { 0.19804074776289243, 20.000000000000000, 25.000000000000000 },
589 { -0.16848153948742683, 20.000000000000000, 30.000000000000000 },
590 { 0.10102784152594022, 20.000000000000000, 35.000000000000000 },
591 { 0.045161820565805755, 20.000000000000000, 40.000000000000000 },
592 { -0.12556489308015448, 20.000000000000000, 45.000000000000000 },
593 { 0.016442633948115834, 20.000000000000000, 50.000000000000000 },
594 { 0.10853448778255181, 20.000000000000000, 55.000000000000000 },
595 { -0.026721408520664701, 20.000000000000000, 60.000000000000000 },
596 { -0.098780425256324175, 20.000000000000000, 65.000000000000000 },
597 { 0.016201957786018233, 20.000000000000000, 70.000000000000000 },
598 { 0.093591198265063721, 20.000000000000000, 75.000000000000000 },
599 { 0.0040484400737296200, 20.000000000000000, 80.000000000000000 },
600 { -0.086314929459920531, 20.000000000000000, 85.000000000000000 },
601 { -0.028274110097231530, 20.000000000000000, 90.000000000000000 },
602 { 0.072349520791638741, 20.000000000000000, 95.000000000000000 },
603 { 0.051247973076188474, 20.000000000000000, 100.00000000000000 },
605 const double toler020 = 1.0000000000000006e-10;
607 // Test data for nu=50.000000000000000.
608 // max(|f - f_GSL|): 1.0522490333925732e+28
609 // max(|f - f_GSL| / |f_GSL|): 2.6658726302692481e-12
610 const testcase_cyl_neumann<double>
611 data021[20] =
613 { -2.7888370175838930e+42, 50.000000000000000, 5.0000000000000000 },
614 { -3.6410665018007421e+27, 50.000000000000000, 10.000000000000000 },
615 { -1.0929732912175415e+19, 50.000000000000000, 15.000000000000000 },
616 { -15606426801663.734, 50.000000000000000, 20.000000000000000 },
617 { -753573251.44662738, 50.000000000000000, 25.000000000000000 },
618 { -386759.32602734759, 50.000000000000000, 30.000000000000000 },
619 { -1172.8690492895323, 50.000000000000000, 35.000000000000000 },
620 { -15.615608873419944, 50.000000000000000, 40.000000000000000 },
621 { -0.87058346204176895, 50.000000000000000, 45.000000000000000 },
622 { -0.21031655464397747, 50.000000000000000, 50.000000000000000 },
623 { 0.093048240412999389, 50.000000000000000, 55.000000000000000 },
624 { 0.0086417699626744754, 50.000000000000000, 60.000000000000000 },
625 { -0.025019788459222037, 50.000000000000000, 65.000000000000000 },
626 { -0.0014815155191909152, 50.000000000000000, 70.000000000000000 },
627 { 0.050335774732164121, 50.000000000000000, 75.000000000000000 },
628 { -0.092924250967987232, 50.000000000000000, 80.000000000000000 },
629 { 0.087332463030205698, 50.000000000000000, 85.000000000000000 },
630 { -0.016164237701651860, 50.000000000000000, 90.000000000000000 },
631 { -0.068897613820457934, 50.000000000000000, 95.000000000000000 },
632 { 0.076505263944803045, 50.000000000000000, 100.00000000000000 },
634 const double toler021 = 2.5000000000000017e-10;
636 // Test data for nu=100.00000000000000.
637 // max(|f - f_GSL|): 6.3342780989716025e+102
638 // max(|f - f_GSL| / |f_GSL|): 1.2681517765786818e-13
639 const testcase_cyl_neumann<double>
640 data022[20] =
642 { -5.0848639160196196e+115, 100.00000000000000, 5.0000000000000000 },
643 { -4.8491482711800252e+85, 100.00000000000000, 10.000000000000000 },
644 { -1.6375955323195320e+68, 100.00000000000000, 15.000000000000000 },
645 { -8.2002648144679126e+55, 100.00000000000000, 20.000000000000000 },
646 { -2.9712216432562368e+46, 100.00000000000000, 25.000000000000000 },
647 { -7.2875284708240751e+38, 100.00000000000000, 30.000000000000000 },
648 { -3.4251079902108953e+32, 100.00000000000000, 35.000000000000000 },
649 { -1.4552439438101802e+27, 100.00000000000000, 40.000000000000000 },
650 { -3.4506612476220073e+22, 100.00000000000000, 45.000000000000000 },
651 { -3.2938001882025953e+18, 100.00000000000000, 50.000000000000000 },
652 { -1005686182055527.4, 100.00000000000000, 55.000000000000000 },
653 { -831892881402.11377, 100.00000000000000, 60.000000000000000 },
654 { -1650863778.0598330, 100.00000000000000, 65.000000000000000 },
655 { -7192614.1976097794, 100.00000000000000, 70.000000000000000 },
656 { -64639.072261231595, 100.00000000000000, 75.000000000000000 },
657 { -1152.5905185698466, 100.00000000000000, 80.000000000000000 },
658 { -40.250761402101560, 100.00000000000000, 85.000000000000000 },
659 { -2.8307771387185459, 100.00000000000000, 90.000000000000000 },
660 { -0.45762200495904848, 100.00000000000000, 95.000000000000000 },
661 { -0.16692141141757652, 100.00000000000000, 100.00000000000000 },
663 const double toler022 = 1.0000000000000006e-11;
665 template<typename Tp, unsigned int Num>
666 void
667 test(const testcase_cyl_neumann<Tp> (&data)[Num], Tp toler)
669 bool test __attribute__((unused)) = true;
670 const Tp eps = std::numeric_limits<Tp>::epsilon();
671 Tp max_abs_diff = -Tp(1);
672 Tp max_abs_frac = -Tp(1);
673 unsigned int num_datum = Num;
674 for (unsigned int i = 0; i < num_datum; ++i)
676 const Tp f = std::cyl_neumann(data[i].nu, data[i].x);
677 const Tp f0 = data[i].f0;
678 const Tp diff = f - f0;
679 if (std::abs(diff) > max_abs_diff)
680 max_abs_diff = std::abs(diff);
681 if (std::abs(f0) > Tp(10) * eps
682 && std::abs(f) > Tp(10) * eps)
684 const Tp frac = diff / f0;
685 if (std::abs(frac) > max_abs_frac)
686 max_abs_frac = std::abs(frac);
689 VERIFY(max_abs_frac < toler);
693 main()
695 test(data001, toler001);
696 test(data002, toler002);
697 test(data003, toler003);
698 test(data004, toler004);
699 test(data005, toler005);
700 test(data006, toler006);
701 test(data007, toler007);
702 test(data008, toler008);
703 test(data009, toler009);
704 test(data010, toler010);
705 test(data011, toler011);
706 test(data012, toler012);
707 test(data013, toler013);
708 test(data014, toler014);
709 test(data015, toler015);
710 test(data016, toler016);
711 test(data017, toler017);
712 test(data018, toler018);
713 test(data019, toler019);
714 test(data020, toler020);
715 test(data021, toler021);
716 test(data022, toler022);
717 return 0;