module Math.NumberTheory.Primes.Testing
(
isPrime
, isCertifiedPrime
, bailliePSW
, millerRabinV
, isStrongFermatPP
, isFermatPP
, FactorSieve
, fsIsPrime
, trialDivisionPrimeTo
) where
import Math.NumberTheory.Primes.Testing.Probabilistic
import Math.NumberTheory.Primes.Testing.Certified
import Math.NumberTheory.Primes.Factorisation.TrialDivision
import Math.NumberTheory.Primes.Sieve.Misc
fsIsPrime :: FactorSieve -> Integer -> Bool
fsIsPrime fs n
| n < 0 = fsIsPrime fs (n)
| n <= fromIntegral (fsBound fs) = fsPrimeTest fs n
| otherwise = isPrime n