Blending was done in srgb space and was not matching cycles. Optimized by using less branches and more vector operations.