implement fast ExpTrunc() and CharPolyMod()#23
Conversation
|
@victorshoup: Is there anything that needs to be done before this can get merged? |
|
Thanks for sending me the reminder and sorry for being so slow. Some questions...
|
|
Thanks for the quick response! I added some documentation for About your other questions: |
|
Thanks. Yeah, there is a method to update the html files. But it’s only semi automatic. I have to do it myself. I should really fix that. Anyway, I’ll try to take care of this soon!On Mar 14, 2026, at 3:11 PM, Lorenz Panny ***@***.***> wrote:yyyyx4 left a comment (libntl/ntl#23)
Thanks for the quick response! I added some documentation for ExpTrunc(), and updated the documentation for CharPolyMod(), in the .txt files in doc/. I don't know how to update the HTML files (they seem to be autogenerated from the .txt?).
About your other questions:
(2) I did run some correctness and performance tests on much larger examples back in the day, albeit not as systematically as for the data shown in my initial comment above. Everything seemed fine.
(3) I don't mind adding my existing test programs somewhere, but I can't find very many tests at all in the existing codebase, and I'm not sure if it makes sense to start a comprehensive testing effort with this patch. Perhaps we can trust my offline testing that I did a while back for the moment, and eventually someone should go over the entire library and write tests for everything?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
...for
zz_pXandZZ_pX. Both algorithms require divisions by scalars up to the precision, so they cannot be used when the degree is larger than the characteristic, but they give significant speedups in large characteristic.Example benchmark results for
CharPolyMod()inzz_pX, where red is the current version of NTL and blue is this branch:Characteristic$11$ (essentially unchanged):

(The outliers appear when the new algorithm cannot be used and the minimal and characteristic polynomials are not the same; in such a case the library falls back to a much slower algorithm.)
Characteristic$99999989 ≈ 2^{26.6}$ (much faster):

I've confirmed on millions of random instances that the code works correctly, for prime characteristics and degrees up to 100.