Optimized evaluation code.