You are looking for a primality test. You should be able to search and find lots of possibilities. Here is an answer I wrote a few years ago that is probably far more than you want:
Fastest way to find if a given number is prime
Most of the details there are for numbers larger than 64-bit where there are lots of possible digressions and choices. For 64-bit inputs, the simple and reasonable answer is to use a little trial division followed by a crafted set of Miller-Rabin tests which give deterministic results (there is both no randomness used and no possibility of error if correctly implemented). If you want to optimize a bit then there are hashed sets and BPSW to consider.
Addendum: There are cases that could be done faster if the number of inputs is much larger than the maximum input size or the number of unique inputs, or if there is some distribution such as an expectation of many repeated inputs. Then solutions such as caching or generating a bitset for fast lookup could be faster. Knowledge of the input set helps a lot.