octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55564] GESDD: vastly different singular value


From: count
Subject: [Octave-bug-tracker] [bug #55564] GESDD: vastly different singular values when vectors are also requested
Date: Fri, 15 Feb 2019 08:11:46 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #18, bug #55564 (project octave):

...In comment #17, the typo fix is for my #15

@Tim Mitchell

For demo1(), though 'gdesdd' start to fail around 1e-15. I don't feel too bad
about it. It is around machine epsilon.

For demo2(), don't change the order of the logspace(), my code is for demo
that 'dgesvd' is not better than 'dgesdd' too much.

It should looks like this (note the logspace() range and the transpose of s):



function demo2(N)
  % Make a orthonomal matrix.
  % Use qr() to avoid the doubtful svd() used in orth().
  [A0, ~]   = qr(rand(N));
  s         = logspace(-40,0,N)';
  C         = s .* A0;
  
  s1        = svd(C);   % GESVD always
  [U,S,V]   = svd(C);   % GESDD for N >= 26 on MATLAB
  s2        = diag(S); 
  
  % Compare the singular values: 
  % truth, GESVD, GESDD (GESVD if N <= 25)
  sort([s s1 s2], 'descend')
  
  % The relative errors of the singular values of
  % GESVD (left) and GESDD (right)
  % For N <= 25, both will be GESVD on MATLAB
  [(s1-s)./s (s2-s)./s ]
end



My Matlab version is 9.3.0.713579 (R2017b) under Linux, using CPU i7-6700HQ
(with avx2 and fma). No idea why can't be reproduced.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55564>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]