Skip to main content
QUICK REVIEW

[Paper Review] In-place fast polynomial modular remainder

Jean‐Guillaume Dumas, Bruno Grenet|arXiv (Cornell University)|Feb 27, 2023
Polynomial and algebraic computationComputer Science1 citations
TL;DR

This paper presents the first fast, in-place algorithms for polynomial modular remainder and related operations, using a novel relaxation of the in-place model that allows temporary modification of inputs followed by restoration. By leveraging Toeplitz matrix representations and recursive reductions, the authors achieve O(m/n M(n) log n) operations for remainder computation—matching standard complexity when M(n) = Θ(n^{1+ϵ}), with applications to in-place modular multiplication and accumulation in polynomial extensions.

ABSTRACT

We consider the simultaneously fast and in-place computation of the Euclidean polynomial modular remainder $R(X) $ ot\equiv$ A(X) \mod B(X)$ with $A$ and $B$ of respective degrees $n$ and $m $\le$ n$. But fast algorithms for this usually come at the expense of (potentially large) extra temporary space. To remain in-place a further issue is to avoid the storage of the whole quotient $Q(X)$ such that $A=BQ+R$. If the multiplication of two polynomials of degree $k$ can be performed with $M(k)$ operations and $O(k)$ extra space, and if it is allowed to use the input space of $A$ or $B$ for intermediate computations, but putting $A$ and $B$ back to their initial states after the completion of the remainder computation, we here propose an in-place algorithm (that is with its extra required space reduced to $O(1)$ only) using at most $O(n/m M(m)\log(m)$ arithmetic operations, if $\M(m)$ is quasi-linear, or $O(n/m M(m)}$ otherwise. We also propose variants that compute -- still in-place and with the same kind of complexity bounds -- the over-place remainder $A(X) $ ot\equiv$ A(X) \mod B(X)$, the accumulated remainder $R(X) += A(X) \mod B(X)$ and the accumulated modular multiplication $R(X) += A(X)C(X) \mod B(X)$. To achieve this, we develop techniques for Toeplitz matrix operations which output is also part of the input. Fast and in-place accumulating versions are obtained for the latter, and thus for convolutions, and then used for polynomial remaindering. This is realized via further reductions to accumulated polynomial multiplication, for which fast in-place algorithms have recently been developed.

Motivation & Objective

  • To design fast and in-place algorithms for polynomial and matrix operations where output variables are reused as inputs, overcoming the space-complexity trade-off of fast algorithms.
  • To enable in-place computation of the Euclidean polynomial remainder R(X) ≡ A(X) mod B(X), traditionally requiring O(n) extra space for quotient storage.
  • To extend the in-place model to allow temporary input modification with subsequent restoration, enabling new classes of fast, space-efficient algorithms.
  • To provide in-place variants of fast polynomial multiplication, convolution, and modular arithmetic, including accumulated and over-place operations.
  • To achieve complexity bounds matching standard non-in-place algorithms when M(n) = Θ(n^{1+ϵ}) for ϵ > 0.

Proposed method

  • Relax the in-place model to allow temporary modification of inputs, provided they are restored to their original state after computation.
  • Represent polynomial operations as Toeplitz or circulant matrix-vector products, enabling efficient in-place computation via recursive decomposition.
  • Use recursive block decomposition and generalized convolutions to reduce polynomial multiplication and remainder to in-place operations on smaller subproblems.
  • Apply the 'undo' technique: perform intermediate computations in-place and reverse them to restore original inputs, ensuring correctness.
  • Reduce modular remainder computation to short product and power series division using recursive splitting and quotient overwriting.
  • Leverage fast matrix algorithms (e.g., Strassen-like) and in-place linear algebra routines (e.g., TRMM, TRSM) as building blocks for polynomial operations.

Experimental results

Research questions

  • RQ1Can fast polynomial modular remainder be computed in-place with only O(1) extra space, avoiding the need to store the full quotient?
  • RQ2Is it possible to design in-place algorithms for fast polynomial multiplication that match the complexity of non-in-place variants?
  • RQ3Can the standard trade-off between speed and space in fast algorithms be broken using a relaxed in-place model with input restoration?
  • RQ4What is the minimal overhead in complexity when computing only the remainder (not the quotient) in polynomial division in-place?
  • RQ5Can in-place algorithms be extended to accumulate results, such as R += A·C mod B, without extra space?

Key findings

  • The proposed in-place remainder algorithm performs O(m/n M(n) log n) arithmetic operations, with a logarithmic factor over the non-in-place complexity.
  • When M(n) = Θ(n^{1+ϵ}) for some ϵ > 0, the in-place algorithm matches the non-in-place complexity bound O(m/n M(n)).
  • An in-place variant of Karatsuba multiplication was implemented and shown to perform nearly as well as the state-of-the-art NTL library.
  • The authors provide the first in-place algorithm for computing only the remainder of polynomial division, bypassing the need to store the quotient.
  • The technique enables in-place accumulation for modular multiplication, including R += A·C mod B, with the same complexity bounds.
  • Over-place variants of Toeplitz and circulant matrix operations are derived, allowing efficient system solving and matrix-vector products in-place.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.