Deformed N = 2 theories, generalized recursion relations and S-duality