edited formula for product of experts