Use same tests for isfinite/finite, lgamma/gamma.