http://benji3up2kxewkqfcq7buxk2xd6zwy3zggnurkrm3l4cvwy2iipvyyad.onion/mirrors/gmpdoc/Jacobi-Symbol.html
For inputs larger than GCD_DC_THRESHOLD , mpz_jacobi , mpz_legendre and mpz_kronecker are computed via the HGCD (Half
GCD) function, as a generalization to Lehmer’s algorithm. Most GCD algorithms reduce a and b by repeatedly computing the
quotient q = floor(a/b) and iteratively replacing a, b = b, a - q * b Different algorithms use different methods for calculating q, but the core
algorithm is the same if we use Lehmer’s...