def sigmoid
import stelliferous@0.0.2.0/math_fp32.bend as MathFp32import Base
68# At x>=18 sigmoid rounds to 1. Below -110 both sigmoid and SiLU round
69# to zero; multiplying the clamped x before the final scaling preserves -0
70# for SiLU, including at -infinity. NaNs pass the clamp and propagate.
71def sigmoid(+x: F32) -> F32:
72 sigmoid_input(False{},x,F32.max(F32.min(18.0,x),F32.neg(110.0)))