hypergeometric_1F1_large_a.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Copyright 2018 John Maddock
  3. // Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MATH_HYPERGEOMETRIC_1F1_CF_HPP
  8. #define BOOST_MATH_HYPERGEOMETRIC_1F1_CF_HPP
  9. //
  10. // Evaluation of 1F1 by continued fraction
  11. // by asymptotic approximation for large a,
  12. // see https://dlmf.nist.gov/13.8#E9
  13. //
  14. // This is not terribly useful, as it only gets a few digits correct even for very
  15. // large a, also needs b and z small:
  16. //
  17. namespace boost { namespace math { namespace detail {
  18. template <class T, class Policy>
  19. T hypergeometric_1F1_large_neg_a_asymtotic_dlmf_13_8_9(T a, T b, T z, const Policy& pol)
  20. {
  21. T result = boost::math::cyl_bessel_j(b - 1, sqrt(2 * z * (b - 2 * a)), pol);
  22. result *= boost::math::tgamma(b, pol) * exp(z / 2);
  23. T p = pow((b / 2 - a) * z, (1 - b) / 4);
  24. result *= p;
  25. result *= p;
  26. return result;
  27. }
  28. } } } // namespaces
  29. #endif // BOOST_MATH_HYPERGEOMETRIC_1F1_BESSEL_HPP