Efficient and stable Arnoldi restarts for matrix functions based on quadrature