Skip to content

Commit

Permalink
Remove some debugging inserts
Browse files Browse the repository at this point in the history
  • Loading branch information
nspope committed Dec 28, 2023
1 parent 2237478 commit 2aaf053
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tsdate/hypergeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ def _hyp2f1_taylor_series(a, b, c, z):
To avoid overflow, returns the function value on a log scale and the
derivatives divided by the (unlogged) function value.
"""
if not (1.0 > z >= 0.0 and a >= 0.0 and b >= 0.0 and c > 0.0):
print("bad taylor:", a, b, c, z) # DEBUG
raise Invalid2F1("Taylor expansion requires nonnegative arguments")
assert 1.0 > z >= 0.0
if not (a >= 0.0 and b >= 0.0 and c > 0.0):
raise Invalid2F1("Negative parameters in Taylor series")

if z == 0.0:
val = 0.0
Expand Down Expand Up @@ -416,9 +416,6 @@ def _hyp2f1(a_i, b_i, a_j, b_j, y, mu):
Overflow protection entails log-transforming the function value,
and dividing the gradient by the function value.
"""
a = a_j
b = a_j + a_i + y
c = a_j + y + 1
z = (mu - b_j) / (mu + b_i)
assert z < 1.0, "Invalid argument"
if z > 0.0:
Expand Down

0 comments on commit 2aaf053

Please sign in to comment.