Hi Mike,
Yes, the current SVD routine in the core application is an adaptation of the NR3 implementation. I have implemented your solution and it seems to work well in all of my tests. For your example 6x6 matrix, the output of your test script is now:
u: 0.7071062183462742,0.7071015740954208,-0.0028565517339196995,-3.3015825279789923e-161,0,0,-0.7071073439970429,0.7071004851896847,-0.0028474391933923254,5.698060336481597e-161,0,0,-0.000006440381235082195,-0.004033330669572706,-0.9999918660680353,-1.442544086577126e-163,0,0,-4.499243768466547e-161,1.198112770725562e-161,5.395651329327801e-164,-0.7070158669675028,0,0,-4.499243768476779e-161,1.198112770719164e-161,5.395651329299175e-164,-0.7070158669637272,0,0,1.0204337425167995e-162,-2.7173337598387453e-163,-1.223740024457242e-165,0.016035202453346702,0,0
w: 1787028157.7260127,9688880090589428,25823892922799290,3.403840351129283e-300,0,0
v: 0.7071062183462746,0.7071015740954211,-0.0028565517339195212,0,0,0,-0.7071073439970428,0.7071004851896849,-0.0028474391933924607,2.3964725526739963e-161,-3.064165658794164e-171,8.985720755944261e-173,-0.00000644038123510659,-0.004033330669572709,-0.9999918660680357,-1.4455511948398978e-163,1.848292220693647e-173,-5.420170265107162e-175,-1.1980831043289655e-161,1.198112770725431e-161,5.395651328686843e-164,-0.7070158670579629,-0.7070158668733328,0.016035202450446904,-1.1980831043225685e-161,1.1981127707190339e-161,5.395651328658029e-164,-0.7070158668733328,0.7071664970096749,0.0066414980550424775,2.717266476104717e-163,-2.7173337598384507e-163,-1.2237400243117817e-165,0.016035202450446907,0.0066414980550424775,0.9998493700482879
where [25823892922799290, 9688880090589428, 1787028157.7260127, 3.403840351129283e-300, 0, 0] look like good singular values. As you see, the new routine replaces NaNs with zeros in the output matrices. Let me know if the above results are valid.
Thank you for detecting this problem, and for your good analysis. We haven't seen it before because the existing tools don't pose so ill-conditioned problems, but it's nice to have a more capable implementation. The improved SVD routine will be available in the incoming 1.8.4.1187 version.