Split diophantine tests as fast/slow.

Please review.

/cc @mattpap, @thilinarmtb