| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/include/boost/math/special_functions/detail/ |
Upload File : |
///////////////////////////////////////////////////////////////////////////////
// Copyright 2014 Anton Bikineev
// Copyright 2014 Christopher Kormanyos
// Copyright 2014 John Maddock
// Copyright 2014 Paul Bristow
// Distributed under 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_HYPERGEOMETRIC_SEPARATED_SERIES_HPP
#define BOOST_MATH_HYPERGEOMETRIC_SEPARATED_SERIES_HPP
namespace boost { namespace math { namespace detail {
template <class T, class Policy>
inline T hypergeometric_1F1_separated_series(const T& a, const T& b, const T& z, const Policy& pol)
{
BOOST_MATH_STD_USING
boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
const T factor = policies::get_epsilon<T, Policy>();
T denom = 1, numer = 1;
T intermediate_result = 1, result = 1;
T a_pochhammer = a, z_pow = z;
unsigned N = 0;
while (--max_iter)
{
++N;
const T mult = (((b + N) - 1) * N);
denom *= mult; numer *= mult;
numer += a_pochhammer * z_pow;
result = numer / denom;
if (fabs(factor * result) > fabs(result - intermediate_result))
break;
intermediate_result = result;
a_pochhammer *= (a + N);
z_pow *= z;
}
return result;
}
} } } // namespaces
#endif // BOOST_MATH_HYPERGEOMETRIC_SEPARATED_SERIES_HPP