Replaced helper function _phi by special.expit