Pricing early-exercise and discrete barrier options by Fourier-Cosine series expansions