Logistic sigmoid

Write codeEasy12 minOpenAI and Anthropic style

Your task

Implement the logistic sigmoid function applied elementwise to a list of real numbers. Sigmoid(x) = 1 / (1 + exp(-x)). To avoid math range overflow for very negative inputs, use the equivalent stable form exp(x) / (1 + exp(x)) when x is negative. Return the list of outputs, each rounded to 6 decimal places. The input list may be empty (return an empty list).

Examples

sigmoid(xs: list[float]) -> list[float]
Example 1
Inputsigmoid([0])
Output[0.5]