Possible Duplicate:
Fastest primality test
Can somebody give an efficient algorithm for determining the primality of an number?
The conventional iteration method seems to take a lot of time when testing primality of large numbers. I have tried some probabilistic algorithms but was not satisfied by the accuracy.