Skip to content
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

Implement Polynomial Middle product #216

Merged
merged 2 commits into from
Oct 26, 2022
Merged

Implement Polynomial Middle product #216

merged 2 commits into from
Oct 26, 2022

Conversation

bgrenet
Copy link
Member

@bgrenet bgrenet commented Oct 25, 2022

  • Implement (a generalized version of) the Polynomial Middle Product as defined in Hanrot-Quercia-Zimmerman'04: If P has size m+n-1 and Q has size n, MP(P,Q) is the size-m polynomial made of the central coefficients of the product P×Q.
  • Three implementations:
    • Standard quadratic algorithm : stdmidmul;
    • Karatsuba algorithm for the balanced case (m=n): karamidmul;
    • A dispatch algorithm for the general case that that either calls the quadratic algorithm for small sizes or Karatsuba's algorithm for larger sizes: midmul. (In particular, in the unbalanced case (m≠n), several calls are made to Karatsuba's algorithm with balanced inputs.)

The aim is to use this Middle Product in Newton iteration introduced in #206. This will be made in a future PR.

@jgdumas
Copy link
Member

jgdumas commented Oct 26, 2022

LGTM.

@jgdumas jgdumas merged commit f91415f into master Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants