1 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
3 // Copyright (C) 2016 Free Software Foundation, Inc.
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)
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/>.
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/
25 #if defined(__TEST_DEBUG)
30 std::cout << "line " << __LINE__ \
31 << " max_abs_frac = " << max_abs_frac \
35 # include <testsuite_hooks.h>
37 #include <specfun_testcase.h>
41 // max(|f - f_GSL|): 0.0000000000000000
42 // max(|f - f_GSL| / |f_GSL|): 0.0000000000000000
43 testcase_hermite
<double>
46 { 1.0000000000000000, 0, -10.000000000000000 },
47 { 1.0000000000000000, 0, -9.9000000000000004 },
48 { 1.0000000000000000, 0, -9.8000000000000007 },
49 { 1.0000000000000000, 0, -9.6999999999999993 },
50 { 1.0000000000000000, 0, -9.5999999999999996 },
51 { 1.0000000000000000, 0, -9.5000000000000000 },
52 { 1.0000000000000000, 0, -9.4000000000000004 },
53 { 1.0000000000000000, 0, -9.3000000000000007 },
54 { 1.0000000000000000, 0, -9.1999999999999993 },
55 { 1.0000000000000000, 0, -9.0999999999999996 },
56 { 1.0000000000000000, 0, -9.0000000000000000 },
57 { 1.0000000000000000, 0, -8.9000000000000004 },
58 { 1.0000000000000000, 0, -8.8000000000000007 },
59 { 1.0000000000000000, 0, -8.6999999999999993 },
60 { 1.0000000000000000, 0, -8.5999999999999996 },
61 { 1.0000000000000000, 0, -8.5000000000000000 },
62 { 1.0000000000000000, 0, -8.4000000000000004 },
63 { 1.0000000000000000, 0, -8.3000000000000007 },
64 { 1.0000000000000000, 0, -8.1999999999999993 },
65 { 1.0000000000000000, 0, -8.0999999999999996 },
66 { 1.0000000000000000, 0, -8.0000000000000000 },
67 { 1.0000000000000000, 0, -7.9000000000000004 },
68 { 1.0000000000000000, 0, -7.7999999999999998 },
69 { 1.0000000000000000, 0, -7.7000000000000002 },
70 { 1.0000000000000000, 0, -7.5999999999999996 },
71 { 1.0000000000000000, 0, -7.5000000000000000 },
72 { 1.0000000000000000, 0, -7.4000000000000004 },
73 { 1.0000000000000000, 0, -7.2999999999999998 },
74 { 1.0000000000000000, 0, -7.2000000000000002 },
75 { 1.0000000000000000, 0, -7.0999999999999996 },
76 { 1.0000000000000000, 0, -7.0000000000000000 },
77 { 1.0000000000000000, 0, -6.9000000000000004 },
78 { 1.0000000000000000, 0, -6.7999999999999998 },
79 { 1.0000000000000000, 0, -6.7000000000000002 },
80 { 1.0000000000000000, 0, -6.5999999999999996 },
81 { 1.0000000000000000, 0, -6.5000000000000000 },
82 { 1.0000000000000000, 0, -6.4000000000000004 },
83 { 1.0000000000000000, 0, -6.2999999999999998 },
84 { 1.0000000000000000, 0, -6.2000000000000002 },
85 { 1.0000000000000000, 0, -6.0999999999999996 },
86 { 1.0000000000000000, 0, -6.0000000000000000 },
87 { 1.0000000000000000, 0, -5.9000000000000004 },
88 { 1.0000000000000000, 0, -5.7999999999999998 },
89 { 1.0000000000000000, 0, -5.7000000000000002 },
90 { 1.0000000000000000, 0, -5.5999999999999996 },
91 { 1.0000000000000000, 0, -5.5000000000000000 },
92 { 1.0000000000000000, 0, -5.4000000000000004 },
93 { 1.0000000000000000, 0, -5.2999999999999998 },
94 { 1.0000000000000000, 0, -5.2000000000000002 },
95 { 1.0000000000000000, 0, -5.0999999999999996 },
96 { 1.0000000000000000, 0, -5.0000000000000000 },
97 { 1.0000000000000000, 0, -4.9000000000000004 },
98 { 1.0000000000000000, 0, -4.7999999999999998 },
99 { 1.0000000000000000, 0, -4.7000000000000002 },
100 { 1.0000000000000000, 0, -4.5999999999999996 },
101 { 1.0000000000000000, 0, -4.5000000000000000 },
102 { 1.0000000000000000, 0, -4.4000000000000004 },
103 { 1.0000000000000000, 0, -4.2999999999999998 },
104 { 1.0000000000000000, 0, -4.2000000000000002 },
105 { 1.0000000000000000, 0, -4.0999999999999996 },
106 { 1.0000000000000000, 0, -4.0000000000000000 },
107 { 1.0000000000000000, 0, -3.9000000000000004 },
108 { 1.0000000000000000, 0, -3.7999999999999998 },
109 { 1.0000000000000000, 0, -3.7000000000000002 },
110 { 1.0000000000000000, 0, -3.5999999999999996 },
111 { 1.0000000000000000, 0, -3.5000000000000000 },
112 { 1.0000000000000000, 0, -3.4000000000000004 },
113 { 1.0000000000000000, 0, -3.2999999999999998 },
114 { 1.0000000000000000, 0, -3.2000000000000002 },
115 { 1.0000000000000000, 0, -3.0999999999999996 },
116 { 1.0000000000000000, 0, -3.0000000000000000 },
117 { 1.0000000000000000, 0, -2.9000000000000004 },
118 { 1.0000000000000000, 0, -2.7999999999999998 },
119 { 1.0000000000000000, 0, -2.7000000000000002 },
120 { 1.0000000000000000, 0, -2.5999999999999996 },
121 { 1.0000000000000000, 0, -2.5000000000000000 },
122 { 1.0000000000000000, 0, -2.4000000000000004 },
123 { 1.0000000000000000, 0, -2.2999999999999998 },
124 { 1.0000000000000000, 0, -2.2000000000000002 },
125 { 1.0000000000000000, 0, -2.0999999999999996 },
126 { 1.0000000000000000, 0, -2.0000000000000000 },
127 { 1.0000000000000000, 0, -1.9000000000000004 },
128 { 1.0000000000000000, 0, -1.8000000000000007 },
129 { 1.0000000000000000, 0, -1.6999999999999993 },
130 { 1.0000000000000000, 0, -1.5999999999999996 },
131 { 1.0000000000000000, 0, -1.5000000000000000 },
132 { 1.0000000000000000, 0, -1.4000000000000004 },
133 { 1.0000000000000000, 0, -1.3000000000000007 },
134 { 1.0000000000000000, 0, -1.1999999999999993 },
135 { 1.0000000000000000, 0, -1.0999999999999996 },
136 { 1.0000000000000000, 0, -1.0000000000000000 },
137 { 1.0000000000000000, 0, -0.90000000000000036 },
138 { 1.0000000000000000, 0, -0.80000000000000071 },
139 { 1.0000000000000000, 0, -0.69999999999999929 },
140 { 1.0000000000000000, 0, -0.59999999999999964 },
141 { 1.0000000000000000, 0, -0.50000000000000000 },
142 { 1.0000000000000000, 0, -0.40000000000000036 },
143 { 1.0000000000000000, 0, -0.30000000000000071 },
144 { 1.0000000000000000, 0, -0.19999999999999929 },
145 { 1.0000000000000000, 0, -0.099999999999999645 },
146 { 1.0000000000000000, 0, 0.0000000000000000 },
147 { 1.0000000000000000, 0, 0.099999999999999645 },
148 { 1.0000000000000000, 0, 0.19999999999999929 },
149 { 1.0000000000000000, 0, 0.30000000000000071 },
150 { 1.0000000000000000, 0, 0.40000000000000036 },
151 { 1.0000000000000000, 0, 0.50000000000000000 },
152 { 1.0000000000000000, 0, 0.59999999999999964 },
153 { 1.0000000000000000, 0, 0.69999999999999929 },
154 { 1.0000000000000000, 0, 0.80000000000000071 },
155 { 1.0000000000000000, 0, 0.90000000000000036 },
156 { 1.0000000000000000, 0, 1.0000000000000000 },
157 { 1.0000000000000000, 0, 1.0999999999999996 },
158 { 1.0000000000000000, 0, 1.1999999999999993 },
159 { 1.0000000000000000, 0, 1.3000000000000007 },
160 { 1.0000000000000000, 0, 1.4000000000000004 },
161 { 1.0000000000000000, 0, 1.5000000000000000 },
162 { 1.0000000000000000, 0, 1.5999999999999996 },
163 { 1.0000000000000000, 0, 1.6999999999999993 },
164 { 1.0000000000000000, 0, 1.8000000000000007 },
165 { 1.0000000000000000, 0, 1.9000000000000004 },
166 { 1.0000000000000000, 0, 2.0000000000000000 },
167 { 1.0000000000000000, 0, 2.0999999999999996 },
168 { 1.0000000000000000, 0, 2.1999999999999993 },
169 { 1.0000000000000000, 0, 2.3000000000000007 },
170 { 1.0000000000000000, 0, 2.4000000000000004 },
171 { 1.0000000000000000, 0, 2.5000000000000000 },
172 { 1.0000000000000000, 0, 2.5999999999999996 },
173 { 1.0000000000000000, 0, 2.6999999999999993 },
174 { 1.0000000000000000, 0, 2.8000000000000007 },
175 { 1.0000000000000000, 0, 2.9000000000000004 },
176 { 1.0000000000000000, 0, 3.0000000000000000 },
177 { 1.0000000000000000, 0, 3.0999999999999996 },
178 { 1.0000000000000000, 0, 3.1999999999999993 },
179 { 1.0000000000000000, 0, 3.3000000000000007 },
180 { 1.0000000000000000, 0, 3.4000000000000004 },
181 { 1.0000000000000000, 0, 3.5000000000000000 },
182 { 1.0000000000000000, 0, 3.5999999999999996 },
183 { 1.0000000000000000, 0, 3.6999999999999993 },
184 { 1.0000000000000000, 0, 3.8000000000000007 },
185 { 1.0000000000000000, 0, 3.9000000000000004 },
186 { 1.0000000000000000, 0, 4.0000000000000000 },
187 { 1.0000000000000000, 0, 4.0999999999999996 },
188 { 1.0000000000000000, 0, 4.1999999999999993 },
189 { 1.0000000000000000, 0, 4.3000000000000007 },
190 { 1.0000000000000000, 0, 4.4000000000000004 },
191 { 1.0000000000000000, 0, 4.5000000000000000 },
192 { 1.0000000000000000, 0, 4.5999999999999996 },
193 { 1.0000000000000000, 0, 4.6999999999999993 },
194 { 1.0000000000000000, 0, 4.8000000000000007 },
195 { 1.0000000000000000, 0, 4.9000000000000004 },
196 { 1.0000000000000000, 0, 5.0000000000000000 },
197 { 1.0000000000000000, 0, 5.0999999999999996 },
198 { 1.0000000000000000, 0, 5.1999999999999993 },
199 { 1.0000000000000000, 0, 5.3000000000000007 },
200 { 1.0000000000000000, 0, 5.4000000000000004 },
201 { 1.0000000000000000, 0, 5.5000000000000000 },
202 { 1.0000000000000000, 0, 5.5999999999999996 },
203 { 1.0000000000000000, 0, 5.6999999999999993 },
204 { 1.0000000000000000, 0, 5.8000000000000007 },
205 { 1.0000000000000000, 0, 5.9000000000000004 },
206 { 1.0000000000000000, 0, 6.0000000000000000 },
207 { 1.0000000000000000, 0, 6.1000000000000014 },
208 { 1.0000000000000000, 0, 6.1999999999999993 },
209 { 1.0000000000000000, 0, 6.3000000000000007 },
210 { 1.0000000000000000, 0, 6.3999999999999986 },
211 { 1.0000000000000000, 0, 6.5000000000000000 },
212 { 1.0000000000000000, 0, 6.6000000000000014 },
213 { 1.0000000000000000, 0, 6.6999999999999993 },
214 { 1.0000000000000000, 0, 6.8000000000000007 },
215 { 1.0000000000000000, 0, 6.8999999999999986 },
216 { 1.0000000000000000, 0, 7.0000000000000000 },
217 { 1.0000000000000000, 0, 7.1000000000000014 },
218 { 1.0000000000000000, 0, 7.1999999999999993 },
219 { 1.0000000000000000, 0, 7.3000000000000007 },
220 { 1.0000000000000000, 0, 7.3999999999999986 },
221 { 1.0000000000000000, 0, 7.5000000000000000 },
222 { 1.0000000000000000, 0, 7.6000000000000014 },
223 { 1.0000000000000000, 0, 7.6999999999999993 },
224 { 1.0000000000000000, 0, 7.8000000000000007 },
225 { 1.0000000000000000, 0, 7.8999999999999986 },
226 { 1.0000000000000000, 0, 8.0000000000000000 },
227 { 1.0000000000000000, 0, 8.1000000000000014 },
228 { 1.0000000000000000, 0, 8.1999999999999993 },
229 { 1.0000000000000000, 0, 8.3000000000000007 },
230 { 1.0000000000000000, 0, 8.3999999999999986 },
231 { 1.0000000000000000, 0, 8.5000000000000000 },
232 { 1.0000000000000000, 0, 8.6000000000000014 },
233 { 1.0000000000000000, 0, 8.6999999999999993 },
234 { 1.0000000000000000, 0, 8.8000000000000007 },
235 { 1.0000000000000000, 0, 8.8999999999999986 },
236 { 1.0000000000000000, 0, 9.0000000000000000 },
237 { 1.0000000000000000, 0, 9.1000000000000014 },
238 { 1.0000000000000000, 0, 9.1999999999999993 },
239 { 1.0000000000000000, 0, 9.3000000000000007 },
240 { 1.0000000000000000, 0, 9.3999999999999986 },
241 { 1.0000000000000000, 0, 9.5000000000000000 },
242 { 1.0000000000000000, 0, 9.6000000000000014 },
243 { 1.0000000000000000, 0, 9.6999999999999993 },
244 { 1.0000000000000000, 0, 9.8000000000000007 },
245 { 1.0000000000000000, 0, 9.8999999999999986 },
246 { 1.0000000000000000, 0, 10.000000000000000 },
249 // Test function for n=0.
250 template<typename Tp
>
254 bool test
__attribute__((unused
)) = true;
255 const Tp eps
= std::numeric_limits
<Tp
>::epsilon();
256 Tp max_abs_diff
= -Tp(1);
257 Tp max_abs_frac
= -Tp(1);
258 unsigned int num_datum
= sizeof(data001
)
259 / sizeof(testcase_hermite
<double>);
260 for (unsigned int i
= 0; i
< num_datum
; ++i
)
262 const Tp f
= std::tr1::hermite(Tp(data001
[i
].n
), Tp(data001
[i
].x
));
263 const Tp f0
= data001
[i
].f0
;
264 const Tp diff
= f
- f0
;
265 if (std::abs(diff
) > max_abs_diff
)
266 max_abs_diff
= std::abs(diff
);
267 if (std::abs(f0
) > Tp(10) * eps
268 && std::abs(f
) > Tp(10) * eps
)
270 const Tp frac
= diff
/ f0
;
271 if (std::abs(frac
) > max_abs_frac
)
272 max_abs_frac
= std::abs(frac
);
275 VERIFY(max_abs_frac
< Tp(2.5000000000000020e-13));
278 // Test data for n=1.
279 // max(|f - f_GSL|): 0.0000000000000000
280 // max(|f - f_GSL| / |f_GSL|): 0.0000000000000000
281 testcase_hermite
<double>
284 { -20.000000000000000, 1, -10.000000000000000 },
285 { -19.800000000000001, 1, -9.9000000000000004 },
286 { -19.600000000000001, 1, -9.8000000000000007 },
287 { -19.399999999999999, 1, -9.6999999999999993 },
288 { -19.199999999999999, 1, -9.5999999999999996 },
289 { -19.000000000000000, 1, -9.5000000000000000 },
290 { -18.800000000000001, 1, -9.4000000000000004 },
291 { -18.600000000000001, 1, -9.3000000000000007 },
292 { -18.399999999999999, 1, -9.1999999999999993 },
293 { -18.199999999999999, 1, -9.0999999999999996 },
294 { -18.000000000000000, 1, -9.0000000000000000 },
295 { -17.800000000000001, 1, -8.9000000000000004 },
296 { -17.600000000000001, 1, -8.8000000000000007 },
297 { -17.399999999999999, 1, -8.6999999999999993 },
298 { -17.199999999999999, 1, -8.5999999999999996 },
299 { -17.000000000000000, 1, -8.5000000000000000 },
300 { -16.800000000000001, 1, -8.4000000000000004 },
301 { -16.600000000000001, 1, -8.3000000000000007 },
302 { -16.399999999999999, 1, -8.1999999999999993 },
303 { -16.199999999999999, 1, -8.0999999999999996 },
304 { -16.000000000000000, 1, -8.0000000000000000 },
305 { -15.800000000000001, 1, -7.9000000000000004 },
306 { -15.600000000000000, 1, -7.7999999999999998 },
307 { -15.400000000000000, 1, -7.7000000000000002 },
308 { -15.199999999999999, 1, -7.5999999999999996 },
309 { -15.000000000000000, 1, -7.5000000000000000 },
310 { -14.800000000000001, 1, -7.4000000000000004 },
311 { -14.600000000000000, 1, -7.2999999999999998 },
312 { -14.400000000000000, 1, -7.2000000000000002 },
313 { -14.199999999999999, 1, -7.0999999999999996 },
314 { -14.000000000000000, 1, -7.0000000000000000 },
315 { -13.800000000000001, 1, -6.9000000000000004 },
316 { -13.600000000000000, 1, -6.7999999999999998 },
317 { -13.400000000000000, 1, -6.7000000000000002 },
318 { -13.199999999999999, 1, -6.5999999999999996 },
319 { -13.000000000000000, 1, -6.5000000000000000 },
320 { -12.800000000000001, 1, -6.4000000000000004 },
321 { -12.600000000000000, 1, -6.2999999999999998 },
322 { -12.400000000000000, 1, -6.2000000000000002 },
323 { -12.199999999999999, 1, -6.0999999999999996 },
324 { -12.000000000000000, 1, -6.0000000000000000 },
325 { -11.800000000000001, 1, -5.9000000000000004 },
326 { -11.600000000000000, 1, -5.7999999999999998 },
327 { -11.400000000000000, 1, -5.7000000000000002 },
328 { -11.199999999999999, 1, -5.5999999999999996 },
329 { -11.000000000000000, 1, -5.5000000000000000 },
330 { -10.800000000000001, 1, -5.4000000000000004 },
331 { -10.600000000000000, 1, -5.2999999999999998 },
332 { -10.400000000000000, 1, -5.2000000000000002 },
333 { -10.199999999999999, 1, -5.0999999999999996 },
334 { -10.000000000000000, 1, -5.0000000000000000 },
335 { -9.8000000000000007, 1, -4.9000000000000004 },
336 { -9.5999999999999996, 1, -4.7999999999999998 },
337 { -9.4000000000000004, 1, -4.7000000000000002 },
338 { -9.1999999999999993, 1, -4.5999999999999996 },
339 { -9.0000000000000000, 1, -4.5000000000000000 },
340 { -8.8000000000000007, 1, -4.4000000000000004 },
341 { -8.5999999999999996, 1, -4.2999999999999998 },
342 { -8.4000000000000004, 1, -4.2000000000000002 },
343 { -8.1999999999999993, 1, -4.0999999999999996 },
344 { -8.0000000000000000, 1, -4.0000000000000000 },
345 { -7.8000000000000007, 1, -3.9000000000000004 },
346 { -7.5999999999999996, 1, -3.7999999999999998 },
347 { -7.4000000000000004, 1, -3.7000000000000002 },
348 { -7.1999999999999993, 1, -3.5999999999999996 },
349 { -7.0000000000000000, 1, -3.5000000000000000 },
350 { -6.8000000000000007, 1, -3.4000000000000004 },
351 { -6.5999999999999996, 1, -3.2999999999999998 },
352 { -6.4000000000000004, 1, -3.2000000000000002 },
353 { -6.1999999999999993, 1, -3.0999999999999996 },
354 { -6.0000000000000000, 1, -3.0000000000000000 },
355 { -5.8000000000000007, 1, -2.9000000000000004 },
356 { -5.5999999999999996, 1, -2.7999999999999998 },
357 { -5.4000000000000004, 1, -2.7000000000000002 },
358 { -5.1999999999999993, 1, -2.5999999999999996 },
359 { -5.0000000000000000, 1, -2.5000000000000000 },
360 { -4.8000000000000007, 1, -2.4000000000000004 },
361 { -4.5999999999999996, 1, -2.2999999999999998 },
362 { -4.4000000000000004, 1, -2.2000000000000002 },
363 { -4.1999999999999993, 1, -2.0999999999999996 },
364 { -4.0000000000000000, 1, -2.0000000000000000 },
365 { -3.8000000000000007, 1, -1.9000000000000004 },
366 { -3.6000000000000014, 1, -1.8000000000000007 },
367 { -3.3999999999999986, 1, -1.6999999999999993 },
368 { -3.1999999999999993, 1, -1.5999999999999996 },
369 { -3.0000000000000000, 1, -1.5000000000000000 },
370 { -2.8000000000000007, 1, -1.4000000000000004 },
371 { -2.6000000000000014, 1, -1.3000000000000007 },
372 { -2.3999999999999986, 1, -1.1999999999999993 },
373 { -2.1999999999999993, 1, -1.0999999999999996 },
374 { -2.0000000000000000, 1, -1.0000000000000000 },
375 { -1.8000000000000007, 1, -0.90000000000000036 },
376 { -1.6000000000000014, 1, -0.80000000000000071 },
377 { -1.3999999999999986, 1, -0.69999999999999929 },
378 { -1.1999999999999993, 1, -0.59999999999999964 },
379 { -1.0000000000000000, 1, -0.50000000000000000 },
380 { -0.80000000000000071, 1, -0.40000000000000036 },
381 { -0.60000000000000142, 1, -0.30000000000000071 },
382 { -0.39999999999999858, 1, -0.19999999999999929 },
383 { -0.19999999999999929, 1, -0.099999999999999645 },
384 { 0.0000000000000000, 1, 0.0000000000000000 },
385 { 0.19999999999999929, 1, 0.099999999999999645 },
386 { 0.39999999999999858, 1, 0.19999999999999929 },
387 { 0.60000000000000142, 1, 0.30000000000000071 },
388 { 0.80000000000000071, 1, 0.40000000000000036 },
389 { 1.0000000000000000, 1, 0.50000000000000000 },
390 { 1.1999999999999993, 1, 0.59999999999999964 },
391 { 1.3999999999999986, 1, 0.69999999999999929 },
392 { 1.6000000000000014, 1, 0.80000000000000071 },
393 { 1.8000000000000007, 1, 0.90000000000000036 },
394 { 2.0000000000000000, 1, 1.0000000000000000 },
395 { 2.1999999999999993, 1, 1.0999999999999996 },
396 { 2.3999999999999986, 1, 1.1999999999999993 },
397 { 2.6000000000000014, 1, 1.3000000000000007 },
398 { 2.8000000000000007, 1, 1.4000000000000004 },
399 { 3.0000000000000000, 1, 1.5000000000000000 },
400 { 3.1999999999999993, 1, 1.5999999999999996 },
401 { 3.3999999999999986, 1, 1.6999999999999993 },
402 { 3.6000000000000014, 1, 1.8000000000000007 },
403 { 3.8000000000000007, 1, 1.9000000000000004 },
404 { 4.0000000000000000, 1, 2.0000000000000000 },
405 { 4.1999999999999993, 1, 2.0999999999999996 },
406 { 4.3999999999999986, 1, 2.1999999999999993 },
407 { 4.6000000000000014, 1, 2.3000000000000007 },
408 { 4.8000000000000007, 1, 2.4000000000000004 },
409 { 5.0000000000000000, 1, 2.5000000000000000 },
410 { 5.1999999999999993, 1, 2.5999999999999996 },
411 { 5.3999999999999986, 1, 2.6999999999999993 },
412 { 5.6000000000000014, 1, 2.8000000000000007 },
413 { 5.8000000000000007, 1, 2.9000000000000004 },
414 { 6.0000000000000000, 1, 3.0000000000000000 },
415 { 6.1999999999999993, 1, 3.0999999999999996 },
416 { 6.3999999999999986, 1, 3.1999999999999993 },
417 { 6.6000000000000014, 1, 3.3000000000000007 },
418 { 6.8000000000000007, 1, 3.4000000000000004 },
419 { 7.0000000000000000, 1, 3.5000000000000000 },
420 { 7.1999999999999993, 1, 3.5999999999999996 },
421 { 7.3999999999999986, 1, 3.6999999999999993 },
422 { 7.6000000000000014, 1, 3.8000000000000007 },
423 { 7.8000000000000007, 1, 3.9000000000000004 },
424 { 8.0000000000000000, 1, 4.0000000000000000 },
425 { 8.1999999999999993, 1, 4.0999999999999996 },
426 { 8.3999999999999986, 1, 4.1999999999999993 },
427 { 8.6000000000000014, 1, 4.3000000000000007 },
428 { 8.8000000000000007, 1, 4.4000000000000004 },
429 { 9.0000000000000000, 1, 4.5000000000000000 },
430 { 9.1999999999999993, 1, 4.5999999999999996 },
431 { 9.3999999999999986, 1, 4.6999999999999993 },
432 { 9.6000000000000014, 1, 4.8000000000000007 },
433 { 9.8000000000000007, 1, 4.9000000000000004 },
434 { 10.000000000000000, 1, 5.0000000000000000 },
435 { 10.199999999999999, 1, 5.0999999999999996 },
436 { 10.399999999999999, 1, 5.1999999999999993 },
437 { 10.600000000000001, 1, 5.3000000000000007 },
438 { 10.800000000000001, 1, 5.4000000000000004 },
439 { 11.000000000000000, 1, 5.5000000000000000 },
440 { 11.199999999999999, 1, 5.5999999999999996 },
441 { 11.399999999999999, 1, 5.6999999999999993 },
442 { 11.600000000000001, 1, 5.8000000000000007 },
443 { 11.800000000000001, 1, 5.9000000000000004 },
444 { 12.000000000000000, 1, 6.0000000000000000 },
445 { 12.200000000000003, 1, 6.1000000000000014 },
446 { 12.399999999999999, 1, 6.1999999999999993 },
447 { 12.600000000000001, 1, 6.3000000000000007 },
448 { 12.799999999999997, 1, 6.3999999999999986 },
449 { 13.000000000000000, 1, 6.5000000000000000 },
450 { 13.200000000000003, 1, 6.6000000000000014 },
451 { 13.399999999999999, 1, 6.6999999999999993 },
452 { 13.600000000000001, 1, 6.8000000000000007 },
453 { 13.799999999999997, 1, 6.8999999999999986 },
454 { 14.000000000000000, 1, 7.0000000000000000 },
455 { 14.200000000000003, 1, 7.1000000000000014 },
456 { 14.399999999999999, 1, 7.1999999999999993 },
457 { 14.600000000000001, 1, 7.3000000000000007 },
458 { 14.799999999999997, 1, 7.3999999999999986 },
459 { 15.000000000000000, 1, 7.5000000000000000 },
460 { 15.200000000000003, 1, 7.6000000000000014 },
461 { 15.399999999999999, 1, 7.6999999999999993 },
462 { 15.600000000000001, 1, 7.8000000000000007 },
463 { 15.799999999999997, 1, 7.8999999999999986 },
464 { 16.000000000000000, 1, 8.0000000000000000 },
465 { 16.200000000000003, 1, 8.1000000000000014 },
466 { 16.399999999999999, 1, 8.1999999999999993 },
467 { 16.600000000000001, 1, 8.3000000000000007 },
468 { 16.799999999999997, 1, 8.3999999999999986 },
469 { 17.000000000000000, 1, 8.5000000000000000 },
470 { 17.200000000000003, 1, 8.6000000000000014 },
471 { 17.399999999999999, 1, 8.6999999999999993 },
472 { 17.600000000000001, 1, 8.8000000000000007 },
473 { 17.799999999999997, 1, 8.8999999999999986 },
474 { 18.000000000000000, 1, 9.0000000000000000 },
475 { 18.200000000000003, 1, 9.1000000000000014 },
476 { 18.399999999999999, 1, 9.1999999999999993 },
477 { 18.600000000000001, 1, 9.3000000000000007 },
478 { 18.799999999999997, 1, 9.3999999999999986 },
479 { 19.000000000000000, 1, 9.5000000000000000 },
480 { 19.200000000000003, 1, 9.6000000000000014 },
481 { 19.399999999999999, 1, 9.6999999999999993 },
482 { 19.600000000000001, 1, 9.8000000000000007 },
483 { 19.799999999999997, 1, 9.8999999999999986 },
484 { 20.000000000000000, 1, 10.000000000000000 },
487 // Test function for n=1.
488 template<typename Tp
>
492 bool test
__attribute__((unused
)) = true;
493 const Tp eps
= std::numeric_limits
<Tp
>::epsilon();
494 Tp max_abs_diff
= -Tp(1);
495 Tp max_abs_frac
= -Tp(1);
496 unsigned int num_datum
= sizeof(data002
)
497 / sizeof(testcase_hermite
<double>);
498 for (unsigned int i
= 0; i
< num_datum
; ++i
)
500 const Tp f
= std::tr1::hermite(Tp(data002
[i
].n
), Tp(data002
[i
].x
));
501 const Tp f0
= data002
[i
].f0
;
502 const Tp diff
= f
- f0
;
503 if (std::abs(diff
) > max_abs_diff
)
504 max_abs_diff
= std::abs(diff
);
505 if (std::abs(f0
) > Tp(10) * eps
506 && std::abs(f
) > Tp(10) * eps
)
508 const Tp frac
= diff
/ f0
;
509 if (std::abs(frac
) > max_abs_frac
)
510 max_abs_frac
= std::abs(frac
);
513 VERIFY(max_abs_frac
< Tp(2.5000000000000020e-13));
516 // Test data for n=2.
517 // max(|f - f_GSL|): 0.0000000000000000
518 // max(|f - f_GSL| / |f_GSL|): 0.0000000000000000
519 testcase_hermite
<double>
522 { 398.00000000000000, 2, -10.000000000000000 },
523 { 390.04000000000002, 2, -9.9000000000000004 },
524 { 382.16000000000008, 2, -9.8000000000000007 },
525 { 374.35999999999996, 2, -9.6999999999999993 },
526 { 366.63999999999999, 2, -9.5999999999999996 },
527 { 359.00000000000000, 2, -9.5000000000000000 },
528 { 351.44000000000005, 2, -9.4000000000000004 },
529 { 343.96000000000004, 2, -9.3000000000000007 },
530 { 336.55999999999995, 2, -9.1999999999999993 },
531 { 329.23999999999995, 2, -9.0999999999999996 },
532 { 322.00000000000000, 2, -9.0000000000000000 },
533 { 314.84000000000003, 2, -8.9000000000000004 },
534 { 307.76000000000005, 2, -8.8000000000000007 },
535 { 300.75999999999993, 2, -8.6999999999999993 },
536 { 293.83999999999997, 2, -8.5999999999999996 },
537 { 287.00000000000000, 2, -8.5000000000000000 },
538 { 280.24000000000001, 2, -8.4000000000000004 },
539 { 273.56000000000006, 2, -8.3000000000000007 },
540 { 266.95999999999998, 2, -8.1999999999999993 },
541 { 260.44000000000000, 2, -8.0999999999999996 },
542 { 254.00000000000000, 2, -8.0000000000000000 },
543 { 247.64000000000001, 2, -7.9000000000000004 },
544 { 241.35999999999999, 2, -7.7999999999999998 },
545 { 235.16000000000003, 2, -7.7000000000000002 },
546 { 229.03999999999999, 2, -7.5999999999999996 },
547 { 223.00000000000000, 2, -7.5000000000000000 },
548 { 217.04000000000002, 2, -7.4000000000000004 },
549 { 211.16000000000000, 2, -7.2999999999999998 },
550 { 205.36000000000001, 2, -7.2000000000000002 },
551 { 199.63999999999999, 2, -7.0999999999999996 },
552 { 194.00000000000000, 2, -7.0000000000000000 },
553 { 188.44000000000003, 2, -6.9000000000000004 },
554 { 182.95999999999998, 2, -6.7999999999999998 },
555 { 177.56000000000000, 2, -6.7000000000000002 },
556 { 172.23999999999998, 2, -6.5999999999999996 },
557 { 167.00000000000000, 2, -6.5000000000000000 },
558 { 161.84000000000003, 2, -6.4000000000000004 },
559 { 156.75999999999999, 2, -6.2999999999999998 },
560 { 151.76000000000002, 2, -6.2000000000000002 },
561 { 146.83999999999997, 2, -6.0999999999999996 },
562 { 142.00000000000000, 2, -6.0000000000000000 },
563 { 137.24000000000001, 2, -5.9000000000000004 },
564 { 132.56000000000000, 2, -5.7999999999999998 },
565 { 127.96000000000001, 2, -5.7000000000000002 },
566 { 123.43999999999998, 2, -5.5999999999999996 },
567 { 119.00000000000000, 2, -5.5000000000000000 },
568 { 114.64000000000001, 2, -5.4000000000000004 },
569 { 110.36000000000000, 2, -5.2999999999999998 },
570 { 106.16000000000001, 2, -5.2000000000000002 },
571 { 102.03999999999999, 2, -5.0999999999999996 },
572 { 98.000000000000000, 2, -5.0000000000000000 },
573 { 94.040000000000020, 2, -4.9000000000000004 },
574 { 90.159999999999997, 2, -4.7999999999999998 },
575 { 86.360000000000014, 2, -4.7000000000000002 },
576 { 82.639999999999986, 2, -4.5999999999999996 },
577 { 79.000000000000000, 2, -4.5000000000000000 },
578 { 75.440000000000012, 2, -4.4000000000000004 },
579 { 71.959999999999994, 2, -4.2999999999999998 },
580 { 68.560000000000002, 2, -4.2000000000000002 },
581 { 65.239999999999995, 2, -4.0999999999999996 },
582 { 62.000000000000000, 2, -4.0000000000000000 },
583 { 58.840000000000011, 2, -3.9000000000000004 },
584 { 55.759999999999998, 2, -3.7999999999999998 },
585 { 52.760000000000005, 2, -3.7000000000000002 },
586 { 49.839999999999989, 2, -3.5999999999999996 },
587 { 47.000000000000000, 2, -3.5000000000000000 },
588 { 44.240000000000009, 2, -3.4000000000000004 },
589 { 41.559999999999995, 2, -3.2999999999999998 },
590 { 38.960000000000008, 2, -3.2000000000000002 },
591 { 36.439999999999991, 2, -3.0999999999999996 },
592 { 34.000000000000000, 2, -3.0000000000000000 },
593 { 31.640000000000008, 2, -2.9000000000000004 },
594 { 29.359999999999996, 2, -2.7999999999999998 },
595 { 27.160000000000004, 2, -2.7000000000000002 },
596 { 25.039999999999992, 2, -2.5999999999999996 },
597 { 23.000000000000000, 2, -2.5000000000000000 },
598 { 21.040000000000006, 2, -2.4000000000000004 },
599 { 19.159999999999997, 2, -2.2999999999999998 },
600 { 17.360000000000003, 2, -2.2000000000000002 },
601 { 15.639999999999993, 2, -2.0999999999999996 },
602 { 14.000000000000000, 2, -2.0000000000000000 },
603 { 12.440000000000005, 2, -1.9000000000000004 },
604 { 10.960000000000010, 2, -1.8000000000000007 },
605 { 9.5599999999999898, 2, -1.6999999999999993 },
606 { 8.2399999999999949, 2, -1.5999999999999996 },
607 { 7.0000000000000000, 2, -1.5000000000000000 },
608 { 5.8400000000000043, 2, -1.4000000000000004 },
609 { 4.7600000000000078, 2, -1.3000000000000007 },
610 { 3.7599999999999936, 2, -1.1999999999999993 },
611 { 2.8399999999999972, 2, -1.0999999999999996 },
612 { 2.0000000000000000, 2, -1.0000000000000000 },
613 { 1.2400000000000024, 2, -0.90000000000000036 },
614 { 0.56000000000000449, 2, -0.80000000000000071 },
615 { -0.040000000000004032, 2, -0.69999999999999929 },
616 { -0.56000000000000161, 2, -0.59999999999999964 },
617 { -1.0000000000000000, 2, -0.50000000000000000 },
618 { -1.3599999999999990, 2, -0.40000000000000036 },
619 { -1.6399999999999983, 2, -0.30000000000000071 },
620 { -1.8400000000000012, 2, -0.19999999999999929 },
621 { -1.9600000000000002, 2, -0.099999999999999645 },
622 { -2.0000000000000000, 2, 0.0000000000000000 },
623 { -1.9600000000000002, 2, 0.099999999999999645 },
624 { -1.8400000000000012, 2, 0.19999999999999929 },
625 { -1.6399999999999983, 2, 0.30000000000000071 },
626 { -1.3599999999999990, 2, 0.40000000000000036 },
627 { -1.0000000000000000, 2, 0.50000000000000000 },
628 { -0.56000000000000161, 2, 0.59999999999999964 },
629 { -0.040000000000004032, 2, 0.69999999999999929 },
630 { 0.56000000000000449, 2, 0.80000000000000071 },
631 { 1.2400000000000024, 2, 0.90000000000000036 },
632 { 2.0000000000000000, 2, 1.0000000000000000 },
633 { 2.8399999999999972, 2, 1.0999999999999996 },
634 { 3.7599999999999936, 2, 1.1999999999999993 },
635 { 4.7600000000000078, 2, 1.3000000000000007 },
636 { 5.8400000000000043, 2, 1.4000000000000004 },
637 { 7.0000000000000000, 2, 1.5000000000000000 },
638 { 8.2399999999999949, 2, 1.5999999999999996 },
639 { 9.5599999999999898, 2, 1.6999999999999993 },
640 { 10.960000000000010, 2, 1.8000000000000007 },
641 { 12.440000000000005, 2, 1.9000000000000004 },
642 { 14.000000000000000, 2, 2.0000000000000000 },
643 { 15.639999999999993, 2, 2.0999999999999996 },
644 { 17.359999999999989, 2, 2.1999999999999993 },
645 { 19.160000000000014, 2, 2.3000000000000007 },
646 { 21.040000000000006, 2, 2.4000000000000004 },
647 { 23.000000000000000, 2, 2.5000000000000000 },
648 { 25.039999999999992, 2, 2.5999999999999996 },
649 { 27.159999999999986, 2, 2.6999999999999993 },
650 { 29.360000000000017, 2, 2.8000000000000007 },
651 { 31.640000000000008, 2, 2.9000000000000004 },
652 { 34.000000000000000, 2, 3.0000000000000000 },
653 { 36.439999999999991, 2, 3.0999999999999996 },
654 { 38.959999999999980, 2, 3.1999999999999993 },
655 { 41.560000000000016, 2, 3.3000000000000007 },
656 { 44.240000000000009, 2, 3.4000000000000004 },
657 { 47.000000000000000, 2, 3.5000000000000000 },
658 { 49.839999999999989, 2, 3.5999999999999996 },
659 { 52.759999999999977, 2, 3.6999999999999993 },
660 { 55.760000000000019, 2, 3.8000000000000007 },
661 { 58.840000000000011, 2, 3.9000000000000004 },
662 { 62.000000000000000, 2, 4.0000000000000000 },
663 { 65.239999999999995, 2, 4.0999999999999996 },
664 { 68.559999999999974, 2, 4.1999999999999993 },
665 { 71.960000000000022, 2, 4.3000000000000007 },
666 { 75.440000000000012, 2, 4.4000000000000004 },
667 { 79.000000000000000, 2, 4.5000000000000000 },
668 { 82.639999999999986, 2, 4.5999999999999996 },
669 { 86.359999999999971, 2, 4.6999999999999993 },
670 { 90.160000000000025, 2, 4.8000000000000007 },
671 { 94.040000000000020, 2, 4.9000000000000004 },
672 { 98.000000000000000, 2, 5.0000000000000000 },
673 { 102.03999999999999, 2, 5.0999999999999996 },
674 { 106.15999999999997, 2, 5.1999999999999993 },
675 { 110.36000000000003, 2, 5.3000000000000007 },
676 { 114.64000000000001, 2, 5.4000000000000004 },
677 { 119.00000000000000, 2, 5.5000000000000000 },
678 { 123.43999999999998, 2, 5.5999999999999996 },
679 { 127.95999999999998, 2, 5.6999999999999993 },
680 { 132.56000000000003, 2, 5.8000000000000007 },
681 { 137.24000000000001, 2, 5.9000000000000004 },
682 { 142.00000000000000, 2, 6.0000000000000000 },
683 { 146.84000000000006, 2, 6.1000000000000014 },
684 { 151.75999999999996, 2, 6.1999999999999993 },
685 { 156.76000000000005, 2, 6.3000000000000007 },
686 { 161.83999999999992, 2, 6.3999999999999986 },
687 { 167.00000000000000, 2, 6.5000000000000000 },
688 { 172.24000000000007, 2, 6.6000000000000014 },
689 { 177.55999999999997, 2, 6.6999999999999993 },
690 { 182.96000000000004, 2, 6.8000000000000007 },
691 { 188.43999999999991, 2, 6.8999999999999986 },
692 { 194.00000000000000, 2, 7.0000000000000000 },
693 { 199.64000000000007, 2, 7.1000000000000014 },
694 { 205.35999999999996, 2, 7.1999999999999993 },
695 { 211.16000000000005, 2, 7.3000000000000007 },
696 { 217.03999999999991, 2, 7.3999999999999986 },
697 { 223.00000000000000, 2, 7.5000000000000000 },
698 { 229.04000000000008, 2, 7.6000000000000014 },
699 { 235.15999999999997, 2, 7.6999999999999993 },
700 { 241.36000000000004, 2, 7.8000000000000007 },
701 { 247.63999999999990, 2, 7.8999999999999986 },
702 { 254.00000000000000, 2, 8.0000000000000000 },
703 { 260.44000000000011, 2, 8.1000000000000014 },
704 { 266.95999999999998, 2, 8.1999999999999993 },
705 { 273.56000000000006, 2, 8.3000000000000007 },
706 { 280.23999999999990, 2, 8.3999999999999986 },
707 { 287.00000000000000, 2, 8.5000000000000000 },
708 { 293.84000000000009, 2, 8.6000000000000014 },
709 { 300.75999999999993, 2, 8.6999999999999993 },
710 { 307.76000000000005, 2, 8.8000000000000007 },
711 { 314.83999999999992, 2, 8.8999999999999986 },
712 { 322.00000000000000, 2, 9.0000000000000000 },
713 { 329.24000000000012, 2, 9.1000000000000014 },
714 { 336.55999999999995, 2, 9.1999999999999993 },
715 { 343.96000000000004, 2, 9.3000000000000007 },
716 { 351.43999999999988, 2, 9.3999999999999986 },
717 { 359.00000000000000, 2, 9.5000000000000000 },
718 { 366.64000000000010, 2, 9.6000000000000014 },
719 { 374.35999999999996, 2, 9.6999999999999993 },
720 { 382.16000000000008, 2, 9.8000000000000007 },
721 { 390.03999999999991, 2, 9.8999999999999986 },
722 { 398.00000000000000, 2, 10.000000000000000 },
725 // Test function for n=2.
726 template<typename Tp
>
730 bool test
__attribute__((unused
)) = true;
731 const Tp eps
= std::numeric_limits
<Tp
>::epsilon();
732 Tp max_abs_diff
= -Tp(1);
733 Tp max_abs_frac
= -Tp(1);
734 unsigned int num_datum
= sizeof(data003
)
735 / sizeof(testcase_hermite
<double>);
736 for (unsigned int i
= 0; i
< num_datum
; ++i
)
738 const Tp f
= std::tr1::hermite(Tp(data003
[i
].n
), Tp(data003
[i
].x
));
739 const Tp f0
= data003
[i
].f0
;
740 const Tp diff
= f
- f0
;
741 if (std::abs(diff
) > max_abs_diff
)
742 max_abs_diff
= std::abs(diff
);
743 if (std::abs(f0
) > Tp(10) * eps
744 && std::abs(f
) > Tp(10) * eps
)
746 const Tp frac
= diff
/ f0
;
747 if (std::abs(frac
) > max_abs_frac
)
748 max_abs_frac
= std::abs(frac
);
751 VERIFY(max_abs_frac
< Tp(2.5000000000000020e-13));
754 // Test data for n=5.
755 // max(|f - f_GSL|): 0.0000000000000000
756 // max(|f - f_GSL| / |f_GSL|): 0.0000000000000000
757 testcase_hermite
<double>
760 { -3041200.0000000000, 5, -10.000000000000000 },
761 { -2889108.3196800007, 5, -9.9000000000000004 },
762 { -2743131.8297600015, 5, -9.8000000000000007 },
763 { -2603085.2022399991, 5, -9.6999999999999993 },
764 { -2468786.8723199992, 5, -9.5999999999999996 },
765 { -2340059.0000000000, 5, -9.5000000000000000 },
766 { -2216727.4316800009, 5, -9.4000000000000004 },
767 { -2098621.6617600010, 5, -9.3000000000000007 },
768 { -1985574.7942399993, 5, -9.1999999999999993 },
769 { -1877423.5043199996, 5, -9.0999999999999996 },
770 { -1774008.0000000000, 5, -9.0000000000000000 },
771 { -1675171.9836800008, 5, -8.9000000000000004 },
772 { -1580762.6137600006, 5, -8.8000000000000007 },
773 { -1490630.4662399990, 5, -8.6999999999999993 },
774 { -1404629.4963199999, 5, -8.5999999999999996 },
775 { -1322617.0000000000, 5, -8.5000000000000000 },
776 { -1244453.5756800002, 5, -8.4000000000000004 },
777 { -1170003.0857600006, 5, -8.3000000000000007 },
778 { -1099132.6182399995, 5, -8.1999999999999993 },
779 { -1031712.4483199996, 5, -8.0999999999999996 },
780 { -967616.00000000000, 5, -8.0000000000000000 },
781 { -906719.80768000009, 5, -7.9000000000000004 },
782 { -848903.47775999992, 5, -7.7999999999999998 },
783 { -794049.65024000010, 5, -7.7000000000000002 },
784 { -742043.96031999995, 5, -7.5999999999999996 },
785 { -692775.00000000000, 5, -7.5000000000000000 },
786 { -646134.27968000027, 5, -7.4000000000000004 },
787 { -602016.18975999986, 5, -7.2999999999999998 },
788 { -560317.96224000002, 5, -7.2000000000000002 },
789 { -520939.63231999992, 5, -7.0999999999999996 },
790 { -483784.00000000000, 5, -7.0000000000000000 },
791 { -448756.59168000019, 5, -6.9000000000000004 },
792 { -415765.62176000001, 5, -6.7999999999999998 },
793 { -384721.95424000005, 5, -6.7000000000000002 },
794 { -355539.06431999995, 5, -6.5999999999999996 },
795 { -328133.00000000000, 5, -6.5000000000000000 },
796 { -302422.34368000011, 5, -6.4000000000000004 },
797 { -278328.17375999998, 5, -6.2999999999999998 },
798 { -255774.02624000004, 5, -6.2000000000000002 },
799 { -234685.85631999990, 5, -6.0999999999999996 },
800 { -214992.00000000000, 5, -6.0000000000000000 },
801 { -196623.13568000006, 5, -5.9000000000000004 },
802 { -179512.24575999999, 5, -5.7999999999999998 },
803 { -163594.57824000003, 5, -5.7000000000000002 },
804 { -148807.60831999997, 5, -5.5999999999999996 },
805 { -135091.00000000000, 5, -5.5000000000000000 },
806 { -122386.56768000004, 5, -5.4000000000000004 },
807 { -110638.23776000000, 5, -5.2999999999999998 },
808 { -99792.010240000047, 5, -5.2000000000000002 },
809 { -89795.920319999976, 5, -5.0999999999999996 },
810 { -80600.000000000000, 5, -5.0000000000000000 },
811 { -72156.239680000028, 5, -4.9000000000000004 },
812 { -64418.549759999994, 5, -4.7999999999999998 },
813 { -57342.722240000010, 5, -4.7000000000000002 },
814 { -50886.392319999970, 5, -4.5999999999999996 },
815 { -45009.000000000000, 5, -4.5000000000000000 },
816 { -39671.751680000008, 5, -4.4000000000000004 },
817 { -34837.581759999986, 5, -4.2999999999999998 },
818 { -30471.114240000010, 5, -4.2000000000000002 },
819 { -26538.624319999992, 5, -4.0999999999999996 },
820 { -23008.000000000000, 5, -4.0000000000000000 },
821 { -19848.703680000013, 5, -3.9000000000000004 },
822 { -17031.733759999996, 5, -3.7999999999999998 },
823 { -14529.586240000001, 5, -3.7000000000000002 },
824 { -12316.216319999992, 5, -3.5999999999999996 },
825 { -10367.000000000000, 5, -3.5000000000000000 },
826 { -8658.6956800000080, 5, -3.4000000000000004 },
827 { -7169.4057599999960, 5, -3.2999999999999998 },
828 { -5878.5382400000035, 5, -3.2000000000000002 },
829 { -4766.7683199999965, 5, -3.0999999999999996 },
830 { -3816.0000000000000, 5, -3.0000000000000000 },
831 { -3009.3276800000026, 5, -2.9000000000000004 },
832 { -2330.9977599999988, 5, -2.7999999999999998 },
833 { -1766.3702400000002, 5, -2.7000000000000002 },
834 { -1301.8803199999984, 5, -2.5999999999999996 },
835 { -925.00000000000000, 5, -2.5000000000000000 },
836 { -624.19968000000074, 5, -2.4000000000000004 },
837 { -388.90975999999978, 5, -2.2999999999999998 },
838 { -209.48224000000022, 5, -2.2000000000000002 },
839 { -77.152319999999520, 5, -2.0999999999999996 },
840 { 16.000000000000000, 5, -2.0000000000000000 },
841 { 77.088319999999840, 5, -1.9000000000000004 },
842 { 112.45823999999980, 5, -1.8000000000000007 },
843 { 127.72576000000002, 5, -1.6999999999999993 },
844 { 127.81567999999996, 5, -1.5999999999999996 },
845 { 117.00000000000000, 5, -1.5000000000000000 },
846 { 98.936320000000080, 5, -1.4000000000000004 },
847 { 76.706240000000179, 5, -1.3000000000000007 },
848 { 52.853759999999838, 5, -1.1999999999999993 },
849 { 29.423679999999933, 5, -1.0999999999999996 },
850 { 8.0000000000000000, 5, -1.0000000000000000 },
851 { -10.255679999999948, 5, -0.90000000000000036 },
852 { -24.565759999999916, 5, -0.80000000000000071 },
853 { -34.498240000000052, 5, -0.69999999999999929 },
854 { -39.928320000000006, 5, -0.59999999999999964 },
855 { -41.000000000000000, 5, -0.50000000000000000 },
856 { -38.087680000000020, 5, -0.40000000000000036 },
857 { -31.757760000000054, 5, -0.30000000000000071 },
858 { -22.730239999999931, 5, -0.19999999999999929 },
859 { -11.840319999999959, 5, -0.099999999999999645 },
860 { 0.0000000000000000, 5, 0.0000000000000000 },
861 { 11.840319999999959, 5, 0.099999999999999645 },
862 { 22.730239999999931, 5, 0.19999999999999929 },
863 { 31.757760000000054, 5, 0.30000000000000071 },
864 { 38.087680000000020, 5, 0.40000000000000036 },
865 { 41.000000000000000, 5, 0.50000000000000000 },
866 { 39.928320000000006, 5, 0.59999999999999964 },
867 { 34.498240000000052, 5, 0.69999999999999929 },
868 { 24.565759999999916, 5, 0.80000000000000071 },
869 { 10.255679999999948, 5, 0.90000000000000036 },
870 { -8.0000000000000000, 5, 1.0000000000000000 },
871 { -29.423679999999933, 5, 1.0999999999999996 },
872 { -52.853759999999838, 5, 1.1999999999999993 },
873 { -76.706240000000179, 5, 1.3000000000000007 },
874 { -98.936320000000080, 5, 1.4000000000000004 },
875 { -117.00000000000000, 5, 1.5000000000000000 },
876 { -127.81567999999996, 5, 1.5999999999999996 },
877 { -127.72576000000002, 5, 1.6999999999999993 },
878 { -112.45823999999980, 5, 1.8000000000000007 },
879 { -77.088319999999840, 5, 1.9000000000000004 },
880 { -16.000000000000000, 5, 2.0000000000000000 },
881 { 77.152319999999520, 5, 2.0999999999999996 },
882 { 209.48223999999891, 5, 2.1999999999999993 },
883 { 388.90976000000148, 5, 2.3000000000000007 },
884 { 624.19968000000074, 5, 2.4000000000000004 },
885 { 925.00000000000000, 5, 2.5000000000000000 },
886 { 1301.8803199999984, 5, 2.5999999999999996 },
887 { 1766.3702399999963, 5, 2.6999999999999993 },
888 { 2330.9977600000047, 5, 2.8000000000000007 },
889 { 3009.3276800000026, 5, 2.9000000000000004 },
890 { 3816.0000000000000, 5, 3.0000000000000000 },
891 { 4766.7683199999965, 5, 3.0999999999999996 },
892 { 5878.5382399999908, 5, 3.1999999999999993 },
893 { 7169.4057600000087, 5, 3.3000000000000007 },
894 { 8658.6956800000080, 5, 3.4000000000000004 },
895 { 10367.000000000000, 5, 3.5000000000000000 },
896 { 12316.216319999992, 5, 3.5999999999999996 },
897 { 14529.586239999979, 5, 3.6999999999999993 },
898 { 17031.733760000021, 5, 3.8000000000000007 },
899 { 19848.703680000013, 5, 3.9000000000000004 },
900 { 23008.000000000000, 5, 4.0000000000000000 },
901 { 26538.624319999992, 5, 4.0999999999999996 },
902 { 30471.114239999963, 5, 4.1999999999999993 },
903 { 34837.581760000037, 5, 4.3000000000000007 },
904 { 39671.751680000008, 5, 4.4000000000000004 },
905 { 45009.000000000000, 5, 4.5000000000000000 },
906 { 50886.392319999970, 5, 4.5999999999999996 },
907 { 57342.722239999952, 5, 4.6999999999999993 },
908 { 64418.549760000053, 5, 4.8000000000000007 },
909 { 72156.239680000028, 5, 4.9000000000000004 },
910 { 80600.000000000000, 5, 5.0000000000000000 },
911 { 89795.920319999976, 5, 5.0999999999999996 },
912 { 99792.010239999945, 5, 5.1999999999999993 },
913 { 110638.23776000006, 5, 5.3000000000000007 },
914 { 122386.56768000004, 5, 5.4000000000000004 },
915 { 135091.00000000000, 5, 5.5000000000000000 },
916 { 148807.60831999997, 5, 5.5999999999999996 },
917 { 163594.57823999992, 5, 5.6999999999999993 },
918 { 179512.24576000011, 5, 5.8000000000000007 },
919 { 196623.13568000006, 5, 5.9000000000000004 },
920 { 214992.00000000000, 5, 6.0000000000000000 },
921 { 234685.85632000031, 5, 6.1000000000000014 },
922 { 255774.02623999983, 5, 6.1999999999999993 },
923 { 278328.17376000021, 5, 6.3000000000000007 },
924 { 302422.34367999958, 5, 6.3999999999999986 },
925 { 328133.00000000000, 5, 6.5000000000000000 },
926 { 355539.06432000035, 5, 6.6000000000000014 },
927 { 384721.95423999976, 5, 6.6999999999999993 },
928 { 415765.62176000018, 5, 6.8000000000000007 },
929 { 448756.59167999960, 5, 6.8999999999999986 },
930 { 483784.00000000000, 5, 7.0000000000000000 },
931 { 520939.63232000044, 5, 7.1000000000000014 },
932 { 560317.96223999979, 5, 7.1999999999999993 },
933 { 602016.18976000033, 5, 7.3000000000000007 },
934 { 646134.27967999945, 5, 7.3999999999999986 },
935 { 692775.00000000000, 5, 7.5000000000000000 },
936 { 742043.96032000054, 5, 7.6000000000000014 },
937 { 794049.65023999964, 5, 7.6999999999999993 },
938 { 848903.47776000027, 5, 7.8000000000000007 },
939 { 906719.80767999915, 5, 7.8999999999999986 },
940 { 967616.00000000000, 5, 8.0000000000000000 },
941 { 1031712.4483200011, 5, 8.1000000000000014 },
942 { 1099132.6182399995, 5, 8.1999999999999993 },
943 { 1170003.0857600006, 5, 8.3000000000000007 },
944 { 1244453.5756799988, 5, 8.3999999999999986 },
945 { 1322617.0000000000, 5, 8.5000000000000000 },
946 { 1404629.4963200013, 5, 8.6000000000000014 },
947 { 1490630.4662399990, 5, 8.6999999999999993 },
948 { 1580762.6137600006, 5, 8.8000000000000007 },
949 { 1675171.9836799989, 5, 8.8999999999999986 },
950 { 1774008.0000000000, 5, 9.0000000000000000 },
951 { 1877423.5043200015, 5, 9.1000000000000014 },
952 { 1985574.7942399993, 5, 9.1999999999999993 },
953 { 2098621.6617600010, 5, 9.3000000000000007 },
954 { 2216727.4316799981, 5, 9.3999999999999986 },
955 { 2340059.0000000000, 5, 9.5000000000000000 },
956 { 2468786.8723200019, 5, 9.6000000000000014 },
957 { 2603085.2022399991, 5, 9.6999999999999993 },
958 { 2743131.8297600015, 5, 9.8000000000000007 },
959 { 2889108.3196799983, 5, 9.8999999999999986 },
960 { 3041200.0000000000, 5, 10.000000000000000 },
963 // Test function for n=5.
964 template<typename Tp
>
968 bool test
__attribute__((unused
)) = true;
969 const Tp eps
= std::numeric_limits
<Tp
>::epsilon();
970 Tp max_abs_diff
= -Tp(1);
971 Tp max_abs_frac
= -Tp(1);
972 unsigned int num_datum
= sizeof(data004
)
973 / sizeof(testcase_hermite
<double>);
974 for (unsigned int i
= 0; i
< num_datum
; ++i
)
976 const Tp f
= std::tr1::hermite(Tp(data004
[i
].n
), Tp(data004
[i
].x
));
977 const Tp f0
= data004
[i
].f0
;
978 const Tp diff
= f
- f0
;
979 if (std::abs(diff
) > max_abs_diff
)
980 max_abs_diff
= std::abs(diff
);
981 if (std::abs(f0
) > Tp(10) * eps
982 && std::abs(f
) > Tp(10) * eps
)
984 const Tp frac
= diff
/ f0
;
985 if (std::abs(frac
) > max_abs_frac
)
986 max_abs_frac
= std::abs(frac
);
989 VERIFY(max_abs_frac
< Tp(2.5000000000000020e-13));
992 // Test data for n=10.
993 // max(|f - f_GSL|): 0.0000000000000000
994 // max(|f - f_GSL| / |f_GSL|): 0.0000000000000000
995 testcase_hermite
<double>
998 { 8093278209760.0000, 10, -10.000000000000000 },
999 { 7282867075495.3066, 10, -9.9000000000000004 },
1000 { 6545846221520.6768, 10, -9.8000000000000007 },
1001 { 5876279006180.6377, 10, -9.6999999999999993 },
1002 { 5268651052510.4668, 10, -9.5999999999999996 },
1003 { 4717844376391.0000, 10, -9.5000000000000000 },
1004 { 4219112842239.1147, 10, -9.4000000000000004 },
1005 { 3768058891466.0469, 10, -9.3000000000000007 },
1006 { 3360611490639.0889, 10, -9.1999999999999993 },
1007 { 2993005247949.7607, 10, -9.0999999999999996 },
1008 { 2661760648224.0000, 10, -9.0000000000000000 },
1009 { 2363665358307.8496, 10, -8.9000000000000004 },
1010 { 2095756556225.3428, 10, -8.8000000000000007 },
1011 { 1855304239034.7983, 10, -8.6999999999999993 },
1012 { 1639795465805.4746, 10, -8.5999999999999996 },
1013 { 1446919493599.0000, 10, -8.5000000000000000 },
1014 { 1274553765769.7463, 10, -8.4000000000000004 },
1015 { 1120750713295.2778, 10, -8.3000000000000007 },
1016 { 983725331213.07190, 10, -8.1999999999999993 },
1017 { 861843493572.90051, 10, -8.0999999999999996 },
1018 { 753610971616.00000, 10, -8.0000000000000000 },
1019 { 657663121163.02454, 10, -7.9000000000000004 },
1020 { 572755206432.81335, 10, -7.7999999999999998 },
1021 { 497753328723.87518, 10, -7.7000000000000002 },
1022 { 431625929570.40063, 10, -7.5999999999999996 },
1023 { 373435839135.00000, 10, -7.5000000000000000 },
1024 { 322332841721.55731, 10, -7.4000000000000004 },
1025 { 277546731384.01782, 10, -7.2999999999999998 },
1026 { 238380831670.89990, 10, -7.2000000000000002 },
1027 { 204205954581.24731, 10, -7.0999999999999996 },
1028 { 174454774816.00000, 10, -7.0000000000000000 },
1029 { 148616596389.67230, 10, -6.9000000000000004 },
1030 { 126232489621.23923, 10, -6.7999999999999998 },
1031 { 106890777450.54663, 10, -6.7000000000000002 },
1032 { 90222850927.787979, 10, -6.5999999999999996 },
1033 { 75899294599.000000, 10, -6.5000000000000000 },
1034 { 63626303360.468109, 10, -6.4000000000000004 },
1035 { 53142373179.806053, 10, -6.2999999999999998 },
1036 { 44215248881.625534, 10, -6.2000000000000002 },
1037 { 36639112971.527679, 10, -6.0999999999999996 },
1038 { 30232000224.000000, 10, -6.0000000000000000 },
1039 { 24833423488.050617, 10, -5.9000000000000004 },
1040 { 20302196869.444584, 10, -5.7999999999999998 },
1041 { 16514443130.579359, 10, -5.7000000000000002 },
1042 { 13361772808.732477, 10, -5.5999999999999996 },
1043 { 10749623191.000000, 10, -5.5000000000000000 },
1044 { 8595745900.0898170, 10, -5.4000000000000004 },
1045 { 6828832439.6160822, 10, -5.2999999999999998 },
1046 { 5387267621.0259018, 10, -5.2000000000000002 },
1047 { 4218001347.1524582, 10, -5.0999999999999996 },
1048 { 3275529760.0000000, 10, -5.0000000000000000 },
1049 { 2520977273.0966806, 10, -4.9000000000000004 },
1050 { 1921271501.9744270, 10, -4.7999999999999998 },
1051 { 1448403580.4203825, 10, -4.7000000000000002 },
1052 { 1078766805.4651456, 10, -4.5999999999999996 },
1053 { 792566991.00000000, 10, -4.5000000000000000 },
1054 { 573298328.81993556, 10, -4.4000000000000004 },
1055 { 407278957.14375639, 10, -4.2999999999999998 },
1056 { 283240820.63788313, 10, -4.2000000000000002 },
1057 { 191968773.03860721, 10, -4.0999999999999996 },
1058 { 125984224.00000000, 10, -4.0000000000000000 },
1059 { 79268966.162877649, 10, -3.9000000000000004 },
1060 { 47025137.016035721, 10, -3.7999999999999998 },
1061 { 25467573.275709353, 10, -3.7000000000000002 },
1062 { 11645103.614666298, 10, -3.5999999999999996 },
1063 { 3287599.0000000000, 10, -3.5000000000000000 },
1064 { -1324140.9798373245, 10, -3.4000000000000004 },
1065 { -3468342.2313268245, 10, -3.2999999999999998 },
1066 { -4074495.5241857050, 10, -3.2000000000000002 },
1067 { -3800107.4878923763, 10, -3.0999999999999996 },
1068 { -3093984.0000000000, 10, -3.0000000000000000 },
1069 { -2247873.5653938209, 10, -2.9000000000000004 },
1070 { -1438117.1978829810, 10, -2.7999999999999998 },
1071 { -758781.93281034287, 10, -2.7000000000000002 },
1072 { -247597.05012469599, 10, -2.5999999999999996 },
1073 { 94135.000000000000, 10, -2.5000000000000000 },
1074 { 286617.47398410190, 10, -2.4000000000000004 },
1075 { 360718.79745525768, 10, -2.2999999999999998 },
1076 { 350419.82826741762, 10, -2.2000000000000002 },
1077 { 287863.09027338214, 10, -2.0999999999999996 },
1078 { 200416.00000000000, 10, -2.0000000000000000 },
1079 { 109249.22783242268, 10, -1.9000000000000004 },
1080 { 29012.094015898125, 10, -1.8000000000000007 },
1081 { -31740.330680422732, 10, -1.6999999999999993 },
1082 { -69648.597834137676, 10, -1.5999999999999996 },
1083 { -85401.000000000000, 10, -1.5000000000000000 },
1084 { -82507.675752857642, 10, -1.4000000000000004 },
1085 { -66123.413033062563, 10, -1.3000000000000007 },
1086 { -42007.465141862223, 10, -1.1999999999999993 },
1087 { -15676.055823257526, 10, -1.0999999999999996 },
1088 { 8224.0000000000000, 10, -1.0000000000000000 },
1089 { 26314.366684262357, 10, -0.90000000000000036 },
1090 { 36668.344916377559, 10, -0.80000000000000071 },
1091 { 38802.826035097583, 10, -0.69999999999999929 },
1092 { 33513.167890022363, 10, -0.59999999999999964 },
1093 { 22591.000000000000, 10, -0.50000000000000000 },
1094 { 8467.6907597824556, 10, -0.40000000000000036 },
1095 { -6173.8524877822965, 10, -0.30000000000000071 },
1096 { -18778.856957542470, 10, -0.19999999999999929 },
1097 { -27256.158950297624, 10, -0.099999999999999645 },
1098 { -30240.000000000000, 10, 0.0000000000000000 },
1099 { -27256.158950297624, 10, 0.099999999999999645 },
1100 { -18778.856957542470, 10, 0.19999999999999929 },
1101 { -6173.8524877822965, 10, 0.30000000000000071 },
1102 { 8467.6907597824556, 10, 0.40000000000000036 },
1103 { 22591.000000000000, 10, 0.50000000000000000 },
1104 { 33513.167890022363, 10, 0.59999999999999964 },
1105 { 38802.826035097583, 10, 0.69999999999999929 },
1106 { 36668.344916377559, 10, 0.80000000000000071 },
1107 { 26314.366684262357, 10, 0.90000000000000036 },
1108 { 8224.0000000000000, 10, 1.0000000000000000 },
1109 { -15676.055823257526, 10, 1.0999999999999996 },
1110 { -42007.465141862223, 10, 1.1999999999999993 },
1111 { -66123.413033062563, 10, 1.3000000000000007 },
1112 { -82507.675752857642, 10, 1.4000000000000004 },
1113 { -85401.000000000000, 10, 1.5000000000000000 },
1114 { -69648.597834137676, 10, 1.5999999999999996 },
1115 { -31740.330680422732, 10, 1.6999999999999993 },
1116 { 29012.094015898125, 10, 1.8000000000000007 },
1117 { 109249.22783242268, 10, 1.9000000000000004 },
1118 { 200416.00000000000, 10, 2.0000000000000000 },
1119 { 287863.09027338214, 10, 2.0999999999999996 },
1120 { 350419.82826741732, 10, 2.1999999999999993 },
1121 { 360718.79745525745, 10, 2.3000000000000007 },
1122 { 286617.47398410190, 10, 2.4000000000000004 },
1123 { 94135.000000000000, 10, 2.5000000000000000 },
1124 { -247597.05012469599, 10, 2.5999999999999996 },
1125 { -758781.93281033845, 10, 2.6999999999999993 },
1126 { -1438117.1978829878, 10, 2.8000000000000007 },
1127 { -2247873.5653938209, 10, 2.9000000000000004 },
1128 { -3093984.0000000000, 10, 3.0000000000000000 },
1129 { -3800107.4878923763, 10, 3.0999999999999996 },
1130 { -4074495.5241857003, 10, 3.1999999999999993 },
1131 { -3468342.2313268133, 10, 3.3000000000000007 },
1132 { -1324140.9798373245, 10, 3.4000000000000004 },
1133 { 3287599.0000000000, 10, 3.5000000000000000 },
1134 { 11645103.614666298, 10, 3.5999999999999996 },
1135 { 25467573.275709212, 10, 3.6999999999999993 },
1136 { 47025137.016035900, 10, 3.8000000000000007 },
1137 { 79268966.162877649, 10, 3.9000000000000004 },
1138 { 125984224.00000000, 10, 4.0000000000000000 },
1139 { 191968773.03860721, 10, 4.0999999999999996 },
1140 { 283240820.63788199, 10, 4.1999999999999993 },
1141 { 407278957.14375770, 10, 4.3000000000000007 },
1142 { 573298328.81993556, 10, 4.4000000000000004 },
1143 { 792566991.00000000, 10, 4.5000000000000000 },
1144 { 1078766805.4651456, 10, 4.5999999999999996 },
1145 { 1448403580.4203794, 10, 4.6999999999999993 },
1146 { 1921271501.9744320, 10, 4.8000000000000007 },
1147 { 2520977273.0966806, 10, 4.9000000000000004 },
1148 { 3275529760.0000000, 10, 5.0000000000000000 },
1149 { 4218001347.1524582, 10, 5.0999999999999996 },
1150 { 5387267621.0258913, 10, 5.1999999999999993 },
1151 { 6828832439.6160927, 10, 5.3000000000000007 },
1152 { 8595745900.0898170, 10, 5.4000000000000004 },
1153 { 10749623191.000000, 10, 5.5000000000000000 },
1154 { 13361772808.732477, 10, 5.5999999999999996 },
1155 { 16514443130.579332, 10, 5.6999999999999993 },
1156 { 20302196869.444618, 10, 5.8000000000000007 },
1157 { 24833423488.050617, 10, 5.9000000000000004 },
1158 { 30232000224.000000, 10, 6.0000000000000000 },
1159 { 36639112971.527824, 10, 6.1000000000000014 },
1160 { 44215248881.625443, 10, 6.1999999999999993 },
1161 { 53142373179.806152, 10, 6.3000000000000007 },
1162 { 63626303360.467911, 10, 6.3999999999999986 },
1163 { 75899294599.000000, 10, 6.5000000000000000 },
1164 { 90222850927.788208, 10, 6.6000000000000014 },
1165 { 106890777450.54652, 10, 6.6999999999999993 },
1166 { 126232489621.23946, 10, 6.8000000000000007 },
1167 { 148616596389.67184, 10, 6.8999999999999986 },
1168 { 174454774816.00000, 10, 7.0000000000000000 },
1169 { 204205954581.24780, 10, 7.1000000000000014 },
1170 { 238380831670.89960, 10, 7.1999999999999993 },
1171 { 277546731384.01831, 10, 7.3000000000000007 },
1172 { 322332841721.55646, 10, 7.3999999999999986 },
1173 { 373435839135.00000, 10, 7.5000000000000000 },
1174 { 431625929570.40161, 10, 7.6000000000000014 },
1175 { 497753328723.87476, 10, 7.6999999999999993 },
1176 { 572755206432.81396, 10, 7.8000000000000007 },
1177 { 657663121163.02307, 10, 7.8999999999999986 },
1178 { 753610971616.00000, 10, 8.0000000000000000 },
1179 { 861843493572.90283, 10, 8.1000000000000014 },
1180 { 983725331213.07190, 10, 8.1999999999999993 },
1181 { 1120750713295.2778, 10, 8.3000000000000007 },
1182 { 1274553765769.7439, 10, 8.3999999999999986 },
1183 { 1446919493599.0000, 10, 8.5000000000000000 },
1184 { 1639795465805.4785, 10, 8.6000000000000014 },
1185 { 1855304239034.7983, 10, 8.6999999999999993 },
1186 { 2095756556225.3428, 10, 8.8000000000000007 },
1187 { 2363665358307.8442, 10, 8.8999999999999986 },
1188 { 2661760648224.0000, 10, 9.0000000000000000 },
1189 { 2993005247949.7671, 10, 9.1000000000000014 },
1190 { 3360611490639.0889, 10, 9.1999999999999993 },
1191 { 3768058891466.0469, 10, 9.3000000000000007 },
1192 { 4219112842239.1055, 10, 9.3999999999999986 },
1193 { 4717844376391.0000, 10, 9.5000000000000000 },
1194 { 5268651052510.4785, 10, 9.6000000000000014 },
1195 { 5876279006180.6377, 10, 9.6999999999999993 },
1196 { 6545846221520.6768, 10, 9.8000000000000007 },
1197 { 7282867075495.2949, 10, 9.8999999999999986 },
1198 { 8093278209760.0000, 10, 10.000000000000000 },
1201 // Test function for n=10.
1202 template<typename Tp
>
1206 bool test
__attribute__((unused
)) = true;
1207 const Tp eps
= std::numeric_limits
<Tp
>::epsilon();
1208 Tp max_abs_diff
= -Tp(1);
1209 Tp max_abs_frac
= -Tp(1);
1210 unsigned int num_datum
= sizeof(data005
)
1211 / sizeof(testcase_hermite
<double>);
1212 for (unsigned int i
= 0; i
< num_datum
; ++i
)
1214 const Tp f
= std::tr1::hermite(Tp(data005
[i
].n
), Tp(data005
[i
].x
));
1215 const Tp f0
= data005
[i
].f0
;
1216 const Tp diff
= f
- f0
;
1217 if (std::abs(diff
) > max_abs_diff
)
1218 max_abs_diff
= std::abs(diff
);
1219 if (std::abs(f0
) > Tp(10) * eps
1220 && std::abs(f
) > Tp(10) * eps
)
1222 const Tp frac
= diff
/ f0
;
1223 if (std::abs(frac
) > max_abs_frac
)
1224 max_abs_frac
= std::abs(frac
);
1227 VERIFY(max_abs_frac
< Tp(2.5000000000000020e-13));
1230 // Test data for n=20.
1231 // max(|f - f_GSL|): 0.0000000000000000
1232 // max(|f - f_GSL| / |f_GSL|): 0.0000000000000000
1233 testcase_hermite
<double>
1236 { 3.6536710970888030e+25, 20, -10.000000000000000 },
1237 { 2.9174932703098834e+25, 20, -9.9000000000000004 },
1238 { 2.3228769039548404e+25, 20, -9.8000000000000007 },
1239 { 1.8439144509496016e+25, 20, -9.6999999999999993 },
1240 { 1.4591971834545420e+25, 20, -9.5999999999999996 },
1241 { 1.1510764882450827e+25, 20, -9.5000000000000000 },
1242 { 9.0503941245991605e+24, 20, -9.4000000000000004 },
1243 { 7.0918188910312152e+24, 20, -9.3000000000000007 },
1244 { 5.5376531405202033e+24, 20, -9.1999999999999993 },
1245 { 4.3084410724035914e+24, 20, -9.0999999999999996 },
1246 { 3.3395360269524137e+24, 20, -9.0000000000000000 },
1247 { 2.5784910430831484e+24, 20, -8.9000000000000004 },
1248 { 1.9828824261062853e+24, 20, -8.8000000000000007 },
1249 { 1.5184989558235974e+24, 20, -8.6999999999999993 },
1250 { 1.1578391431515818e+24, 20, -8.5999999999999996 },
1251 { 8.7886740525023878e+23, 20, -8.5000000000000000 },
1252 { 6.6398733801206072e+23, 20, -8.4000000000000004 },
1253 { 4.9919656538201190e+23, 20, -8.3000000000000007 },
1254 { 3.7339306542317994e+23, 20, -8.1999999999999993 },
1255 { 2.7780752653950559e+23, 20, -8.0999999999999996 },
1256 { 2.0554027373991249e+23, 20, -8.0000000000000000 },
1257 { 1.5118471231121695e+23, 20, -7.9000000000000004 },
1258 { 1.1052214218386250e+23, 20, -7.7999999999999998 },
1259 { 8.0275268594719504e+22, 20, -7.7000000000000002 },
1260 { 5.7909832934009042e+22, 20, -7.5999999999999996 },
1261 { 4.1475563998692745e+22, 20, -7.5000000000000000 },
1262 { 2.9479149729249250e+22, 20, -7.4000000000000004 },
1263 { 2.0783192485964573e+22, 20, -7.2999999999999998 },
1264 { 1.4526171451238503e+22, 20, -7.2000000000000002 },
1265 { 1.0059323685871305e+22, 20, -7.0999999999999996 },
1266 { 6.8970965604502329e+21, 20, -7.0000000000000000 },
1267 { 4.6784410379528280e+21, 20, -6.9000000000000004 },
1268 { 3.1367268160419670e+21, 20, -6.7999999999999998 },
1269 { 2.0764831558419748e+21, 20, -6.7000000000000002 },
1270 { 1.3555174744148132e+21, 20, -6.5999999999999996 },
1271 { 8.7124954970091579e+20, 20, -6.5000000000000000 },
1272 { 5.5033278133788108e+20, 20, -6.4000000000000004 },
1273 { 3.4082412197533739e+20, 20, -6.2999999999999998 },
1274 { 2.0631845648712185e+20, 20, -6.2000000000000002 },
1275 { 1.2158762212269028e+20, 20, -6.0999999999999996 },
1276 { 6.9364200641629315e+19, 20, -6.0000000000000000 },
1277 { 3.7990093270095905e+19, 20, -5.9000000000000004 },
1278 { 1.9713403927925858e+19, 20, -5.7999999999999998 },
1279 { 9.4673798488533340e+18, 20, -5.7000000000000002 },
1280 { 4.0046403628787825e+18, 20, -5.5999999999999996 },
1281 { 1.2907686705724293e+18, 20, -5.5000000000000000 },
1282 { 85277679782823936., 20, -5.4000000000000004 },
1283 { -3.4359547179069376e+17, 20, -5.2999999999999998 },
1284 { -4.0970873501577555e+17, 20, -5.2000000000000002 },
1285 { -3.3419585613348250e+17, 20, -5.0999999999999996 },
1286 { -2.2571776716382720e+17, 20, -5.0000000000000000 },
1287 { -1.3051120203565566e+17, 20, -4.9000000000000004 },
1288 { -62555669197021992., 20, -4.7999999999999998 },
1289 { -20974173561010048., 20, -4.7000000000000002 },
1290 { 519073301695656.00, 20, -4.5999999999999996 },
1291 { 8939556693761121.0, 20, -4.5000000000000000 },
1292 { 10070625675125180., 20, -4.4000000000000004 },
1293 { 7940371996960715.0, 20, -4.2999999999999998 },
1294 { 4973623686173568.0, 20, -4.2000000000000002 },
1295 { 2389023282480410.0, 20, -4.0999999999999996 },
1296 { 619678016654336.00, 20, -4.0000000000000000 },
1297 { -339773491011946.00, 20, -3.9000000000000004 },
1298 { -687467334428204.38, 20, -3.7999999999999998 },
1299 { -663019129550482.75, 20, -3.7000000000000002 },
1300 { -469585152350670.25, 20, -3.5999999999999996 },
1301 { -245659781875039.00, 20, -3.5000000000000000 },
1302 { -66042773886778.938, 20, -3.4000000000000004 },
1303 { 43442261337436.312, 20, -3.2999999999999998 },
1304 { 87626632986465.375, 20, -3.2000000000000002 },
1305 { 85786202388511.375, 20, -3.0999999999999996 },
1306 { 59990281399296.000, 20, -3.0000000000000000 },
1307 { 28343496696718.070, 20, -2.9000000000000004 },
1308 { 2296898915036.0859, 20, -2.7999999999999998 },
1309 { -13249381789941.502, 20, -2.7000000000000002 },
1310 { -18328180426561.059, 20, -2.5999999999999996 },
1311 { -15799429886575.000, 20, -2.5000000000000000 },
1312 { -9442592050214.3027, 20, -2.4000000000000004 },
1313 { -2602375356373.2393, 20, -2.2999999999999998 },
1314 { 2521759315047.8428, 20, -2.2000000000000002 },
1315 { 5027779307352.6660, 20, -2.0999999999999996 },
1316 { 5080118660096.0000, 20, -2.0000000000000000 },
1317 { 3490463276000.5425, 20, -1.9000000000000004 },
1318 { 1277254793997.1128, 20, -1.8000000000000007 },
1319 { -682119355279.28784, 20, -1.6999999999999993 },
1320 { -1851544254412.3203, 20, -1.5999999999999996 },
1321 { -2085387081039.0000, 20, -1.5000000000000000 },
1322 { -1559402933581.5054, 20, -1.4000000000000004 },
1323 { -634265763221.87231, 20, -1.3000000000000007 },
1324 { 295481874887.33429, 20, -1.1999999999999993 },
1325 { 924603483429.34241, 20, -1.0999999999999996 },
1326 { 1107214478336.0000, 20, -1.0000000000000000 },
1327 { 867235623835.12463, 20, -0.90000000000000036 },
1328 { 358848462745.15466, 20, -0.80000000000000071 },
1329 { -202944086511.71936, 20, -0.69999999999999929 },
1330 { -617730863561.32617, 20, -0.59999999999999964 },
1331 { -759627879679.00000, 20, -0.50000000000000000 },
1332 { -607451728035.03271, 20, -0.40000000000000036 },
1333 { -240424854484.42111, 20, -0.30000000000000071 },
1334 { 195759209122.61337, 20, -0.19999999999999929 },
1335 { 540334019322.52014, 20, -0.099999999999999645 },
1336 { 670442572800.00000, 20, 0.0000000000000000 },
1337 { 540334019322.52014, 20, 0.099999999999999645 },
1338 { 195759209122.61337, 20, 0.19999999999999929 },
1339 { -240424854484.42111, 20, 0.30000000000000071 },
1340 { -607451728035.03271, 20, 0.40000000000000036 },
1341 { -759627879679.00000, 20, 0.50000000000000000 },
1342 { -617730863561.32617, 20, 0.59999999999999964 },
1343 { -202944086511.71936, 20, 0.69999999999999929 },
1344 { 358848462745.15466, 20, 0.80000000000000071 },
1345 { 867235623835.12463, 20, 0.90000000000000036 },
1346 { 1107214478336.0000, 20, 1.0000000000000000 },
1347 { 924603483429.34241, 20, 1.0999999999999996 },
1348 { 295481874887.33429, 20, 1.1999999999999993 },
1349 { -634265763221.87231, 20, 1.3000000000000007 },
1350 { -1559402933581.5054, 20, 1.4000000000000004 },
1351 { -2085387081039.0000, 20, 1.5000000000000000 },
1352 { -1851544254412.3203, 20, 1.5999999999999996 },
1353 { -682119355279.28784, 20, 1.6999999999999993 },
1354 { 1277254793997.1128, 20, 1.8000000000000007 },
1355 { 3490463276000.5425, 20, 1.9000000000000004 },
1356 { 5080118660096.0000, 20, 2.0000000000000000 },
1357 { 5027779307352.6660, 20, 2.0999999999999996 },
1358 { 2521759315047.8770, 20, 2.1999999999999993 },
1359 { -2602375356373.2969, 20, 2.3000000000000007 },
1360 { -9442592050214.3027, 20, 2.4000000000000004 },
1361 { -15799429886575.000, 20, 2.5000000000000000 },
1362 { -18328180426561.059, 20, 2.5999999999999996 },
1363 { -13249381789941.586, 20, 2.6999999999999993 },
1364 { 2296898915036.2812, 20, 2.8000000000000007 },
1365 { 28343496696718.070, 20, 2.9000000000000004 },
1366 { 59990281399296.000, 20, 3.0000000000000000 },
1367 { 85786202388511.375, 20, 3.0999999999999996 },
1368 { 87626632986465.438, 20, 3.1999999999999993 },
1369 { 43442261337435.672, 20, 3.3000000000000007 },
1370 { -66042773886778.938, 20, 3.4000000000000004 },
1371 { -245659781875039.00, 20, 3.5000000000000000 },
1372 { -469585152350670.25, 20, 3.5999999999999996 },
1373 { -663019129550482.25, 20, 3.6999999999999993 },
1374 { -687467334428203.38, 20, 3.8000000000000007 },
1375 { -339773491011946.00, 20, 3.9000000000000004 },
1376 { 619678016654336.00, 20, 4.0000000000000000 },
1377 { 2389023282480410.0, 20, 4.0999999999999996 },
1378 { 4973623686173539.0, 20, 4.1999999999999993 },
1379 { 7940371996960741.0, 20, 4.3000000000000007 },
1380 { 10070625675125180., 20, 4.4000000000000004 },
1381 { 8939556693761121.0, 20, 4.5000000000000000 },
1382 { 519073301695656.00, 20, 4.5999999999999996 },
1383 { -20974173561009776., 20, 4.6999999999999993 },
1384 { -62555669197022528., 20, 4.8000000000000007 },
1385 { -1.3051120203565566e+17, 20, 4.9000000000000004 },
1386 { -2.2571776716382720e+17, 20, 5.0000000000000000 },
1387 { -3.3419585613348250e+17, 20, 5.0999999999999996 },
1388 { -4.0970873501577562e+17, 20, 5.1999999999999993 },
1389 { -3.4359547179069216e+17, 20, 5.3000000000000007 },
1390 { 85277679782823936., 20, 5.4000000000000004 },
1391 { 1.2907686705724293e+18, 20, 5.5000000000000000 },
1392 { 4.0046403628787825e+18, 20, 5.5999999999999996 },
1393 { 9.4673798488532767e+18, 20, 5.6999999999999993 },
1394 { 1.9713403927925973e+19, 20, 5.8000000000000007 },
1395 { 3.7990093270095905e+19, 20, 5.9000000000000004 },
1396 { 6.9364200641629315e+19, 20, 6.0000000000000000 },
1397 { 1.2158762212269156e+20, 20, 6.1000000000000014 },
1398 { 2.0631845648712086e+20, 20, 6.1999999999999993 },
1399 { 3.4082412197533902e+20, 20, 6.3000000000000007 },
1400 { 5.5033278133787696e+20, 20, 6.3999999999999986 },
1401 { 8.7124954970091579e+20, 20, 6.5000000000000000 },
1402 { 1.3555174744148243e+21, 20, 6.6000000000000014 },
1403 { 2.0764831558419680e+21, 20, 6.6999999999999993 },
1404 { 3.1367268160419775e+21, 20, 6.8000000000000007 },
1405 { 4.6784410379527966e+21, 20, 6.8999999999999986 },
1406 { 6.8970965604502329e+21, 20, 7.0000000000000000 },
1407 { 1.0059323685871368e+22, 20, 7.1000000000000014 },
1408 { 1.4526171451238465e+22, 20, 7.1999999999999993 },
1409 { 2.0783192485964666e+22, 20, 7.3000000000000007 },
1410 { 2.9479149729249048e+22, 20, 7.3999999999999986 },
1411 { 4.1475563998692745e+22, 20, 7.5000000000000000 },
1412 { 5.7909832934009378e+22, 20, 7.6000000000000014 },
1413 { 8.0275268594719286e+22, 20, 7.6999999999999993 },
1414 { 1.1052214218386286e+23, 20, 7.8000000000000007 },
1415 { 1.5118471231121604e+23, 20, 7.8999999999999986 },
1416 { 2.0554027373991249e+23, 20, 8.0000000000000000 },
1417 { 2.7780752653950703e+23, 20, 8.1000000000000014 },
1418 { 3.7339306542317994e+23, 20, 8.1999999999999993 },
1419 { 4.9919656538201190e+23, 20, 8.3000000000000007 },
1420 { 6.6398733801205790e+23, 20, 8.3999999999999986 },
1421 { 8.7886740525023878e+23, 20, 8.5000000000000000 },
1422 { 1.1578391431515869e+24, 20, 8.6000000000000014 },
1423 { 1.5184989558235974e+24, 20, 8.6999999999999993 },
1424 { 1.9828824261062853e+24, 20, 8.8000000000000007 },
1425 { 2.5784910430831355e+24, 20, 8.8999999999999986 },
1426 { 3.3395360269524137e+24, 20, 9.0000000000000000 },
1427 { 4.3084410724036123e+24, 20, 9.1000000000000014 },
1428 { 5.5376531405202033e+24, 20, 9.1999999999999993 },
1429 { 7.0918188910312152e+24, 20, 9.3000000000000007 },
1430 { 9.0503941245991197e+24, 20, 9.3999999999999986 },
1431 { 1.1510764882450827e+25, 20, 9.5000000000000000 },
1432 { 1.4591971834545491e+25, 20, 9.6000000000000014 },
1433 { 1.8439144509496016e+25, 20, 9.6999999999999993 },
1434 { 2.3228769039548404e+25, 20, 9.8000000000000007 },
1435 { 2.9174932703098731e+25, 20, 9.8999999999999986 },
1436 { 3.6536710970888030e+25, 20, 10.000000000000000 },
1439 // Test function for n=20.
1440 template<typename Tp
>
1444 bool test
__attribute__((unused
)) = true;
1445 const Tp eps
= std::numeric_limits
<Tp
>::epsilon();
1446 Tp max_abs_diff
= -Tp(1);
1447 Tp max_abs_frac
= -Tp(1);
1448 unsigned int num_datum
= sizeof(data006
)
1449 / sizeof(testcase_hermite
<double>);
1450 for (unsigned int i
= 0; i
< num_datum
; ++i
)
1452 const Tp f
= std::tr1::hermite(Tp(data006
[i
].n
), Tp(data006
[i
].x
));
1453 const Tp f0
= data006
[i
].f0
;
1454 const Tp diff
= f
- f0
;
1455 if (std::abs(diff
) > max_abs_diff
)
1456 max_abs_diff
= std::abs(diff
);
1457 if (std::abs(f0
) > Tp(10) * eps
1458 && std::abs(f
) > Tp(10) * eps
)
1460 const Tp frac
= diff
/ f0
;
1461 if (std::abs(frac
) > max_abs_frac
)
1462 max_abs_frac
= std::abs(frac
);
1465 VERIFY(max_abs_frac
< Tp(2.5000000000000020e-13));
1468 // Test data for n=50.
1469 // max(|f - f_GSL|): 0.0000000000000000
1470 // max(|f - f_GSL| / |f_GSL|): 0.0000000000000000
1471 testcase_hermite
<double>
1474 { 1.3516643049819314e+61, 50, -10.000000000000000 },
1475 { 5.8466703062266110e+60, 50, -9.9000000000000004 },
1476 { 2.4344814863741168e+60, 50, -9.8000000000000007 },
1477 { 9.6739828066585787e+59, 50, -9.6999999999999993 },
1478 { 3.6194312967780128e+59, 50, -9.5999999999999996 },
1479 { 1.2454022521696361e+59, 50, -9.5000000000000000 },
1480 { 3.7546881918013145e+58, 50, -9.4000000000000004 },
1481 { 8.6500158470917270e+57, 50, -9.3000000000000007 },
1482 { 5.3163209769527426e+56, 50, -9.1999999999999993 },
1483 { -9.7863165370930473e+56, 50, -9.0999999999999996 },
1484 { -8.0563930902368911e+56, 50, -9.0000000000000000 },
1485 { -4.3145937406321933e+56, 50, -8.9000000000000004 },
1486 { -1.8210771577645630e+56, 50, -8.8000000000000007 },
1487 { -6.0082225302289557e+55, 50, -8.6999999999999993 },
1488 { -1.2392013720948442e+55, 50, -8.5999999999999996 },
1489 { 1.5935887905806307e+54, 50, -8.5000000000000000 },
1490 { 3.4325365049909381e+54, 50, -8.4000000000000004 },
1491 { 2.2368641272300899e+54, 50, -8.3000000000000007 },
1492 { 1.0009712198862341e+54, 50, -8.1999999999999993 },
1493 { 3.0699480272357337e+53, 50, -8.0999999999999996 },
1494 { 2.9492797132685063e+52, 50, -8.0000000000000000 },
1495 { -3.9982544106300062e+52, 50, -7.9000000000000004 },
1496 { -3.5678031330023779e+52, 50, -7.7999999999999998 },
1497 { -1.8076371748762468e+52, 50, -7.7000000000000002 },
1498 { -5.7887622198708925e+51, 50, -7.5999999999999996 },
1499 { -3.5808467693113330e+50, 50, -7.5000000000000000 },
1500 { 1.0219511166806405e+51, 50, -7.4000000000000004 },
1501 { 8.4241263694549560e+50, 50, -7.2999999999999998 },
1502 { 3.9143899315095369e+50, 50, -7.2000000000000002 },
1503 { 9.3178966245756654e+49, 50, -7.0999999999999996 },
1504 { -2.4714855983436561e+49, 50, -7.0000000000000000 },
1505 { -4.1428217272044600e+49, 50, -6.9000000000000004 },
1506 { -2.4864980414057334e+49, 50, -6.7999999999999998 },
1507 { -8.0684355476447979e+48, 50, -6.7000000000000002 },
1508 { 4.2529238530179841e+47, 50, -6.5999999999999996 },
1509 { 2.4709663739849681e+48, 50, -6.5000000000000000 },
1510 { 1.7500305481204125e+48, 50, -6.4000000000000004 },
1511 { 6.3834558285146007e+47, 50, -6.2999999999999998 },
1512 { -1.1477672402381055e+46, 50, -6.2000000000000002 },
1513 { -1.9304630401841983e+47, 50, -6.0999999999999996 },
1514 { -1.4355266959903589e+47, 50, -6.0000000000000000 },
1515 { -5.1482200905566146e+46, 50, -5.9000000000000004 },
1516 { 4.6577356827463283e+45, 50, -5.7999999999999998 },
1517 { 1.9676012349652066e+46, 50, -5.7000000000000002 },
1518 { 1.3630554018675846e+46, 50, -5.5999999999999996 },
1519 { 4.0920495328093750e+45, 50, -5.5000000000000000 },
1520 { -1.3680638882145392e+45, 50, -5.4000000000000004 },
1521 { -2.4465265559935436e+45, 50, -5.2999999999999998 },
1522 { -1.4270495629649456e+45, 50, -5.2000000000000002 },
1523 { -2.4845518743338381e+44, 50, -5.0999999999999996 },
1524 { 3.1953926721271990e+44, 50, -5.0000000000000000 },
1525 { 3.4169399444879600e+44, 50, -4.9000000000000004 },
1526 { 1.4896819114978755e+44, 50, -4.7999999999999998 },
1527 { -1.3078430866968493e+43, 50, -4.7000000000000002 },
1528 { -6.8449168639700716e+43, 50, -4.5999999999999996 },
1529 { -4.9181639709997461e+43, 50, -4.5000000000000000 },
1530 { -1.1434943490345182e+43, 50, -4.4000000000000004 },
1531 { 1.1214652543461432e+43, 50, -4.2999999999999998 },
1532 { 1.3843548994480608e+43, 50, -4.2000000000000002 },
1533 { 6.3349790205303262e+42, 50, -4.0999999999999996 },
1534 { -9.5599640670553907e+41, 50, -4.0000000000000000 },
1535 { -3.6202558158287927e+42, 50, -3.9000000000000004 },
1536 { -2.5206461734624493e+42, 50, -3.7999999999999998 },
1537 { -3.7818051510732439e+41, 50, -3.7000000000000002 },
1538 { 8.8921371165335050e+41, 50, -3.5999999999999996 },
1539 { 9.2055485763852770e+41, 50, -3.5000000000000000 },
1540 { 3.2535765707283020e+41, 50, -3.4000000000000004 },
1541 { -1.9358941418244578e+41, 50, -3.2999999999999998 },
1542 { -3.3076282847915670e+41, 50, -3.2000000000000002 },
1543 { -1.7764977066639160e+41, 50, -3.0999999999999996 },
1544 { 2.6751882008697154e+40, 50, -3.0000000000000000 },
1545 { 1.2025382369996052e+41, 50, -2.9000000000000004 },
1546 { 8.8383035103557973e+40, 50, -2.7999999999999998 },
1547 { 7.7733606479641769e+39, 50, -2.7000000000000002 },
1548 { -4.4696811758713757e+40, 50, -2.5999999999999996 },
1549 { -4.3715062488963453e+40, 50, -2.5000000000000000 },
1550 { -1.1390080390575289e+40, 50, -2.4000000000000004 },
1551 { 1.6938519751181342e+40, 50, -2.2999999999999998 },
1552 { 2.2284509952956210e+40, 50, -2.2000000000000002 },
1553 { 9.0967994280570531e+39, 50, -2.0999999999999996 },
1554 { -6.4126677997472978e+39, 50, -2.0000000000000000 },
1555 { -1.1926839454034341e+40, 50, -1.9000000000000004 },
1556 { -6.5436654274699114e+39, 50, -1.8000000000000007 },
1557 { 2.2779499542550411e+39, 50, -1.6999999999999993 },
1558 { 6.7720530889699639e+39, 50, -1.5999999999999996 },
1559 { 4.6884851188034300e+39, 50, -1.5000000000000000 },
1560 { -5.9005001052557463e+38, 50, -1.4000000000000004 },
1561 { -4.1028320210430589e+39, 50, -1.3000000000000007 },
1562 { -3.4780049977083965e+39, 50, -1.1999999999999993 },
1563 { -1.3484918476373692e+38, 50, -1.0999999999999996 },
1564 { 2.6586815431645456e+39, 50, -1.0000000000000000 },
1565 { 2.7225429473661429e+39, 50, -0.90000000000000036 },
1566 { 4.7785441024951729e+38, 50, -0.80000000000000071 },
1567 { -1.8416784378790159e+39, 50, -0.69999999999999929 },
1568 { -2.2725918816693132e+39, 50, -0.59999999999999964 },
1569 { -6.7948375014926916e+38, 50, -0.50000000000000000 },
1570 { 1.3581645858905750e+39, 50, -0.40000000000000036 },
1571 { 2.0349661043040497e+39, 50, -0.30000000000000071 },
1572 { 8.5049248815817037e+38, 50, -0.19999999999999929 },
1573 { -1.0564542132990048e+39, 50, -0.099999999999999645 },
1574 { -1.9607814681608194e+39, 50, 0.0000000000000000 },
1575 { -1.0564542132990048e+39, 50, 0.099999999999999645 },
1576 { 8.5049248815817037e+38, 50, 0.19999999999999929 },
1577 { 2.0349661043040497e+39, 50, 0.30000000000000071 },
1578 { 1.3581645858905750e+39, 50, 0.40000000000000036 },
1579 { -6.7948375014926916e+38, 50, 0.50000000000000000 },
1580 { -2.2725918816693132e+39, 50, 0.59999999999999964 },
1581 { -1.8416784378790159e+39, 50, 0.69999999999999929 },
1582 { 4.7785441024951729e+38, 50, 0.80000000000000071 },
1583 { 2.7225429473661429e+39, 50, 0.90000000000000036 },
1584 { 2.6586815431645456e+39, 50, 1.0000000000000000 },
1585 { -1.3484918476373692e+38, 50, 1.0999999999999996 },
1586 { -3.4780049977083965e+39, 50, 1.1999999999999993 },
1587 { -4.1028320210430589e+39, 50, 1.3000000000000007 },
1588 { -5.9005001052557463e+38, 50, 1.4000000000000004 },
1589 { 4.6884851188034300e+39, 50, 1.5000000000000000 },
1590 { 6.7720530889699639e+39, 50, 1.5999999999999996 },
1591 { 2.2779499542550411e+39, 50, 1.6999999999999993 },
1592 { -6.5436654274699114e+39, 50, 1.8000000000000007 },
1593 { -1.1926839454034341e+40, 50, 1.9000000000000004 },
1594 { -6.4126677997472978e+39, 50, 2.0000000000000000 },
1595 { 9.0967994280570531e+39, 50, 2.0999999999999996 },
1596 { 2.2284509952956162e+40, 50, 2.1999999999999993 },
1597 { 1.6938519751181172e+40, 50, 2.3000000000000007 },
1598 { -1.1390080390575289e+40, 50, 2.4000000000000004 },
1599 { -4.3715062488963453e+40, 50, 2.5000000000000000 },
1600 { -4.4696811758713757e+40, 50, 2.5999999999999996 },
1601 { 7.7733606479635628e+39, 50, 2.6999999999999993 },
1602 { 8.8383035103558611e+40, 50, 2.8000000000000007 },
1603 { 1.2025382369996052e+41, 50, 2.9000000000000004 },
1604 { 2.6751882008697154e+40, 50, 3.0000000000000000 },
1605 { -1.7764977066639160e+41, 50, 3.0999999999999996 },
1606 { -3.3076282847915616e+41, 50, 3.1999999999999993 },
1607 { -1.9358941418244260e+41, 50, 3.3000000000000007 },
1608 { 3.2535765707283020e+41, 50, 3.4000000000000004 },
1609 { 9.2055485763852770e+41, 50, 3.5000000000000000 },
1610 { 8.8921371165335050e+41, 50, 3.5999999999999996 },
1611 { -3.7818051510730675e+41, 50, 3.6999999999999993 },
1612 { -2.5206461734624660e+42, 50, 3.8000000000000007 },
1613 { -3.6202558158287927e+42, 50, 3.9000000000000004 },
1614 { -9.5599640670553907e+41, 50, 4.0000000000000000 },
1615 { 6.3349790205303262e+42, 50, 4.0999999999999996 },
1616 { 1.3843548994480566e+43, 50, 4.1999999999999993 },
1617 { 1.1214652543461340e+43, 50, 4.3000000000000007 },
1618 { -1.1434943490345182e+43, 50, 4.4000000000000004 },
1619 { -4.9181639709997461e+43, 50, 4.5000000000000000 },
1620 { -6.8449168639700716e+43, 50, 4.5999999999999996 },
1621 { -1.3078430866969463e+43, 50, 4.6999999999999993 },
1622 { 1.4896819114978953e+44, 50, 4.8000000000000007 },
1623 { 3.4169399444879600e+44, 50, 4.9000000000000004 },
1624 { 3.1953926721271990e+44, 50, 5.0000000000000000 },
1625 { -2.4845518743338381e+44, 50, 5.0999999999999996 },
1626 { -1.4270495629649337e+45, 50, 5.1999999999999993 },
1627 { -2.4465265559935458e+45, 50, 5.3000000000000007 },
1628 { -1.3680638882145392e+45, 50, 5.4000000000000004 },
1629 { 4.0920495328093750e+45, 50, 5.5000000000000000 },
1630 { 1.3630554018675846e+46, 50, 5.5999999999999996 },
1631 { 1.9676012349652081e+46, 50, 5.6999999999999993 },
1632 { 4.6577356827460393e+45, 50, 5.8000000000000007 },
1633 { -5.1482200905566146e+46, 50, 5.9000000000000004 },
1634 { -1.4355266959903589e+47, 50, 6.0000000000000000 },
1635 { -1.9304630401841966e+47, 50, 6.1000000000000014 },
1636 { -1.1477672402384868e+46, 50, 6.1999999999999993 },
1637 { 6.3834558285146981e+47, 50, 6.3000000000000007 },
1638 { 1.7500305481203924e+48, 50, 6.3999999999999986 },
1639 { 2.4709663739849681e+48, 50, 6.5000000000000000 },
1640 { 4.2529238530171793e+47, 50, 6.6000000000000014 },
1641 { -8.0684355476446876e+48, 50, 6.6999999999999993 },
1642 { -2.4864980414057495e+49, 50, 6.8000000000000007 },
1643 { -4.1428217272044496e+49, 50, 6.8999999999999986 },
1644 { -2.4714855983436561e+49, 50, 7.0000000000000000 },
1645 { 9.3178966245760310e+49, 50, 7.1000000000000014 },
1646 { 3.9143899315095070e+50, 50, 7.1999999999999993 },
1647 { 8.4241263694549925e+50, 50, 7.3000000000000007 },
1648 { 1.0219511166806458e+51, 50, 7.3999999999999986 },
1649 { -3.5808467693113330e+50, 50, 7.5000000000000000 },
1650 { -5.7887622198710268e+51, 50, 7.6000000000000014 },
1651 { -1.8076371748762319e+52, 50, 7.6999999999999993 },
1652 { -3.5678031330023971e+52, 50, 7.8000000000000007 },
1653 { -3.9982544106300530e+52, 50, 7.8999999999999986 },
1654 { 2.9492797132685063e+52, 50, 8.0000000000000000 },
1655 { 3.0699480272358086e+53, 50, 8.1000000000000014 },
1656 { 1.0009712198862341e+54, 50, 8.1999999999999993 },
1657 { 2.2368641272300899e+54, 50, 8.3000000000000007 },
1658 { 3.4325365049909340e+54, 50, 8.3999999999999986 },
1659 { 1.5935887905806307e+54, 50, 8.5000000000000000 },
1660 { -1.2392013720948937e+55, 50, 8.6000000000000014 },
1661 { -6.0082225302289557e+55, 50, 8.6999999999999993 },
1662 { -1.8210771577645630e+56, 50, 8.8000000000000007 },
1663 { -4.3145937406321376e+56, 50, 8.8999999999999986 },
1664 { -8.0563930902368911e+56, 50, 9.0000000000000000 },
1665 { -9.7863165370930194e+56, 50, 9.1000000000000014 },
1666 { 5.3163209769527426e+56, 50, 9.1999999999999993 },
1667 { 8.6500158470917270e+57, 50, 9.3000000000000007 },
1668 { 3.7546881918012164e+58, 50, 9.3999999999999986 },
1669 { 1.2454022521696361e+59, 50, 9.5000000000000000 },
1670 { 3.6194312967780793e+59, 50, 9.6000000000000014 },
1671 { 9.6739828066585787e+59, 50, 9.6999999999999993 },
1672 { 2.4344814863741168e+60, 50, 9.8000000000000007 },
1673 { 5.8466703062265247e+60, 50, 9.8999999999999986 },
1674 { 1.3516643049819314e+61, 50, 10.000000000000000 },
1677 // Test function for n=50.
1678 template<typename Tp
>
1682 bool test
__attribute__((unused
)) = true;
1683 const Tp eps
= std::numeric_limits
<Tp
>::epsilon();
1684 Tp max_abs_diff
= -Tp(1);
1685 Tp max_abs_frac
= -Tp(1);
1686 unsigned int num_datum
= sizeof(data007
)
1687 / sizeof(testcase_hermite
<double>);
1688 for (unsigned int i
= 0; i
< num_datum
; ++i
)
1690 const Tp f
= std::tr1::hermite(Tp(data007
[i
].n
), Tp(data007
[i
].x
));
1691 const Tp f0
= data007
[i
].f0
;
1692 const Tp diff
= f
- f0
;
1693 if (std::abs(diff
) > max_abs_diff
)
1694 max_abs_diff
= std::abs(diff
);
1695 if (std::abs(f0
) > Tp(10) * eps
1696 && std::abs(f
) > Tp(10) * eps
)
1698 const Tp frac
= diff
/ f0
;
1699 if (std::abs(frac
) > max_abs_frac
)
1700 max_abs_frac
= std::abs(frac
);
1703 VERIFY(max_abs_frac
< Tp(2.5000000000000020e-13));
1706 // Test data for n=100.
1707 // max(|f - f_GSL|): 0.0000000000000000
1708 // max(|f - f_GSL| / |f_GSL|): 0.0000000000000000
1709 testcase_hermite
<double>
1712 { -1.8738689223256612e+115, 100, -10.000000000000000 },
1713 { -4.4232904120311186e+114, 100, -9.9000000000000004 },
1714 { 8.3761676654305186e+113, 100, -9.8000000000000007 },
1715 { 9.4857435427570856e+113, 100, -9.6999999999999993 },
1716 { 2.4904626130429828e+113, 100, -9.5999999999999996 },
1717 { -4.2265051766934789e+112, 100, -9.5000000000000000 },
1718 { -5.3374224541142079e+112, 100, -9.4000000000000004 },
1719 { -1.3977488190034162e+112, 100, -9.3000000000000007 },
1720 { 2.9686037583393142e+111, 100, -9.1999999999999993 },
1721 { 3.3341330166544008e+111, 100, -9.0999999999999996 },
1722 { 7.7294136683043515e+110, 100, -9.0000000000000000 },
1723 { -2.6071876743328352e+110, 100, -8.9000000000000004 },
1724 { -2.2669773300293168e+110, 100, -8.8000000000000007 },
1725 { -3.8930624477368766e+109, 100, -8.6999999999999993 },
1726 { 2.5386102824684956e+109, 100, -8.5999999999999996 },
1727 { 1.6203702280499544e+109, 100, -8.5000000000000000 },
1728 { 1.2481735250539652e+108, 100, -8.4000000000000004 },
1729 { -2.5611278359589723e+108, 100, -8.3000000000000007 },
1730 { -1.1534178973583771e+108, 100, -8.1999999999999993 },
1731 { 8.4932594446954126e+106, 100, -8.0999999999999996 },
1732 { 2.5761505535443451e+107, 100, -8.0000000000000000 },
1733 { 7.3445622927437730e+106, 100, -7.9000000000000004 },
1734 { -2.7252309851017323e+106, 100, -7.7999999999999998 },
1735 { -2.4850432648124068e+106, 100, -7.7000000000000002 },
1736 { -2.7486638813238851e+105, 100, -7.5999999999999996 },
1737 { 4.4772364475394960e+105, 100, -7.5000000000000000 },
1738 { 2.1375121759800508e+105, 100, -7.4000000000000004 },
1739 { -2.9237691057265876e+104, 100, -7.2999999999999998 },
1740 { -5.9348804074874781e+104, 100, -7.2000000000000002 },
1741 { -1.2947583568692734e+104, 100, -7.0999999999999996 },
1742 { 1.0002273523275075e+104, 100, -7.0000000000000000 },
1743 { 6.4900499886057735e+103, 100, -6.9000000000000004 },
1744 { -3.7817730019124298e+102, 100, -6.7999999999999998 },
1745 { -1.7849709684883137e+103, 100, -6.7000000000000002 },
1746 { -4.8039047085580619e+102, 100, -6.5999999999999996 },
1747 { 3.2072472002047670e+102, 100, -6.5000000000000000 },
1748 { 2.3341289432999226e+102, 100, -6.4000000000000004 },
1749 { -1.4587350659146165e+101, 100, -6.2999999999999998 },
1750 { -7.0672139150705532e+101, 100, -6.2000000000000002 },
1751 { -1.8039133351601998e+101, 100, -6.0999999999999996 },
1752 { 1.5170693933260738e+101, 100, -6.0000000000000000 },
1753 { 1.0141407690966954e+101, 100, -5.9000000000000004 },
1754 { -1.5140717605507886e+100, 100, -5.7999999999999998 },
1755 { -3.6379102593330533e+100, 100, -5.7000000000000002 },
1756 { -6.2933057672779134e+99, 100, -5.5999999999999996 },
1757 { 9.9309186425970402e+99, 100, -5.5000000000000000 },
1758 { 5.0935670879056567e+99, 100, -5.4000000000000004 },
1759 { -1.8337906983006129e+99, 100, -5.2999999999999998 },
1760 { -2.3096466887887402e+99, 100, -5.2000000000000002 },
1761 { -4.0259235416602546e+97, 100, -5.0999999999999996 },
1762 { 8.1931937130591466e+98, 100, -5.0000000000000000 },
1763 { 2.5601172475776894e+98, 100, -4.9000000000000004 },
1764 { -2.3193021196802698e+98, 100, -4.7999999999999998 },
1765 { -1.6545238014142802e+98, 100, -4.7000000000000002 },
1766 { 4.2440218943299170e+97, 100, -4.5999999999999996 },
1767 { 7.8073853756187101e+97, 100, -4.5000000000000000 },
1768 { 5.2136163919277588e+96, 100, -4.4000000000000004 },
1769 { -3.0837503404959950e+97, 100, -4.2999999999999998 },
1770 { -1.0988290456447777e+97, 100, -4.2000000000000002 },
1771 { 1.0173847230741884e+97, 100, -4.0999999999999996 },
1772 { 7.7070682747643550e+96, 100, -4.0000000000000000 },
1773 { -2.3947326745293331e+96, 100, -3.9000000000000004 },
1774 { -4.1993887070961596e+96, 100, -3.7999999999999998 },
1775 { -5.5521768050542138e+94, 100, -3.7000000000000002 },
1776 { 1.9852724296241180e+96, 100, -3.5999999999999996 },
1777 { 5.7841213444838915e+95, 100, -3.5000000000000000 },
1778 { -8.2433116644948570e+95, 100, -3.4000000000000004 },
1779 { -5.2035951331058195e+95, 100, -3.2999999999999998 },
1780 { 2.8212012454566057e+95, 100, -3.2000000000000002 },
1781 { 3.5161870090563867e+95, 100, -3.0999999999999996 },
1782 { -5.5084542871196523e+94, 100, -3.0000000000000000 },
1783 { -2.0784160746797610e+95, 100, -2.9000000000000004 },
1784 { -2.6058116248679496e+94, 100, -2.7999999999999998 },
1785 { 1.1147132226581844e+95, 100, -2.7000000000000002 },
1786 { 4.5607706742532875e+94, 100, -2.5999999999999996 },
1787 { -5.3758761713337664e+94, 100, -2.5000000000000000 },
1788 { -4.2303228932575769e+94, 100, -2.4000000000000004 },
1789 { 2.1691501564685499e+94, 100, -2.2999999999999998 },
1790 { 3.2602488340116974e+94, 100, -2.2000000000000002 },
1791 { -5.0527155039787607e+93, 100, -2.0999999999999996 },
1792 { -2.2785574311661325e+94, 100, -2.0000000000000000 },
1793 { -2.8549527653152903e+93, 100, -1.9000000000000004 },
1794 { 1.4787573463714363e+94, 100, -1.8000000000000007 },
1795 { 6.0554070654771248e+93, 100, -1.6999999999999993 },
1796 { -8.8496828346970978e+93, 100, -1.5999999999999996 },
1797 { -6.8402151897169509e+93, 100, -1.5000000000000000 },
1798 { 4.6555468819923166e+93, 100, -1.4000000000000004 },
1799 { 6.4625437128323579e+93, 100, -1.3000000000000007 },
1800 { -1.7820042440391653e+93, 100, -1.1999999999999993 },
1801 { -5.5814393347235886e+93, 100, -1.0999999999999996 },
1802 { -1.4487067293379347e+92, 100, -1.0000000000000000 },
1803 { 4.5268398678911204e+93, 100, -0.90000000000000036 },
1804 { 1.4120762149478435e+93, 100, -0.80000000000000071 },
1805 { -3.4510765981144258e+93, 100, -0.69999999999999929 },
1806 { -2.2242581581553176e+93, 100, -0.59999999999999964 },
1807 { 2.4129827902061037e+93, 100, -0.50000000000000000 },
1808 { 2.7195429139752497e+93, 100, -0.40000000000000036 },
1809 { -1.4235309630836904e+93, 100, -0.30000000000000071 },
1810 { -2.9850618739468043e+93, 100, -0.19999999999999929 },
1811 { 4.7017027479251074e+92, 100, -0.099999999999999645 },
1812 { 3.0685187562549660e+93, 100, 0.0000000000000000 },
1813 { 4.7017027479251074e+92, 100, 0.099999999999999645 },
1814 { -2.9850618739468043e+93, 100, 0.19999999999999929 },
1815 { -1.4235309630836904e+93, 100, 0.30000000000000071 },
1816 { 2.7195429139752497e+93, 100, 0.40000000000000036 },
1817 { 2.4129827902061037e+93, 100, 0.50000000000000000 },
1818 { -2.2242581581553176e+93, 100, 0.59999999999999964 },
1819 { -3.4510765981144258e+93, 100, 0.69999999999999929 },
1820 { 1.4120762149478435e+93, 100, 0.80000000000000071 },
1821 { 4.5268398678911204e+93, 100, 0.90000000000000036 },
1822 { -1.4487067293379347e+92, 100, 1.0000000000000000 },
1823 { -5.5814393347235886e+93, 100, 1.0999999999999996 },
1824 { -1.7820042440391653e+93, 100, 1.1999999999999993 },
1825 { 6.4625437128323579e+93, 100, 1.3000000000000007 },
1826 { 4.6555468819923166e+93, 100, 1.4000000000000004 },
1827 { -6.8402151897169509e+93, 100, 1.5000000000000000 },
1828 { -8.8496828346970978e+93, 100, 1.5999999999999996 },
1829 { 6.0554070654771248e+93, 100, 1.6999999999999993 },
1830 { 1.4787573463714363e+94, 100, 1.8000000000000007 },
1831 { -2.8549527653152903e+93, 100, 1.9000000000000004 },
1832 { -2.2785574311661325e+94, 100, 2.0000000000000000 },
1833 { -5.0527155039787607e+93, 100, 2.0999999999999996 },
1834 { 3.2602488340116774e+94, 100, 2.1999999999999993 },
1835 { 2.1691501564685076e+94, 100, 2.3000000000000007 },
1836 { -4.2303228932575769e+94, 100, 2.4000000000000004 },
1837 { -5.3758761713337664e+94, 100, 2.5000000000000000 },
1838 { 4.5607706742532875e+94, 100, 2.5999999999999996 },
1839 { 1.1147132226581881e+95, 100, 2.6999999999999993 },
1840 { -2.6058116248681564e+94, 100, 2.8000000000000007 },
1841 { -2.0784160746797610e+95, 100, 2.9000000000000004 },
1842 { -5.5084542871196523e+94, 100, 3.0000000000000000 },
1843 { 3.5161870090563867e+95, 100, 3.0999999999999996 },
1844 { 2.8212012454566478e+95, 100, 3.1999999999999993 },
1845 { -5.2035951331058918e+95, 100, 3.3000000000000007 },
1846 { -8.2433116644948570e+95, 100, 3.4000000000000004 },
1847 { 5.7841213444838915e+95, 100, 3.5000000000000000 },
1848 { 1.9852724296241180e+96, 100, 3.5999999999999996 },
1849 { -5.5521768050503009e+94, 100, 3.6999999999999993 },
1850 { -4.1993887070961795e+96, 100, 3.8000000000000007 },
1851 { -2.3947326745293331e+96, 100, 3.9000000000000004 },
1852 { 7.7070682747643550e+96, 100, 4.0000000000000000 },
1853 { 1.0173847230741884e+97, 100, 4.0999999999999996 },
1854 { -1.0988290456447506e+97, 100, 4.1999999999999993 },
1855 { -3.0837503404959957e+97, 100, 4.3000000000000007 },
1856 { 5.2136163919277588e+96, 100, 4.4000000000000004 },
1857 { 7.8073853756187101e+97, 100, 4.5000000000000000 },
1858 { 4.2440218943299170e+97, 100, 4.5999999999999996 },
1859 { -1.6545238014142650e+98, 100, 4.6999999999999993 },
1860 { -2.3193021196802549e+98, 100, 4.8000000000000007 },
1861 { 2.5601172475776894e+98, 100, 4.9000000000000004 },
1862 { 8.1931937130591466e+98, 100, 5.0000000000000000 },
1863 { -4.0259235416602546e+97, 100, 5.0999999999999996 },
1864 { -2.3096466887887237e+99, 100, 5.1999999999999993 },
1865 { -1.8337906983005823e+99, 100, 5.3000000000000007 },
1866 { 5.0935670879056567e+99, 100, 5.4000000000000004 },
1867 { 9.9309186425970402e+99, 100, 5.5000000000000000 },
1868 { -6.2933057672779134e+99, 100, 5.5999999999999996 },
1869 { -3.6379102593330386e+100, 100, 5.6999999999999993 },
1870 { -1.5140717605507249e+100, 100, 5.8000000000000007 },
1871 { 1.0141407690966954e+101, 100, 5.9000000000000004 },
1872 { 1.5170693933260738e+101, 100, 6.0000000000000000 },
1873 { -1.8039133351602961e+101, 100, 6.1000000000000014 },
1874 { -7.0672139150705246e+101, 100, 6.1999999999999993 },
1875 { -1.4587350659144549e+101, 100, 6.3000000000000007 },
1876 { 2.3341289432998748e+102, 100, 6.3999999999999986 },
1877 { 3.2072472002047670e+102, 100, 6.5000000000000000 },
1878 { -4.8039047085582927e+102, 100, 6.6000000000000014 },
1879 { -1.7849709684883083e+103, 100, 6.6999999999999993 },
1880 { -3.7817730019120996e+102, 100, 6.8000000000000007 },
1881 { 6.4900499886056430e+103, 100, 6.8999999999999986 },
1882 { 1.0002273523275075e+104, 100, 7.0000000000000000 },
1883 { -1.2947583568693485e+104, 100, 7.1000000000000014 },
1884 { -5.9348804074874565e+104, 100, 7.1999999999999993 },
1885 { -2.9237691057264679e+104, 100, 7.3000000000000007 },
1886 { 2.1375121759799924e+105, 100, 7.3999999999999986 },
1887 { 4.4772364475394960e+105, 100, 7.5000000000000000 },
1888 { -2.7486638813241244e+105, 100, 7.6000000000000014 },
1889 { -2.4850432648123868e+106, 100, 7.6999999999999993 },
1890 { -2.7252309851017070e+106, 100, 7.8000000000000007 },
1891 { 7.3445622927434568e+106, 100, 7.8999999999999986 },
1892 { 2.5761505535443451e+107, 100, 8.0000000000000000 },
1893 { 8.4932594446944218e+106, 100, 8.1000000000000014 },
1894 { -1.1534178973583771e+108, 100, 8.1999999999999993 },
1895 { -2.5611278359589723e+108, 100, 8.3000000000000007 },
1896 { 1.2481735250538004e+108, 100, 8.3999999999999986 },
1897 { 1.6203702280499544e+109, 100, 8.5000000000000000 },
1898 { 2.5386102824684747e+109, 100, 8.6000000000000014 },
1899 { -3.8930624477368766e+109, 100, 8.6999999999999993 },
1900 { -2.2669773300293168e+110, 100, 8.8000000000000007 },
1901 { -2.6071876743328939e+110, 100, 8.8999999999999986 },
1902 { 7.7294136683043515e+110, 100, 9.0000000000000000 },
1903 { 3.3341330166544429e+111, 100, 9.1000000000000014 },
1904 { 2.9686037583393142e+111, 100, 9.1999999999999993 },
1905 { -1.3977488190034162e+112, 100, 9.3000000000000007 },
1906 { -5.3374224541141370e+112, 100, 9.3999999999999986 },
1907 { -4.2265051766934789e+112, 100, 9.5000000000000000 },
1908 { 2.4904626130430740e+113, 100, 9.6000000000000014 },
1909 { 9.4857435427570856e+113, 100, 9.6999999999999993 },
1910 { 8.3761676654305186e+113, 100, 9.8000000000000007 },
1911 { -4.4232904120309469e+114, 100, 9.8999999999999986 },
1912 { -1.8738689223256612e+115, 100, 10.000000000000000 },
1915 // Test function for n=100.
1916 template<typename Tp
>
1920 bool test
__attribute__((unused
)) = true;
1921 const Tp eps
= std::numeric_limits
<Tp
>::epsilon();
1922 Tp max_abs_diff
= -Tp(1);
1923 Tp max_abs_frac
= -Tp(1);
1924 unsigned int num_datum
= sizeof(data008
)
1925 / sizeof(testcase_hermite
<double>);
1926 for (unsigned int i
= 0; i
< num_datum
; ++i
)
1928 const Tp f
= std::tr1::hermite(Tp(data008
[i
].n
), Tp(data008
[i
].x
));
1929 const Tp f0
= data008
[i
].f0
;
1930 const Tp diff
= f
- f0
;
1931 if (std::abs(diff
) > max_abs_diff
)
1932 max_abs_diff
= std::abs(diff
);
1933 if (std::abs(f0
) > Tp(10) * eps
1934 && std::abs(f
) > Tp(10) * eps
)
1936 const Tp frac
= diff
/ f0
;
1937 if (std::abs(frac
) > max_abs_frac
)
1938 max_abs_frac
= std::abs(frac
);
1941 VERIFY(max_abs_frac
< Tp(2.5000000000000020e-13));