Bug in dlasd4 in 3.4.2

Post here if you want to report a bug to the LAPACK team

Bug in dlasd4 in 3.4.2

Postby andreasnoackjensen » Wed Feb 20, 2013 3:51 am

This small program gives either sigma=NaN or the wrong answer 0.5 in LAPACK 3.4.2 but not in previous versions. Also, the answer changes if I comment out the write statements.

program test

implicit none

double precision :: v(5), z(5), delta(5), work(5), sigma, rho, dnrm2
integer :: info

v = (/0.1d0, 0.2d0, 0.3d0, 0.4d0, 0.5d0/)
z = (/0.1d0, 0.2d0, 0.3d0, 0.4d0, 0.5d0/)
rho = dnrm2(5_8, z, 1_8)
write(*,*) "z", z
z = z / rho
rho = rho**2
write(*,*) "v", v
write(*,*) "z", z
write(*,*) "rho", rho
call dlasd4(5_8, 5_8, v, z, delta, rho, sigma, work, info)
write(*,*) "sigma", sigma
write(*,*) "info", info
end program
andreasnoackjensen
 
Posts: 4
Joined: Wed Feb 20, 2013 3:40 am

Re: Bug in dlasd4 in 3.4.2

Postby lawrence mulholland » Wed Aug 07, 2013 6:56 am

I think this is the problem

dlasd4.f
line 268
TAU = RHO
should be
TAU2 = RHO

Lawrence

PS I think NAG should give somebody who performs the Lapack builds and tests
a NAG compiler licence to find things like this. It shows up right away as an unitialized
variable.
lawrence mulholland
 
Posts: 17
Joined: Mon Jun 11, 2012 6:33 am
Location: NAG Ltd, Oxford, UK

Re: Bug in dlasd4 in 3.4.2

Postby akobotov » Thu Aug 08, 2013 12:58 am

Hello,

Could you please check the latest version of dlasd4 on NETLIB LAPACK SVN https://icl.cs.utk.edu/svn/lapack-dev/l ... C/dlasd4.f. Very similar issue was corrected there at rev 1337.

Thank you,
Alexander
akobotov
 
Posts: 8
Joined: Wed Feb 03, 2010 7:38 am
Location: Intel Corp., Russia, Novosibirsk

Re: Bug in dlasd4 in 3.4.2

Postby lawrence mulholland » Thu Aug 08, 2013 5:13 am

OK looks like latest repo version is quite a bit different and doesn't have the same bug.
Presumably this is a revision for the next release.
Some might still might want the one line fix for 3.4.2 in the meantime.
lawrence mulholland
 
Posts: 17
Joined: Mon Jun 11, 2012 6:33 am
Location: NAG Ltd, Oxford, UK


Return to Bug report

Who is online

Users browsing this forum: Google [Bot] and 2 guests