We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a531af5 + c623ce6 commit 7e8d2d8Copy full SHA for 7e8d2d8
1 file changed
maths/brent_method.py
@@ -81,7 +81,9 @@ def brent_method(
81
s = right - fr * (right - left) / (fr - fl)
82
83
conditions = [
84
- not ((3 * left + right) / 4 < s < right) if right > left else not (right < s < (3 * left + right) / 4),
+ not ((3 * left + right) / 4 < s < right)
85
+ if right > left
86
+ else not (right < s < (3 * left + right) / 4),
87
iteration > 1 and abs(s - right) >= abs(right - c) / 2,
88
iteration <= 1 and abs(s - right) >= abs(c - d) / 2,
89
iteration > 1 and abs(right - c) < tol,
0 commit comments