Calculate the product of values in an array