Skip to content

Commit c95226b

Browse files
committed
Handle further review comments
1 parent 0703718 commit c95226b

File tree

4 files changed

+144
-175
lines changed

4 files changed

+144
-175
lines changed

test/Jamfile.v2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ test-suite special_fun :
201201
[ run git_issue_1249.cpp /boost/test//boost_unit_test_framework : : : [ check-target-builds ../config//is_ci_sanitizer_run "Santizer Build" : : <build>no ] ]
202202
[ run git_issue_1255.cpp ]
203203
[ run git_issue_1247.cpp ]
204-
[ run git_issue_1292.cpp ]
205204
[ run special_functions_test.cpp /boost/test//boost_unit_test_framework ]
206205
[ run test_airy.cpp test_instances//test_instances pch_light /boost/test//boost_unit_test_framework ]
207206
[ run test_bessel_j.cpp test_instances//test_instances pch_light /boost/test//boost_unit_test_framework ]

test/git_issue_1292.cpp

Lines changed: 0 additions & 170 deletions
This file was deleted.

test/test_bessel_j.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,3 @@ BOOST_AUTO_TEST_CASE( test_main )
345345
"to pass.</note>" << std::endl;
346346
#endif
347347
}
348-
349-
350-
351-

test/test_bessel_j.hpp

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,146 @@ void do_test_sph_bessel_j(const T& data, const char* type_name, const char* test
128128
#endif
129129
}
130130

131+
template<class T>
132+
auto test_issue1292_n() -> void
133+
{
134+
using local_ctrl_array_type = std::array<T, std::size_t { UINT8_C(43) }>;
135+
136+
// Table[N[BesselJ[3, n/10], 40], {n, 9, 51, 1}]
137+
const local_ctrl_array_type ctrl_data =
138+
{{
139+
SC_(0.01443402847586617545767791623904539755731),
140+
SC_(0.01956335398266840591890532162175150825451),
141+
SC_(0.02569452861246328174726417617756888741432),
142+
SC_(0.03287433692499494270867882730165246683837),
143+
SC_(0.04113582571991693187673486447516908751463),
144+
SC_(0.05049771328895129623567992727476043273558),
145+
SC_(0.06096395114113963064394955997646387979571),
146+
SC_(0.07252344333261900300034928368068248675877),
147+
SC_(0.08514992694801526415321095754253909148633),
148+
SC_(0.09880201565861918291536618746528733463749),
149+
SC_(0.1134234066389601112649841240858617923591),
150+
SC_(0.1289432494744020510987933329692398352700),
151+
SC_(0.1452766740542063665759023355570418120750),
152+
SC_(0.1623254728332874543121706910035271736854),
153+
SC_(0.1799789312775334540800304157279732327839),
154+
SC_(0.1981147987975668248498434552081155790183),
155+
SC_(0.2166003910391135247666890035159637217168),
156+
SC_(0.2352938130489638091015220916013129483423),
157+
SC_(0.2540452915872273499615464996563039918262),
158+
SC_(0.2726986037216204380267188592437356599939),
159+
SC_(0.2910925878291867784836313080855848616815),
160+
SC_(0.3090627222552516436182601949468331494291),
161+
SC_(0.3264427561473409695937042738575781129080),
162+
SC_(0.3430663764006682009386373318558777864023),
163+
SC_(0.3587688942275418259451574456258027163924),
164+
SC_(0.3733889346000900583527754127339797472980),
165+
SC_(0.3867701117168813668578718121131100327218),
166+
SC_(0.3987626737105880326848194417650226836608),
167+
SC_(0.4092251000454309977422936498249743734653),
168+
SC_(0.4180256354477855744864458808409348352597),
169+
SC_(0.4250437447674560017637404058105525727991),
170+
SC_(0.4301714738756219403581834788533355563393),
171+
SC_(0.4333147025616927046073022200802734463060),
172+
SC_(0.4343942763872007823091130214493427347554),
173+
SC_(0.4333470055809823422144251313032973397899),
174+
SC_(0.4301265203055088083605755042771532591535),
175+
SC_(0.4247039729774556002468140098011553543390),
176+
SC_(0.4170685797734672711167804755454067582755),
177+
SC_(0.4072279949807128989552790124633945783765),
178+
SC_(0.3952085134465309348696666123753181072022),
179+
SC_(0.3810550980268886849843356923521907577982),
180+
SC_(0.3648312306136669944635769493587219791343),
181+
SC_(0.3466185870197064968846647990300282094299)
182+
}};
183+
184+
int n_val { 9 };
185+
186+
const T tolerance { 128 * std::numeric_limits<T>::epsilon() };
187+
188+
for(std::size_t index { UINT8_C(0) }; index < std::tuple_size<local_ctrl_array_type>::value; ++index)
189+
{
190+
const T x_val { static_cast<T>(static_cast<T>(n_val) / 10) };
191+
192+
const T jn_val { boost::math::cyl_bessel_j(3, x_val) };
193+
194+
++n_val;
195+
196+
BOOST_CHECK_CLOSE_FRACTION(jn_val, ctrl_data[index], tolerance);
197+
}
198+
}
199+
200+
template<class T>
201+
auto test_issue1292_vu() -> void
202+
{
203+
using local_ctrl_array_type = std::array<T, std::size_t { UINT8_C(43) }>;
204+
205+
// Table[N[BesselJ[31 / 10, n/10], 40], {n, 9, 51, 1}]
206+
const local_ctrl_array_type ctrl_data =
207+
{{
208+
SC_(0.01175139795214295170487105485346781171863),
209+
SC_(0.01610092560641321584451701371378836908343),
210+
SC_(0.02135659148701787280713314897691402425560),
211+
SC_(0.02757316602094671775387912184375438913864),
212+
SC_(0.03479372470942323424236519547108889796879),
213+
SC_(0.04304884612770317349181083608393216357649),
214+
SC_(0.05235595486839477302545989170267853515412),
215+
SC_(0.06271881444009116864560457340917173135492),
216+
SC_(0.07412717428914531462554459978389560408816),
217+
SC_(0.08655657401374878955779092959288219537482),
218+
SC_(0.09996830657138141192006478769855556316995),
219+
SC_(0.1143095409011066041623799431143340837007),
220+
SC_(0.1295136029333754366226206053365805922136),
221+
SC_(0.1455004124749064242445094865982308151833),
222+
SC_(0.1621770719619318324763655518038365467780),
223+
SC_(0.1794386015949089605595848208470049166853),
224+
SC_(0.1971688139222575484595939469080319406355),
225+
SC_(0.2152413195483352761119610246805962611319),
226+
SC_(0.2335206543185642795903443565627832597552),
227+
SC_(0.2518635170977563283446184976264924077045),
228+
SC_(0.2701201061202457234361463802484836927464),
229+
SC_(0.2881355408650536940851830262098172944660),
230+
SC_(0.3057513555072237123913927136839853900197),
231+
SC_(0.3228070492275195774383850177821175151772),
232+
SC_(0.3391416780352496831991017115498371039332),
233+
SC_(0.3545954722799571667706920253581728149226),
234+
SC_(0.3690114637024459111815176585531943143085),
235+
SC_(0.3822371057078773326211699424651752096338),
236+
SC_(0.3941258705356621024731438508712990073773),
237+
SC_(0.4045388071531719615179931506197074798366),
238+
SC_(0.4133460440118967760814988295083688541739),
239+
SC_(0.4204282212729730452147271372029342292548),
240+
SC_(0.4256778377298582292448895379334671298297),
241+
SC_(0.4290004984236535775073755577697874033289),
242+
SC_(0.4303160498540635572666996674883665298558),
243+
SC_(0.4295595907277138677145484170304736319185),
244+
SC_(0.4266823473457215250850626209433240464185),
245+
SC_(0.4216524040030023831246842156638018726147),
246+
SC_(0.4144552801406973126588418824207056743782),
247+
SC_(0.4050943474472003316564108983454900189419),
248+
SC_(0.3935910816286283019261303507307813773886),
249+
SC_(0.3799851451515116989978414766085547417497),
250+
SC_(0.3643342988837623802358278078893847672838)
251+
}};
252+
253+
int n_val { 9 };
254+
255+
const T vu_val { static_cast<T>(static_cast<T>(31) / 10) };
256+
257+
const T tolerance { 128 * std::numeric_limits<T>::epsilon() };
258+
259+
for(std::size_t index { UINT8_C(0) }; index < std::tuple_size<local_ctrl_array_type>::value; ++index)
260+
{
261+
const T x_val { static_cast<T>(static_cast<T>(n_val) / 10) };
262+
263+
const T jn_val { boost::math::cyl_bessel_j(vu_val, x_val) };
264+
265+
++n_val;
266+
267+
BOOST_CHECK_CLOSE_FRACTION(jn_val, ctrl_data[index], tolerance);
268+
}
269+
}
270+
131271
template <class T>
132272
void test_bessel(T, const char* name)
133273
{
@@ -261,6 +401,10 @@ void test_bessel(T, const char* name)
261401
//
262402
// Some special cases:
263403
//
404+
405+
test_issue1292_n<double>();
406+
test_issue1292_vu<double>();
407+
264408
BOOST_CHECK_EQUAL(boost::math::sph_bessel(0, T(0)), T(1));
265409
BOOST_CHECK_EQUAL(boost::math::sph_bessel(1, T(0)), T(0));
266410
BOOST_CHECK_EQUAL(boost::math::sph_bessel(100000, T(0)), T(0));

0 commit comments

Comments
 (0)