-
Couldn't load subscription status.
- Fork 36
Add monic polynomial #453
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
Add monic polynomial #453
Conversation
| The |
| @9il Happy to make the required changes. I was following how |
Looks good. In that case, you don't need monic because it will be compiled-time optimized from |
| @9il Coefficients are parameters that can be provided at run-time. This means that the compiler-optimized version of |
| @9il Made some changes and added the |
|
This makes things a little more awkward when calling it with slices. If I remove those overloads, then I got a whole bunch of template errors when calling it with either
The motivation was originally that a version of |
I am 99% sure it will be optimised. godbold.org could help.
Do you mean in unit tests or your private code? |
Is there any way to include dependencies with that?
I mean adding a unittest here that makes it a little clearer how it works. |
Yes, it allows to inclusion mir libs. However, you don't need that to check if you do a little code update.
Just use arrays. |
| Here's the godbolt: https://godbolt.org/z/cvvx48GeE Looks like the polyImpl version uses some additional instructions. I'm happy to just use arrays for my application of these functions. My point about |
|
| @9il So it looks like if |
| @9il pushed new commit. Feel free to squash before merging. |
| Please
|
source/mir/polynomial.d Outdated
| x = value to evaluate | ||
| coefficients = coefficients of polynomial | ||
| +/ | ||
| typeof(F.init * X.init * 1f + F.init) poly(X, F)(in X x, scope F[] coefficients...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scope const F
| @9il That change results in the error below. It seems as if |
Codecov ReportBase: 91.56% // Head: 91.59% // Increases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@ ## master #453 +/- ## ========================================== + Coverage 91.56% 91.59% +0.03% ========================================== Files 79 79 Lines 18739 18812 +73 ========================================== + Hits 17158 17231 +73 Misses 1581 1581
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
| @9il Well it looks like my motivation for adding this is a bit mute as I was able to prod the phobos team to fix log1p. dlang/phobos#8701 |
Monicis a specialization ofPolynomialassuming the leading coefficient equals to 1. I want to add my own version oflog1p(because phobos documentation lies about how it works) and the CEPHES implementation uses the equivalent of this.The tester fails, but I believe it is unrelated. I tested it with a separate version identifier and tests pass.