Bristol-Myers quarterly profit beats expectations as costs cut