expit

The function expit from scipy.special is a numerically stable implementation of the sigmoid function, expit handles these cases safely and efficiently using internal tricks like: Clipping, Log-exp identities, SIMD-optimized instructions.