Polynomial roots - #1452
Conversation
There was a problem hiding this comment.
I have some questions and remarks, so, per void check_residuals in test/polynomial_roots_test.cpp:
- This could be
const auto&forfor(auto root : roots).
per void fft in polynomial_roots.hpp:
- This could benefit of some comments, and more testing as well due to the nested loops.
|
Just wondering naming, since there are so many algorithms for finding polynomial roots; you wouldn't call it |
|
@jeremy-murphy : I believe this algorithm finishes polynomial rootfinding as it is nlogn and stable. |
Cool, that's pretty exciting! Do you have any results on how accurate it is compared to the existing algorithms we have or against some optimal answer? |
Not yet-I think Aurentz's 2015 work (which is O(n^2)) is probably the reference for stability. I do not believe this algorithm is stable in quite the same sense. |
| assert(std::count(zero_roots.begin(), zero_roots.end(), std::complex<double>(0, 0)) == 2); | ||
|
|
||
| std::mt19937_64 generator(0x5eed); | ||
| std::uniform_real_distribution<double> distribution(-2, 2); |
There was a problem hiding this comment.
Have you tested how accurate this method is with multiprecision types like boost::multiprecision::cpp_bin_float?
| using std::abs; | ||
| using std::log2; |
There was a problem hiding this comment.
Would adding BOOST_MATH_STD_USING here and below allow multiprecision types?
| try { polynomial_roots(std::vector<double>{0, 0}); } | ||
| catch(std::domain_error const&) { threw = true; } | ||
| assert(threw); |
There was a problem hiding this comment.
Should all tests here use boost test functions like BOOST_CHECK_THROW? Additionally, is there any benefit in adding policies to polynomial_roots?
No description provided.