Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Faster polynomial multiplication #45

Open
Labels
enhancementNew feature or request
@jonasvanderschaaf

Description

@jonasvanderschaaf

The currentpolynomial multiplication has a runtime of O(n^2). This is fine for some cases (especially lower degree polynomials), but is suboptimal, as it is relatively easy to reduce the runtime using aFast Fourier Transformation to O(n log n). This would be a considerable speedup for higher degree polynomials.

I think it would be best to perhaps use the currrent algorithm for polynomials of low degree, as it is undoubtedly faster for these kinds, but for higher degree polynomials switch to the more complex, but asymptotically faster FFT. The switching point should of course be determined by the implementation details.

If this is something worth considering, I think there would be three ways to go about using this method:

  1. Use an existing FFT crate which is significantly faster than what would be used in this crate, which in turn significantly improve the runtime of many things using polynomials.
  2. Create a custom implementation of the FFT algorithm. This would mean that the crate has less dependencies, and would therefore be more portable.
  3. You could also possibly use a feature flag to indicate use of an external FFT library, which would include the best of both worlds: It would allow for people who need an efficient implementation to use the external library for the multiplication, and those who care more about portability to use the slower version.

If you think that the second option sounds appealing, I would be willing to write an implementation of the algorithm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp