Efficient Algorithms for Chemical Threshold Testing Problems