Skip to content

Commit

Permalink
Update adaptive_newton_cotes_rules.py
Browse files Browse the repository at this point in the history
  • Loading branch information
PyNumAl authored Sep 2, 2022
1 parent 94ff7db commit 9a18426
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Numerical Integration/adaptive_newton_cotes_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def quad_ancr(f, a, b, order=4, rtol=1e-6, atol=1e-10):
[1] Adaptive Simpson's method, https://en.wikipedia.org/wiki/Adaptive_Simpson%27s_method
[2] Wolfram Mathworld, Newton-Cotes Formulas, https://mathworld.wolfram.com/Newton-CotesFormulas.html
"""
if order not in list(range(2, 14, 2)):
if order not in range(2, 14, 2):
raise ValueError('order argument must be among [2,4,6,8,10,12].')

if type(rtol) is not float:
Expand All @@ -99,4 +99,4 @@ def quad_ancr(f, a, b, order=4, rtol=1e-6, atol=1e-10):

fa, fb = f(a), f(b)
m, fm, whole = _quad_ancr_mem(f, a, b, fa, fb, order)
return _quad_ancr(f, a, m, b, fa, fm, fb, whole, order, rtol, atol)
return _quad_ancr(f, a, m, b, fa, fm, fb, whole, order, rtol, atol)

0 comments on commit 9a18426

Please sign in to comment.