Faster C implementation for soft normalization