Fast inversion of Hankel and Toeplitz matrices