% primality_benchmark.m

# create input vector over several orders of magnitude
n = uint64(2) .^ (1:63) - 1;        # some are Mersenne primes, some are not
n(end+1) = intmax("uint64");        # == 2^64-1
n(end+1) = intmax("uint64") - 58;   # == 2^64 - 59 == largest 64-bit prime

# actual test
tic; x = isprime(n); toc            # current standard
tic, y = isprime2(n); toc           # proposed replacement
assert (all (x == y))               # verify correctness
whos

