2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-18 02:02:15 +00:00

1F1: Fix some multiprecision errors, refactor difficult/unsolved cases into separate tests and only test where appropriate.

[CI SKIP]
This commit is contained in:
jzmaddock
2019-01-20 11:27:38 +00:00
parent 695486b1ce
commit fbba64a30c
7 changed files with 103 additions and 21 deletions

View File

@@ -268,7 +268,7 @@
//
hypergeometric_1F1_AS_13_3_8_series(const T& a, const T& b, const T& z, const T& h, const Policy& pol_)
: C_minus_2(1), C_minus_1(-b * h), C(b * (b + 1) * h * h / 2 - (2 * h - 1) * a / 2),
bessel_arg(2 * sqrt(-a * z)), bessel_order(b - 1), power_term(pow(-a * z, (1 - b) / 2)), mult(z / sqrt(-a * z)),
bessel_arg(2 * sqrt(-a * z)), bessel_order(b - 1), power_term(std::pow(-a * z, (1 - b) / 2)), mult(z / std::sqrt(-a * z)),
a_(a), b_(b), z_(z), h_(h), n(2), pol(pol_)
{
}

View File

@@ -416,10 +416,13 @@
}
//
// Cost for bessel approximation is the number of recurrences required to make a ~ b,
// Note that recurrence relations fail for very small b:
// Note that recurrence relations fail for very small b. We also have issue with large
// z: either overflow/numeric instability or else the series goes divergent. We seem to be
// OK for z smaller than log_max_value<Quad> though, maybe we can stretch a little further
// but that's not clear...
//
cost = fabs(b - a);
if((b > 1) && (cost <= current_cost) && (z < tools::log_max_value<T>()))
if((b > 1) && (cost <= current_cost) && (z < tools::log_max_value<T>()) && (z < 11356))
{
current_method = method_bessel;
current_cost = cost;