An O(M(n) log n) algorithm for the Jacobi symbol
Richard P. Brent, Paul Zimmermann

TL;DR
This paper presents a new O(M(n) log n) algorithm for computing the Jacobi symbol, based on a binary recursive gcd approach, which outperforms previous implementations for large inputs.
Contribution
The authors introduce a novel O(M(n) log n) algorithm for the Jacobi symbol using a binary recursive gcd method, improving efficiency over prior algorithms.
Findings
Implementation is faster than GMP's quadratic method for inputs over 10,000 digits.
First known implementation achieving O(M(n) log n) runtime for the Jacobi symbol.
Demonstrates practical efficiency for large integer inputs.
Abstract
The best known algorithm to compute the Jacobi symbol of two n-bit integers runs in time O(M(n) log n), using Sch\"onhage's fast continued fraction algorithm combined with an identity due to Gauss. We give a different O(M(n) log n) algorithm based on the binary recursive gcd algorithm of Stehl\'e and Zimmermann. Our implementation - which to our knowledge is the first to run in time O(M(n) log n) - is faster than GMP's quadratic implementation for inputs larger than about 10000 decimal digits.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · Coding theory and cryptography · semigroups and automata theory
