I'm writing some code in Python that has to deal with very large matrices so it is virtually impossible (atleast very sub-optimal) to compute inverses of matrices. In an earlier problem I ran into a situation where i had $\mathbf{y}=A^{-1}B\mathbf{x}$ where $A$ and $B$ are large square matrices and $\mathbf{x}$ and $\mathbf{y}$ are vectors. I could turn this into $A\mathbf{y}=B\mathbf{x}$ and then solve for $\mathbf{y}$. However, I'm not sure how to eliminate computing the inverse in the problem described in the title, i.e. if I have $\mathbf{y}=AB^{-1}\mathbf{x}$. Figured it would be fine to post this question here since it's not so much programming related and more linear algebra related.
Any help is appreciated!