I think `x.dtype.type is not longdouble`  might be better here.