Extrapolation at points geometric progression, over nmod#2667
Conversation
sequence - add test file for geometric extrapolation Co-authored-by: ktran11 <kevintran3009@outlook.fr>
Co-authored-by: ktran11 <kevintran3009@outlook.fr>
…n+interpolation Co-authored-by: ktran11 <kevintran3009@outlook.fr>
Co-authored-by: ktran11 <kevintran3009@outlook.fr>
|
This is very nice! Looks interesting for having a variant of |
Not really "other", but in the exact same idea as what you mention ("variant represented by evaluations"), this operation may be beneficial in fast algorithms for rational reconstruction problems, for polynomials or for polynomial matrices. Say, for polynomials: given |
This PR comes from work done in collaboration with @ktran11 .
This completes the set of functions for evaluation/interpolation at points in geometric progression, by adding extrapolation: given the evaluations of some (implicit) polynomial at a list of$m$ successive points from the geometric progression, return the evaluations of this polynomial at another list of $n$ successive points in this progression.
More precisely, here is a simplified excerpt of the documentation for the new function: consider the geometric progression$(c \cdot q^i)_ {i \ge 0}$ , for some invertible element $c$ and for $q$ of "sufficiently large" order. The new function takes as input the list of values $(f(c \cdot q^{k+i}))_ {0 \le i < m}$ of some polynomial $f$ of degree less than $m$ , for some given starting index $k \ge 0$ , and computes the list of values $(f(c \cdot q^{\ell+j}))_ {0 \le j < n}$ , for some other starting index $\ell$ . The parameters are such that both lists of points are disjoint. Note that $f$ is not part of the input or output, and in fact the provided implementation does not compute it.
The naive approach would be to interpolate to find$f$ and then evaluate it at the output points, and even that is not straightforward (the current implementations of evaluate/interpolate focus on a sublist of the $q^i$ 's that must start with $i=0$ , and only supports $c=1$ ). The implemented approach is based on an approach due to Bostan, Gaudry, and Schost (Section 3 of SIAM J.Computing, 2007, https://doi.org/10.1137/S0097539704443793). This is presented there for arithmetic progressions, and adapted here to geometric progressions.
The timings below show how this behaves performance-wise, with$m = n$ , compared to what one could expect from an interpolation+evaluation approach, and compared to one middle product with relevant parameters (which is the main step in the algorithm, apart from precomputations). Roughly: the performance is just a tiny bit higher than the middle product, and this is between 2 and 2.5 faster than the naive approach (theory predicts a factor of 3, if I'm not mistaken, but that would require a middle product that perfectly matches the performance of polynomial multiplication).