xROTMG issue & proposed fix

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

xROTMG issue & proposed fix

Postby jonasson » Tue Jun 25, 2019 11:02 am

Dear folks!

There is a bug in srotmg and drotmg in the reference blas that comes with LAPACK. It has been there at least since LAPACK 3.2. A test program, bug_srotmg.f90, demonstrating the problem using SROTMG, is attached.
Program demonstrating bug
(1.1 KiB) Downloaded 140 times

What happens is that rotmg keeps 2 by 2 Givens rotations in factored form, G = D*H. As computation moves on, with repeated application of rotmg, the elements in the diagonal D gradually become smaller and may in the end underflow. Thus, when d11 or d22 < 4096^(-2), then D is scaled up and H is scaled down correspondingly inside rotmg. In the original BLAS (1977) this was implemented with assigned goto and worked OK, but in the current versions it just produces the wrong H completely in cases when both d11 and d22 go below 4096^(-2) simultaneously (which can happen in realistic cases).

Fixed versions of both SROTMG and DROTMG are also attached to this post.
(7.66 KiB) Downloaded 130 times

(7.8 KiB) Downloaded 141 times

Kristjan Jonasson, University of Iceland
Mick Pont, NAG
Posts: 1
Joined: Wed Nov 04, 2009 9:47 pm

Re: xROTMG issue & proposed fix

Postby Julien Langou » Tue Jun 25, 2019 11:54 am

Thanks Kristjan and Mick!
We will have a look. Can you post this post on GitHub as an issue?
Cheers, Julien.
Julien Langou
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Return to Bug report

Who is online

Users browsing this forum: No registered users and 1 guest