Pricing discrete barrier options and credit default swaps under Lévy processes