Implement the Newton-Schulz iteration to approximately orthogonalize a matrix . Given an input matrix , first normalize it by its Frobenius norm so that its largest singular value does not exceed 1. Then apply num_iters iterations of the update rule:
Implement this using efficient matrix multiplications (avoid computing directly as a product of two full matrix multiplies when you can reuse intermediate results). Return the final matrix as a nested Python list.
If the Frobenius norm of the input is zero, return the zero matrix unchanged.
Parameters
M: a 2D list (or array-like) representing the input matrix (shape n x m).num_iters: integer, number of iterations.a, b, c: floats, the polynomial coefficients of the iteration.