/usr/include/boost/math/special_functions/detail
NameSizeModeActions
airy_ai_bi_zero.hpp62940644editdlrm
bernoulli_details.hpp265130644editdlrm
bessel_derivatives_linear.hpp33780644editdlrm
bessel_i0.hpp281350644editdlrm
bessel_i1.hpp299330644editdlrm
bessel_ik.hpp139170644editdlrm
bessel_j0.hpp85850644editdlrm
bessel_j1.hpp89510644editdlrm
bessel_jn.hpp39090644editdlrm
bessel_jy.hpp218680644editdlrm
bessel_jy_asym.hpp64880644editdlrm
bessel_jy_derivatives_asym.hpp46490644editdlrm
bessel_jy_derivatives_series.hpp69440644editdlrm
bessel_jy_series.hpp72410644editdlrm
bessel_jy_zero.hpp249670644editdlrm
bessel_k0.hpp221780644editdlrm
bessel_k1.hpp254650644editdlrm
bessel_kn.hpp22490644editdlrm
bessel_y0.hpp108050644editdlrm
bessel_y1.hpp94580644editdlrm
bessel_yn.hpp31180644editdlrm
daubechies_scaling_integer_grid.hpp2337880644editdlrm
erf_inv.hpp227380644editdlrm
fp_traits.hpp171930644editdlrm
gamma_inva.hpp70660644editdlrm
hypergeometric_0F1_bessel.hpp15430644editdlrm
hypergeometric_1F1_addition_theorems_on_z.hpp129800644editdlrm
hypergeometric_1F1_bessel.hpp327810644editdlrm
hypergeometric_1F1_by_ratios.hpp335400644editdlrm
hypergeometric_1F1_cf.hpp18300644editdlrm
hypergeometric_1F1_large_a.hpp11590644editdlrm
hypergeometric_1F1_large_abz.hpp221010644editdlrm
hypergeometric_1F1_negative_b_regions.hpp333760644editdlrm
hypergeometric_1F1_recurrence.hpp172950644editdlrm
hypergeometric_1F1_scaled_series.hpp21830644editdlrm
hypergeometric_1F1_small_a_negative_b_by_ratio.hpp38930644editdlrm
hypergeometric_asym.hpp59020644editdlrm
hypergeometric_cf.hpp58260644editdlrm
hypergeometric_pade.hpp38370644editdlrm
hypergeometric_pFq_checked_series.hpp279430644editdlrm
hypergeometric_rational.hpp50680644editdlrm
hypergeometric_separated_series.hpp14490644editdlrm
hypergeometric_series.hpp144220644editdlrm
ibeta_inverse.hpp340720644editdlrm
ibeta_inv_ab.hpp103630644editdlrm
iconv.hpp10090644editdlrm
igamma_inverse.hpp174140644editdlrm
igamma_large.hpp395340644editdlrm
lambert_w_lookup_table.ipp156010644editdlrm
lanczos_sse2.hpp89160644editdlrm
lgamma_small.hpp232950644editdlrm
polygamma.hpp225960644editdlrm
round_fwd.hpp27940644editdlrm
t_distribution_inv.hpp177350644editdlrm
unchecked_bernoulli.hpp764370644editdlrm
unchecked_factorial.hpp462900644editdlrm
Edit: /usr/include/boost/math/special_functions/detail/lanczos_sse2.hpp (8916B)
// (C) Copyright John Maddock 2006. // 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_SPECIAL_FUNCTIONS_LANCZOS_SSE2 #define BOOST_MATH_SPECIAL_FUNCTIONS_LANCZOS_SSE2 #ifdef _MSC_VER #pragma once #endif #include #if defined(__GNUC__) || defined(__PGI) || defined(__SUNPRO_CC) #define ALIGN16 __attribute__((__aligned__(16))) #else #define ALIGN16 __declspec(align(16)) #endif namespace boost{ namespace math{ namespace lanczos{ template <> inline double lanczos13m53::lanczos_sum(const double& x) { static const ALIGN16 double coeff[26] = { static_cast(2.506628274631000270164908177133837338626L), static_cast(1u), static_cast(210.8242777515793458725097339207133627117L), static_cast(66u), static_cast(8071.672002365816210638002902272250613822L), static_cast(1925u), static_cast(186056.2653952234950402949897160456992822L), static_cast(32670u), static_cast(2876370.628935372441225409051620849613599L), static_cast(357423u), static_cast(31426415.58540019438061423162831820536287L), static_cast(2637558u), static_cast(248874557.8620541565114603864132294232163L), static_cast(13339535u), static_cast(1439720407.311721673663223072794912393972L), static_cast(45995730u), static_cast(6039542586.35202800506429164430729792107L), static_cast(105258076u), static_cast(17921034426.03720969991975575445893111267L), static_cast(150917976u), static_cast(35711959237.35566804944018545154716670596L), static_cast(120543840u), static_cast(42919803642.64909876895789904700198885093L), static_cast(39916800u), static_cast(23531376880.41075968857200767445163675473L), static_cast(0u) }; static const double lim = 4.31965e+25; // By experiment, the largest x for which the SSE2 code does not go bad. if (x > lim) { double z = 1 / x; return ((((((((((((coeff[24] * z + coeff[22]) * z + coeff[20]) * z + coeff[18]) * z + coeff[16]) * z + coeff[14]) * z + coeff[12]) * z + coeff[10]) * z + coeff[8]) * z + coeff[6]) * z + coeff[4]) * z + coeff[2]) * z + coeff[0]) / ((((((((((((coeff[25] * z + coeff[23]) * z + coeff[21]) * z + coeff[19]) * z + coeff[17]) * z + coeff[15]) * z + coeff[13]) * z + coeff[11]) * z + coeff[9]) * z + coeff[7]) * z + coeff[5]) * z + coeff[3]) * z + coeff[1]); } __m128d vx = _mm_load1_pd(&x); __m128d sum_even = _mm_load_pd(coeff); __m128d sum_odd = _mm_load_pd(coeff+2); __m128d nc_odd, nc_even; __m128d vx2 = _mm_mul_pd(vx, vx); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 4); sum_odd = _mm_mul_pd(sum_odd, vx2); nc_odd = _mm_load_pd(coeff + 6); sum_even = _mm_add_pd(sum_even, nc_even); sum_odd = _mm_add_pd(sum_odd, nc_odd); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 8); sum_odd = _mm_mul_pd(sum_odd, vx2); nc_odd = _mm_load_pd(coeff + 10); sum_even = _mm_add_pd(sum_even, nc_even); sum_odd = _mm_add_pd(sum_odd, nc_odd); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 12); sum_odd = _mm_mul_pd(sum_odd, vx2); nc_odd = _mm_load_pd(coeff + 14); sum_even = _mm_add_pd(sum_even, nc_even); sum_odd = _mm_add_pd(sum_odd, nc_odd); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 16); sum_odd = _mm_mul_pd(sum_odd, vx2); nc_odd = _mm_load_pd(coeff + 18); sum_even = _mm_add_pd(sum_even, nc_even); sum_odd = _mm_add_pd(sum_odd, nc_odd); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 20); sum_odd = _mm_mul_pd(sum_odd, vx2); nc_odd = _mm_load_pd(coeff + 22); sum_even = _mm_add_pd(sum_even, nc_even); sum_odd = _mm_add_pd(sum_odd, nc_odd); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 24); sum_odd = _mm_mul_pd(sum_odd, vx); sum_even = _mm_add_pd(sum_even, nc_even); sum_even = _mm_add_pd(sum_even, sum_odd); double ALIGN16 t[2]; _mm_store_pd(t, sum_even); return t[0] / t[1]; } template <> inline double lanczos13m53::lanczos_sum_expG_scaled(const double& x) { static const ALIGN16 double coeff[26] = { static_cast(0.006061842346248906525783753964555936883222L), static_cast(1u), static_cast(0.5098416655656676188125178644804694509993L), static_cast(66u), static_cast(19.51992788247617482847860966235652136208L), static_cast(1925u), static_cast(449.9445569063168119446858607650988409623L), static_cast(32670u), static_cast(6955.999602515376140356310115515198987526L), static_cast(357423u), static_cast(75999.29304014542649875303443598909137092L), static_cast(2637558u), static_cast(601859.6171681098786670226533699352302507L), static_cast(13339535u), static_cast(3481712.15498064590882071018964774556468L), static_cast(45995730u), static_cast(14605578.08768506808414169982791359218571L), static_cast(105258076u), static_cast(43338889.32467613834773723740590533316085L), static_cast(150917976u), static_cast(86363131.28813859145546927288977868422342L), static_cast(120543840u), static_cast(103794043.1163445451906271053616070238554L), static_cast(39916800u), static_cast(56906521.91347156388090791033559122686859L), static_cast(0u) }; static const double lim = 4.76886e+25; // By experiment, the largest x for which the SSE2 code does not go bad. if (x > lim) { double z = 1 / x; return ((((((((((((coeff[24] * z + coeff[22]) * z + coeff[20]) * z + coeff[18]) * z + coeff[16]) * z + coeff[14]) * z + coeff[12]) * z + coeff[10]) * z + coeff[8]) * z + coeff[6]) * z + coeff[4]) * z + coeff[2]) * z + coeff[0]) / ((((((((((((coeff[25] * z + coeff[23]) * z + coeff[21]) * z + coeff[19]) * z + coeff[17]) * z + coeff[15]) * z + coeff[13]) * z + coeff[11]) * z + coeff[9]) * z + coeff[7]) * z + coeff[5]) * z + coeff[3]) * z + coeff[1]); } __m128d vx = _mm_load1_pd(&x); __m128d sum_even = _mm_load_pd(coeff); __m128d sum_odd = _mm_load_pd(coeff+2); __m128d nc_odd, nc_even; __m128d vx2 = _mm_mul_pd(vx, vx); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 4); sum_odd = _mm_mul_pd(sum_odd, vx2); nc_odd = _mm_load_pd(coeff + 6); sum_even = _mm_add_pd(sum_even, nc_even); sum_odd = _mm_add_pd(sum_odd, nc_odd); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 8); sum_odd = _mm_mul_pd(sum_odd, vx2); nc_odd = _mm_load_pd(coeff + 10); sum_even = _mm_add_pd(sum_even, nc_even); sum_odd = _mm_add_pd(sum_odd, nc_odd); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 12); sum_odd = _mm_mul_pd(sum_odd, vx2); nc_odd = _mm_load_pd(coeff + 14); sum_even = _mm_add_pd(sum_even, nc_even); sum_odd = _mm_add_pd(sum_odd, nc_odd); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 16); sum_odd = _mm_mul_pd(sum_odd, vx2); nc_odd = _mm_load_pd(coeff + 18); sum_even = _mm_add_pd(sum_even, nc_even); sum_odd = _mm_add_pd(sum_odd, nc_odd); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 20); sum_odd = _mm_mul_pd(sum_odd, vx2); nc_odd = _mm_load_pd(coeff + 22); sum_even = _mm_add_pd(sum_even, nc_even); sum_odd = _mm_add_pd(sum_odd, nc_odd); sum_even = _mm_mul_pd(sum_even, vx2); nc_even = _mm_load_pd(coeff + 24); sum_odd = _mm_mul_pd(sum_odd, vx); sum_even = _mm_add_pd(sum_even, nc_even); sum_even = _mm_add_pd(sum_even, sum_odd); double ALIGN16 t[2]; _mm_store_pd(t, sum_even); return t[0] / t[1]; } #ifdef _MSC_VER BOOST_STATIC_ASSERT(sizeof(double) == sizeof(long double)); template <> inline long double lanczos13m53::lanczos_sum(const long double& x) { return lanczos_sum(static_cast(x)); } template <> inline long double lanczos13m53::lanczos_sum_expG_scaled(const long double& x) { return lanczos_sum_expG_scaled(static_cast(x)); } #endif } // namespace lanczos } // namespace math } // namespace boost #undef ALIGN16 #endif // BOOST_MATH_SPECIAL_FUNCTIONS_LANCZOS