Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DROTMG returns unexpected values #244

Open
vladimir-ch opened this issue Mar 5, 2018 · 3 comments
Open

DROTMG returns unexpected values #244

vladimir-ch opened this issue Mar 5, 2018 · 3 comments
Assignees

Comments

@vladimir-ch
Copy link
Contributor

In some cases, DROTMG returns values that, when used in DROTM, do not zero out the second component of the given vector.

This can be observed for example with the following input values for DROTMG:

D1 = 1600000000
D2 = 800000000
X1 = 8
Y1 = 7

After DROTM, Y1 is currently mapped to -24052.672896090524.

The issue we see is in the rescaling part. The setup phase sets the non-unit elements of H. When rescaling is done, the unit elements are set explicitly before the scaling. Rescaling for D1 scales H11,H12 and sets FLAG=-1 but then rescaling for D2 overwrites H12 with 1 which is wrong.

In Gonum we fixed the issue by adopting in gonum/gonum#420 the implementation proposed in:

Tim Hopkins. 1997. Restructuring the BLAS level 1 routine for computing the modified
givens transformation. SIGNUM Newsl. 32, 4 (October 1997), 2-14.
DOI=http://dx.doi.org/10.1145/289251.289253

OpenBLAS later fixed their rotmg implementation with the same approach in OpenMathLib/OpenBLAS#1480.
There was also some discussion in OpenMathLib/OpenBLAS#1452 where the initial report about strange values returned by DROTMG was done.

Also, as I comment in that thread, we would like to clarify whether the value of GAM could be increased and to what value. From what I read in the above paper, the current value of 4096 was chosen very conservatively when BLAS Level 1 was created, that is before IEEE floating point. A larger value of GAM would reduce the necessity for rescaling (flag = -1) which is good because having units in H saves operations in DROTM which is the whole point of DROTMG in my understanding. However, it is not clear what an appropriate value would be. What are your views on this?

Lastly, it would worth revising the documentation for DROTMG and thus improve slightly its status of an underdog. It took us some time to fully understand how to interpret the values the routine takes and returns. The most mysterious was the square root of D1 and D2, some projects that provide interface to BLAS even drop the square root from their documentation.

@jacobbogers
Copy link

Hi, can anyone give the status on this ussue, is it resolved?

@langou langou assigned scr2016 and unassigned langou May 10, 2018
@jacobbogers
Copy link

What is the status on this issue?

@langou
Copy link
Contributor

langou commented Jul 13, 2019

This might be related to #344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants