Performance optimizations (pre calculate coefficients, AVX implementation)