+-- Module: Math.NumberTheory.Primes.Testing
+-- Copyright: (c) 2011 Daniel Fischer
+-- Maintainer: Daniel Fischer <firstname.lastname@example.org>
+-- Stability: Provisional
+-- Portability: Non-portable (GHC extensions)
+-- | Test primality using a 'FactorSieve'. If @n@ is out of bounds
+-- of the sieve, fall back to 'isPrime'.
+fsIsPrime :: FactorSieve -> Integer -> Bool
+ | n < 0 = fsIsPrime fs (-n)
+ | n <= fromIntegral (fsBound fs) = fsPrimeTest fs n
+ | otherwise = isPrime n
+-- The tests in this module may wrongly consider some composite numbers as prime.
+-- For the Baillie-PSW test, no pseudoprimes are known, and it is known that none
+-- exist below @2^64@, so for most practical purposes it can be regarded as conclusive.
+-- Nevertheless, it is desirable to certify numbers passing it as primes (or find that
+-- they are composite). The addition of prime certificates is planned for the next release.