Skip to content

Commit 40ade69

Browse files
committed
some fixes in hypergeometric
1 parent dda7e93 commit 40ade69

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/sage/functions/hypergeometric.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
124124
sage: maxima(hypergeometric([1, 1, 1], [3, 3, 3], x)) # needs sage.symbolic
125125
hypergeometric([1,1,1],[3,3,3],_SAGE_VAR_x)
126-
sage: hypergeometric((5, 4), (4, 4), 3)._sympy_() # needs sympy sage.symbolic
126+
sage: hypergeometric((5,), (4,), 3)._sympy_() # needs sympy sage.symbolic
127127
hyper((5,), (4,), 3)
128128
sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_() # needs sage.symbolic
129129
'HypergeometricPFQ[{5,4},{4,4},3]'
@@ -295,6 +295,11 @@ def __call__(self, a, b, z, **kwargs):
295295
The only simplification that is done automatically is returning 1
296296
if ``z`` is 0. For other simplifications use the
297297
``simplify_hypergeometric`` method.
298+
299+
TESTS::
300+
301+
sage: hypergeometric([2, 3, 4], [4, 1], 1)
302+
hypergeometric((2, 3, 4), (4, 1), 1)
298303
"""
299304
return BuiltinFunction.__call__(self,
300305
SR._force_pyobject(a),
@@ -458,23 +463,21 @@ def eliminate_parameters(self, a, b, z):
458463
"""
459464
aa = list(a) # tuples are immutable
460465
bb = list(b)
461-
p = pp = len(aa)
462466
q = qq = len(bb)
463467
i = 0
464468
while i < qq and aa:
465-
bbb = bb[i]
466-
if bbb in aa:
467-
aa.remove(bbb)
468-
bb.remove(bbb)
469-
pp -= 1
469+
bbi = bb[i]
470+
if bbi in aa:
471+
aa.remove(bbi)
472+
bb.remove(bbi)
470473
qq -= 1
471474
else:
472475
i += 1
473-
if (pp, qq) != (p, q):
476+
if qq != q:
474477
return hypergeometric(aa, bb, z)
475478
return self
476479

477-
def is_termwise_finite(self, a, b, z):
480+
def is_termwise_finite(self, a, b, z) -> bool:
478481
"""
479482
Determine whether all terms of ``self`` are finite.
480483
@@ -516,8 +519,6 @@ def is_termwise_finite(self, a, b, z):
516519
return 0 not in b
517520
if abs(z) == Infinity:
518521
return False
519-
if abs(z) == Infinity:
520-
return False
521522
for bb in b:
522523
if bb in ZZ and bb <= 0:
523524
if any((aa in ZZ) and (bb < aa <= 0) for aa in a):

0 commit comments

Comments
 (0)