diff --git a/include/oneapi/dpl/cmath b/include/oneapi/dpl/cmath index 5a0b165496d..3f9cfdf3ffb 100644 --- a/include/oneapi/dpl/cmath +++ b/include/oneapi/dpl/cmath @@ -37,6 +37,15 @@ using ::std::copysign; using ::std::copysignf; using ::std::cos; using ::std::cosh; +using ::std::cyl_bessel_i; // https://learn.microsoft.com/en-us/cpp/standard-library/cmath?view=msvc-170#regular-modified-cylindrical-bessel-functions +using ::std::cyl_bessel_if; // https://learn.microsoft.com/en-us/cpp/standard-library/cmath?view=msvc-170#regular-modified-cylindrical-bessel-functions +using ::std::cyl_bessel_il; // https://learn.microsoft.com/en-us/cpp/standard-library/cmath?view=msvc-170#regular-modified-cylindrical-bessel-functions +using ::std::cyl_bessel_j; // https://learn.microsoft.com/en-us/cpp/standard-library/cmath?view=msvc-170#cylindrical-bessel-functions-of-the-first-kind +using ::std::cyl_bessel_jf; // https://learn.microsoft.com/en-us/cpp/standard-library/cmath?view=msvc-170#cylindrical-bessel-functions-of-the-first-kind +using ::std::cyl_bessel_jl; // https://learn.microsoft.com/en-us/cpp/standard-library/cmath?view=msvc-170#cylindrical-bessel-functions-of-the-first-kind +using ::std::cyl_bessel_k; // https://learn.microsoft.com/en-us/cpp/standard-library/cmath?view=msvc-170#irregular-modified-cylindrical-bessel-functions +using ::std::cyl_bessel_kf; // https://learn.microsoft.com/en-us/cpp/standard-library/cmath?view=msvc-170#irregular-modified-cylindrical-bessel-functions +using ::std::cyl_bessel_kl; // https://learn.microsoft.com/en-us/cpp/standard-library/cmath?view=msvc-170#irregular-modified-cylindrical-bessel-functions using ::std::erf; using ::std::erfc; using ::std::exp; diff --git a/test/support/specfun_testcase.h b/test/support/specfun_testcase.h new file mode 100644 index 00000000000..39f16a7996c --- /dev/null +++ b/test/support/specfun_testcase.h @@ -0,0 +1,68 @@ +// Copyright (C) 2015-2022 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// specfun_testcase.h.h + +// +// These are little PODs for special function inputs and +// expexted results for the testsuite. +// + +#ifndef _TEST_SPECFUN_TESTCASE_H +#define _TEST_SPECFUN_TESTCASE_H + +// Generic cylindrical Bessel functions. +template +struct testcase_cyl_bessel +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// Regular modified cylindrical Bessel functions. +template +struct testcase_cyl_bessel_i +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// Cylindrical Bessel functions (of the first kind). +template +struct testcase_cyl_bessel_j +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// Irregular modified cylindrical Bessel functions. +template +struct testcase_cyl_bessel_k +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +#endif // _TEST_SPECFUN_TESTCASE_H diff --git a/test/support/test_bessel.h b/test/support/test_bessel.h new file mode 100644 index 00000000000..418fc0f3897 --- /dev/null +++ b/test/support/test_bessel.h @@ -0,0 +1,48 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Copyright (C) Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// This file incorporates work covered by the following copyright and permission +// notice: +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// +//===----------------------------------------------------------------------===// + +#ifndef _TEST_BESSEL_H +#define _TEST_BESSEL_H + +#define __STDCPP_WANT_MATH_SPEC_FUNCS__ 1 + +#ifdef __SYCL_DEVICE_ONLY__ + +// Required to define these before all includes +namespace std +{ + SYCL_EXTERNAL void __throw_domain_error(const char*) + { + } +}; + +// Required to define these before all includes +namespace std +{ + SYCL_EXTERNAL void __throw_runtime_error(const char*) + { + } +}; + +#endif // __SYCL_DEVICE_ONLY__ + +#include "test_complex.h" +#include "specfun_testcase.h" + +#include +#include +#include + +#endif // _TEST_BESSEL_H diff --git a/test/support/test_config.h b/test/support/test_config.h index f02e6d8e7da..0fee6705367 100644 --- a/test/support/test_config.h +++ b/test/support/test_config.h @@ -228,6 +228,12 @@ #define _PSTL_TEST_COMPLEX_DIV_COMPLEX_BROKEN _PSTL_TEST_COMPLEX_OP_BROKEN #define _PSTL_TEST_COMPLEX_DIV_COMPLEX_BROKEN_IN_INTEL_LLVM_COMPILER _PSTL_TEST_COMPLEX_OP_BROKEN_IN_INTEL_LLVM_COMPILER +#if __SYCL_DEVICE_ONLY__ && _MSVC_STL_VERSION && _MSVC_STL_VERSION > 0 +# define _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT 0 +#else +# define _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT 1 +#endif + #define _PSTL_ICC_TEST_UNDERLYING_TYPE_BROKEN (_GLIBCXX_RELEASE && _GLIBCXX_RELEASE < 9) // Known limitation: diff --git a/test/xpu_api/numerics/special/bessel/bessel_i_check.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_i_check.pass.cpp new file mode 100644 index 00000000000..004773d5f3c --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_i_check.pass.cpp @@ -0,0 +1,688 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +// cyl_bessel_i +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +// Test data for nu=0.0000000000000000. +// max(|f - f_GSL|): 5.2402526762307389e-14 at index 12 +// max(|f - f_GSL| / |f_GSL|): 1.0747725055352992e-14 +// mean(f - f_GSL): -1.9624513654326576e-14 +// variance(f - f_GSL): 4.0630093099383162e-30 +// stddev(f - f_GSL): 2.0156907773610308e-15 +const testcase_cyl_bessel_i data007[21] = { + {1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0}, + {1.0156861412236078, 0.0000000000000000, 0.25000000000000000, 0.0}, + {1.0634833707413236, 0.0000000000000000, 0.50000000000000000, 0.0}, + {1.1456467780440014, 0.0000000000000000, 0.75000000000000000, 0.0}, + {1.2660658777520082, 0.0000000000000000, 1.0000000000000000, 0.0}, + {1.4304687177218294, 0.0000000000000000, 1.2500000000000000, 0.0}, + {1.6467231897728904, 0.0000000000000000, 1.5000000000000000, 0.0}, + {1.9252521538585021, 0.0000000000000000, 1.7500000000000000, 0.0}, + {2.2795853023360668, 0.0000000000000000, 2.0000000000000000, 0.0}, + {2.7270783071907951, 0.0000000000000000, 2.2500000000000000, 0.0}, + {3.2898391440501231, 0.0000000000000000, 2.5000000000000000, 0.0}, + {3.9959131072376550, 0.0000000000000000, 2.7500000000000000, 0.0}, + {4.8807925858650245, 0.0000000000000000, 3.0000000000000000, 0.0}, + {5.9893359979395138, 0.0000000000000000, 3.2500000000000000, 0.0}, + {7.3782034322254750, 0.0000000000000000, 3.5000000000000000, 0.0}, + {9.1189458608445655, 0.0000000000000000, 3.7500000000000000, 0.0}, + {11.301921952136325, 0.0000000000000000, 4.0000000000000000, 0.0}, + {14.041263683000595, 0.0000000000000000, 4.2500000000000000, 0.0}, + {17.481171855609272, 0.0000000000000000, 4.5000000000000000, 0.0}, + {21.803898740902120, 0.0000000000000000, 4.7500000000000000, 0.0}, + {27.239871823604439, 0.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler007 = 1.0000000000000008e-12; + +// Test data for nu=0.33333333333333331. +// max(|f - f_GSL|): 6.2172489379008766e-15 at index 14 +// max(|f - f_GSL| / |f_GSL|): 9.1624880778907085e-16 +// mean(f - f_GSL): 1.1525172350870673e-15 +// variance(f - f_GSL): 6.9735538801568761e-32 +// stddev(f - f_GSL): 2.6407487347638500e-16 +const testcase_cyl_bessel_i data008[21] = { + {0.0000000000000000, 0.33333333333333331, 0.0000000000000000, 0.0}, + {0.56650686557808660, 0.33333333333333331, 0.25000000000000000, 0.0}, + {0.73897315642511863, 0.33333333333333331, 0.50000000000000000, 0.0}, + {0.89532320365836815, 0.33333333333333331, 0.75000000000000000, 0.0}, + {1.0646313978895283, 0.33333333333333331, 1.0000000000000000, 0.0}, + {1.2623776732605250, 0.33333333333333331, 1.2500000000000000, 0.0}, + {1.5014290000224382, 0.33333333333333331, 1.5000000000000000, 0.0}, + {1.7951195525946040, 0.33333333333333331, 1.7500000000000000, 0.0}, + {2.1587825813728614, 0.33333333333333331, 2.0000000000000000, 0.0}, + {2.6109134564811405, 0.33333333333333331, 2.2500000000000000, 0.0}, + {3.1743242297241938, 0.33333333333333331, 2.5000000000000000, 0.0}, + {3.8774551722182093, 0.33333333333333331, 2.7500000000000000, 0.0}, + {4.7559569371646946, 0.33333333333333331, 3.0000000000000000, 0.0}, + {5.8546499652731825, 0.33333333333333331, 3.2500000000000000, 0.0}, + {7.2299798619171129, 0.33333333333333331, 3.5000000000000000, 0.0}, + {8.9531114355506318, 0.33333333333333331, 3.7500000000000000, 0.0}, + {11.113838389991479, 0.33333333333333331, 4.0000000000000000, 0.0}, + {13.825531136529117, 0.33333333333333331, 4.2500000000000000, 0.0}, + {17.231403968478318, 0.33333333333333331, 4.5000000000000000, 0.0}, + {21.512458099556554, 0.33333333333333331, 4.7500000000000000, 0.0}, + {26.897553069268362, 0.33333333333333331, 5.0000000000000000, 0.0}, +}; +const double toler008 = 2.5000000000000020e-13; + +// Test data for nu=0.50000000000000000. +// max(|f - f_GSL|): 1.4210854715202004e-14 at index 19 +// max(|f - f_GSL| / |f_GSL|): 9.6042704318763827e-16 +// mean(f - f_GSL): 1.9296733523246769e-16 +// variance(f - f_GSL): 1.9549106045027772e-33 +// stddev(f - f_GSL): 4.4214371017835108e-17 +const testcase_cyl_bessel_i data009[21] = { + {0.0000000000000000, 0.50000000000000000, 0.0000000000000000, 0.0}, + {0.40311093489975897, 0.50000000000000000, 0.25000000000000000, 0.0}, + {0.58799308679041573, 0.50000000000000000, 0.50000000000000000, 0.0}, + {0.75761498638991298, 0.50000000000000000, 0.75000000000000000, 0.0}, + {0.93767488824548695, 0.50000000000000000, 1.0000000000000000, 0.0}, + {1.1432089853159872, 0.50000000000000000, 1.2500000000000000, 0.0}, + {1.3871617204034761, 0.50000000000000000, 1.5000000000000000, 0.0}, + {1.6830217804556813, 0.50000000000000000, 1.7500000000000000, 0.0}, + {2.0462368630890526, 0.50000000000000000, 2.0000000000000000, 0.0}, + {2.4953405089360046, 0.50000000000000000, 2.2500000000000000, 0.0}, + {3.0530935381967175, 0.50000000000000000, 2.5000000000000000, 0.0}, + {3.7477882494879449, 0.50000000000000000, 2.7500000000000000, 0.0}, + {4.6148229034075969, 0.50000000000000000, 3.0000000000000000, 0.0}, + {5.6986505325335486, 0.50000000000000000, 3.2500000000000000, 0.0}, + {7.0552194086911859, 0.50000000000000000, 3.5000000000000000, 0.0}, + {8.7550467841188979, 0.50000000000000000, 3.7500000000000000, 0.0}, + {10.887101798588422, 0.50000000000000000, 4.0000000000000000, 0.0}, + {13.563718712579764, 0.50000000000000000, 4.2500000000000000, 0.0}, + {16.926820080158183, 0.50000000000000000, 4.5000000000000000, 0.0}, + {21.155804306570005, 0.50000000000000000, 4.7500000000000000, 0.0}, + {26.477547497559065, 0.50000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler009 = 2.5000000000000020e-13; + +// Test data for nu=0.66666666666666663. +// max(|f - f_GSL|): 1.9539925233402755e-14 at index 16 +// max(|f - f_GSL| / |f_GSL|): 2.2100364323953014e-15 +// mean(f - f_GSL): -5.2312651565075830e-15 +// variance(f - f_GSL): 1.4792059082391298e-31 +// stddev(f - f_GSL): 3.8460446022363414e-16 +const testcase_cyl_bessel_i data010[21] = { + {0.0000000000000000, 0.66666666666666663, 0.0000000000000000, 0.0}, + {0.27953690613200444, 0.66666666666666663, 0.25000000000000000, 0.0}, + {0.45628323113556890, 0.66666666666666663, 0.50000000000000000, 0.0}, + {0.62594569838182623, 0.66666666666666663, 0.75000000000000000, 0.0}, + {0.80752128860612971, 0.66666666666666663, 1.0000000000000000, 0.0}, + {1.0139484513577173, 0.66666666666666663, 1.2500000000000000, 0.0}, + {1.2572918396962993, 0.66666666666666663, 1.5000000000000000, 0.0}, + {1.5505806938325581, 0.66666666666666663, 1.7500000000000000, 0.0}, + {1.9089492968236210, 0.66666666666666663, 2.0000000000000000, 0.0}, + {2.3506463490300340, 0.66666666666666663, 2.2500000000000000, 0.0}, + {2.8981161894224896, 0.66666666666666663, 2.5000000000000000, 0.0}, + {3.5792654911068724, 0.66666666666666663, 2.7500000000000000, 0.0}, + {4.4290087213549514, 0.66666666666666663, 3.0000000000000000, 0.0}, + {5.4911895720097705, 0.66666666666666663, 3.2500000000000000, 0.0}, + {6.8209918044137305, 0.66666666666666663, 3.5000000000000000, 0.0}, + {8.4879784249619785, 0.66666666666666663, 3.7500000000000000, 0.0}, + {10.579932774013004, 0.66666666666666663, 4.0000000000000000, 0.0}, + {13.207720355482458, 0.66666666666666663, 4.2500000000000000, 0.0}, + {16.511448404200543, 0.66666666666666663, 4.5000000000000000, 0.0}, + {20.668274532832392, 0.66666666666666663, 4.7500000000000000, 0.0}, + {25.902310583215122, 0.66666666666666663, 5.0000000000000000, 0.0}, +}; +const double toler010 = 2.5000000000000020e-13; + +// Test data for nu=1.0000000000000000. +// max(|f - f_GSL|): 1.2967404927621828e-13 at index 17 +// max(|f - f_GSL| / |f_GSL|): 1.0977631741433893e-14 +// mean(f - f_GSL): -3.0188814411265717e-14 +// variance(f - f_GSL): 3.7247797767076778e-29 +// stddev(f - f_GSL): 6.1030973912495271e-15 +const testcase_cyl_bessel_i data011[21] = { + {0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0}, + {0.12597910894546793, 1.0000000000000000, 0.25000000000000000, 0.0}, + {0.25789430539089631, 1.0000000000000000, 0.50000000000000000, 0.0}, + {0.40199246158092228, 1.0000000000000000, 0.75000000000000000, 0.0}, + {0.56515910399248503, 1.0000000000000000, 1.0000000000000000, 0.0}, + {0.75528141834074725, 1.0000000000000000, 1.2500000000000000, 0.0}, + {0.98166642857790720, 1.0000000000000000, 1.5000000000000000, 0.0}, + {1.2555375122401728, 1.0000000000000000, 1.7500000000000000, 0.0}, + {1.5906368546373291, 1.0000000000000000, 2.0000000000000000, 0.0}, + {2.0039674569295931, 1.0000000000000000, 2.2500000000000000, 0.0}, + {2.5167162452886984, 1.0000000000000000, 2.5000000000000000, 0.0}, + {3.1554101386190028, 1.0000000000000000, 2.7500000000000000, 0.0}, + {3.9533702174026097, 1.0000000000000000, 3.0000000000000000, 0.0}, + {4.9525461659085490, 1.0000000000000000, 3.2500000000000000, 0.0}, + {6.2058349222583642, 1.0000000000000000, 3.5000000000000000, 0.0}, + {7.7800152298244170, 1.0000000000000000, 3.7500000000000000, 0.0}, + {9.7594651537044523, 1.0000000000000000, 4.0000000000000000, 0.0}, + {12.250874667409304, 1.0000000000000000, 4.2500000000000000, 0.0}, + {15.389222753735924, 1.0000000000000000, 4.5000000000000000, 0.0}, + {19.345361447520226, 1.0000000000000000, 4.7500000000000000, 0.0}, + {24.335642142450524, 1.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler011 = 1.0000000000000008e-12; + +// Test data for nu=2.0000000000000000. +// max(|f - f_GSL|): 1.8474111129762605e-13 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.0796880796865132e-14 +// mean(f - f_GSL): -3.8692841919903068e-14 +// variance(f - f_GSL): 1.1198300918819667e-27 +// stddev(f - f_GSL): 3.3463862477035829e-14 +const testcase_cyl_bessel_i data012[21] = { + {0.0000000000000000, 2.0000000000000000, 0.0000000000000000, 0.0}, + {0.0078532696598645167, 2.0000000000000000, 0.25000000000000000, 0.0}, + {0.031906149177738249, 2.0000000000000000, 0.50000000000000000, 0.0}, + {0.073666880494875436, 2.0000000000000000, 0.75000000000000000, 0.0}, + {0.13574766976703831, 2.0000000000000000, 1.0000000000000000, 0.0}, + {0.22201844837663415, 2.0000000000000000, 1.2500000000000000, 0.0}, + {0.33783461833568068, 2.0000000000000000, 1.5000000000000000, 0.0}, + {0.49035213986973314, 2.0000000000000000, 1.7500000000000000, 0.0}, + {0.68894844769873831, 2.0000000000000000, 2.0000000000000000, 0.0}, + {0.94577390103115722, 2.0000000000000000, 2.2500000000000000, 0.0}, + {1.2764661478191643, 2.0000000000000000, 2.5000000000000000, 0.0}, + {1.7010693700601991, 2.0000000000000000, 2.7500000000000000, 0.0}, + {2.2452124409299512, 2.0000000000000000, 3.0000000000000000, 0.0}, + {2.9416152804573357, 2.0000000000000000, 3.2500000000000000, 0.0}, + {3.8320120480778415, 2.0000000000000000, 3.5000000000000000, 0.0}, + {4.9696044049382113, 2.0000000000000000, 3.7500000000000000, 0.0}, + {6.4221893752841055, 2.0000000000000000, 4.0000000000000000, 0.0}, + {8.2761461924550552, 2.0000000000000000, 4.2500000000000000, 0.0}, + {10.641517298393307, 2.0000000000000000, 4.5000000000000000, 0.0}, + {13.658483394577813, 2.0000000000000000, 4.7500000000000000, 0.0}, + {17.505614966624233, 2.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler012 = 1.0000000000000008e-12; + +// Test data for nu=5.0000000000000000. +// max(|f - f_GSL|): 2.2204460492503131e-14 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.1379865680381910e-14 +// mean(f - f_GSL): -3.4502652328999478e-15 +// variance(f - f_GSL): 1.8465291591354433e-29 +// stddev(f - f_GSL): 4.2971259687556788e-15 +const testcase_cyl_bessel_i data013[21] = { + {0.0000000000000000, 5.0000000000000000, 0.0000000000000000, 0.0}, + {2.5497616449882785e-07, 5.0000000000000000, 0.25000000000000000, 0.0}, + {8.2231713131092646e-06, 5.0000000000000000, 0.50000000000000000, 0.0}, + {6.3261122739811725e-05, 5.0000000000000000, 0.75000000000000000, 0.0}, + {0.00027146315595697195, 5.0000000000000000, 1.0000000000000000, 0.0}, + {0.00084793613616686856, 5.0000000000000000, 1.2500000000000000, 0.0}, + {0.0021705595690975554, 5.0000000000000000, 1.5000000000000000, 0.0}, + {0.0048504513371845385, 5.0000000000000000, 1.7500000000000000, 0.0}, + {0.0098256793231317023, 5.0000000000000000, 2.0000000000000000, 0.0}, + {0.018486577941045829, 5.0000000000000000, 2.2500000000000000, 0.0}, + {0.032843475172023219, 5.0000000000000000, 2.5000000000000000, 0.0}, + {0.055750882754221943, 5.0000000000000000, 2.7500000000000000, 0.0}, + {0.091206477661513338, 5.0000000000000000, 3.0000000000000000, 0.0}, + {0.14474880546308083, 5.0000000000000000, 3.2500000000000000, 0.0}, + {0.22398495470190780, 5.0000000000000000, 3.5000000000000000, 0.0}, + {0.33928899170999877, 5.0000000000000000, 3.7500000000000000, 0.0}, + {0.50472436311316637, 5.0000000000000000, 4.0000000000000000, 0.0}, + {0.73925961816682961, 5.0000000000000000, 4.2500000000000000, 0.0}, + {1.0683677743764701, 5.0000000000000000, 4.5000000000000000, 0.0}, + {1.5261268693599621, 5.0000000000000000, 4.7500000000000000, 0.0}, + {2.1579745473225476, 5.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler013 = 1.0000000000000008e-12; + +// Test data for nu=10.000000000000000. +// max(|f - f_GSL|): 5.0306980803327406e-17 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.2741587624782699e-14 +// mean(f - f_GSL): -5.4602116438803446e-18 +// variance(f - f_GSL): 1.0558971696213844e-34 +// stddev(f - f_GSL): 1.0275685717368863e-17 +const testcase_cyl_bessel_i data014[21] = { + {0.0000000000000000, 10.000000000000000, 0.0000000000000000, 0.0}, + {2.5701232848571186e-16, 10.000000000000000, 0.25000000000000000, 0.0}, + {2.6430419258812784e-13, 10.000000000000000, 0.50000000000000000, 0.0}, + {1.5349659676120412e-11, 10.000000000000000, 0.75000000000000000, 0.0}, + {2.7529480398368732e-10, 10.000000000000000, 1.0000000000000000, 0.0}, + {2.5967897782035928e-09, 10.000000000000000, 1.2500000000000000, 0.0}, + {1.6330924437799743e-08, 10.000000000000000, 1.5000000000000000, 0.0}, + {7.7706676834614079e-08, 10.000000000000000, 1.7500000000000000, 0.0}, + {3.0169638793506839e-07, 10.000000000000000, 2.0000000000000000, 0.0}, + {1.0034459057774481e-06, 10.000000000000000, 2.2500000000000000, 0.0}, + {2.9557436109680578e-06, 10.000000000000000, 2.5000000000000000, 0.0}, + {7.8955603774082724e-06, 10.000000000000000, 2.7500000000000000, 0.0}, + {1.9464393470612970e-05, 10.000000000000000, 3.0000000000000000, 0.0}, + {4.4875369479742435e-05, 10.000000000000000, 3.2500000000000000, 0.0}, + {9.7760848514528916e-05, 10.000000000000000, 3.5000000000000000, 0.0}, + {0.00020289011210063496, 10.000000000000000, 3.7500000000000000, 0.0}, + {0.00040378896132693058, 10.000000000000000, 4.0000000000000000, 0.0}, + {0.00077478519551669892, 10.000000000000000, 4.2500000000000000, 0.0}, + {0.0014397060684919682, 10.000000000000000, 4.5000000000000000, 0.0}, + {0.0026004486016189452, 10.000000000000000, 4.7500000000000000, 0.0}, + {0.0045800444191760525, 10.000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler014 = 1.0000000000000008e-12; + +// Test data for nu=20.000000000000000. +// max(|f - f_GSL|): 6.9147129330604657e-25 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.6061319023473306e-14 +// mean(f - f_GSL): -5.1436249496041580e-26 +// variance(f - f_GSL): 2.1506355008505938e-50 +// stddev(f - f_GSL): 1.4665045178418625e-25 +const testcase_cyl_bessel_i data015[21] = { + {0.0000000000000000, 20.000000000000000, 0.0000000000000000, 0.0}, + {3.5677858077910353e-37, 20.000000000000000, 0.25000000000000000, 0.0}, + {3.7494538480790194e-31, 20.000000000000000, 0.50000000000000000, 0.0}, + {1.2514356342425337e-27, 20.000000000000000, 0.75000000000000000, 0.0}, + {3.9668359858190197e-25, 20.000000000000000, 1.0000000000000000, 0.0}, + {3.4637832909868234e-23, 20.000000000000000, 1.2500000000000000, 0.0}, + {1.3388331839683472e-21, 20.000000000000000, 1.5000000000000000, 0.0}, + {2.9502376732679751e-20, 20.000000000000000, 1.7500000000000000, 0.0}, + {4.3105605761095479e-19, 20.000000000000000, 2.0000000000000000, 0.0}, + {4.6032451406433059e-18, 20.000000000000000, 2.2500000000000000, 0.0}, + {3.8400317244170310e-17, 20.000000000000000, 2.5000000000000000, 0.0}, + {2.6239115263043263e-16, 20.000000000000000, 2.7500000000000000, 0.0}, + {1.5209660019426689e-15, 20.000000000000000, 3.0000000000000000, 0.0}, + {7.6806450728249953e-15, 20.000000000000000, 3.2500000000000000, 0.0}, + {3.4495528847222945e-14, 20.000000000000000, 3.5000000000000000, 0.0}, + {1.4006589294850677e-13, 20.000000000000000, 3.7500000000000000, 0.0}, + {5.2100734221993054e-13, 20.000000000000000, 4.0000000000000000, 0.0}, + {1.7946903269488168e-12, 20.000000000000000, 4.2500000000000000, 0.0}, + {5.7763830562279699e-12, 20.000000000000000, 4.5000000000000000, 0.0}, + {1.7502433074548735e-11, 20.000000000000000, 4.7500000000000000, 0.0}, + {5.0242393579718066e-11, 20.000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler015 = 1.0000000000000008e-12; +// cyl_bessel_i + +// Test data for nu=0.0000000000000000. +// max(|f - f_GSL|): 2.5841998320082313e+28 at index 20 +// max(|f - f_GSL| / |f_GSL|): 2.4067014886642843e-14 +// mean(f - f_GSL): -1.2242902567974868e+27 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_i data016[21] = { + {1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0}, + {27.239871823604439, 0.0000000000000000, 5.0000000000000000, 0.0}, + {2815.7166284662558, 0.0000000000000000, 10.000000000000000, 0.0}, + {339649.37329791381, 0.0000000000000000, 15.000000000000000, 0.0}, + {43558282.559553474, 0.0000000000000000, 20.000000000000000, 0.0}, + {5774560606.4663124, 0.0000000000000000, 25.000000000000000, 0.0}, + {781672297823.97925, 0.0000000000000000, 30.000000000000000, 0.0}, + {107338818494514.42, 0.0000000000000000, 35.000000000000000, 0.0}, + {14894774793419916., 0.0000000000000000, 40.000000000000000, 0.0}, + {2.0834140751773164e+18, 0.0000000000000000, 45.000000000000000, 0.0}, + {2.9325537838493457e+20, 0.0000000000000000, 50.000000000000000, 0.0}, + {4.1487895607332160e+22, 0.0000000000000000, 55.000000000000000, 0.0}, + {5.8940770556098216e+24, 0.0000000000000000, 60.000000000000000, 0.0}, + {8.4030398456255582e+26, 0.0000000000000000, 65.000000000000000, 0.0}, + {1.2015889579125424e+29, 0.0000000000000000, 70.000000000000000, 0.0}, + {1.7226390780357976e+31, 0.0000000000000000, 75.000000000000000, 0.0}, + {2.4751784043341661e+33, 0.0000000000000000, 80.000000000000000, 0.0}, + {3.5634776304081403e+35, 0.0000000000000000, 85.000000000000000, 0.0}, + {5.1392383455086475e+37, 0.0000000000000000, 90.000000000000000, 0.0}, + {7.4233258618752072e+39, 0.0000000000000000, 95.000000000000000, 0.0}, + {1.0737517071310986e+42, 0.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler016 = 2.5000000000000015e-12; + +// Test data for nu=0.33333333333333331. +// max(|f - f_GSL|): 1.0986717848657750e+28 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.2017640663876795e-14 +// mean(f - f_GSL): -5.2068252642007974e+26 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_i data017[21] = { + {0.0000000000000000, 0.33333333333333331, 0.0000000000000000, 0.0}, + {26.897553069268362, 0.33333333333333331, 5.0000000000000000, 0.0}, + {2799.2396097056790, 0.33333333333333331, 10.000000000000000, 0.0}, + {338348.63146593666, 0.33333333333333331, 15.000000000000000, 0.0}, + {43434263.927938424, 0.33333333333333331, 20.000000000000000, 0.0}, + {5761474759.6213636, 0.33333333333333331, 25.000000000000000, 0.0}, + {780201111830.30237, 0.33333333333333331, 30.000000000000000, 0.0}, + {107166066959051.91, 0.33333333333333331, 35.000000000000000, 0.0}, + {14873836574083762., 0.33333333333333331, 40.000000000000000, 0.0}, + {2.0808143020217085e+18, 0.33333333333333331, 45.000000000000000, 0.0}, + {2.9292639365644226e+20, 0.33333333333333331, 50.000000000000000, 0.0}, + {4.1445621624120489e+22, 0.33333333333333331, 55.000000000000000, 0.0}, + {5.8885758374365916e+24, 0.33333333333333331, 60.000000000000000, 0.0}, + {8.3958047021083941e+26, 0.33333333333333331, 65.000000000000000, 0.0}, + {1.2006287819446431e+29, 0.33333333333333331, 70.000000000000000, 0.0}, + {1.7213548977150022e+31, 0.33333333333333331, 75.000000000000000, 0.0}, + {2.4734492458444449e+33, 0.33333333333333331, 80.000000000000000, 0.0}, + {3.5611354547857122e+35, 0.33333333333333331, 85.000000000000000, 0.0}, + {5.1360491295551848e+37, 0.33333333333333331, 90.000000000000000, 0.0}, + {7.4189629097600431e+39, 0.33333333333333331, 95.000000000000000, 0.0}, + {1.0731523308358370e+42, 0.33333333333333331, 100.00000000000000, 0.0}, +}; +const double toler017 = 1.0000000000000008e-12; + +// Test data for nu=0.50000000000000000. +// max(|f - f_GSL|): 7.1181552258909366e+27 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.2230293310085236e-14 +// mean(f - f_GSL): -3.3462733503919608e+26 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_i data018[21] = { + {0.0000000000000000, 0.50000000000000000, 0.0000000000000000, 0.0}, + {26.477547497559065, 0.50000000000000000, 5.0000000000000000, 0.0}, + {2778.7846038745711, 0.50000000000000000, 10.000000000000000, 0.0}, + {336729.88718706399, 0.50000000000000000, 15.000000000000000, 0.0}, + {43279746.272428922, 0.50000000000000000, 20.000000000000000, 0.0}, + {5745159748.3464680, 0.50000000000000000, 25.000000000000000, 0.0}, + {778366068840.44580, 0.50000000000000000, 30.000000000000000, 0.0}, + {106950522408567.66, 0.50000000000000000, 35.000000000000000, 0.0}, + {14847705549021960., 0.50000000000000000, 40.000000000000000, 0.0}, + {2.0775691824625661e+18, 0.50000000000000000, 45.000000000000000, 0.0}, + {2.9251568529912984e+20, 0.50000000000000000, 50.000000000000000, 0.0}, + {4.1392840094781220e+22, 0.50000000000000000, 55.000000000000000, 0.0}, + {5.8817065760751945e+24, 0.50000000000000000, 60.000000000000000, 0.0}, + {8.3867695787277245e+26, 0.50000000000000000, 65.000000000000000, 0.0}, + {1.1994296461653203e+29, 0.50000000000000000, 70.000000000000000, 0.0}, + {1.7197510246063334e+31, 0.50000000000000000, 75.000000000000000, 0.0}, + {2.4712895036230794e+33, 0.50000000000000000, 80.000000000000000, 0.0}, + {3.5582099086757769e+35, 0.50000000000000000, 85.000000000000000, 0.0}, + {5.1320654031231128e+37, 0.50000000000000000, 90.000000000000000, 0.0}, + {7.4135128383495239e+39, 0.50000000000000000, 95.000000000000000, 0.0}, + {1.0724035825423179e+42, 0.50000000000000000, 100.00000000000000, 0.0}, +}; +const double toler018 = 1.0000000000000008e-12; + +// Test data for nu=0.66666666666666663. +// max(|f - f_GSL|): 4.6422751473201760e+27 at index 20 +// max(|f - f_GSL| / |f_GSL|): 8.8432218147527708e-15 +// mean(f - f_GSL): -2.2367290021744526e+26 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_i data019[21] = { + {0.0000000000000000, 0.66666666666666663, 0.0000000000000000, 0.0}, + {25.902310583215122, 0.66666666666666663, 5.0000000000000000, 0.0}, + {2750.4090423459315, 0.66666666666666663, 10.000000000000000, 0.0}, + {334476.98138574377, 0.66666666666666663, 15.000000000000000, 0.0}, + {43064361.686912313, 0.66666666666666663, 20.000000000000000, 0.0}, + {5722397441.9603882, 0.66666666666666663, 25.000000000000000, 0.0}, + {775804343498.02661, 0.66666666666666663, 30.000000000000000, 0.0}, + {106649495512800.88, 0.66666666666666663, 35.000000000000000, 0.0}, + {14811199896983754., 0.66666666666666663, 40.000000000000000, 0.0}, + {2.0730345814356961e+18, 0.66666666666666663, 45.000000000000000, 0.0}, + {2.9194166755257467e+20, 0.66666666666666663, 50.000000000000000, 0.0}, + {4.1319059569935374e+22, 0.66666666666666663, 55.000000000000000, 0.0}, + {5.8721031476386222e+24, 0.66666666666666663, 60.000000000000000, 0.0}, + {8.3741368248217830e+26, 0.66666666666666663, 65.000000000000000, 0.0}, + {1.1977528777008688e+29, 0.66666666666666663, 70.000000000000000, 0.0}, + {1.7175081240014333e+31, 0.66666666666666663, 75.000000000000000, 0.0}, + {2.4682690458513916e+33, 0.66666666666666663, 80.000000000000000, 0.0}, + {3.5541181975850724e+35, 0.66666666666666663, 85.000000000000000, 0.0}, + {5.1264933963228892e+37, 0.66666666666666663, 90.000000000000000, 0.0}, + {7.4058894880134064e+39, 0.66666666666666663, 95.000000000000000, 0.0}, + {1.0713562154788124e+42, 0.66666666666666663, 100.00000000000000, 0.0}, +}; +const double toler019 = 5.0000000000000039e-13; + +// Test data for nu=1.0000000000000000. +// max(|f - f_GSL|): 5.4159876718735387e+27 at index 20 +// max(|f - f_GSL| / |f_GSL|): 7.0819761463168391e-15 +// mean(f - f_GSL): 2.5933470782682662e+26 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_i data020[21] = { + {0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0}, + {24.335642142450524, 1.0000000000000000, 5.0000000000000000, 0.0}, + {2670.9883037012560, 1.0000000000000000, 10.000000000000000, 0.0}, + {328124.92197020649, 1.0000000000000000, 15.000000000000000, 0.0}, + {42454973.385127783, 1.0000000000000000, 20.000000000000000, 0.0}, + {5657865129.8787022, 1.0000000000000000, 25.000000000000000, 0.0}, + {768532038938.95667, 1.0000000000000000, 30.000000000000000, 0.0}, + {105794126051896.17, 1.0000000000000000, 35.000000000000000, 0.0}, + {14707396163259352., 1.0000000000000000, 40.000000000000000, 0.0}, + {2.0601334620815780e+18, 1.0000000000000000, 45.000000000000000, 0.0}, + {2.9030785901035638e+20, 1.0000000000000000, 50.000000000000000, 0.0}, + {4.1108986452992812e+22, 1.0000000000000000, 55.000000000000000, 0.0}, + {5.8447515883904527e+24, 1.0000000000000000, 60.000000000000000, 0.0}, + {8.3381485471501288e+26, 1.0000000000000000, 65.000000000000000, 0.0}, + {1.1929750788892366e+29, 1.0000000000000000, 70.000000000000000, 0.0}, + {1.7111160152965382e+31, 1.0000000000000000, 75.000000000000000, 0.0}, + {2.4596595795675343e+33, 1.0000000000000000, 80.000000000000000, 0.0}, + {3.5424536064404024e+35, 1.0000000000000000, 85.000000000000000, 0.0}, + {5.1106068152566129e+37, 1.0000000000000000, 90.000000000000000, 0.0}, + {7.3841518091360182e+39, 1.0000000000000000, 95.000000000000000, 0.0}, + {1.0683693903381569e+42, 1.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler020 = 5.0000000000000039e-13; + +// Test data for nu=2.0000000000000000. +// max(|f - f_GSL|): 6.1897001964269014e+27 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.0553248866140883e-14 +// mean(f - f_GSL): 2.9514880793266611e+26 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_i data021[21] = { + {0.0000000000000000, 2.0000000000000000, 0.0000000000000000, 0.0}, + {17.505614966624233, 2.0000000000000000, 5.0000000000000000, 0.0}, + {2281.5189677260046, 2.0000000000000000, 10.000000000000000, 0.0}, + {295899.38370188628, 2.0000000000000000, 15.000000000000000, 0.0}, + {39312785.221040756, 2.0000000000000000, 20.000000000000000, 0.0}, + {5321931396.0760155, 2.0000000000000000, 25.000000000000000, 0.0}, + {730436828561.38013, 2.0000000000000000, 30.000000000000000, 0.0}, + {101293439862977.19, 2.0000000000000000, 35.000000000000000, 0.0}, + {14159404985256920., 2.0000000000000000, 40.000000000000000, 0.0}, + {1.9918525879736883e+18, 2.0000000000000000, 45.000000000000000, 0.0}, + {2.8164306402451938e+20, 2.0000000000000000, 50.000000000000000, 0.0}, + {3.9993023372677540e+22, 2.0000000000000000, 55.000000000000000, 0.0}, + {5.6992520026634433e+24, 2.0000000000000000, 60.000000000000000, 0.0}, + {8.1464814287900364e+26, 2.0000000000000000, 65.000000000000000, 0.0}, + {1.1675039556585663e+29, 2.0000000000000000, 70.000000000000000, 0.0}, + {1.6770093176278926e+31, 2.0000000000000000, 75.000000000000000, 0.0}, + {2.4136869148449879e+33, 2.0000000000000000, 80.000000000000000, 0.0}, + {3.4801257808448186e+35, 2.0000000000000000, 85.000000000000000, 0.0}, + {5.0256693051696307e+37, 2.0000000000000000, 90.000000000000000, 0.0}, + {7.2678700343145818e+39, 2.0000000000000000, 95.000000000000000, 0.0}, + {1.0523843193243042e+42, 2.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler021 = 1.0000000000000008e-12; + +// Test data for nu=5.0000000000000000. +// max(|f - f_GSL|): 1.0831975343747077e+27 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.0289491375166011e-14 +// mean(f - f_GSL): -5.2041812077613416e+25 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_i data022[21] = { + {0.0000000000000000, 5.0000000000000000, 0.0000000000000000, 0.0}, + {2.1579745473225476, 5.0000000000000000, 5.0000000000000000, 0.0}, + {777.18828640326012, 5.0000000000000000, 10.000000000000000, 0.0}, + {144572.01120063409, 5.0000000000000000, 15.000000000000000, 0.0}, + {23018392.213413671, 5.0000000000000000, 20.000000000000000, 0.0}, + {3472466208.7419176, 5.0000000000000000, 25.000000000000000, 0.0}, + {512151465476.93494, 5.0000000000000000, 30.000000000000000, 0.0}, + {74756743552251.547, 5.0000000000000000, 35.000000000000000, 0.0}, + {10858318337624278., 5.0000000000000000, 40.000000000000000, 0.0}, + {1.5736087399245911e+18, 5.0000000000000000, 45.000000000000000, 0.0}, + {2.2785483079112825e+20, 5.0000000000000000, 50.000000000000000, 0.0}, + {3.2989391052963687e+22, 5.0000000000000000, 55.000000000000000, 0.0}, + {4.7777652072561732e+24, 5.0000000000000000, 60.000000000000000, 0.0}, + {6.9232165147172657e+26, 5.0000000000000000, 65.000000000000000, 0.0}, + {1.0038643002095155e+29, 5.0000000000000000, 70.000000000000000, 0.0}, + {1.4566328222327073e+31, 5.0000000000000000, 75.000000000000000, 0.0}, + {2.1151488565944835e+33, 5.0000000000000000, 80.000000000000000, 0.0}, + {3.0735883450768239e+35, 5.0000000000000000, 85.000000000000000, 0.0}, + {4.4694790189230327e+37, 5.0000000000000000, 90.000000000000000, 0.0}, + {6.5037505570430995e+39, 5.0000000000000000, 95.000000000000000, 0.0}, + {9.4700938730355882e+41, 5.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler022 = 1.0000000000000008e-12; + +// Test data for nu=10.000000000000000. +// max(|f - f_GSL|): 1.5474250491067253e+26 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.2009151331790140e-14 +// mean(f - f_GSL): 7.4845081675400805e+24 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_i data023[21] = { + {0.0000000000000000, 10.000000000000000, 0.0000000000000000, 0.0}, + {0.0045800444191760525, 10.000000000000000, 5.0000000000000000, 0.0}, + {21.891706163723381, 10.000000000000000, 10.000000000000000, 0.0}, + {12267.475049806462, 10.000000000000000, 15.000000000000000, 0.0}, + {3540200.2090195213, 10.000000000000000, 20.000000000000000, 0.0}, + {771298871.17072666, 10.000000000000000, 25.000000000000000, 0.0}, + {145831809975.96710, 10.000000000000000, 30.000000000000000, 0.0}, + {25449470018534.777, 10.000000000000000, 35.000000000000000, 0.0}, + {4228469210516757.0, 10.000000000000000, 40.000000000000000, 0.0}, + {6.8049404557505165e+17, 10.000000000000000, 45.000000000000000, 0.0}, + {1.0715971594776370e+20, 10.000000000000000, 50.000000000000000, 0.0}, + {1.6618215752886714e+22, 10.000000000000000, 55.000000000000000, 0.0}, + {2.5486246072566784e+24, 10.000000000000000, 60.000000000000000, 0.0}, + {3.8764628702155475e+26, 10.000000000000000, 65.000000000000000, 0.0}, + {5.8592538145409686e+28, 10.000000000000000, 70.000000000000000, 0.0}, + {8.8135370711317444e+30, 10.000000000000000, 75.000000000000000, 0.0}, + {1.3207418268325279e+33, 10.000000000000000, 80.000000000000000, 0.0}, + {1.9732791360862190e+35, 10.000000000000000, 85.000000000000000, 0.0}, + {2.9411893748384672e+37, 10.000000000000000, 90.000000000000000, 0.0}, + {4.3754494922439984e+39, 10.000000000000000, 95.000000000000000, 0.0}, + {6.4989755247201446e+41, 10.000000000000000, 100.00000000000000, 0.0}, +}; +const double toler023 = 1.0000000000000008e-12; + +// Test data for nu=20.000000000000000. +// max(|f - f_GSL|): 1.9342813113834067e+25 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.5819230756119302e-14 +// mean(f - f_GSL): 1.0213821732843951e+24 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_i data024[21] = { + {0.0000000000000000, 20.000000000000000, 0.0000000000000000, 0.0}, + {5.0242393579718066e-11, 20.000000000000000, 5.0000000000000000, 0.0}, + {0.00012507997356449481, 20.000000000000000, 10.000000000000000, 0.0}, + {1.6470152535015836, 20.000000000000000, 15.000000000000000, 0.0}, + {3188.7503288536154, 20.000000000000000, 20.000000000000000, 0.0}, + {2449840.5422952301, 20.000000000000000, 25.000000000000000, 0.0}, + {1126985104.4483771, 20.000000000000000, 30.000000000000000, 0.0}, + {379617876611.88580, 20.000000000000000, 35.000000000000000, 0.0}, + {104459633129479.88, 20.000000000000000, 40.000000000000000, 0.0}, + {25039579987216524., 20.000000000000000, 45.000000000000000, 0.0}, + {5.4420084027529984e+18, 20.000000000000000, 50.000000000000000, 0.0}, + {1.1007498584335495e+21, 20.000000000000000, 55.000000000000000, 0.0}, + {2.1091734863057236e+23, 20.000000000000000, 60.000000000000000, 0.0}, + {3.8763618091286891e+25, 20.000000000000000, 65.000000000000000, 0.0}, + {6.8946130527930870e+27, 20.000000000000000, 70.000000000000000, 0.0}, + {1.1946319948836447e+30, 20.000000000000000, 75.000000000000000, 0.0}, + {2.0265314377577587e+32, 20.000000000000000, 80.000000000000000, 0.0}, + {3.3784665214179985e+34, 20.000000000000000, 85.000000000000000, 0.0}, + {5.5516089411796646e+36, 20.000000000000000, 90.000000000000000, 0.0}, + {9.0129310795305151e+38, 20.000000000000000, 95.000000000000000, 0.0}, + {1.4483461256427176e+41, 20.000000000000000, 100.00000000000000, 0.0}, +}; +const double toler024 = 1.0000000000000008e-12; + +// Test data for nu=50.000000000000000. +// max(|f - f_GSL|): 4.4862481587261630e+22 at index 20 +// max(|f - f_GSL| / |f_GSL|): 6.0191728870880627e-14 +// mean(f - f_GSL): 2.1246678955085789e+21 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_i data025[21] = { + {0.0000000000000000, 50.000000000000000, 0.0000000000000000, 0.0}, + {2.9314696468108517e-45, 50.000000000000000, 5.0000000000000000, 0.0}, + {4.7568945607268435e-30, 50.000000000000000, 10.000000000000000, 0.0}, + {5.5468372730667069e-21, 50.000000000000000, 15.000000000000000, 0.0}, + {2.2551205757604056e-14, 50.000000000000000, 20.000000000000000, 0.0}, + {4.5344251866130257e-09, 50.000000000000000, 25.000000000000000, 0.0}, + {0.00014590106916468940, 50.000000000000000, 30.000000000000000, 0.0}, + {1.3965549457254882, 50.000000000000000, 35.000000000000000, 0.0}, + {5726.8656631289887, 50.000000000000000, 40.000000000000000, 0.0}, + {12672593.113027781, 50.000000000000000, 45.000000000000000, 0.0}, + {17650802430.016712, 50.000000000000000, 50.000000000000000, 0.0}, + {17220231607789.926, 50.000000000000000, 55.000000000000000, 0.0}, + {12704607933652176., 50.000000000000000, 60.000000000000000, 0.0}, + {7.4989491942193715e+18, 50.000000000000000, 65.000000000000000, 0.0}, + {3.6944034898904922e+21, 50.000000000000000, 70.000000000000000, 0.0}, + {1.5691634774370186e+24, 50.000000000000000, 75.000000000000000, 0.0}, + {5.8927749458163587e+26, 50.000000000000000, 80.000000000000000, 0.0}, + {1.9958849054749339e+29, 50.000000000000000, 85.000000000000000, 0.0}, + {6.1946050361781500e+31, 50.000000000000000, 90.000000000000000, 0.0}, + {1.7845429728697119e+34, 50.000000000000000, 95.000000000000000, 0.0}, + {4.8219580855940819e+36, 50.000000000000000, 100.00000000000000, 0.0}, +}; +const double toler025 = 5.0000000000000029e-12; + +// Test data for nu=100.00000000000000. +// max(|f - f_GSL|): 185597952.00000000 at index 20 +// max(|f - f_GSL| / |f_GSL|): 2.8278213985558577e-13 +// mean(f - f_GSL): 8855366.2060860656 +// variance(f - f_GSL): 4.2527168883984777e+19 +// stddev(f - f_GSL): 6521285830.5693655 +const testcase_cyl_bessel_i data026[21] = { + {0.0000000000000000, 100.00000000000000, 0.0000000000000000, 0.0}, + {7.0935514885313123e-119, 100.00000000000000, 5.0000000000000000, 0.0}, + {1.0823442017492015e-88, 100.00000000000000, 10.000000000000000, 0.0}, + {5.9887888536468904e-71, 100.00000000000000, 15.000000000000000, 0.0}, + {2.8703193216428771e-58, 100.00000000000000, 20.000000000000000, 0.0}, + {2.4426896913122370e-48, 100.00000000000000, 25.000000000000000, 0.0}, + {3.9476420053334271e-40, 100.00000000000000, 30.000000000000000, 0.0}, + {4.2836596180818780e-33, 100.00000000000000, 35.000000000000000, 0.0}, + {6.6249380222596129e-27, 100.00000000000000, 40.000000000000000, 0.0}, + {2.3702587262788900e-21, 100.00000000000000, 45.000000000000000, 0.0}, + {2.7278879470966917e-16, 100.00000000000000, 50.000000000000000, 0.0}, + {1.2763258878228082e-11, 100.00000000000000, 55.000000000000000, 0.0}, + {2.8832770906491972e-07, 100.00000000000000, 60.000000000000000, 0.0}, + {0.0035805902717061223, 100.00000000000000, 65.000000000000000, 0.0}, + {27.017219102595387, 100.00000000000000, 70.000000000000000, 0.0}, + {134001.44891209516, 100.00000000000000, 75.000000000000000, 0.0}, + {465194832.85060996, 100.00000000000000, 80.000000000000000, 0.0}, + {1189280653119.4814, 100.00000000000000, 85.000000000000000, 0.0}, + {2334119331258728.0, 100.00000000000000, 90.000000000000000, 0.0}, + {3.6399223078502436e+18, 100.00000000000000, 95.000000000000000, 0.0}, + {4.6415349416162005e+21, 100.00000000000000, 100.00000000000000, 0.0}, +}; +const double toler026 = 2.5000000000000014e-11; + +template +void +test(const testcase_cyl_bessel_i (&data)[Num], Ret toler) +{ + bool test __attribute__((unused)) = true; + const Ret eps = std::numeric_limits::epsilon(); + Ret max_abs_diff = -Ret(1); + Ret max_abs_frac = -Ret(1); + unsigned int num_datum = Num; + for (unsigned int i = 0; i < num_datum; ++i) + { + const Ret f = std::cyl_bessel_i(data[i].nu, data[i].x); + const Ret f0 = data[i].f0; + const Ret diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Ret(10) * eps && std::abs(f) > Ret(10) * eps) + { + const Ret frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + assert(max_abs_frac < toler); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + IF_DOUBLE_SUPPORT(test(data007, toler007)) + IF_DOUBLE_SUPPORT(test(data008, toler008)) + IF_DOUBLE_SUPPORT(test(data009, toler009)) + IF_DOUBLE_SUPPORT(test(data010, toler010)) + IF_DOUBLE_SUPPORT(test(data011, toler011)) + IF_DOUBLE_SUPPORT(test(data012, toler012)) + IF_DOUBLE_SUPPORT(test(data013, toler013)) + IF_DOUBLE_SUPPORT(test(data014, toler014)) + IF_DOUBLE_SUPPORT(test(data015, toler015)) + IF_DOUBLE_SUPPORT(test(data016, toler016)) + IF_DOUBLE_SUPPORT(test(data017, toler017)) + IF_DOUBLE_SUPPORT(test(data018, toler018)) + IF_DOUBLE_SUPPORT(test(data019, toler019)) + IF_DOUBLE_SUPPORT(test(data020, toler020)) + IF_DOUBLE_SUPPORT(test(data021, toler021)) + IF_DOUBLE_SUPPORT(test(data022, toler022)) + IF_DOUBLE_SUPPORT(test(data023, toler023)) + IF_DOUBLE_SUPPORT(test(data024, toler024)) + IF_DOUBLE_SUPPORT(test(data025, toler025)) + IF_DOUBLE_SUPPORT(test(data026, toler026)) +#endif + + return 0; +} diff --git a/test/xpu_api/numerics/special/bessel/bessel_i_check_nan.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_i_check_nan.pass.cpp new file mode 100644 index 00000000000..adc049f606a --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_i_check_nan.pass.cpp @@ -0,0 +1,80 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +template +void +test01(); + +template +void +test02(); + +template <> +void +test01() +{ + float xf = std::numeric_limits::quiet_NaN(); + float nuf = 0.0F; + + [[maybe_unused]] float a = std::cyl_bessel_i(nuf, xf); + [[maybe_unused]] float b = std::cyl_bessel_if(nuf, xf); + + assert(std::isnan(a)); + assert(std::isnan(b)); +} + +template <> +void +test01() +{ + double xd = std::numeric_limits::quiet_NaN(); + double nud = 0.0; + [[maybe_unused]] double c = std::cyl_bessel_i(nud, xd); + + assert(std::isnan(c)); +} + +template <> +void +test02() +{ + float xf = 1.0F; + float nuf = std::numeric_limits::quiet_NaN(); + + [[maybe_unused]] float a = std::cyl_bessel_i(nuf, xf); + [[maybe_unused]] float b = std::cyl_bessel_if(nuf, xf); + + assert(std::isnan(a)); + assert(std::isnan(b)); +} + +template <> +void +test02() +{ + double xd = 1.0; + double nud = std::numeric_limits::quiet_NaN(); + [[maybe_unused]] double c = std::cyl_bessel_i(nud, xd); + + assert(std::isnan(c)); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + test01(); + test02(); + + IF_DOUBLE_SUPPORT(test01()) + IF_DOUBLE_SUPPORT(test02()) +#endif + + return 0; +} diff --git a/test/xpu_api/numerics/special/bessel/bessel_i_compile.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_i_compile.pass.cpp new file mode 100644 index 00000000000..281a0e9272a --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_i_compile.pass.cpp @@ -0,0 +1,28 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +// cyl_bessel_if + +void +test() +{ + double nud = 1.0 / 3.0, xd = 0.5; + + [[maybe_unused]] auto t = std::cyl_bessel_if(nud, xd); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + IF_DOUBLE_SUPPORT(test()) +#endif + + return 0; +} diff --git a/test/xpu_api/numerics/special/bessel/bessel_if_compile.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_if_compile.pass.cpp new file mode 100644 index 00000000000..3a4c0e8524e --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_if_compile.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +// cyl_bessel_if +#include + +void +test() +{ + float nuf = 1.0F / 3.0F, xf = 0.5F; + + [[maybe_unused]] auto t = std::cyl_bessel_if(nuf, xf); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + test(); +#endif + + return 0; +} diff --git a/test/xpu_api/numerics/special/bessel/bessel_j_check.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_j_check.pass.cpp new file mode 100644 index 00000000000..1d20c9f1ec4 --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_j_check.pass.cpp @@ -0,0 +1,720 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +// cyl_bessel_j +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +// Test data for nu=0.0000000000000000. +// max(|f - f_GSL|): 1.0547118733938987e-14 at index 1 +// max(|f - f_GSL| / |f_GSL|): 1.0733293243042314e-14 +// mean(f - f_GSL): -2.4682636886755713e-15 +// variance(f - f_GSL): 3.4179114172015086e-31 +// stddev(f - f_GSL): 5.8462906335568952e-16 +const testcase_cyl_bessel_j data007[21] = { + {1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0}, + {0.98443592929585266, 0.0000000000000000, 0.25000000000000000, 0.0}, + {0.93846980724081297, 0.0000000000000000, 0.50000000000000000, 0.0}, + {0.86424227516664853, 0.0000000000000000, 0.75000000000000000, 0.0}, + {0.76519768655796661, 0.0000000000000000, 1.0000000000000000, 0.0}, + {0.64590608527128535, 0.0000000000000000, 1.2500000000000000, 0.0}, + {0.51182767173591814, 0.0000000000000000, 1.5000000000000000, 0.0}, + {0.36903253018515075, 0.0000000000000000, 1.7500000000000000, 0.0}, + {0.22389077914123562, 0.0000000000000000, 2.0000000000000000, 0.0}, + {0.082749851288734022, 0.0000000000000000, 2.2500000000000000, 0.0}, + {-0.048383776468197998, 0.0000000000000000, 2.5000000000000000, 0.0}, + {-0.16414142780851368, 0.0000000000000000, 2.7500000000000000, 0.0}, + {-0.26005195490193334, 0.0000000000000000, 3.0000000000000000, 0.0}, + {-0.33275080217061132, 0.0000000000000000, 3.2500000000000000, 0.0}, + {-0.38012773998726335, 0.0000000000000000, 3.5000000000000000, 0.0}, + {-0.40140605493617426, 0.0000000000000000, 3.7500000000000000, 0.0}, + {-0.39714980986384740, 0.0000000000000000, 4.0000000000000000, 0.0}, + {-0.36919977029989554, 0.0000000000000000, 4.2500000000000000, 0.0}, + {-0.32054250898512149, 0.0000000000000000, 4.5000000000000000, 0.0}, + {-0.25512082749137405, 0.0000000000000000, 4.7500000000000000, 0.0}, + {-0.17759677131433835, 0.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler007 = 1.0000000000000008e-12; + +// Test data for nu=0.33333333333333331. +// max(|f - f_GSL|): 4.4408920985006262e-16 at index 4 +// max(|f - f_GSL| / |f_GSL|): 8.0807620553987087e-16 +// mean(f - f_GSL): 1.2423924323186276e-16 +// variance(f - f_GSL): 4.4388099670639150e-33 +// stddev(f - f_GSL): 6.6624394684409066e-17 +const testcase_cyl_bessel_j data008[21] = { + {0.0000000000000000, 0.33333333333333331, 0.0000000000000000, 0.0}, + {0.55338359549647709, 0.33333333333333331, 0.25000000000000000, 0.0}, + {0.67283082949794537, 0.33333333333333331, 0.50000000000000000, 0.0}, + {0.72490863199379019, 0.33333333333333331, 0.75000000000000000, 0.0}, + {0.73087640216944749, 0.33333333333333331, 1.0000000000000000, 0.0}, + {0.69953374433894455, 0.33333333333333331, 1.2500000000000000, 0.0}, + {0.63713263706489176, 0.33333333333333331, 1.5000000000000000, 0.0}, + {0.54956352730788460, 0.33333333333333331, 1.7500000000000000, 0.0}, + {0.44293981814857586, 0.33333333333333331, 2.0000000000000000, 0.0}, + {0.32366988946292502, 0.33333333333333331, 2.2500000000000000, 0.0}, + {0.19832093341860796, 0.33333333333333331, 2.5000000000000000, 0.0}, + {0.073389637874297461, 0.33333333333333331, 2.7500000000000000, 0.0}, + {-0.044963820940233351, 0.33333333333333331, 3.0000000000000000, 0.0}, + {-0.15118395956666372, 0.33333333333333331, 3.2500000000000000, 0.0}, + {-0.24056593952693622, 0.33333333333333331, 3.5000000000000000, 0.0}, + {-0.30946094681921288, 0.33333333333333331, 3.7500000000000000, 0.0}, + {-0.35542737345457609, 0.33333333333333331, 4.0000000000000000, 0.0}, + {-0.37731852825457068, 0.33333333333333331, 4.2500000000000000, 0.0}, + {-0.37530189159358079, 0.33333333333333331, 4.5000000000000000, 0.0}, + {-0.35080916720916927, 0.33333333333333331, 4.7500000000000000, 0.0}, + {-0.30642046380026405, 0.33333333333333331, 5.0000000000000000, 0.0}, +}; +const double toler008 = 2.5000000000000020e-13; + +// Test data for nu=0.50000000000000000. +// max(|f - f_GSL|): 5.5511151231257827e-16 at index 6 +// max(|f - f_GSL| / |f_GSL|): 8.6943152885834554e-16 +// mean(f - f_GSL): 1.6058583034756728e-16 +// variance(f - f_GSL): 1.3538599676919272e-33 +// stddev(f - f_GSL): 3.6794836155253190e-17 +const testcase_cyl_bessel_j data009[21] = { + {0.0000000000000000, 0.50000000000000000, 0.0000000000000000, 0.0}, + {0.39479959874136972, 0.50000000000000000, 0.25000000000000000, 0.0}, + {0.54097378993452760, 0.50000000000000000, 0.50000000000000000, 0.0}, + {0.62800587637588623, 0.50000000000000000, 0.75000000000000000, 0.0}, + {0.67139670714180244, 0.50000000000000000, 1.0000000000000000, 0.0}, + {0.67724253810014312, 0.50000000000000000, 1.2500000000000000, 0.0}, + {0.64983807475374655, 0.50000000000000000, 1.5000000000000000, 0.0}, + {0.59348525447147382, 0.50000000000000000, 1.7500000000000000, 0.0}, + {0.51301613656182721, 0.50000000000000000, 2.0000000000000000, 0.0}, + {0.41387506064759988, 0.50000000000000000, 2.2500000000000000, 0.0}, + {0.30200490606236535, 0.50000000000000000, 2.5000000000000000, 0.0}, + {0.18363332138431521, 0.50000000000000000, 2.7500000000000000, 0.0}, + {0.065008182877375753, 0.50000000000000000, 3.0000000000000000, 0.0}, + {-0.047885729975898537, 0.50000000000000000, 3.2500000000000000, 0.0}, + {-0.14960456964952618, 0.50000000000000000, 3.5000000000000000, 0.0}, + {-0.23549801845815518, 0.50000000000000000, 3.7500000000000000, 0.0}, + {-0.30192051329163944, 0.50000000000000000, 4.0000000000000000, 0.0}, + {-0.34638850218952444, 0.50000000000000000, 4.2500000000000000, 0.0}, + {-0.36767487332724025, 0.50000000000000000, 4.5000000000000000, 0.0}, + {-0.36583563802350400, 0.50000000000000000, 4.7500000000000000, 0.0}, + {-0.34216798479816180, 0.50000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler009 = 2.5000000000000020e-13; + +// Test data for nu=0.66666666666666663. +// max(|f - f_GSL|): 1.2212453270876722e-15 at index 4 +// max(|f - f_GSL| / |f_GSL|): 2.1504146437492276e-15 +// mean(f - f_GSL): -4.8208791456193557e-16 +// variance(f - f_GSL): 1.8468435800786558e-32 +// stddev(f - f_GSL): 1.3589862324831168e-16 +const testcase_cyl_bessel_j data010[21] = { + {0.0000000000000000, 0.66666666666666663, 0.0000000000000000, 0.0}, + {0.27434438998865140, 0.66666666666666663, 0.25000000000000000, 0.0}, + {0.42331075068448332, 0.66666666666666663, 0.50000000000000000, 0.0}, + {0.52870551548162803, 0.66666666666666663, 0.75000000000000000, 0.0}, + {0.59794997367362812, 0.66666666666666663, 1.0000000000000000, 0.0}, + {0.63338726889075903, 0.66666666666666663, 1.2500000000000000, 0.0}, + {0.63673234502877407, 0.66666666666666663, 1.5000000000000000, 0.0}, + {0.61022230460131910, 0.66666666666666663, 1.7500000000000000, 0.0}, + {0.55696967691913724, 0.66666666666666663, 2.0000000000000000, 0.0}, + {0.48101276749106131, 0.66666666666666663, 2.2500000000000000, 0.0}, + {0.38721242477084322, 0.66666666666666663, 2.5000000000000000, 0.0}, + {0.28105724771080548, 0.66666666666666663, 2.7500000000000000, 0.0}, + {0.16841218049067047, 0.66666666666666663, 3.0000000000000000, 0.0}, + {0.055235893475364936, 0.66666666666666663, 3.2500000000000000, 0.0}, + {-0.052711584404031932, 0.66666666666666663, 3.5000000000000000, 0.0}, + {-0.15015178042293031, 0.66666666666666663, 3.7500000000000000, 0.0}, + {-0.23254408502670393, 0.66666666666666663, 4.0000000000000000, 0.0}, + {-0.29630067002972543, 0.66666666666666663, 4.2500000000000000, 0.0}, + {-0.33894810189777724, 0.66666666666666663, 4.5000000000000000, 0.0}, + {-0.35922706960321099, 0.66666666666666663, 4.7500000000000000, 0.0}, + {-0.35712533549168868, 0.66666666666666663, 5.0000000000000000, 0.0}, +}; +const double toler010 = 2.5000000000000020e-13; + +// Test data for nu=1.0000000000000000. +// max(|f - f_GSL|): 6.1062266354383610e-15 at index 7 +// max(|f - f_GSL| / |f_GSL|): 1.0805601471765146e-14 +// mean(f - f_GSL): -2.7170725986585303e-15 +// variance(f - f_GSL): 4.1990134041171014e-31 +// stddev(f - f_GSL): 6.4799794784529226e-16 +const testcase_cyl_bessel_j data011[21] = { + {0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0}, + {0.12402597732272694, 1.0000000000000000, 0.25000000000000000, 0.0}, + {0.24226845767487390, 1.0000000000000000, 0.50000000000000000, 0.0}, + {0.34924360217486222, 1.0000000000000000, 0.75000000000000000, 0.0}, + {0.44005058574493355, 1.0000000000000000, 1.0000000000000000, 0.0}, + {0.51062326031988059, 1.0000000000000000, 1.2500000000000000, 0.0}, + {0.55793650791009952, 1.0000000000000000, 1.5000000000000000, 0.0}, + {0.58015619763899240, 1.0000000000000000, 1.7500000000000000, 0.0}, + {0.57672480775687363, 1.0000000000000000, 2.0000000000000000, 0.0}, + {0.54837835664696011, 1.0000000000000000, 2.2500000000000000, 0.0}, + {0.49709410246427416, 1.0000000000000000, 2.5000000000000000, 0.0}, + {0.42597230295790256, 1.0000000000000000, 2.7500000000000000, 0.0}, + {0.33905895852593648, 1.0000000000000000, 3.0000000000000000, 0.0}, + {0.24111968801520400, 1.0000000000000000, 3.2500000000000000, 0.0}, + {0.13737752736232706, 1.0000000000000000, 3.5000000000000000, 0.0}, + {0.033229349129679724, 1.0000000000000000, 3.7500000000000000, 0.0}, + {-0.066043328023549230, 1.0000000000000000, 4.0000000000000000, 0.0}, + {-0.15555319297834286, 1.0000000000000000, 4.2500000000000000, 0.0}, + {-0.23106043192337070, 1.0000000000000000, 4.5000000000000000, 0.0}, + {-0.28918679864711044, 1.0000000000000000, 4.7500000000000000, 0.0}, + {-0.32757913759146529, 1.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler011 = 1.0000000000000008e-12; + +// Test data for nu=2.0000000000000000. +// max(|f - f_GSL|): 5.1625370645069779e-15 at index 12 +// max(|f - f_GSL| / |f_GSL|): 1.0822675144009871e-14 +// mean(f - f_GSL): -2.7863789318177942e-15 +// variance(f - f_GSL): 2.7454120215792639e-31 +// stddev(f - f_GSL): 5.2396679490014096e-16 +const testcase_cyl_bessel_j data012[21] = { + {0.0000000000000000, 2.0000000000000000, 0.0000000000000000, 0.0}, + {0.0077718892859626760, 2.0000000000000000, 0.25000000000000000, 0.0}, + {0.030604023458682638, 2.0000000000000000, 0.50000000000000000, 0.0}, + {0.067073997299650551, 2.0000000000000000, 0.75000000000000000, 0.0}, + {0.11490348493190047, 2.0000000000000000, 1.0000000000000000, 0.0}, + {0.17109113124052350, 2.0000000000000000, 1.2500000000000000, 0.0}, + {0.23208767214421472, 2.0000000000000000, 1.5000000000000000, 0.0}, + {0.29400312425941216, 2.0000000000000000, 1.7500000000000000, 0.0}, + {0.35283402861563773, 2.0000000000000000, 2.0000000000000000, 0.0}, + {0.40469757684189717, 2.0000000000000000, 2.2500000000000000, 0.0}, + {0.44605905843961718, 2.0000000000000000, 2.5000000000000000, 0.0}, + {0.47393946632335160, 2.0000000000000000, 2.7500000000000000, 0.0}, + {0.48609126058589119, 2.0000000000000000, 3.0000000000000000, 0.0}, + {0.48113214864150627, 2.0000000000000000, 3.2500000000000000, 0.0}, + {0.45862918419430765, 2.0000000000000000, 3.5000000000000000, 0.0}, + {0.41912837447200352, 2.0000000000000000, 3.7500000000000000, 0.0}, + {0.36412814585207293, 2.0000000000000000, 4.0000000000000000, 0.0}, + {0.29599826772185189, 2.0000000000000000, 4.2500000000000000, 0.0}, + {0.21784898368584549, 2.0000000000000000, 4.5000000000000000, 0.0}, + {0.13335796490311685, 2.0000000000000000, 4.7500000000000000, 0.0}, + {0.046565116277751971, 2.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler012 = 1.0000000000000008e-12; + +// Test data for nu=5.0000000000000000. +// max(|f - f_GSL|): 2.6645352591003757e-15 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.1360392768632928e-14 +// mean(f - f_GSL): -6.6594499701393519e-16 +// variance(f - f_GSL): 2.0970405937460423e-31 +// stddev(f - f_GSL): 4.5793455796063728e-16 +const testcase_cyl_bessel_j data013[21] = { + {0.0000000000000000, 5.0000000000000000, 0.0000000000000000, 0.0}, + {2.5365161587472413e-07, 5.0000000000000000, 0.25000000000000000, 0.0}, + {8.0536272413574753e-06, 5.0000000000000000, 0.50000000000000000, 0.0}, + {6.0364166510576438e-05, 5.0000000000000000, 0.75000000000000000, 0.0}, + {0.00024975773021123450, 5.0000000000000000, 1.0000000000000000, 0.0}, + {0.00074440885254749821, 5.0000000000000000, 1.2500000000000000, 0.0}, + {0.0017994217673606111, 5.0000000000000000, 1.5000000000000000, 0.0}, + {0.0037577257273157133, 5.0000000000000000, 1.7500000000000000, 0.0}, + {0.0070396297558716842, 5.0000000000000000, 2.0000000000000000, 0.0}, + {0.012121078633445751, 5.0000000000000000, 2.2500000000000000, 0.0}, + {0.019501625134503223, 5.0000000000000000, 2.5000000000000000, 0.0}, + {0.029664058320006174, 5.0000000000000000, 2.7500000000000000, 0.0}, + {0.043028434877047578, 5.0000000000000000, 3.0000000000000000, 0.0}, + {0.059903888098560426, 5.0000000000000000, 3.2500000000000000, 0.0}, + {0.080441986647991792, 5.0000000000000000, 3.5000000000000000, 0.0}, + {0.10459554742314070, 5.0000000000000000, 3.7500000000000000, 0.0}, + {0.13208665604709827, 5.0000000000000000, 4.0000000000000000, 0.0}, + {0.16238721643623680, 5.0000000000000000, 4.2500000000000000, 0.0}, + {0.19471465863871368, 5.0000000000000000, 4.5000000000000000, 0.0}, + {0.22804452118769436, 5.0000000000000000, 4.7500000000000000, 0.0}, + {0.26114054612017007, 5.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler013 = 1.0000000000000008e-12; + +// Test data for nu=10.000000000000000. +// max(|f - f_GSL|): 1.6263032587282567e-17 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.2824480053608853e-14 +// mean(f - f_GSL): -1.9939226062419386e-18 +// variance(f - f_GSL): 1.0689393731679246e-35 +// stddev(f - f_GSL): 3.2694638293884283e-18 +const testcase_cyl_bessel_j data014[21] = { + {0.0000000000000000, 10.000000000000000, 0.0000000000000000, 0.0}, + {2.5628321598050096e-16, 10.000000000000000, 0.25000000000000000, 0.0}, + {2.6131773608228023e-13, 10.000000000000000, 0.50000000000000000, 0.0}, + {1.4962171311759677e-11, 10.000000000000000, 0.75000000000000000, 0.0}, + {2.6306151236874524e-10, 10.000000000000000, 1.0000000000000000, 0.0}, + {2.4187548221114514e-09, 10.000000000000000, 1.2500000000000000, 0.0}, + {1.4743269078039996e-08, 10.000000000000000, 1.5000000000000000, 0.0}, + {6.7608502849897560e-08, 10.000000000000000, 1.7500000000000000, 0.0}, + {2.5153862827167358e-07, 10.000000000000000, 2.0000000000000000, 0.0}, + {7.9717051583730038e-07, 10.000000000000000, 2.2500000000000000, 0.0}, + {2.2247284173983839e-06, 10.000000000000000, 2.5000000000000000, 0.0}, + {5.5985475639210430e-06, 10.000000000000000, 2.7500000000000000, 0.0}, + {1.2928351645715880e-05, 10.000000000000000, 3.0000000000000000, 0.0}, + {2.7761691354244538e-05, 10.000000000000000, 3.2500000000000000, 0.0}, + {5.6009495875078844e-05, 10.000000000000000, 3.5000000000000000, 0.0}, + {0.00010703761729231951, 10.000000000000000, 3.7500000000000000, 0.0}, + {0.00019504055466003446, 10.000000000000000, 4.0000000000000000, 0.0}, + {0.00034068888474064193, 10.000000000000000, 4.2500000000000000, 0.0}, + {0.00057300977667164505, 10.000000000000000, 4.5000000000000000, 0.0}, + {0.00093142172588886810, 10.000000000000000, 4.7500000000000000, 0.0}, + {0.0014678026473104744, 10.000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler014 = 1.0000000000000008e-12; + +// Test data for nu=20.000000000000000. +// max(|f - f_GSL|): 3.8450973786644646e-25 at index 20 +// max(|f - f_GSL| / |f_GSL|): 1.6112330065488876e-14 +// mean(f - f_GSL): -2.9366599259721097e-26 +// variance(f - f_GSL): 6.6216490672203760e-51 +// stddev(f - f_GSL): 8.1373515760475631e-26 +const testcase_cyl_bessel_j data015[21] = { + {0.0000000000000000, 20.000000000000000, 0.0000000000000000, 0.0}, + {3.5624805510586969e-37, 20.000000000000000, 0.25000000000000000, 0.0}, + {3.7272019617047132e-31, 20.000000000000000, 0.50000000000000000, 0.0}, + {1.2347870693633488e-27, 20.000000000000000, 0.75000000000000000, 0.0}, + {3.8735030085246562e-25, 20.000000000000000, 1.0000000000000000, 0.0}, + {3.3372897667043766e-23, 20.000000000000000, 1.2500000000000000, 0.0}, + {1.2689972189332558e-21, 20.000000000000000, 1.5000000000000000, 0.0}, + {2.7427715944032989e-20, 20.000000000000000, 1.7500000000000000, 0.0}, + {3.9189728050907524e-19, 20.000000000000000, 2.0000000000000000, 0.0}, + {4.0805232551365158e-18, 20.000000000000000, 2.2500000000000000, 0.0}, + {3.3090793836587786e-17, 20.000000000000000, 2.5000000000000000, 0.0}, + {2.1915404680645990e-16, 20.000000000000000, 2.7500000000000000, 0.0}, + {1.2275946737992981e-15, 20.000000000000000, 3.0000000000000000, 0.0}, + {5.9727663938305382e-15, 20.000000000000000, 3.2500000000000000, 0.0}, + {2.5768553102807590e-14, 20.000000000000000, 3.5000000000000000, 0.0}, + {1.0021112208287217e-13, 20.000000000000000, 3.7500000000000000, 0.0}, + {3.5595116285938516e-13, 20.000000000000000, 4.0000000000000000, 0.0}, + {1.1673622958555074e-12, 20.000000000000000, 4.2500000000000000, 0.0}, + {3.5665470983611762e-12, 20.000000000000000, 4.5000000000000000, 0.0}, + {1.0227564044880958e-11, 20.000000000000000, 4.7500000000000000, 0.0}, + {2.7703300521289426e-11, 20.000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler015 = 1.0000000000000008e-12; +// cyl_bessel_j + +// Test data for nu=0.0000000000000000. +// max(|f - f_GSL|): 7.6709472107694410e-15 at index 13 +// max(|f - f_GSL| / |f_GSL|): 4.1048891312746575e-13 +// mean(f - f_GSL): -4.8105534106433027e-16 +// variance(f - f_GSL): 9.0295585401833436e-31 +// stddev(f - f_GSL): 9.5023989287881106e-16 +const testcase_cyl_bessel_j data016[21] = { + {1.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0}, + {-0.17759677131433835, 0.0000000000000000, 5.0000000000000000, 0.0}, + {-0.24593576445134835, 0.0000000000000000, 10.000000000000000, 0.0}, + {-0.014224472826780771, 0.0000000000000000, 15.000000000000000, 0.0}, + {0.16702466434058319, 0.0000000000000000, 20.000000000000000, 0.0}, + {0.096266783275958154, 0.0000000000000000, 25.000000000000000, 0.0}, + {-0.086367983581040142, 0.0000000000000000, 30.000000000000000, 0.0}, + {-0.12684568275631256, 0.0000000000000000, 35.000000000000000, 0.0}, + {0.0073668905842374085, 0.0000000000000000, 40.000000000000000, 0.0}, + {0.11581867067325631, 0.0000000000000000, 45.000000000000000, 0.0}, + {0.055812327669251746, 0.0000000000000000, 50.000000000000000, 0.0}, + {-0.074548302648236808, 0.0000000000000000, 55.000000000000000, 0.0}, + {-0.091471804089061859, 0.0000000000000000, 60.000000000000000, 0.0}, + {0.018687343227677979, 0.0000000000000000, 65.000000000000000, 0.0}, + {0.094908726483013545, 0.0000000000000000, 70.000000000000000, 0.0}, + {0.034643913805097008, 0.0000000000000000, 75.000000000000000, 0.0}, + {-0.069742165512210033, 0.0000000000000000, 80.000000000000000, 0.0}, + {-0.070940394796273273, 0.0000000000000000, 85.000000000000000, 0.0}, + {0.026630016699969526, 0.0000000000000000, 90.000000000000000, 0.0}, + {0.081811967783384135, 0.0000000000000000, 95.000000000000000, 0.0}, + {0.019985850304223170, 0.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler016 = 2.5000000000000014e-11; + +// Test data for nu=0.33333333333333331. +// max(|f - f_GSL|): 7.9363599025938925e-15 at index 15 +// max(|f - f_GSL| / |f_GSL|): 4.2442260743498463e-12 +// mean(f - f_GSL): -4.0073144868561849e-16 +// variance(f - f_GSL): 1.2341887679989061e-30 +// stddev(f - f_GSL): 1.1109404880545609e-15 +const testcase_cyl_bessel_j data017[21] = { + {0.0000000000000000, 0.33333333333333331, 0.0000000000000000, 0.0}, + {-0.30642046380026405, 0.33333333333333331, 5.0000000000000000, 0.0}, + {-0.18614516704869571, 0.33333333333333331, 10.000000000000000, 0.0}, + {0.089740004221152650, 0.33333333333333331, 15.000000000000000, 0.0}, + {0.17606058001293901, 0.33333333333333331, 20.000000000000000, 0.0}, + {0.020097162141383233, 0.33333333333333331, 25.000000000000000, 0.0}, + {-0.13334053387426159, 0.33333333333333331, 30.000000000000000, 0.0}, + {-0.087118009397765497, 0.33333333333333331, 35.000000000000000, 0.0}, + {0.069202942818858179, 0.33333333333333331, 40.000000000000000, 0.0}, + {0.11387616964518317, 0.33333333333333331, 45.000000000000000, 0.0}, + {-0.00057226680771808045, 0.33333333333333331, 50.000000000000000, 0.0}, + {-0.10331600929280822, 0.33333333333333331, 55.000000000000000, 0.0}, + {-0.055618147270528003, 0.33333333333333331, 60.000000000000000, 0.0}, + {0.064711954014113948, 0.33333333333333331, 65.000000000000000, 0.0}, + {0.086879926462481605, 0.33333333333333331, 70.000000000000000, 0.0}, + {-0.012614484229891068, 0.33333333333333331, 75.000000000000000, 0.0}, + {-0.088199784400034537, 0.33333333333333331, 80.000000000000000, 0.0}, + {-0.036703611076564523, 0.33333333333333331, 85.000000000000000, 0.0}, + {0.062916286828779547, 0.33333333333333331, 90.000000000000000, 0.0}, + {0.069465244416806030, 0.33333333333333331, 95.000000000000000, 0.0}, + {-0.021271244853702364, 0.33333333333333331, 100.00000000000000, 0.0}, +}; +const double toler017 = 2.5000000000000017e-10; + +// Test data for nu=0.50000000000000000. +// max(|f - f_GSL|): 7.4384942649885488e-15 at index 15 +// max(|f - f_GSL| / |f_GSL|): 3.6736636954373887e-13 +// mean(f - f_GSL): -2.3914402204537413e-16 +// variance(f - f_GSL): 7.8293530348883143e-31 +// stddev(f - f_GSL): 8.8483631451745435e-16 +const testcase_cyl_bessel_j data018[21] = { + {0.0000000000000000, 0.50000000000000000, 0.0000000000000000, 0.0}, + {-0.34216798479816180, 0.50000000000000000, 5.0000000000000000, 0.0}, + {-0.13726373575505049, 0.50000000000000000, 10.000000000000000, 0.0}, + {0.13396768882243937, 0.50000000000000000, 15.000000000000000, 0.0}, + {0.16288076385502984, 0.50000000000000000, 20.000000000000000, 0.0}, + {-0.021120283599650493, 0.50000000000000000, 25.000000000000000, 0.0}, + {-0.14392965337039987, 0.50000000000000000, 30.000000000000000, 0.0}, + {-0.057747757589458777, 0.50000000000000000, 35.000000000000000, 0.0}, + {0.094000962389533649, 0.50000000000000000, 40.000000000000000, 0.0}, + {0.10120783324271411, 0.50000000000000000, 45.000000000000000, 0.0}, + {-0.029605831888924641, 0.50000000000000000, 50.000000000000000, 0.0}, + {-0.10756039213265806, 0.50000000000000000, 55.000000000000000, 0.0}, + {-0.031397461182520438, 0.50000000000000000, 60.000000000000000, 0.0}, + {0.081827430775628554, 0.50000000000000000, 65.000000000000000, 0.0}, + {0.073802429539054554, 0.50000000000000000, 70.000000000000000, 0.0}, + {-0.035727009681702615, 0.50000000000000000, 75.000000000000000, 0.0}, + {-0.088661035811765460, 0.50000000000000000, 80.000000000000000, 0.0}, + {-0.015238065106312516, 0.50000000000000000, 85.000000000000000, 0.0}, + {0.075189068550269425, 0.50000000000000000, 90.000000000000000, 0.0}, + {0.055932643481494133, 0.50000000000000000, 95.000000000000000, 0.0}, + {-0.040402132716252127, 0.50000000000000000, 100.00000000000000, 0.0}, +}; +const double toler018 = 2.5000000000000014e-11; + +// Test data for nu=0.66666666666666663. +// max(|f - f_GSL|): 6.3699046037868357e-15 at index 15 +// max(|f - f_GSL| / |f_GSL|): 1.2249770426844829e-12 +// mean(f - f_GSL): -1.1601995819092502e-16 +// variance(f - f_GSL): 5.5905222078728605e-31 +// stddev(f - f_GSL): 7.4769794756123678e-16 +const testcase_cyl_bessel_j data019[21] = { + {0.0000000000000000, 0.66666666666666663, 0.0000000000000000, 0.0}, + {-0.35712533549168868, 0.66666666666666663, 5.0000000000000000, 0.0}, + {-0.080149603304315808, 0.66666666666666663, 10.000000000000000, 0.0}, + {0.16918875175798079, 0.66666666666666663, 15.000000000000000, 0.0}, + {0.13904826122116531, 0.66666666666666663, 20.000000000000000, 0.0}, + {-0.060770629698497600, 0.66666666666666663, 25.000000000000000, 0.0}, + {-0.14489851974205062, 0.66666666666666663, 30.000000000000000, 0.0}, + {-0.024604880159644394, 0.66666666666666663, 35.000000000000000, 0.0}, + {0.11243936464912010, 0.66666666666666663, 40.000000000000000, 0.0}, + {0.081776275512525309, 0.66666666666666663, 45.000000000000000, 0.0}, + {-0.056589908749367777, 0.66666666666666663, 50.000000000000000, 0.0}, + {-0.10455814523765931, 0.66666666666666663, 55.000000000000000, 0.0}, + {-0.0051030148548608456, 0.66666666666666663, 60.000000000000000, 0.0}, + {0.093398227061639236, 0.66666666666666663, 65.000000000000000, 0.0}, + {0.055763883611864913, 0.66666666666666663, 70.000000000000000, 0.0}, + {-0.056395322915757364, 0.66666666666666663, 75.000000000000000, 0.0}, + {-0.083131347805783087, 0.66666666666666663, 80.000000000000000, 0.0}, + {0.0072315397874096648, 0.66666666666666663, 85.000000000000000, 0.0}, + {0.082362798520905250, 0.66666666666666663, 90.000000000000000, 0.0}, + {0.038630504403446168, 0.66666666666666663, 95.000000000000000, 0.0}, + {-0.056778819380529734, 0.66666666666666663, 100.00000000000000, 0.0}, +}; +const double toler019 = 1.0000000000000006e-10; + +// Test data for nu=1.0000000000000000. +// max(|f - f_GSL|): 7.1418565505965148e-15 at index 14 +// max(|f - f_GSL| / |f_GSL|): 1.7859762266854228e-12 +// mean(f - f_GSL): 9.6132592627048056e-17 +// variance(f - f_GSL): 8.7314103995980843e-32 +// stddev(f - f_GSL): 2.9548960048702366e-16 +const testcase_cyl_bessel_j data020[21] = { + {0.0000000000000000, 1.0000000000000000, 0.0000000000000000, 0.0}, + {-0.32757913759146529, 1.0000000000000000, 5.0000000000000000, 0.0}, + {0.043472746168861459, 1.0000000000000000, 10.000000000000000, 0.0}, + {0.20510403861352280, 1.0000000000000000, 15.000000000000000, 0.0}, + {0.066833124175850078, 1.0000000000000000, 20.000000000000000, 0.0}, + {-0.12535024958028990, 1.0000000000000000, 25.000000000000000, 0.0}, + {-0.11875106261662294, 1.0000000000000000, 30.000000000000000, 0.0}, + {0.043990942179625646, 1.0000000000000000, 35.000000000000000, 0.0}, + {0.12603831803758500, 1.0000000000000000, 40.000000000000000, 0.0}, + {0.028348854376424561, 1.0000000000000000, 45.000000000000000, 0.0}, + {-0.097511828125175129, 1.0000000000000000, 50.000000000000000, 0.0}, + {-0.078250038308684711, 1.0000000000000000, 55.000000000000000, 0.0}, + {0.046598383758166370, 1.0000000000000000, 60.000000000000000, 0.0}, + {0.097330172226126929, 1.0000000000000000, 65.000000000000000, 0.0}, + {0.0099877887848385128, 1.0000000000000000, 70.000000000000000, 0.0}, + {-0.085139995044829081, 1.0000000000000000, 75.000000000000000, 0.0}, + {-0.056057296675712555, 1.0000000000000000, 80.000000000000000, 0.0}, + {0.049151460334891130, 1.0000000000000000, 85.000000000000000, 0.0}, + {0.079925646708868092, 1.0000000000000000, 90.000000000000000, 0.0}, + {-0.0023925612997269283, 1.0000000000000000, 95.000000000000000, 0.0}, + {-0.077145352014112129, 1.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler020 = 1.0000000000000006e-10; + +// Test data for nu=2.0000000000000000. +// max(|f - f_GSL|): 7.5980888247784151e-15 at index 13 +// max(|f - f_GSL| / |f_GSL|): 2.0010877493528614e-12 +// mean(f - f_GSL): 4.4867383617942993e-16 +// variance(f - f_GSL): 8.9441502176883788e-31 +// stddev(f - f_GSL): 9.4573517528367196e-16 +const testcase_cyl_bessel_j data021[21] = { + {0.0000000000000000, 2.0000000000000000, 0.0000000000000000, 0.0}, + {0.046565116277751971, 2.0000000000000000, 5.0000000000000000, 0.0}, + {0.25463031368512068, 2.0000000000000000, 10.000000000000000, 0.0}, + {0.041571677975250486, 2.0000000000000000, 15.000000000000000, 0.0}, + {-0.16034135192299820, 2.0000000000000000, 20.000000000000000, 0.0}, + {-0.10629480324238134, 2.0000000000000000, 25.000000000000000, 0.0}, + {0.078451246073265299, 2.0000000000000000, 30.000000000000000, 0.0}, + {0.12935945088086259, 2.0000000000000000, 35.000000000000000, 0.0}, + {-0.0010649746823579794, 2.0000000000000000, 40.000000000000000, 0.0}, + {-0.11455872158985966, 2.0000000000000000, 45.000000000000000, 0.0}, + {-0.059712800794258863, 2.0000000000000000, 50.000000000000000, 0.0}, + {0.071702846709739240, 2.0000000000000000, 55.000000000000000, 0.0}, + {0.093025083547667420, 2.0000000000000000, 60.000000000000000, 0.0}, + {-0.015692568697643128, 2.0000000000000000, 65.000000000000000, 0.0}, + {-0.094623361089161029, 2.0000000000000000, 70.000000000000000, 0.0}, + {-0.036914313672959179, 2.0000000000000000, 75.000000000000000, 0.0}, + {0.068340733095317172, 2.0000000000000000, 80.000000000000000, 0.0}, + {0.072096899745329540, 2.0000000000000000, 85.000000000000000, 0.0}, + {-0.024853891217550248, 2.0000000000000000, 90.000000000000000, 0.0}, + {-0.081862337494957332, 2.0000000000000000, 95.000000000000000, 0.0}, + {-0.021528757344505364, 2.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler021 = 2.5000000000000017e-10; + +// Test data for nu=5.0000000000000000. +// max(|f - f_GSL|): 6.8452188362044808e-15 at index 14 +// max(|f - f_GSL| / |f_GSL|): 5.6871180922055143e-13 +// mean(f - f_GSL): -8.6612264979127729e-17 +// variance(f - f_GSL): 1.4989992815624512e-31 +// stddev(f - f_GSL): 3.8716912087128681e-16 +const testcase_cyl_bessel_j data022[21] = { + {0.0000000000000000, 5.0000000000000000, 0.0000000000000000, 0.0}, + {0.26114054612017007, 5.0000000000000000, 5.0000000000000000, 0.0}, + {-0.23406152818679371, 5.0000000000000000, 10.000000000000000, 0.0}, + {0.13045613456502966, 5.0000000000000000, 15.000000000000000, 0.0}, + {0.15116976798239498, 5.0000000000000000, 20.000000000000000, 0.0}, + {-0.066007995398422933, 5.0000000000000000, 25.000000000000000, 0.0}, + {-0.14324029551207709, 5.0000000000000000, 30.000000000000000, 0.0}, + {-0.0015053072953907251, 5.0000000000000000, 35.000000000000000, 0.0}, + {0.12257346597711777, 5.0000000000000000, 40.000000000000000, 0.0}, + {0.057984499200954109, 5.0000000000000000, 45.000000000000000, 0.0}, + {-0.081400247696569616, 5.0000000000000000, 50.000000000000000, 0.0}, + {-0.092569895786432765, 5.0000000000000000, 55.000000000000000, 0.0}, + {0.027454744228344204, 5.0000000000000000, 60.000000000000000, 0.0}, + {0.099110527701539025, 5.0000000000000000, 65.000000000000000, 0.0}, + {0.026058129823895364, 5.0000000000000000, 70.000000000000000, 0.0}, + {-0.078523977013751398, 5.0000000000000000, 75.000000000000000, 0.0}, + {-0.065862349140031584, 5.0000000000000000, 80.000000000000000, 0.0}, + {0.038669072284680979, 5.0000000000000000, 85.000000000000000, 0.0}, + {0.082759319528415157, 5.0000000000000000, 90.000000000000000, 0.0}, + {0.0079423372702472871, 5.0000000000000000, 95.000000000000000, 0.0}, + {-0.074195736964513898, 5.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler022 = 5.0000000000000028e-11; + +// Test data for nu=10.000000000000000. +// max(|f - f_GSL|): 7.2337968948232856e-15 at index 18 +// max(|f - f_GSL| / |f_GSL|): 3.6992532852132266e-13 +// mean(f - f_GSL): 4.8246996675604947e-16 +// variance(f - f_GSL): 7.6040256561433464e-31 +// stddev(f - f_GSL): 8.7201064535608434e-16 +const testcase_cyl_bessel_j data023[21] = { + {0.0000000000000000, 10.000000000000000, 0.0000000000000000, 0.0}, + {0.0014678026473104744, 10.000000000000000, 5.0000000000000000, 0.0}, + {0.20748610663335865, 10.000000000000000, 10.000000000000000, 0.0}, + {-0.090071811047659087, 10.000000000000000, 15.000000000000000, 0.0}, + {0.18648255802394512, 10.000000000000000, 20.000000000000000, 0.0}, + {-0.075179843948523312, 10.000000000000000, 25.000000000000000, 0.0}, + {-0.12987689399858882, 10.000000000000000, 30.000000000000000, 0.0}, + {0.063546391343962866, 10.000000000000000, 35.000000000000000, 0.0}, + {0.11938336278226094, 10.000000000000000, 40.000000000000000, 0.0}, + {-0.026971402475010831, 10.000000000000000, 45.000000000000000, 0.0}, + {-0.11384784914946940, 10.000000000000000, 50.000000000000000, 0.0}, + {-0.015773790303746080, 10.000000000000000, 55.000000000000000, 0.0}, + {0.097177143328071064, 10.000000000000000, 60.000000000000000, 0.0}, + {0.054617389951112129, 10.000000000000000, 65.000000000000000, 0.0}, + {-0.065870338561952013, 10.000000000000000, 70.000000000000000, 0.0}, + {-0.080417867891894437, 10.000000000000000, 75.000000000000000, 0.0}, + {0.024043850978184747, 10.000000000000000, 80.000000000000000, 0.0}, + {0.086824832700067869, 10.000000000000000, 85.000000000000000, 0.0}, + {0.019554748856312299, 10.000000000000000, 90.000000000000000, 0.0}, + {-0.072341598669443757, 10.000000000000000, 95.000000000000000, 0.0}, + {-0.054732176935472096, 10.000000000000000, 100.00000000000000, 0.0}, +}; +const double toler023 = 2.5000000000000014e-11; + +// Test data for nu=20.000000000000000. +// max(|f - f_GSL|): 7.7212541915727684e-15 at index 15 +// max(|f - f_GSL| / |f_GSL|): 1.1196544285022136e-12 +// mean(f - f_GSL): 5.2156489342296849e-16 +// variance(f - f_GSL): 3.4201480080426176e-31 +// stddev(f - f_GSL): 5.8482031497226715e-16 +const testcase_cyl_bessel_j data024[21] = { + {0.0000000000000000, 20.000000000000000, 0.0000000000000000, 0.0}, + {2.7703300521289426e-11, 20.000000000000000, 5.0000000000000000, 0.0}, + {1.1513369247813403e-05, 20.000000000000000, 10.000000000000000, 0.0}, + {0.0073602340792234934, 20.000000000000000, 15.000000000000000, 0.0}, + {0.16474777377532665, 20.000000000000000, 20.000000000000000, 0.0}, + {0.051994049228303307, 20.000000000000000, 25.000000000000000, 0.0}, + {0.0048310199934040923, 20.000000000000000, 30.000000000000000, 0.0}, + {-0.10927417397178038, 20.000000000000000, 35.000000000000000, 0.0}, + {0.12779393355084889, 20.000000000000000, 40.000000000000000, 0.0}, + {0.0047633437900313621, 20.000000000000000, 45.000000000000000, 0.0}, + {-0.11670435275957974, 20.000000000000000, 50.000000000000000, 0.0}, + {0.025389204574566639, 20.000000000000000, 55.000000000000000, 0.0}, + {0.10266020557876326, 20.000000000000000, 60.000000000000000, 0.0}, + {-0.023138582263434154, 20.000000000000000, 65.000000000000000, 0.0}, + {-0.096058573489952365, 20.000000000000000, 70.000000000000000, 0.0}, + {0.0068961047221522270, 20.000000000000000, 75.000000000000000, 0.0}, + {0.090565405489918357, 20.000000000000000, 80.000000000000000, 0.0}, + {0.015985497599497172, 20.000000000000000, 85.000000000000000, 0.0}, + {-0.080345344044422534, 20.000000000000000, 90.000000000000000, 0.0}, + {-0.040253075701614051, 20.000000000000000, 95.000000000000000, 0.0}, + {0.062217458498338672, 20.000000000000000, 100.00000000000000, 0.0}, +}; +const double toler024 = 1.0000000000000006e-10; + +// Test data for nu=50.000000000000000. +// max(|f - f_GSL|): 6.6543992538470320e-15 at index 17 +// max(|f - f_GSL| / |f_GSL|): 1.6466369526724007e-13 +// mean(f - f_GSL): -1.7248164093189558e-16 +// variance(f - f_GSL): 3.3098955753115488e-31 +// stddev(f - f_GSL): 5.7531691921162455e-16 +const testcase_cyl_bessel_j data025[21] = { + {0.0000000000000000, 50.000000000000000, 0.0000000000000000, 0.0}, + {2.2942476159525415e-45, 50.000000000000000, 5.0000000000000000, 0.0}, + {1.7845136078715964e-30, 50.000000000000000, 10.000000000000000, 0.0}, + {6.1060519495338733e-22, 50.000000000000000, 15.000000000000000, 0.0}, + {4.4510392847006872e-16, 50.000000000000000, 20.000000000000000, 0.0}, + {9.7561594280229808e-12, 50.000000000000000, 25.000000000000000, 0.0}, + {2.0581656631564172e-08, 50.000000000000000, 30.000000000000000, 0.0}, + {7.6069951699272960e-06, 50.000000000000000, 35.000000000000000, 0.0}, + {0.00068185243531768309, 50.000000000000000, 40.000000000000000, 0.0}, + {0.017284343240791214, 50.000000000000000, 45.000000000000000, 0.0}, + {0.12140902189761507, 50.000000000000000, 50.000000000000000, 0.0}, + {0.13594720957176012, 50.000000000000000, 55.000000000000000, 0.0}, + {-0.13798273148535209, 50.000000000000000, 60.000000000000000, 0.0}, + {0.12116217746619409, 50.000000000000000, 65.000000000000000, 0.0}, + {-0.11394866738787145, 50.000000000000000, 70.000000000000000, 0.0}, + {0.094076799581573348, 50.000000000000000, 75.000000000000000, 0.0}, + {-0.039457764590251347, 50.000000000000000, 80.000000000000000, 0.0}, + {-0.040412060734136383, 50.000000000000000, 85.000000000000000, 0.0}, + {0.090802099838032266, 50.000000000000000, 90.000000000000000, 0.0}, + {-0.055979156267280165, 50.000000000000000, 95.000000000000000, 0.0}, + {-0.038698339728525440, 50.000000000000000, 100.00000000000000, 0.0}, +}; +const double toler025 = 1.0000000000000006e-11; + +// Test data for nu=100.00000000000000. +// max(|f - f_GSL|): 6.3751087742147661e-17 at index 18 +// max(|f - f_GSL| / |f_GSL|): 1.3655432948759698e-13 +// mean(f - f_GSL): -3.2198025339906150e-18 +// variance(f - f_GSL): 7.7469087160903957e-35 +// stddev(f - f_GSL): 8.8016525244356221e-18 +const testcase_cyl_bessel_j data026[21] = { + {0.0000000000000000, 100.00000000000000, 0.0000000000000000, 0.0}, + {6.2677893955418763e-119, 100.00000000000000, 5.0000000000000000, 0.0}, + {6.5973160641553816e-89, 100.00000000000000, 10.000000000000000, 0.0}, + {1.9660095611249536e-71, 100.00000000000000, 15.000000000000000, 0.0}, + {3.9617550943362524e-59, 100.00000000000000, 20.000000000000000, 0.0}, + {1.1064482655301687e-49, 100.00000000000000, 25.000000000000000, 0.0}, + {4.5788015281752354e-42, 100.00000000000000, 30.000000000000000, 0.0}, + {9.9210206714735426e-36, 100.00000000000000, 35.000000000000000, 0.0}, + {2.3866062996026735e-30, 100.00000000000000, 40.000000000000000, 0.0}, + {1.0329791804565538e-25, 100.00000000000000, 45.000000000000000, 0.0}, + {1.1159273690838498e-21, 100.00000000000000, 50.000000000000000, 0.0}, + {3.7899753451900944e-18, 100.00000000000000, 55.000000000000000, 0.0}, + {4.7832744078782562e-15, 100.00000000000000, 60.000000000000000, 0.0}, + {2.5375564579490428e-12, 100.00000000000000, 65.000000000000000, 0.0}, + {6.1982452141641260e-10, 100.00000000000000, 70.000000000000000, 0.0}, + {7.4479005905904457e-08, 100.00000000000000, 75.000000000000000, 0.0}, + {4.6065530648234940e-06, 100.00000000000000, 80.000000000000000, 0.0}, + {0.00015043869999501787, 100.00000000000000, 85.000000000000000, 0.0}, + {0.0026021305819963628, 100.00000000000000, 90.000000000000000, 0.0}, + {0.023150768009428030, 100.00000000000000, 95.000000000000000, 0.0}, + {0.096366673295861571, 100.00000000000000, 100.00000000000000, 0.0}, +}; +const double toler026 = 1.0000000000000006e-11; + +// Test data for nu=100.0000000000000000 +// max(|f - f_GSL|): 3.9438938226332709e-14 at index 19 +// max(|f - f_GSL| / |f_GSL|): 2.0193411077170867e-11 +// mean(f - f_GSL): 1.6682360684660055e-15 +// variance(f - f_GSL): 5.3274331668346898e-28 +// stddev(f - f_GSL): 2.3081232997469372e-14 +const testcase_cyl_bessel_j data027[21] = { + {1.1676135007789573e-02, 100.0000000000000000, 1000.0000000000000000, 0.0}, + {-1.1699854778025796e-02, 100.0000000000000000, 1100.0000000000000000, 0.0}, + {-2.2801483405083697e-02, 100.0000000000000000, 1200.0000000000000000, 0.0}, + {-1.6973500787373915e-02, 100.0000000000000000, 1300.0000000000000000, 0.0}, + {-1.4154528803481308e-03, 100.0000000000000000, 1400.0000000000000000, 0.0}, + {1.3333726584495232e-02, 100.0000000000000000, 1500.0000000000000000, 0.0}, + {1.9802562020148559e-02, 100.0000000000000000, 1600.0000000000000000, 0.0}, + {1.6129771279838816e-02, 100.0000000000000000, 1700.0000000000000000, 0.0}, + {5.3753369281536031e-03, 100.0000000000000000, 1800.0000000000000000, 0.0}, + {-6.9238868725645785e-03, 100.0000000000000000, 1900.0000000000000000, 0.0}, + {-1.5487871720069789e-02, 100.0000000000000000, 2000.0000000000000000, 0.0}, + {-1.7275186717671070e-02, 100.0000000000000000, 2100.0000000000000000, 0.0}, + {-1.2233030525173150e-02, 100.0000000000000000, 2200.0000000000000000, 0.0}, + {-2.8518508672241900e-03, 100.0000000000000000, 2300.0000000000000000, 0.0}, + {7.0784372270289329e-03, 100.0000000000000000, 2400.0000000000000000, 0.0}, + {1.3955367586928166e-02, 100.0000000000000000, 2500.0000000000000000, 0.0}, + {1.5574059842493392e-02, 100.0000000000000000, 2600.0000000000000000, 0.0}, + {1.1718043044647556e-02, 100.0000000000000000, 2700.0000000000000000, 0.0}, + {4.0320953231285607e-03, 100.0000000000000000, 2800.0000000000000000, 0.0}, + {-4.6895111783053977e-03, 100.0000000000000000, 2900.0000000000000000, 0.0}, + {-1.1507715400035966e-02, 100.0000000000000000, 3000.0000000000000000, 0.0}, +}; +const double toler027 = 1.0000000000000006e-10; + +template +void +test(const testcase_cyl_bessel_j (&data)[Num], Ret toler) +{ + bool test __attribute__((unused)) = true; + const Ret eps = std::numeric_limits::epsilon(); + Ret max_abs_diff = -Ret(1); + Ret max_abs_frac = -Ret(1); + unsigned int num_datum = Num; + for (unsigned int i = 0; i < num_datum; ++i) + { + const Ret f = std::cyl_bessel_j(data[i].nu, data[i].x); + const Ret f0 = data[i].f0; + const Ret diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Ret(10) * eps && std::abs(f) > Ret(10) * eps) + { + const Ret frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + assert(max_abs_frac < toler); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + IF_DOUBLE_SUPPORT(test(data007, toler007)) + IF_DOUBLE_SUPPORT(test(data008, toler008)) + IF_DOUBLE_SUPPORT(test(data009, toler009)) + IF_DOUBLE_SUPPORT(test(data010, toler010)) + IF_DOUBLE_SUPPORT(test(data011, toler011)) + IF_DOUBLE_SUPPORT(test(data012, toler012)) + IF_DOUBLE_SUPPORT(test(data013, toler013)) + IF_DOUBLE_SUPPORT(test(data014, toler014)) + IF_DOUBLE_SUPPORT(test(data015, toler015)) + IF_DOUBLE_SUPPORT(test(data016, toler016)) + IF_DOUBLE_SUPPORT(test(data017, toler017)) + IF_DOUBLE_SUPPORT(test(data018, toler018)) + IF_DOUBLE_SUPPORT(test(data019, toler019)) + IF_DOUBLE_SUPPORT(test(data020, toler020)) + IF_DOUBLE_SUPPORT(test(data021, toler021)) + IF_DOUBLE_SUPPORT(test(data022, toler022)) + IF_DOUBLE_SUPPORT(test(data023, toler023)) + IF_DOUBLE_SUPPORT(test(data024, toler024)) + IF_DOUBLE_SUPPORT(test(data025, toler025)) + IF_DOUBLE_SUPPORT(test(data026, toler026)) + IF_DOUBLE_SUPPORT(test(data027, toler027)) +#endif + + return 0; +} diff --git a/test/xpu_api/numerics/special/bessel/bessel_j_check_nan.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_j_check_nan.pass.cpp new file mode 100644 index 00000000000..b03a420ea48 --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_j_check_nan.pass.cpp @@ -0,0 +1,80 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +template +void +test01(); + +template +void +test02(); + +template <> +void +test01() +{ + float xf = std::numeric_limits::quiet_NaN(); + float nuf = 0.0F; + + [[maybe_unused]] float a = std::cyl_bessel_j(nuf, xf); + [[maybe_unused]] float b = std::cyl_bessel_jf(nuf, xf); + + assert(std::isnan(a)); + assert(std::isnan(b)); +} + +template <> +void +test01() +{ + double xd = std::numeric_limits::quiet_NaN(); + double nud = 0.0; + [[maybe_unused]] double c = std::cyl_bessel_j(nud, xd); + + assert(std::isnan(c)); +} + +template <> +void +test02() +{ + float xf = 1.0F; + float nuf = std::numeric_limits::quiet_NaN(); + + [[maybe_unused]] float a = std::cyl_bessel_j(nuf, xf); + [[maybe_unused]] float b = std::cyl_bessel_jf(nuf, xf); + + assert(std::isnan(a)); + assert(std::isnan(b)); +} + +template <> +void +test02() +{ + double xd = 1.0; + double nud = std::numeric_limits::quiet_NaN(); + [[maybe_unused]] double c = std::cyl_bessel_j(nud, xd); + + assert(std::isnan(c)); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + test01(); + test02(); + + IF_DOUBLE_SUPPORT(test01()) + IF_DOUBLE_SUPPORT(test02()) +#endif + + return 0; +} diff --git a/test/xpu_api/numerics/special/bessel/bessel_j_compile.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_j_compile.pass.cpp new file mode 100644 index 00000000000..37e90cf0347 --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_j_compile.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +// cyl_bessel_j +#include + +void +test() +{ + double nud = 1.0 / 3.0, xd = 0.5; + + [[maybe_unused]] auto t = std::cyl_bessel_j(nud, xd); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + IF_DOUBLE_SUPPORT(test()) +#endif + + return 0; +} diff --git a/test/xpu_api/numerics/special/bessel/bessel_jf_compile.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_jf_compile.pass.cpp new file mode 100644 index 00000000000..0708e146492 --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_jf_compile.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +// cyl_bessel_jf +#include + +void +test() +{ + float nuf = 1.0F / 3.0F, xf = 0.5F; + + [[maybe_unused]] auto t = std::cyl_bessel_jf(nuf, xf); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + test(); +#endif + + return 0; +} diff --git a/test/xpu_api/numerics/special/bessel/bessel_k_check.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_k_check.pass.cpp new file mode 100644 index 00000000000..742eaed30fc --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_k_check.pass.cpp @@ -0,0 +1,730 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +// cyl_bessel_k +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +// Test data for nu=0.0000000000000000. +// max(|f - f_GSL|): 2.2204460492503131e-16 at index 0 +// max(|f - f_GSL| / |f_GSL|): 3.3025402038894216e-16 +// mean(f - f_GSL): 1.0473392986209972e-17 +// variance(f - f_GSL): 5.5842559222476003e-36 +// stddev(f - f_GSL): 2.3631030282760842e-18 +const testcase_cyl_bessel_k data007[20] = { + {1.5415067512483025, 0.0000000000000000, 0.25000000000000000, 0.0}, + {0.92441907122766565, 0.0000000000000000, 0.50000000000000000, 0.0}, + {0.61058242211646430, 0.0000000000000000, 0.75000000000000000, 0.0}, + {0.42102443824070834, 0.0000000000000000, 1.0000000000000000, 0.0}, + {0.29760308908410588, 0.0000000000000000, 1.2500000000000000, 0.0}, + {0.21380556264752565, 0.0000000000000000, 1.5000000000000000, 0.0}, + {0.15537981238660359, 0.0000000000000000, 1.7500000000000000, 0.0}, + {0.11389387274953360, 0.0000000000000000, 2.0000000000000000, 0.0}, + {0.084043111974658191, 0.0000000000000000, 2.2500000000000000, 0.0}, + {0.062347553200366168, 0.0000000000000000, 2.5000000000000000, 0.0}, + {0.046454901308760774, 0.0000000000000000, 2.7500000000000000, 0.0}, + {0.034739504386279256, 0.0000000000000000, 3.0000000000000000, 0.0}, + {0.026058755255154966, 0.0000000000000000, 3.2500000000000000, 0.0}, + {0.019598897170368501, 0.0000000000000000, 3.5000000000000000, 0.0}, + {0.014774250877128707, 0.0000000000000000, 3.7500000000000000, 0.0}, + {0.011159676085853030, 0.0000000000000000, 4.0000000000000000, 0.0}, + {0.0084443877245429649, 0.0000000000000000, 4.2500000000000000, 0.0}, + {0.0063998572432339756, 0.0000000000000000, 4.5000000000000000, 0.0}, + {0.0048572045578879524, 0.0000000000000000, 4.7500000000000000, 0.0}, + {0.0036910983340425947, 0.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler007 = 2.5000000000000020e-13; + +// Test data for nu=0.33333333333333331. +// max(|f - f_GSL|): 9.1593399531575415e-16 at index 5 +// max(|f - f_GSL| / |f_GSL|): 4.1603543087763551e-15 +// mean(f - f_GSL): -2.0157486790850499e-16 +// variance(f - f_GSL): 2.2511040095474369e-33 +// stddev(f - f_GSL): 4.7445800757785052e-17 +const testcase_cyl_bessel_k data008[20] = { + {1.7144912564234513, 0.33333333333333331, 0.25000000000000000, 0.0}, + {0.98903107424672421, 0.33333333333333331, 0.50000000000000000, 0.0}, + {0.64216899667282989, 0.33333333333333331, 0.75000000000000000, 0.0}, + {0.43843063344153443, 0.33333333333333331, 1.0000000000000000, 0.0}, + {0.30788192414945043, 0.33333333333333331, 1.2500000000000000, 0.0}, + {0.22015769026776688, 0.33333333333333331, 1.5000000000000000, 0.0}, + {0.15943413057311243, 0.33333333333333331, 1.7500000000000000, 0.0}, + {0.11654496129616534, 0.33333333333333331, 2.0000000000000000, 0.0}, + {0.085809609306439674, 0.33333333333333331, 2.2500000000000000, 0.0}, + {0.063542537454733386, 0.33333333333333331, 2.5000000000000000, 0.0}, + {0.047273354184795509, 0.33333333333333331, 2.7500000000000000, 0.0}, + {0.035305904902162587, 0.33333333333333331, 3.0000000000000000, 0.0}, + {0.026454186892773169, 0.33333333333333331, 3.2500000000000000, 0.0}, + {0.019877061407943805, 0.33333333333333331, 3.5000000000000000, 0.0}, + {0.014971213514760216, 0.33333333333333331, 3.7500000000000000, 0.0}, + {0.011299947573672166, 0.33333333333333331, 4.0000000000000000, 0.0}, + {0.0085447959546110473, 0.33333333333333331, 4.2500000000000000, 0.0}, + {0.0064720581217078245, 0.33333333333333331, 4.5000000000000000, 0.0}, + {0.0049093342803275264, 0.33333333333333331, 4.7500000000000000, 0.0}, + {0.0037288750960535887, 0.33333333333333331, 5.0000000000000000, 0.0}, +}; +const double toler008 = 2.5000000000000020e-13; + +// Test data for nu=0.50000000000000000. +// max(|f - f_GSL|): 1.3322676295501878e-15 at index 1 +// max(|f - f_GSL| / |f_GSL|): 1.3827172837936134e-15 +// mean(f - f_GSL): 7.5200262683594590e-17 +// variance(f - f_GSL): 3.1330080374967473e-34 +// stddev(f - f_GSL): 1.7700305188037711e-17 +const testcase_cyl_bessel_k data009[20] = { + {1.9521640631515476, 0.50000000000000000, 0.25000000000000000, 0.0}, + {1.0750476034999195, 0.50000000000000000, 0.50000000000000000, 0.0}, + {0.68361006034952432, 0.50000000000000000, 0.75000000000000000, 0.0}, + {0.46106850444789443, 0.50000000000000000, 1.0000000000000000, 0.0}, + {0.32117137397144746, 0.50000000000000000, 1.2500000000000000, 0.0}, + {0.22833505222826550, 0.50000000000000000, 1.5000000000000000, 0.0}, + {0.16463628997380861, 0.50000000000000000, 1.7500000000000000, 0.0}, + {0.11993777196806145, 0.50000000000000000, 2.0000000000000000, 0.0}, + {0.088065558803650454, 0.50000000000000000, 2.2500000000000000, 0.0}, + {0.065065943154009986, 0.50000000000000000, 2.5000000000000000, 0.0}, + {0.048315198301417825, 0.50000000000000000, 2.7500000000000000, 0.0}, + {0.036025985131764589, 0.50000000000000000, 3.0000000000000000, 0.0}, + {0.026956356532443351, 0.50000000000000000, 3.2500000000000000, 0.0}, + {0.020229969578139294, 0.50000000000000000, 3.5000000000000000, 0.0}, + {0.015220888252975568, 0.50000000000000000, 3.7500000000000000, 0.0}, + {0.011477624576608053, 0.50000000000000000, 4.0000000000000000, 0.0}, + {0.0086718932956978342, 0.50000000000000000, 4.2500000000000000, 0.0}, + {0.0065633945646345424, 0.50000000000000000, 4.5000000000000000, 0.0}, + {0.0049752435421262292, 0.50000000000000000, 4.7500000000000000, 0.0}, + {0.0037766133746428825, 0.50000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler009 = 2.5000000000000020e-13; + +// Test data for nu=0.66666666666666663. +// max(|f - f_GSL|): 8.3266726846886741e-16 at index 4 +// max(|f - f_GSL| / |f_GSL|): 2.4444922503951783e-15 +// mean(f - f_GSL): 1.5718763096694843e-16 +// variance(f - f_GSL): 1.3764253709076715e-33 +// stddev(f - f_GSL): 3.7100207154511570e-17 +const testcase_cyl_bessel_k data010[20] = { + {2.3289060745544101, 0.66666666666666663, 0.25000000000000000, 0.0}, + {1.2059304647203353, 0.66666666666666663, 0.50000000000000000, 0.0}, + {0.74547232976647226, 0.66666666666666663, 0.75000000000000000, 0.0}, + {0.49447506210420811, 0.66666666666666663, 1.0000000000000000, 0.0}, + {0.34062994813514252, 0.66666666666666663, 1.2500000000000000, 0.0}, + {0.24024045240315581, 0.66666666666666663, 1.5000000000000000, 0.0}, + {0.17217716908452307, 0.66666666666666663, 1.7500000000000000, 0.0}, + {0.12483892748812841, 0.66666666666666663, 2.0000000000000000, 0.0}, + {0.091315296079621050, 0.66666666666666663, 2.2500000000000000, 0.0}, + {0.067255322171623361, 0.66666666666666663, 2.5000000000000000, 0.0}, + {0.049809546542402224, 0.66666666666666663, 2.7500000000000000, 0.0}, + {0.037057074495188531, 0.66666666666666663, 3.0000000000000000, 0.0}, + {0.027674365504886729, 0.66666666666666663, 3.2500000000000000, 0.0}, + {0.020733915836010912, 0.66666666666666663, 3.5000000000000000, 0.0}, + {0.015577015510251336, 0.66666666666666663, 3.7500000000000000, 0.0}, + {0.011730801456525337, 0.66666666666666663, 4.0000000000000000, 0.0}, + {0.0088528343204658851, 0.66666666666666663, 4.2500000000000000, 0.0}, + {0.0066933190915775568, 0.66666666666666663, 4.5000000000000000, 0.0}, + {0.0050689292106255480, 0.66666666666666663, 4.7500000000000000, 0.0}, + {0.0038444246344968226, 0.66666666666666663, 5.0000000000000000, 0.0}, +}; +const double toler010 = 2.5000000000000020e-13; + +// Test data for nu=1.0000000000000000. +// max(|f - f_GSL|): 5.5511151231257827e-17 at index 5 +// max(|f - f_GSL| / |f_GSL|): 4.1133060946717609e-16 +// mean(f - f_GSL): 9.1072982488782376e-19 +// variance(f - f_GSL): 4.5951734844332747e-38 +// stddev(f - f_GSL): 2.1436355764059512e-19 +const testcase_cyl_bessel_k data011[20] = { + {3.7470259744407115, 1.0000000000000000, 0.25000000000000000, 0.0}, + {1.6564411200033007, 1.0000000000000000, 0.50000000000000000, 0.0}, + {0.94958046696214016, 1.0000000000000000, 0.75000000000000000, 0.0}, + {0.60190723019723458, 1.0000000000000000, 1.0000000000000000, 0.0}, + {0.40212407978419540, 1.0000000000000000, 1.2500000000000000, 0.0}, + {0.27738780045684375, 1.0000000000000000, 1.5000000000000000, 0.0}, + {0.19547745347439305, 1.0000000000000000, 1.7500000000000000, 0.0}, + {0.13986588181652262, 1.0000000000000000, 2.0000000000000000, 0.0}, + {0.10121630256832535, 1.0000000000000000, 2.2500000000000000, 0.0}, + {0.073890816347747038, 1.0000000000000000, 2.5000000000000000, 0.0}, + {0.054318522758919859, 1.0000000000000000, 2.7500000000000000, 0.0}, + {0.040156431128194198, 1.0000000000000000, 3.0000000000000000, 0.0}, + {0.029825529796040143, 1.0000000000000000, 3.2500000000000000, 0.0}, + {0.022239392925923845, 1.0000000000000000, 3.5000000000000000, 0.0}, + {0.016638191754688916, 1.0000000000000000, 3.7500000000000000, 0.0}, + {0.012483498887268437, 1.0000000000000000, 4.0000000000000000, 0.0}, + {0.0093896806560432589, 1.0000000000000000, 4.2500000000000000, 0.0}, + {0.0070780949089680918, 1.0000000000000000, 4.5000000000000000, 0.0}, + {0.0053459218178228390, 1.0000000000000000, 4.7500000000000000, 0.0}, + {0.0040446134454521655, 1.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler011 = 2.5000000000000020e-13; + +// Test data for nu=2.0000000000000000. +// max(|f - f_GSL|): 3.5527136788005009e-15 at index 0 +// max(|f - f_GSL| / |f_GSL|): 3.2289213139335320e-16 +// mean(f - f_GSL): -2.2187113257743364e-16 +// variance(f - f_GSL): 2.7486114598283265e-33 +// stddev(f - f_GSL): 5.2427201525814123e-17 +const testcase_cyl_bessel_k data012[20] = { + {31.517714546773998, 2.0000000000000000, 0.25000000000000000, 0.0}, + {7.5501835512408695, 2.0000000000000000, 0.50000000000000000, 0.0}, + {3.1427970006821715, 2.0000000000000000, 0.75000000000000000, 0.0}, + {1.6248388986351774, 2.0000000000000000, 1.0000000000000000, 0.0}, + {0.94100161673881855, 2.0000000000000000, 1.2500000000000000, 0.0}, + {0.58365596325665070, 2.0000000000000000, 1.5000000000000000, 0.0}, + {0.37878261635733851, 2.0000000000000000, 1.7500000000000000, 0.0}, + {0.25375975456605621, 2.0000000000000000, 2.0000000000000000, 0.0}, + {0.17401315870205850, 2.0000000000000000, 2.2500000000000000, 0.0}, + {0.12146020627856381, 2.0000000000000000, 2.5000000000000000, 0.0}, + {0.085959281497066137, 2.0000000000000000, 2.7500000000000000, 0.0}, + {0.061510458471742059, 2.0000000000000000, 3.0000000000000000, 0.0}, + {0.044412927437333515, 2.0000000000000000, 3.2500000000000000, 0.0}, + {0.032307121699467839, 2.0000000000000000, 3.5000000000000000, 0.0}, + {0.023647953146296131, 2.0000000000000000, 3.7500000000000000, 0.0}, + {0.017401425529487247, 2.0000000000000000, 4.0000000000000000, 0.0}, + {0.012863060974445674, 2.0000000000000000, 4.2500000000000000, 0.0}, + {0.0095456772027753493, 2.0000000000000000, 4.5000000000000000, 0.0}, + {0.0071081190074975690, 2.0000000000000000, 4.7500000000000000, 0.0}, + {0.0053089437122234608, 2.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler012 = 2.5000000000000020e-13; + +// Test data for nu=5.0000000000000000. +// max(|f - f_GSL|): 5.8207660913467407e-11 at index 0 +// max(|f - f_GSL| / |f_GSL|): 5.4133817134973930e-16 +// mean(f - f_GSL): -3.0029749520377179e-12 +// variance(f - f_GSL): 4.9960666134422494e-25 +// stddev(f - f_GSL): 7.0682859403410163e-13 +const testcase_cyl_bessel_k data013[20] = { + {391683.98962334893, 5.0000000000000000, 0.25000000000000000, 0.0}, + {12097.979476096394, 5.0000000000000000, 0.50000000000000000, 0.0}, + {1562.5870339691098, 5.0000000000000000, 0.75000000000000000, 0.0}, + {360.96058960124071, 5.0000000000000000, 1.0000000000000000, 0.0}, + {114.29321426334016, 5.0000000000000000, 1.2500000000000000, 0.0}, + {44.067781159301056, 5.0000000000000000, 1.5000000000000000, 0.0}, + {19.426568687730288, 5.0000000000000000, 1.7500000000000000, 0.0}, + {9.4310491005964820, 5.0000000000000000, 2.0000000000000000, 0.0}, + {4.9221270549918685, 5.0000000000000000, 2.2500000000000000, 0.0}, + {2.7168842907865423, 5.0000000000000000, 2.5000000000000000, 0.0}, + {1.5677685890536335, 5.0000000000000000, 2.7500000000000000, 0.0}, + {0.93777360238680818, 5.0000000000000000, 3.0000000000000000, 0.0}, + {0.57775534736785106, 5.0000000000000000, 3.2500000000000000, 0.0}, + {0.36482440208451983, 5.0000000000000000, 3.5000000000000000, 0.0}, + {0.23520290620082260, 5.0000000000000000, 3.7500000000000000, 0.0}, + {0.15434254872599726, 5.0000000000000000, 4.0000000000000000, 0.0}, + {0.10283347176876455, 5.0000000000000000, 4.2500000000000000, 0.0}, + {0.069423643150881773, 5.0000000000000000, 4.5000000000000000, 0.0}, + {0.047410616917942211, 5.0000000000000000, 4.7500000000000000, 0.0}, + {0.032706273712031865, 5.0000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler013 = 2.5000000000000020e-13; + +// Test data for nu=10.000000000000000. +// max(|f - f_GSL|): 6.1035156250000000e-05 at index 1 +// max(|f - f_GSL| / |f_GSL|): 7.7998476565326393e-16 +// mean(f - f_GSL): -3.0495557438392496e-06 +// variance(f - f_GSL): 5.1522383752309128e-13 +// stddev(f - f_GSL): 7.1779094277031061e-07 +const testcase_cyl_bessel_k data014[20] = { + {194481817927839.88, 10.000000000000000, 0.25000000000000000, 0.0}, + {188937569319.90030, 10.000000000000000, 0.50000000000000000, 0.0}, + {3248187687.8018155, 10.000000000000000, 0.75000000000000000, 0.0}, + {180713289.90102944, 10.000000000000000, 1.0000000000000000, 0.0}, + {19104425.945252180, 10.000000000000000, 1.2500000000000000, 0.0}, + {3027483.5236822353, 10.000000000000000, 1.5000000000000000, 0.0}, + {633724.71555087867, 10.000000000000000, 1.7500000000000000, 0.0}, + {162482.40397955943, 10.000000000000000, 2.0000000000000000, 0.0}, + {48602.446087749791, 10.000000000000000, 2.2500000000000000, 0.0}, + {16406.916416341937, 10.000000000000000, 2.5000000000000000, 0.0}, + {6104.1720745909606, 10.000000000000000, 2.7500000000000000, 0.0}, + {2459.6204220569480, 10.000000000000000, 3.0000000000000000, 0.0}, + {1059.2358443703381, 10.000000000000000, 3.2500000000000000, 0.0}, + {482.53582096664758, 10.000000000000000, 3.5000000000000000, 0.0}, + {230.64249314993782, 10.000000000000000, 3.7500000000000000, 0.0}, + {114.91408364049623, 10.000000000000000, 4.0000000000000000, 0.0}, + {59.361613632706479, 10.000000000000000, 4.2500000000000000, 0.0}, + {31.652958759229872, 10.000000000000000, 4.5000000000000000, 0.0}, + {17.357723966417399, 10.000000000000000, 4.7500000000000000, 0.0}, + {9.7585628291778121, 10.000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler014 = 2.5000000000000020e-13; + +// Test data for nu=20.000000000000000. +// max(|f - f_GSL|): 2.7670116110564327e+19 at index 0 +// max(|f - f_GSL| / |f_GSL|): 1.2737005853777639e-15 +// mean(f - f_GSL): -1.3835066851362150e+18 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_k data015[20] = { + {7.0065983661641184e+34, 20.000000000000000, 0.25000000000000000, 0.0}, + {6.6655498744171593e+28, 20.000000000000000, 0.50000000000000000, 0.0}, + {1.9962989615380379e+25, 20.000000000000000, 0.75000000000000000, 0.0}, + {6.2943693604245335e+22, 20.000000000000000, 1.0000000000000000, 0.0}, + {7.2034511920074182e+20, 20.000000000000000, 1.2500000000000000, 0.0}, + {1.8620549984645546e+19, 20.000000000000000, 1.5000000000000000, 0.0}, + {8.4415605303952486e+17, 20.000000000000000, 1.7500000000000000, 0.0}, + {57708568527002520., 20.000000000000000, 2.0000000000000000, 0.0}, + {5396824209986879.0, 20.000000000000000, 2.2500000000000000, 0.0}, + {645996884063683.62, 20.000000000000000, 2.5000000000000000, 0.0}, + {94387401970996.328, 20.000000000000000, 2.7500000000000000, 0.0}, + {16254643952204.371, 20.000000000000000, 3.0000000000000000, 0.0}, + {3212694836166.4053, 20.000000000000000, 3.2500000000000000, 0.0}, + {713857897923.74072, 20.000000000000000, 3.5000000000000000, 0.0}, + {175423421958.35925, 20.000000000000000, 3.7500000000000000, 0.0}, + {47050078926.298088, 20.000000000000000, 4.0000000000000000, 0.0}, + {13625066095.067503, 20.000000000000000, 4.2500000000000000, 0.0}, + {4222179870.6810660, 20.000000000000000, 4.5000000000000000, 0.0}, + {1389634112.7516634, 20.000000000000000, 4.7500000000000000, 0.0}, + {482700052.06214869, 20.000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler015 = 2.5000000000000020e-13; + +// Test data for nu=50.000000000000000. +// max(|f - f_GSL|): 3.9111090745622133e+92 at index 0 +// max(|f - f_GSL| / |f_GSL|): 3.7220730535457535e-15 +// mean(f - f_GSL): -1.9555545372811066e+91 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_k data016[20] = { + {4.3394604622138714e+107, 50.000000000000000, 0.25000000000000000, 0.0}, + {3.8505298918269003e+92, 50.000000000000000, 0.50000000000000000, 0.0}, + {6.0292756894842793e+83, 50.000000000000000, 0.75000000000000000, 0.0}, + {3.4068968541617001e+77, 50.000000000000000, 1.0000000000000000, 0.0}, + {4.8485527365039051e+72, 50.000000000000000, 1.2500000000000000, 0.0}, + {5.3091717574907920e+68, 50.000000000000000, 1.5000000000000000, 0.0}, + {2.3762245257445824e+65, 50.000000000000000, 1.7500000000000000, 0.0}, + {2.9799817396049268e+62, 50.000000000000000, 2.0000000000000000, 0.0}, + {8.2079431233488581e+59, 50.000000000000000, 2.2500000000000000, 0.0}, + {4.2046528212987503e+57, 50.000000000000000, 2.5000000000000000, 0.0}, + {3.5578676911884825e+55, 50.000000000000000, 2.7500000000000000, 0.0}, + {4.5559542293221535e+53, 50.000000000000000, 3.0000000000000000, 0.0}, + {8.2606735967628997e+51, 50.000000000000000, 3.2500000000000000, 0.0}, + {2.0139406747903812e+50, 50.000000000000000, 3.5000000000000000, 0.0}, + {6.3368727837484613e+48, 50.000000000000000, 3.7500000000000000, 0.0}, + {2.4897317389325757e+47, 50.000000000000000, 4.0000000000000000, 0.0}, + {1.1888958173039699e+46, 50.000000000000000, 4.2500000000000000, 0.0}, + {6.7472593648148550e+44, 50.000000000000000, 4.5000000000000000, 0.0}, + {4.4664266585930700e+43, 50.000000000000000, 4.7500000000000000, 0.0}, + {3.3943222434301628e+42, 50.000000000000000, 5.0000000000000000, 0.0}, +}; +const double toler016 = 2.5000000000000020e-13; + +// Test data for nu=100.00000000000000. +// max(|f - f_GSL|): 8.5970689361151757e+232 at index 0 +// max(|f - f_GSL| / |f_GSL|): 9.0457919481999128e-14 +// mean(f - f_GSL): -4.2985344680575876e+231 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_k data017[20] = { + {9.5039428115809898e+245, 100.00000000000000, 0.25000000000000000, 0.0}, + {7.4937399313533112e+215, 100.00000000000000, 0.50000000000000000, 0.0}, + {1.8417471020730699e+198, 100.00000000000000, 0.75000000000000000, 0.0}, + {5.9003331836386410e+185, 100.00000000000000, 1.0000000000000000, 0.0}, + {1.2002130935576950e+176, 100.00000000000000, 1.2500000000000000, 0.0}, + {1.4467044226487075e+168, 100.00000000000000, 1.5000000000000000, 0.0}, + {2.9161498411497642e+161, 100.00000000000000, 1.7500000000000000, 0.0}, + {4.6194159776013925e+155, 100.00000000000000, 2.0000000000000000, 0.0}, + {3.5332121583541727e+150, 100.00000000000000, 2.2500000000000000, 0.0}, + {9.3566097231039940e+145, 100.00000000000000, 2.5000000000000000, 0.0}, + {6.7672283615134532e+141, 100.00000000000000, 2.7500000000000000, 0.0}, + {1.1219630864949494e+138, 100.00000000000000, 3.0000000000000000, 0.0}, + {3.7329723699990903e+134, 100.00000000000000, 3.2500000000000000, 0.0}, + {2.2476893883855163e+131, 100.00000000000000, 3.5000000000000000, 0.0}, + {2.2564559319883200e+128, 100.00000000000000, 3.7500000000000000, 0.0}, + {3.5353340499626463e+125, 100.00000000000000, 4.0000000000000000, 0.0}, + {8.1898439213010234e+122, 100.00000000000000, 4.2500000000000000, 0.0}, + {2.6823744110726800e+120, 100.00000000000000, 4.5000000000000000, 0.0}, + {1.1963963615212274e+118, 100.00000000000000, 4.7500000000000000, 0.0}, + {7.0398601930616815e+115, 100.00000000000000, 5.0000000000000000, 0.0}, +}; +const double toler017 = 5.0000000000000029e-12; +// cyl_bessel_k + +// Test data for nu=0.0000000000000000. +// max(|f - f_GSL|): 4.3368086899420177e-19 at index 0 +// max(|f - f_GSL| / |f_GSL|): 2.3318588132773140e-16 +// mean(f - f_GSL): 2.1684048659978596e-20 +// variance(f - f_GSL): 2.6049748824837649e-41 +// stddev(f - f_GSL): 5.1038954559079328e-21 +const testcase_cyl_bessel_k data018[20] = { + {0.0036910983340425947, 0.0000000000000000, 5.0000000000000000, 0.0}, + {1.7780062316167647e-05, 0.0000000000000000, 10.000000000000000, 0.0}, + {9.8195364823964333e-08, 0.0000000000000000, 15.000000000000000, 0.0}, + {5.7412378153365238e-10, 0.0000000000000000, 20.000000000000000, 0.0}, + {3.4641615622131151e-12, 0.0000000000000000, 25.000000000000000, 0.0}, + {2.1324774964630566e-14, 0.0000000000000000, 30.000000000000000, 0.0}, + {1.3310351491429464e-16, 0.0000000000000000, 35.000000000000000, 0.0}, + {8.3928611000995700e-19, 0.0000000000000000, 40.000000000000000, 0.0}, + {5.3334561226187247e-21, 0.0000000000000000, 45.000000000000000, 0.0}, + {3.4101677497894956e-23, 0.0000000000000000, 50.000000000000000, 0.0}, + {2.1913102183534147e-25, 0.0000000000000000, 55.000000000000000, 0.0}, + {1.4138978405591074e-27, 0.0000000000000000, 60.000000000000000, 0.0}, + {9.1544673210030045e-30, 0.0000000000000000, 65.000000000000000, 0.0}, + {5.9446613372925013e-32, 0.0000000000000000, 70.000000000000000, 0.0}, + {3.8701170455869113e-34, 0.0000000000000000, 75.000000000000000, 0.0}, + {2.5251198425054720e-36, 0.0000000000000000, 80.000000000000000, 0.0}, + {1.6507623579783908e-38, 0.0000000000000000, 85.000000000000000, 0.0}, + {1.0810242556984256e-40, 0.0000000000000000, 90.000000000000000, 0.0}, + {7.0901249699001278e-43, 0.0000000000000000, 95.000000000000000, 0.0}, + {4.6566282291759025e-45, 0.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler018 = 2.5000000000000020e-13; + +// Test data for nu=0.33333333333333331. +// max(|f - f_GSL|): 1.0339757656912846e-25 at index 3 +// max(|f - f_GSL| / |f_GSL|): 2.3267819230578392e-16 +// mean(f - f_GSL): 5.2104262741326337e-27 +// variance(f - f_GSL): 1.5040743467131125e-54 +// stddev(f - f_GSL): 1.2264070884959499e-27 +const testcase_cyl_bessel_k data019[20] = { + {0.0037288750960535887, 0.33333333333333331, 5.0000000000000000, 0.0}, + {1.7874608271055336e-05, 0.33333333333333331, 10.000000000000000, 0.0}, + {9.8548341568798317e-08, 0.33333333333333331, 15.000000000000000, 0.0}, + {5.7568278247790865e-10, 0.33333333333333331, 20.000000000000000, 0.0}, + {3.4717201424907059e-12, 0.33333333333333331, 25.000000000000000, 0.0}, + {2.1363664736611189e-14, 0.33333333333333331, 30.000000000000000, 0.0}, + {1.3331202314165813e-16, 0.33333333333333331, 35.000000000000000, 0.0}, + {8.4043837769480934e-19, 0.33333333333333331, 40.000000000000000, 0.0}, + {5.3399731261024948e-21, 0.33333333333333331, 45.000000000000000, 0.0}, + {3.4139217813583632e-23, 0.33333333333333331, 50.000000000000000, 0.0}, + {2.1935050179185627e-25, 0.33333333333333331, 55.000000000000000, 0.0}, + {1.4151968805623662e-27, 0.33333333333333331, 60.000000000000000, 0.0}, + {9.1622357217019043e-30, 0.33333333333333331, 65.000000000000000, 0.0}, + {5.9493479703461315e-32, 0.33333333333333331, 70.000000000000000, 0.0}, + {3.8729660011055947e-34, 0.33333333333333331, 75.000000000000000, 0.0}, + {2.5268631828013874e-36, 0.33333333333333331, 80.000000000000000, 0.0}, + {1.6518353676138867e-38, 0.33333333333333331, 85.000000000000000, 0.0}, + {1.0816880942511494e-40, 0.33333333333333331, 90.000000000000000, 0.0}, + {7.0942508599231512e-43, 0.33333333333333331, 95.000000000000000, 0.0}, + {4.6592031570213448e-45, 0.33333333333333331, 100.00000000000000, 0.0}, +}; +const double toler019 = 2.5000000000000020e-13; + +// Test data for nu=0.50000000000000000. +// max(|f - f_GSL|): 8.0779356694631609e-28 at index 4 +// max(|f - f_GSL| / |f_GSL|): 2.3204515428965958e-16 +// mean(f - f_GSL): 4.0547450415218674e-29 +// variance(f - f_GSL): 9.1085636297762724e-59 +// stddev(f - f_GSL): 9.5438795202874765e-30 +const testcase_cyl_bessel_k data020[20] = { + {0.0037766133746428825, 0.50000000000000000, 5.0000000000000000, 0.0}, + {1.7993478093705178e-05, 0.50000000000000000, 10.000000000000000, 0.0}, + {9.8991312032877236e-08, 0.50000000000000000, 15.000000000000000, 0.0}, + {5.7763739747074450e-10, 0.50000000000000000, 20.000000000000000, 0.0}, + {3.4811912768406949e-12, 0.50000000000000000, 25.000000000000000, 0.0}, + {2.1412375659560111e-14, 0.50000000000000000, 30.000000000000000, 0.0}, + {1.3357311366035824e-16, 0.50000000000000000, 35.000000000000000, 0.0}, + {8.4188091949489049e-19, 0.50000000000000000, 40.000000000000000, 0.0}, + {5.3481305002517408e-21, 0.50000000000000000, 45.000000000000000, 0.0}, + {3.4186200954570754e-23, 0.50000000000000000, 50.000000000000000, 0.0}, + {2.1962515908772453e-25, 0.50000000000000000, 55.000000000000000, 0.0}, + {1.4168223500353693e-27, 0.50000000000000000, 60.000000000000000, 0.0}, + {9.1719554473256892e-30, 0.50000000000000000, 65.000000000000000, 0.0}, + {5.9552114337788932e-32, 0.50000000000000000, 70.000000000000000, 0.0}, + {3.8765301321409432e-34, 0.50000000000000000, 75.000000000000000, 0.0}, + {2.5290440439442907e-36, 0.50000000000000000, 80.000000000000000, 0.0}, + {1.6531776067605980e-38, 0.50000000000000000, 85.000000000000000, 0.0}, + {1.0825184636529955e-40, 0.50000000000000000, 90.000000000000000, 0.0}, + {7.0994115873258822e-43, 0.50000000000000000, 95.000000000000000, 0.0}, + {4.6624238126346709e-45, 0.50000000000000000, 100.00000000000000, 0.0}, +}; +const double toler020 = 2.5000000000000020e-13; + +// Test data for nu=0.66666666666666663. +// max(|f - f_GSL|): 4.3368086899420177e-19 at index 0 +// max(|f - f_GSL| / |f_GSL|): 3.5630695000470094e-16 +// mean(f - f_GSL): -2.1684694793857957e-20 +// variance(f - f_GSL): 2.6051301291012209e-41 +// stddev(f - f_GSL): 5.1040475400423349e-21 +const testcase_cyl_bessel_k data021[20] = { + {0.0038444246344968226, 0.66666666666666663, 5.0000000000000000, 0.0}, + {1.8161187569530204e-05, 0.66666666666666663, 10.000000000000000, 0.0}, + {9.9614751542305571e-08, 0.66666666666666663, 15.000000000000000, 0.0}, + {5.8038484271925811e-10, 0.66666666666666663, 20.000000000000000, 0.0}, + {3.4944937498488603e-12, 0.66666666666666663, 25.000000000000000, 0.0}, + {2.1480755645577720e-14, 0.66666666666666663, 30.000000000000000, 0.0}, + {1.3393949190152161e-16, 0.66666666666666663, 35.000000000000000, 0.0}, + {8.4390460553642992e-19, 0.66666666666666663, 40.000000000000000, 0.0}, + {5.3595716143622089e-21, 0.66666666666666663, 45.000000000000000, 0.0}, + {3.4252085301433749e-23, 0.66666666666666663, 50.000000000000000, 0.0}, + {2.2001025377982308e-25, 0.66666666666666663, 55.000000000000000, 0.0}, + {1.4191011274172078e-27, 0.66666666666666663, 60.000000000000000, 0.0}, + {9.1855803020269763e-30, 0.66666666666666663, 65.000000000000000, 0.0}, + {5.9634299472578764e-32, 0.66666666666666663, 70.000000000000000, 0.0}, + {3.8815254026478500e-34, 0.66666666666666663, 75.000000000000000, 0.0}, + {2.5321003991943847e-36, 0.66666666666666663, 80.000000000000000, 0.0}, + {1.6550585670593067e-38, 0.66666666666666663, 85.000000000000000, 0.0}, + {1.0836820479428605e-40, 0.66666666666666663, 90.000000000000000, 0.0}, + {7.1066428916285356e-43, 0.66666666666666663, 95.000000000000000, 0.0}, + {4.6669364587280459e-45, 0.66666666666666663, 100.00000000000000, 0.0}, +}; +const double toler021 = 2.5000000000000020e-13; + +// Test data for nu=1.0000000000000000. +// max(|f - f_GSL|): 1.0339757656912846e-25 at index 3 +// max(|f - f_GSL| / |f_GSL|): 1.7575481510496439e-16 +// mean(f - f_GSL): 5.1899158905965940e-27 +// variance(f - f_GSL): 1.4922563408014978e-54 +// stddev(f - f_GSL): 1.2215794451452995e-27 +const testcase_cyl_bessel_k data022[20] = { + {0.0040446134454521655, 1.0000000000000000, 5.0000000000000000, 0.0}, + {1.8648773453825579e-05, 1.0000000000000000, 10.000000000000000, 0.0}, + {1.0141729369762091e-07, 1.0000000000000000, 15.000000000000000, 0.0}, + {5.8830579695570384e-10, 1.0000000000000000, 20.000000000000000, 0.0}, + {3.5327780731999345e-12, 1.0000000000000000, 25.000000000000000, 0.0}, + {2.1677320018915498e-14, 1.0000000000000000, 30.000000000000000, 0.0}, + {1.3499178340011053e-16, 1.0000000000000000, 35.000000000000000, 0.0}, + {8.4971319548610435e-19, 1.0000000000000000, 40.000000000000000, 0.0}, + {5.3923945937225035e-21, 1.0000000000000000, 45.000000000000000, 0.0}, + {3.4441022267175555e-23, 1.0000000000000000, 50.000000000000000, 0.0}, + {2.2111422716117463e-25, 1.0000000000000000, 55.000000000000000, 0.0}, + {1.4256320265171041e-27, 1.0000000000000000, 60.000000000000000, 0.0}, + {9.2246195278906156e-30, 1.0000000000000000, 65.000000000000000, 0.0}, + {5.9869736739138550e-32, 1.0000000000000000, 70.000000000000000, 0.0}, + {3.8958329467421912e-34, 1.0000000000000000, 75.000000000000000, 0.0}, + {2.5408531275211705e-36, 1.0000000000000000, 80.000000000000000, 0.0}, + {1.6604444948567571e-38, 1.0000000000000000, 85.000000000000000, 0.0}, + {1.0870134457498335e-40, 1.0000000000000000, 90.000000000000000, 0.0}, + {7.1273442329907240e-43, 1.0000000000000000, 95.000000000000000, 0.0}, + {4.6798537356369088e-45, 1.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler022 = 2.5000000000000020e-13; + +// Test data for nu=2.0000000000000000. +// max(|f - f_GSL|): 8.6736173798840355e-19 at index 0 +// max(|f - f_GSL| / |f_GSL|): 2.1559652446630200e-16 +// mean(f - f_GSL): 4.3368092109689917e-20 +// variance(f - f_GSL): 1.0419897026230187e-40 +// stddev(f - f_GSL): 1.0207789685446202e-20 +const testcase_cyl_bessel_k data023[20] = { + {0.0053089437122234608, 2.0000000000000000, 5.0000000000000000, 0.0}, + {2.1509817006932763e-05, 2.0000000000000000, 10.000000000000000, 0.0}, + {1.1171767065031378e-07, 2.0000000000000000, 15.000000000000000, 0.0}, + {6.3295436122922281e-10, 2.0000000000000000, 20.000000000000000, 0.0}, + {3.7467838080691102e-12, 2.0000000000000000, 25.000000000000000, 0.0}, + {2.2769929632558265e-14, 2.0000000000000000, 30.000000000000000, 0.0}, + {1.4081733110858665e-16, 2.0000000000000000, 35.000000000000000, 0.0}, + {8.8177176978426223e-19, 2.0000000000000000, 40.000000000000000, 0.0}, + {5.5731181045619470e-21, 2.0000000000000000, 45.000000000000000, 0.0}, + {3.5479318388581979e-23, 2.0000000000000000, 50.000000000000000, 0.0}, + {2.2717153918665688e-25, 2.0000000000000000, 55.000000000000000, 0.0}, + {1.4614189081096777e-27, 2.0000000000000000, 60.000000000000000, 0.0}, + {9.4383017680150234e-30, 2.0000000000000000, 65.000000000000000, 0.0}, + {6.1157177279757537e-32, 2.0000000000000000, 70.000000000000000, 0.0}, + {3.9740059241667034e-34, 2.0000000000000000, 75.000000000000000, 0.0}, + {2.5886411706935012e-36, 2.0000000000000000, 80.000000000000000, 0.0}, + {1.6898316402103142e-38, 2.0000000000000000, 85.000000000000000, 0.0}, + {1.1051801100484218e-40, 2.0000000000000000, 90.000000000000000, 0.0}, + {7.2401743221736176e-43, 2.0000000000000000, 95.000000000000000, 0.0}, + {4.7502253038886407e-45, 2.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler023 = 2.5000000000000020e-13; + +// Test data for nu=5.0000000000000000. +// max(|f - f_GSL|): 6.9388939039072284e-18 at index 0 +// max(|f - f_GSL| / |f_GSL|): 2.1215788643493719e-16 +// mean(f - f_GSL): 3.4694602906449006e-19 +// variance(f - f_GSL): 6.6687837719455956e-39 +// stddev(f - f_GSL): 8.1662621632822905e-20 +const testcase_cyl_bessel_k data024[20] = { + {0.032706273712031865, 5.0000000000000000, 5.0000000000000000, 0.0}, + {5.7541849985312275e-05, 5.0000000000000000, 10.000000000000000, 0.0}, + {2.1878261369258224e-07, 5.0000000000000000, 15.000000000000000, 0.0}, + {1.0538660139974233e-09, 5.0000000000000000, 20.000000000000000, 0.0}, + {5.6485921365284157e-12, 5.0000000000000000, 25.000000000000000, 0.0}, + {3.2103335105890266e-14, 5.0000000000000000, 30.000000000000000, 0.0}, + {1.8919208406439644e-16, 5.0000000000000000, 35.000000000000000, 0.0}, + {1.1423814375953188e-18, 5.0000000000000000, 40.000000000000000, 0.0}, + {7.0181216822204101e-21, 5.0000000000000000, 45.000000000000000, 0.0}, + {4.3671822541009859e-23, 5.0000000000000000, 50.000000000000000, 0.0}, + {2.7444967640357869e-25, 5.0000000000000000, 55.000000000000000, 0.0}, + {1.7382232741886986e-27, 5.0000000000000000, 60.000000000000000, 0.0}, + {1.1078474298959669e-29, 5.0000000000000000, 65.000000000000000, 0.0}, + {7.0974537081794416e-32, 5.0000000000000000, 70.000000000000000, 0.0}, + {4.5667269500061064e-34, 5.0000000000000000, 75.000000000000000, 0.0}, + {2.9491764420206146e-36, 5.0000000000000000, 80.000000000000000, 0.0}, + {1.9105685973117463e-38, 5.0000000000000000, 85.000000000000000, 0.0}, + {1.2411034311592645e-40, 5.0000000000000000, 90.000000000000000, 0.0}, + {8.0814211331379146e-43, 5.0000000000000000, 95.000000000000000, 0.0}, + {5.2732561132929503e-45, 5.0000000000000000, 100.00000000000000, 0.0}, +}; +const double toler024 = 2.5000000000000020e-13; + +// Test data for nu=10.000000000000000. +// max(|f - f_GSL|): 5.3290705182007514e-15 at index 0 +// max(|f - f_GSL| / |f_GSL|): 5.4609173619982130e-16 +// mean(f - f_GSL): 2.6646441036645034e-16 +// variance(f - f_GSL): 3.9336998333484790e-33 +// stddev(f - f_GSL): 6.2719214227766586e-17 +const testcase_cyl_bessel_k data025[20] = { + {9.7585628291778121, 10.000000000000000, 5.0000000000000000, 0.0}, + {0.0016142553003906698, 10.000000000000000, 10.000000000000000, 0.0}, + {2.2605303776606435e-06, 10.000000000000000, 15.000000000000000, 0.0}, + {6.3162145283215804e-09, 10.000000000000000, 20.000000000000000, 0.0}, + {2.4076769602801233e-11, 10.000000000000000, 25.000000000000000, 0.0}, + {1.0842816942222975e-13, 10.000000000000000, 30.000000000000000, 0.0}, + {5.3976770429777191e-16, 10.000000000000000, 35.000000000000000, 0.0}, + {2.8680293113671932e-18, 10.000000000000000, 40.000000000000000, 0.0}, + {1.5939871900169600e-20, 10.000000000000000, 45.000000000000000, 0.0}, + {9.1509882099879962e-23, 10.000000000000000, 50.000000000000000, 0.0}, + {5.3823846249592858e-25, 10.000000000000000, 55.000000000000000, 0.0}, + {3.2253408700563144e-27, 10.000000000000000, 60.000000000000000, 0.0}, + {1.9613367530075138e-29, 10.000000000000000, 65.000000000000000, 0.0}, + {1.2068471495933484e-31, 10.000000000000000, 70.000000000000000, 0.0}, + {7.4979152649449644e-34, 10.000000000000000, 75.000000000000000, 0.0}, + {4.6957285830490531e-36, 10.000000000000000, 80.000000000000000, 0.0}, + {2.9606323347034079e-38, 10.000000000000000, 85.000000000000000, 0.0}, + {1.8773542561131613e-40, 10.000000000000000, 90.000000000000000, 0.0}, + {1.1962899527846350e-42, 10.000000000000000, 95.000000000000000, 0.0}, + {7.6554279773881006e-45, 10.000000000000000, 100.00000000000000, 0.0}, +}; +const double toler025 = 2.5000000000000020e-13; + +// Test data for nu=20.000000000000000. +// max(|f - f_GSL|): 4.1723251342773438e-07 at index 0 +// max(|f - f_GSL| / |f_GSL|): 1.2224656515794909e-15 +// mean(f - f_GSL): 2.0861629934990416e-08 +// variance(f - f_GSL): 2.4111224573101845e-17 +// stddev(f - f_GSL): 4.9103181743245358e-09 +const testcase_cyl_bessel_k data026[20] = { + {482700052.06214869, 20.000000000000000, 5.0000000000000000, 0.0}, + {178.74427820770543, 20.000000000000000, 10.000000000000000, 0.0}, + {0.012141257729731143, 20.000000000000000, 15.000000000000000, 0.0}, + {5.5431116361258155e-06, 20.000000000000000, 20.000000000000000, 0.0}, + {6.3744029330352113e-09, 20.000000000000000, 25.000000000000000, 0.0}, + {1.2304516475442478e-11, 20.000000000000000, 30.000000000000000, 0.0}, + {3.2673136479809018e-14, 20.000000000000000, 35.000000000000000, 0.0}, + {1.0703023799997383e-16, 20.000000000000000, 40.000000000000000, 0.0}, + {4.0549953175660457e-19, 20.000000000000000, 45.000000000000000, 0.0}, + {1.7061483797220349e-21, 20.000000000000000, 50.000000000000000, 0.0}, + {7.7617008115659413e-24, 20.000000000000000, 55.000000000000000, 0.0}, + {3.7482954006874720e-26, 20.000000000000000, 60.000000000000000, 0.0}, + {1.8966880763956576e-28, 20.000000000000000, 65.000000000000000, 0.0}, + {9.9615763479998864e-31, 20.000000000000000, 70.000000000000000, 0.0}, + {5.3921623063091066e-33, 20.000000000000000, 75.000000000000000, 0.0}, + {2.9920407657642266e-35, 20.000000000000000, 80.000000000000000, 0.0}, + {1.6948662723618255e-37, 20.000000000000000, 85.000000000000000, 0.0}, + {9.7689149642963042e-40, 20.000000000000000, 90.000000000000000, 0.0}, + {5.7143603019220823e-42, 20.000000000000000, 95.000000000000000, 0.0}, + {3.3852054148901695e-44, 20.000000000000000, 100.00000000000000, 0.0}, +}; +const double toler026 = 2.5000000000000020e-13; + +// Test data for nu=50.000000000000000. +// max(|f - f_GSL|): 8.6655802749976619e+27 at index 0 +// max(|f - f_GSL| / |f_GSL|): 2.6684549464729312e-15 +// mean(f - f_GSL): 4.3327901374988334e+26 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_k data027[20] = { + {3.3943222434301628e+42, 50.000000000000000, 5.0000000000000000, 0.0}, + {2.0613737753892554e+27, 50.000000000000000, 10.000000000000000, 0.0}, + {1.7267736974519188e+18, 50.000000000000000, 15.000000000000000, 0.0}, + {411711209122.01788, 50.000000000000000, 20.000000000000000, 0.0}, + {1972478.7419813874, 50.000000000000000, 25.000000000000000, 0.0}, + {58.770686258007267, 50.000000000000000, 30.000000000000000, 0.0}, + {0.0058659391182535178, 50.000000000000000, 35.000000000000000, 0.0}, + {1.3634854128794101e-06, 50.000000000000000, 40.000000000000000, 0.0}, + {5.8652396362160819e-10, 50.000000000000000, 45.000000000000000, 0.0}, + {4.0060134766400893e-13, 50.000000000000000, 50.000000000000000, 0.0}, + {3.9062324485711016e-16, 50.000000000000000, 55.000000000000000, 0.0}, + {5.0389298085176510e-19, 50.000000000000000, 60.000000000000000, 0.0}, + {8.1305344250110424e-22, 50.000000000000000, 65.000000000000000, 0.0}, + {1.5732816234948991e-24, 50.000000000000000, 70.000000000000000, 0.0}, + {3.5349854993874412e-27, 50.000000000000000, 75.000000000000000, 0.0}, + {8.9940101003189471e-30, 50.000000000000000, 80.000000000000000, 0.0}, + {2.5403205503080723e-32, 50.000000000000000, 85.000000000000000, 0.0}, + {7.8397596486715721e-35, 50.000000000000000, 90.000000000000000, 0.0}, + {2.6098900651329542e-37, 50.000000000000000, 95.000000000000000, 0.0}, + {9.2745226536133242e-40, 50.000000000000000, 100.00000000000000, 0.0}, +}; +const double toler027 = 2.5000000000000020e-13; + +// Test data for nu=100.00000000000000. +// max(|f - f_GSL|): 3.4996011596528191e+101 at index 0 +// max(|f - f_GSL| / |f_GSL|): 5.1049818083452373e-15 +// mean(f - f_GSL): 1.7498005798264095e+100 +// variance(f - f_GSL): inf +// stddev(f - f_GSL): inf +const testcase_cyl_bessel_k data028[20] = { + {7.0398601930616815e+115, 100.00000000000000, 5.0000000000000000, 0.0}, + {4.5966740842695231e+85, 100.00000000000000, 10.000000000000000, 0.0}, + {8.2565552242653946e+67, 100.00000000000000, 15.000000000000000, 0.0}, + {1.7081356456876041e+55, 100.00000000000000, 20.000000000000000, 0.0}, + {1.9858028128780610e+45, 100.00000000000000, 25.000000000000000, 0.0}, + {1.2131584253026677e+37, 100.00000000000000, 30.000000000000000, 0.0}, + {1.1016916354696688e+30, 100.00000000000000, 35.000000000000000, 0.0}, + {7.0074023297775712e+23, 100.00000000000000, 40.000000000000000, 0.0}, + {1.9236643958470894e+18, 100.00000000000000, 45.000000000000000, 0.0}, + {16394035276269.250, 100.00000000000000, 50.000000000000000, 0.0}, + {343254952.89495474, 100.00000000000000, 55.000000000000000, 0.0}, + {14870.012754946298, 100.00000000000000, 60.000000000000000, 0.0}, + {1.1708099078572216, 100.00000000000000, 65.000000000000000, 0.0}, + {0.00015161193930722313, 100.00000000000000, 70.000000000000000, 0.0}, + {2.9850234381623443e-08, 100.00000000000000, 75.000000000000000, 0.0}, + {8.3928710724649113e-12, 100.00000000000000, 80.000000000000000, 0.0}, + {3.2033435630927732e-15, 100.00000000000000, 85.000000000000000, 0.0}, + {1.5922281431788096e-18, 100.00000000000000, 90.000000000000000, 0.0}, + {9.9589454577674131e-22, 100.00000000000000, 95.000000000000000, 0.0}, + {7.6171296304940831e-25, 100.00000000000000, 100.00000000000000, 0.0}, +}; +const double toler028 = 5.0000000000000039e-13; + +template +void +test(const testcase_cyl_bessel_k (&data)[Num], Ret toler) +{ + bool test __attribute__((unused)) = true; + const Ret eps = std::numeric_limits::epsilon(); + Ret max_abs_diff = -Ret(1); + Ret max_abs_frac = -Ret(1); + unsigned int num_datum = Num; + for (unsigned int i = 0; i < num_datum; ++i) + { + const Ret f = std::cyl_bessel_k(data[i].nu, data[i].x); + const Ret f0 = data[i].f0; + const Ret diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Ret(10) * eps && std::abs(f) > Ret(10) * eps) + { + const Ret frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + assert(max_abs_frac < toler); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + IF_DOUBLE_SUPPORT(test(data007, toler007)) + IF_DOUBLE_SUPPORT(test(data008, toler008)) + IF_DOUBLE_SUPPORT(test(data009, toler009)) + IF_DOUBLE_SUPPORT(test(data010, toler010)) + IF_DOUBLE_SUPPORT(test(data011, toler011)) + IF_DOUBLE_SUPPORT(test(data012, toler012)) + IF_DOUBLE_SUPPORT(test(data013, toler013)) + IF_DOUBLE_SUPPORT(test(data014, toler014)) + IF_DOUBLE_SUPPORT(test(data015, toler015)) + IF_DOUBLE_SUPPORT(test(data016, toler016)) + IF_DOUBLE_SUPPORT(test(data017, toler017)) + IF_DOUBLE_SUPPORT(test(data018, toler018)) + IF_DOUBLE_SUPPORT(test(data019, toler019)) + IF_DOUBLE_SUPPORT(test(data020, toler020)) + IF_DOUBLE_SUPPORT(test(data021, toler021)) + IF_DOUBLE_SUPPORT(test(data022, toler022)) + IF_DOUBLE_SUPPORT(test(data023, toler023)) + IF_DOUBLE_SUPPORT(test(data024, toler024)) + IF_DOUBLE_SUPPORT(test(data025, toler025)) + IF_DOUBLE_SUPPORT(test(data026, toler026)) + IF_DOUBLE_SUPPORT(test(data027, toler027)) + IF_DOUBLE_SUPPORT(test(data028, toler028)) +#endif + + return 0; +} \ No newline at end of file diff --git a/test/xpu_api/numerics/special/bessel/bessel_k_check_nan.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_k_check_nan.pass.cpp new file mode 100644 index 00000000000..1106324e49d --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_k_check_nan.pass.cpp @@ -0,0 +1,82 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +template +void +test01(); + +template +void +test02(); + +template <> +void +test01() +{ + float xf = std::numeric_limits::quiet_NaN(); + float nuf = 0.0F; + + [[maybe_unused]] float a = std::cyl_bessel_k(nuf, xf); + [[maybe_unused]] float b = std::cyl_bessel_kf(nuf, xf); + + assert(std::isnan(a)); + assert(std::isnan(b)); +} + +template <> +void +test01() +{ + double xd = std::numeric_limits::quiet_NaN(); + double nud = 0.0; + + [[maybe_unused]] double c = std::cyl_bessel_k(nud, xd); + + assert(std::isnan(c)); +} + +template <> +void +test02() +{ + float xf = 1.0F; + float nuf = std::numeric_limits::quiet_NaN(); + + [[maybe_unused]] float a = std::cyl_bessel_k(nuf, xf); + [[maybe_unused]] float b = std::cyl_bessel_kf(nuf, xf); + + assert(std::isnan(a)); + assert(std::isnan(b)); +} + +template <> +void +test02() +{ + double xd = 1.0; + double nud = std::numeric_limits::quiet_NaN(); + + [[maybe_unused]] double c = std::cyl_bessel_k(nud, xd); + + assert(std::isnan(c)); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + test01(); + test02(); + + IF_DOUBLE_SUPPORT(test01()) + IF_DOUBLE_SUPPORT(test02()) +#endif + + return 0; +} diff --git a/test/xpu_api/numerics/special/bessel/bessel_k_compile.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_k_compile.pass.cpp new file mode 100644 index 00000000000..2505dae773d --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_k_compile.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +// cyl_bessel_jl +#include + +void +test() +{ + double nud = 1.0 / 3.0, xd = 0.5; + + [[maybe_unused]] auto t = std::cyl_bessel_k(nud, xd); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + IF_DOUBLE_SUPPORT(test()) +#endif + + return 0; +} diff --git a/test/xpu_api/numerics/special/bessel/bessel_kf_compile.pass.cpp b/test/xpu_api/numerics/special/bessel/bessel_kf_compile.pass.cpp new file mode 100644 index 00000000000..1de4589c1b0 --- /dev/null +++ b/test/xpu_api/numerics/special/bessel/bessel_kf_compile.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "support/test_bessel.h" + +// cyl_bessel_jl +#include + +void +test() +{ + float nuf = 1.0F / 3.0F, xf = 0.5F; + + [[maybe_unused]] auto t = std::cyl_bessel_kf(nuf, xf); +} + +ONEDPL_TEST_NUM_MAIN +{ +#if _PSTL_TEST_BESSEL_STD_LIB_IMPL_COMPLIANT + test(); +#endif + + return 0; +}