Skip to content

Commit c623ce6

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent cdaeabe commit c623ce6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

maths/brent_method.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ def brent_method(
8080
s = right - fr * (right - left) / (fr - fl)
8181

8282
conditions = [
83-
not ((3 * left + right) / 4 < s < right) if right > left else not (right < s < (3 * left + right) / 4),
83+
not ((3 * left + right) / 4 < s < right)
84+
if right > left
85+
else not (right < s < (3 * left + right) / 4),
8486
iteration > 1 and abs(s - right) >= abs(right - c) / 2,
8587
iteration <= 1 and abs(s - right) >= abs(c - d) / 2,
8688
iteration > 1 and abs(right - c) < tol,

0 commit comments

Comments
 (0)