The COS Method: An Efficient Fourier Method for Pricing Financial Derivatives