-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Futility Margin Formula #5077
Conversation
bench: 1303971
Idk, I find using the current implementation cleaner. |
What if instead of ternary, we add at least a few parentheses, such as: |
I honestly don't feel any need for changes to our existing formula, however I believe the outside brackets are redundant in our current formula |
bench: 1303971
What do people think about ? return futilityMult * d - 3 * futilityMult * improving / 2; |
@mstembera So basically just completely removing the parentheses? |
Right no parentheses and an easier to read operator precedence by moving the improving multiply before the divide. Just a suggestion though. |
@mstembera Oh yes! I didn't see the improving placement change. This is perfect also for the mentioned issue! I didn't think of this solution. |
bench: 1303971
I find this discussion pretty pointless tbh... This calculation is just pure multiplication, subtraction and division. |
In the current implementation, the formula involves several consecutive multiplications and divisors. Making it challenging to understand the order of operations.
Refactor Futility Margin Formula, to make it easier to understand.
Since using ternary operator, the logic, and order of operations become more apparent.Removed the parentheses and moved the improving multiply before the divide for easier-to-read operator precedence (Thanks to @mstembera for this solution idea).
Non Functional