diff --git a/arb_hypgeom/1f1_integration.c b/arb_hypgeom/1f1_integration.c index d59cca35..50a9ace9 100644 --- a/arb_hypgeom/1f1_integration.c +++ b/arb_hypgeom/1f1_integration.c @@ -340,11 +340,11 @@ arb_hypgeom_1f1_integration(arb_t res, const arb_t a, const arb_t b, const arb_t arb_init(t); ok = arb_is_finite(z); - arb_sub_ui(t, b, 1, prec); - ok = ok && arb_is_positive(t); + arb_sub_ui(t, a, 1, prec); + ok = ok && arb_is_nonnegative(t); arb_sub(t, b, a, prec); arb_sub_ui(t, t, 1, prec); - ok = ok && arb_is_positive(t); + ok = ok && arb_is_nonnegative(t); if (!ok) { diff --git a/doc/source/arb_hypgeom.rst b/doc/source/arb_hypgeom.rst index f6a5bad9..b26b3d29 100644 --- a/doc/source/arb_hypgeom.rst +++ b/doc/source/arb_hypgeom.rst @@ -166,7 +166,7 @@ Confluent hypergeometric functions is used. This algorithm can be useful if the parameters are large. This will currently - only return a finite enclosure if `b > 1` and `b - a > 1`. + only return a finite enclosure if `a \ge 1` and `b - a \ge 1`. .. function:: void arb_hypgeom_u(arb_t res, const arb_t a, const arb_t b, const arb_t z, slong prec) diff --git a/double_interval.h b/double_interval.h index fed7e0ea..9e3a17ee 100644 --- a/double_interval.h +++ b/double_interval.h @@ -162,6 +162,8 @@ DOUBLE_INTERVAL_INLINE di_t di_fast_mid(di_t x) { di_t a, b; + if (x.a == -D_INF || x.b == D_INF) + return di_interval(-D_INF, D_INF); a = di_interval(x.a, x.a); b = di_interval(x.b, x.b); return di_fast_mul_d(di_fast_add(a, b), 0.5);