Efficient Probabilistic Learning and Optimization for Physical Simulations