Assuming arguments will be uniformly picked an extra check would speed things up on many architectures:
return (x & 0xFE0000001 == 0) &&
(x == 6 || x == 28 || x == 496 || x == 8128 || x == 33550336):
The original code does about 5 comparisons in each call. The improvement always does a binary ‘and’ and 1 comparison, and only does the original 5 in 1/256 of the calls.