Just use a backward stable algorithm to solve the least-squares problem $\min \|W^{1/2}(Ax-b)\|_2$ resulting from IRLS. For instance, use the QR factorization or the SVD of $W^{1/2}A$, instead of forming normal equations like you are doing here.
Federico Poloni
- 20.2k
- 2
- 82
- 120