Commerce: 1 product but N prices
You have two options.


You can create one product for each combonation of X and Y and have those as values on the product. If you reference all the products on the node, commerce can turn the value of X and Y into a dropdown which will trigger an ajax update, changing the other data for the product like this price.
The other options if you don't want to create a product for each combonation (my preferred solution), would be to create a pricing rule, custom code is probably needed here, to calculate and set the unit price on the line item based on X/Y data.