/
usr
/
include
/
boost
/
math
/
special_functions
/
detail
/
/usr/include/boost/math/special_functions/detail
mkdir
upload
Name
Size
Mode
Actions
airy_ai_bi_zero.hpp
6294
0644
edit
dl
rm
bernoulli_details.hpp
26513
0644
edit
dl
rm
bessel_derivatives_linear.hpp
3378
0644
edit
dl
rm
bessel_i0.hpp
28135
0644
edit
dl
rm
bessel_i1.hpp
29933
0644
edit
dl
rm
bessel_ik.hpp
13917
0644
edit
dl
rm
bessel_j0.hpp
8585
0644
edit
dl
rm
bessel_j1.hpp
8951
0644
edit
dl
rm
bessel_jn.hpp
3909
0644
edit
dl
rm
bessel_jy.hpp
21868
0644
edit
dl
rm
bessel_jy_asym.hpp
6488
0644
edit
dl
rm
bessel_jy_derivatives_asym.hpp
4649
0644
edit
dl
rm
bessel_jy_derivatives_series.hpp
6944
0644
edit
dl
rm
bessel_jy_series.hpp
7241
0644
edit
dl
rm
bessel_jy_zero.hpp
24967
0644
edit
dl
rm
bessel_k0.hpp
22178
0644
edit
dl
rm
bessel_k1.hpp
25465
0644
edit
dl
rm
bessel_kn.hpp
2249
0644
edit
dl
rm
bessel_y0.hpp
10805
0644
edit
dl
rm
bessel_y1.hpp
9458
0644
edit
dl
rm
bessel_yn.hpp
3118
0644
edit
dl
rm
daubechies_scaling_integer_grid.hpp
233788
0644
edit
dl
rm
erf_inv.hpp
22738
0644
edit
dl
rm
fp_traits.hpp
17193
0644
edit
dl
rm
gamma_inva.hpp
7066
0644
edit
dl
rm
hypergeometric_0F1_bessel.hpp
1543
0644
edit
dl
rm
hypergeometric_1F1_addition_theorems_on_z.hpp
12980
0644
edit
dl
rm
hypergeometric_1F1_bessel.hpp
32781
0644
edit
dl
rm
hypergeometric_1F1_by_ratios.hpp
33540
0644
edit
dl
rm
hypergeometric_1F1_cf.hpp
1830
0644
edit
dl
rm
hypergeometric_1F1_large_a.hpp
1159
0644
edit
dl
rm
hypergeometric_1F1_large_abz.hpp
22101
0644
edit
dl
rm
hypergeometric_1F1_negative_b_regions.hpp
33376
0644
edit
dl
rm
hypergeometric_1F1_recurrence.hpp
17295
0644
edit
dl
rm
hypergeometric_1F1_scaled_series.hpp
2183
0644
edit
dl
rm
hypergeometric_1F1_small_a_negative_b_by_ratio.hpp
3893
0644
edit
dl
rm
hypergeometric_asym.hpp
5902
0644
edit
dl
rm
hypergeometric_cf.hpp
5826
0644
edit
dl
rm
hypergeometric_pade.hpp
3837
0644
edit
dl
rm
hypergeometric_pFq_checked_series.hpp
27943
0644
edit
dl
rm
hypergeometric_rational.hpp
5068
0644
edit
dl
rm
hypergeometric_separated_series.hpp
1449
0644
edit
dl
rm
hypergeometric_series.hpp
14422
0644
edit
dl
rm
ibeta_inverse.hpp
34072
0644
edit
dl
rm
ibeta_inv_ab.hpp
10363
0644
edit
dl
rm
iconv.hpp
1009
0644
edit
dl
rm
igamma_inverse.hpp
17414
0644
edit
dl
rm
igamma_large.hpp
39534
0644
edit
dl
rm
lambert_w_lookup_table.ipp
15601
0644
edit
dl
rm
lanczos_sse2.hpp
8916
0644
edit
dl
rm
lgamma_small.hpp
23295
0644
edit
dl
rm
polygamma.hpp
22596
0644
edit
dl
rm
round_fwd.hpp
2794
0644
edit
dl
rm
t_distribution_inv.hpp
17735
0644
edit
dl
rm
unchecked_bernoulli.hpp
76437
0644
edit
dl
rm
unchecked_factorial.hpp
46290
0644
edit
dl
rm
Edit:
/usr/include/boost/math/special_functions/detail/bessel_jn.hpp
(3909B)
// Copyright (c) 2006 Xiaogang Zhang // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_MATH_BESSEL_JN_HPP #define BOOST_MATH_BESSEL_JN_HPP #ifdef _MSC_VER #pragma once #endif #include <boost/math/special_functions/detail/bessel_j0.hpp> #include <boost/math/special_functions/detail/bessel_j1.hpp> #include <boost/math/special_functions/detail/bessel_jy.hpp> #include <boost/math/special_functions/detail/bessel_jy_asym.hpp> #include <boost/math/special_functions/detail/bessel_jy_series.hpp> // Bessel function of the first kind of integer order // J_n(z) is the minimal solution // n < abs(z), forward recurrence stable and usable // n >= abs(z), forward recurrence unstable, use Miller's algorithm namespace boost { namespace math { namespace detail{ template <typename T, typename Policy> T bessel_jn(int n, T x, const Policy& pol) { T value(0), factor, current, prev, next; BOOST_MATH_STD_USING // // Reflection has to come first: // if (n < 0) { factor = static_cast<T>((n & 0x1) ? -1 : 1); // J_{-n}(z) = (-1)^n J_n(z) n = -n; } else { factor = 1; } if(x < 0) { factor *= (n & 0x1) ? -1 : 1; // J_{n}(-z) = (-1)^n J_n(z) x = -x; } // // Special cases: // if(asymptotic_bessel_large_x_limit(T(n), x)) return factor * asymptotic_bessel_j_large_x_2<T>(T(n), x); if (n == 0) { return factor * bessel_j0(x); } if (n == 1) { return factor * bessel_j1(x); } if (x == 0) // n >= 2 { return static_cast<T>(0); } BOOST_ASSERT(n > 1); T scale = 1; if (n < abs(x)) // forward recurrence { prev = bessel_j0(x); current = bessel_j1(x); policies::check_series_iterations<T>("boost::math::bessel_j_n<%1%>(%1%,%1%)", n, pol); for (int k = 1; k < n; k++) { T fact = 2 * k / x; // // rescale if we would overflow or underflow: // if((fabs(fact) > 1) && ((tools::max_value<T>() - fabs(prev)) / fabs(fact) < fabs(current))) { scale /= current; prev /= current; current = 1; } value = fact * current - prev; prev = current; current = value; } } else if((x < 1) || (n > x * x / 4) || (x < 5)) { return factor * bessel_j_small_z_series(T(n), x, pol); } else // backward recurrence { T fn; int s; // fn = J_(n+1) / J_n // |x| <= n, fast convergence for continued fraction CF1 boost::math::detail::CF1_jy(static_cast<T>(n), x, &fn, &s, pol); prev = fn; current = 1; // Check recursion won't go on too far: policies::check_series_iterations<T>("boost::math::bessel_j_n<%1%>(%1%,%1%)", n, pol); for (int k = n; k > 0; k--) { T fact = 2 * k / x; if((fabs(fact) > 1) && ((tools::max_value<T>() - fabs(prev)) / fabs(fact) < fabs(current))) { prev /= current; scale /= current; current = 1; } next = fact * current - prev; prev = current; current = next; } value = bessel_j0(x) / current; // normalization scale = 1 / scale; } value *= factor; if(tools::max_value<T>() * scale < fabs(value)) return policies::raise_overflow_error<T>("boost::math::bessel_jn<%1%>(%1%,%1%)", 0, pol); return value / scale; } }}} // namespaces #endif // BOOST_MATH_BESSEL_JN_HPP
Save
cmd:
run