/* mpz_millerrabin(n,reps) -- An implementation of the probabilistic primality test found in Knuth's Seminumerical Algorithms book. If the function mpz_millerrabin() returns 0 then n is not prime. If it returns 1, then n is 'probably' prime. The probability of a false positive is (1/4)**reps, where reps is the number of internal passes of the probabilistic algorithm. Knuth indicates that 25 passes are reasonable.
With the current implementation, the first 24 MR-tests are substituted by a Baillie-PSW probable prime test.
This implementation of the Baillie-PSW test was checked up to 2463*10^12, for smaller values no MR-test is performed, regardless of reps, and 2 ("surely prime") is returned if the number was not proved composite.
If GMP_BPSW_NOFALSEPOSITIVES_UPTO_64BITS is defined as non-zero, the code assumes that the Baillie-PSW test was checked up to 2^64.
THE FUNCTIONS IN THIS FILE ARE FOR INTERNAL USE ONLY. THEY'RE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES.
Contributed by John Amanatides. Changed to "BPSW, then Miller Rabin if required" by Marco Bodrato.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
or
* the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
or both in parallel, as here.
The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.