Reimplement min_of_type using __MATH_TG.