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.
1 parent cdaeabe commit c623ce6Copy full SHA for c623ce6
1 file changed
maths/brent_method.py
@@ -80,7 +80,9 @@ def brent_method(
80
s = right - fr * (right - left) / (fr - fl)
81
82
conditions = [
83
- 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)
84
+ if right > left
85
+ else not (right < s < (3 * left + right) / 4),
86
iteration > 1 and abs(s - right) >= abs(right - c) / 2,
87
iteration <= 1 and abs(s - right) >= abs(c - d) / 2,
88
iteration > 1 and abs(right - c) < tol,
0 commit comments