QR decomposition with increasingly large errors
I received a code to work on and it has a QR decomposition subroutine as shown below. When checking this QR decomposition using the error calculation I added at the end of it, I found the error increases as the simulation continues to very high magnitudes after hundreds of simulation steps.