Up for consideration is the following function which can be used to (relatively quickly) factor a 64-bit unsigned integer into its prime factors. Note that the factoring is
Fermat's factorization method is simple and quick for finding pairs of large prime factors as long as you stop it before it goes too far and becomes slow. However, in my tests on random numbers such cases have been too rare to see any improvement.
...without using a probabalistic approach (e.g., Miller-Rabin) for determining primality
With uniform distribution, 75% of your inputs are going to need a billion loop iterations, so it's worth spending a million operations on less deterministic techniques first even if you get an inconclusive answer and have to revert back to trial division.
I've found the Brent variation of Pollard's Rho Method to be very good, though more complicated to code and understand. The best example I've seen is from this forum discussion. The method relies on luck, but helps often enough to be worthwhile.
The Miller-Rabin primality test is actually deterministic up to about 10^15, which can save you the trouble of a fruitless search.
I tried a few dozen variations and settled on the following for factoring int64 values:
Note that Pollard's Rho finds factors that are not necessarily prime, so recursion can be used to factor those.