-
Notifications
You must be signed in to change notification settings - Fork 461
Pow, min, and max improved function approximations #8683
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
base: develop
Are you sure you want to change the base?
Conversation
|
Sweet! I did not know the |
|
@amirroth I'm not sure regarding your question above, but it looks like the float functions are still using the more traditional approach. I could look closer, but maybe @mbadams5 could confirm. I don't have a problem with these changes, but this is definitely needing some love before it's ready. Lots of failing tests and diffs that will need to be analyzed. Do you have a specific plan for getting this on track to merge @mbadams5 ? |
|
Also interesting that an article was just posted this week on some of these approximations: https://www.geeksforgeeks.org/compute-the-minimum-or-maximum-max-of-two-integers-without-branching/ |
|
Fun stuff! I think it would be wise to put this in an E+ math header (in a namespace) rather than altering the ObjexxFCL code so "New & Improved" ObjexxFCL releases can be integrated. (Versions 4.3 and 5.0 with modernizations and performance gains are available.) If you really feel you need to make changes inside the ObjexxFCL code it would be best to flag such changes with a comment to identify the authorship as non-Objexx. I am skeptical of these "improvements" and there should be demo code proving the performance impact of each function category for each type. Specifically:
|
|
@mbadams5 do you have anything else on this for now? I haven't tested it myself but it seems like you are seeing improvement and @DeadParrot has done some demo work and is not seeing it. Perhaps some compiler explorer toy tests could help build some confidence either way? |
1 similar comment
|
@mbadams5 thoughts on this being wrapped up for this release? If not I'll change the milestone to get it out of the review queue. |
2 similar comments
|
@mbadams5 it has been 7 days since this pull request was last updated. |
1 similar comment
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 8 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 15 days since this pull request was last updated. |
|
@mbadams5 it has been 9 days since this pull request was last updated. |
1 similar comment
|
@mbadams5 it has been 9 days since this pull request was last updated. |
|
@mbadams5 it has been 8 days since this pull request was last updated. |
|
@mbadams5 it has been 14 days since this pull request was last updated. |
|
@mbadams5 it has been 12 days since this pull request was last updated. |
|
@mbadams5 it has been 16 days since this pull request was last updated. |
|
@mbadams5 it has been 10 days since this pull request was last updated. |
|
@mbadams5 it has been 16 days since this pull request was last updated. |
|
@mbadams5 it has been 56 days since this pull request was last updated. |
|
@mbadams5 it has been 9 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
11 similar comments
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 7 days since this pull request was last updated. |
|
@mbadams5 it has been 8 days since this pull request was last updated. |
Pull request overview
This pull request changes pow_* and min/max functions to use new, faster approximations.
For power function, x^n == exp(n*ln(x))
For min/max function, it is using the bitwise operator: min(a,b) == b ^ ((a ^ b) & -(a < b))
Overall on average there was a 3.2% performance increase, while some files had up to 12% improvement.
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.