we see that this is incorrect because RWORK in ZLARCM requires workspace of size 2*M*N and the larger dimension is not put in the formula. Since NRWORK = 2*N*N+N (assuming that N <= M) we get that the required workspace for RWORK is at least 2*N*(M+N) + N which is larger than 5*N*N+7*N for sufficiently large M.

I found out that something was wrong in this subroutine when I consistently was getting segmentation error working with the documented size of RWORK.

Indeed, this is a known bug, and it is currently fix but not yet released.See http://www.netlib.org/lapack/Errata/[quote](*) bug0021 :: in DGESDD, workspace query gives a value smaller than the minimal value given in the header to run the routine[quote]Thank you for the reportJulie

Maybe I should have been more specific. The incorrect workspace in ZGESDD is for RWORK, not WORK (as is in DGESDD). But I agree that the proposed corrected formula may work in this case. By the way, I used the following formula in this case for ZGESDD:

The correction has been included as revision 729. It will be release in 3.2.2.The Errata has been updated as well see http://www.netlib.org/lapack/Errata/, bug 0046Thank you very much for the bug reportJulie