Fastest algorithm for primality test

algorithm, c++, math, primes

Solution

One good method is the Miller-Rabin test. It should be noted however, that this is only a probabilistic test.

Problem

I need to test primality on intervals between numbers which are really big (in the range of long long), so i need some fast algorithm for checking if a number is prime or not. Please suggest your ideas.

Original source

Related problems