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

nmod_poly_divexact #1759

Merged
merged 1 commit into from Jan 30, 2024
Merged

nmod_poly_divexact #1759

merged 1 commit into from Jan 30, 2024

Conversation

fredrik-johansson
Copy link
Collaborator

Adds nmod_poly_divexact and uses it instead of nmod_poly_div in several places where an exact division is intended.

@fredrik-johansson fredrik-johansson merged commit 7dc31d3 into main Jan 30, 2024
13 of 14 checks passed
@fredrik-johansson fredrik-johansson deleted the divexact branch January 30, 2024 18:49
@fredrik-johansson
Copy link
Collaborator Author

Speedup of _nmod_poly_divexact vs _nmod_poly_div with a 64-bit modulus:

lenB \ lenQ
         1    2    4    8   16   32   64  128  256  512 1024 2048 4096 8192 16384 32768 65536 
    1 2.05 1.00 1.00 1.00 0.97 1.00 1.08 1.00 1.00 1.00 1.00 1.00 1.00 1.09 0.96 1.02 1.01 
    2 1.03 1.00 1.01 0.91 0.95 1.03 0.99 1.00 0.96 1.02 1.00 1.00 1.03 1.01 1.07 1.00 1.00 
    4 0.91 1.00 0.99 1.00 1.00 1.00 1.00 1.00 1.02 1.01 0.95 1.00 1.00 0.93 1.00 1.00 1.00 
    8 1.00 1.02 1.00 0.95 1.00 1.00 1.08 1.00 1.00 1.00 1.05 1.00 1.01 0.94 1.03 1.00 1.08 
   16 1.03 1.03 1.00 1.00 0.97 1.28 1.20 1.21 1.25 1.17 1.22 1.17 1.20 1.11 1.14 1.16 1.21 
   32 1.07 1.00 1.00 0.94 1.03 1.14 1.00 1.00 0.97 0.94 0.92 0.94 0.93 0.97 0.95 1.00 0.92 
   64 1.06 1.00 1.00 1.00 1.03 1.32 1.28 1.25 1.00 1.04 1.04 1.03 1.00 1.05 1.03 1.00 1.03 
  128 0.97 1.02 1.01 0.93 1.00 1.43 1.28 1.49 1.23 1.12 1.06 1.07 1.03 1.02 1.08 1.04 1.02 
  256 1.00 1.02 1.01 1.00 1.00 1.37 1.28 1.50 1.69 1.37 1.09 1.08 1.06 1.10 1.00 1.00 1.01 
  512 1.00 0.97 1.00 0.94 1.00 1.45 1.33 1.49 1.62 1.32 1.00 1.00 0.98 1.01 0.94 1.00 1.03 
 1024 0.95 1.05 1.01 1.06 1.03 1.30 1.28 1.49 1.62 1.29 1.20 1.00 0.96 0.97 1.00 1.03 1.02 
 2048 0.97 1.02 1.00 0.94 0.97 1.50 1.33 1.51 1.69 1.29 1.09 1.09 0.98 1.11 1.00 1.00 1.00 
 4096 1.04 1.02 1.00 1.00 1.00 1.27 1.28 1.49 1.69 1.32 1.20 1.09 1.08 0.91 1.05 0.95 0.99 
 8192 0.96 1.00 1.00 1.00 1.00 1.50 1.33 1.49 1.69 1.29 1.10 1.04 1.08 1.00 0.96 0.95 0.95 
16384 0.94 1.01 1.01 1.00 1.00 1.42 1.28 1.52 1.62 1.29 1.00 1.09 1.06 1.00 1.04 0.98 0.97 
32768 1.03 1.00 1.01 1.00 1.00 1.47 1.28 1.49 1.62 1.29 1.20 1.04 1.08 1.20 1.09 1.06 0.96 
65536 1.11 1.03 1.01 1.06 1.00 1.41 1.28 1.51 1.62 1.32 1.09 1.09 1.08 1.09 1.09 1.06 1.10 

Obviously some further fine-tuning is possible.

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.

None yet

1 participant