-
Notifications
You must be signed in to change notification settings - Fork 430
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
Make lapy and nrm2 consistent #607
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Instead of using the FORTRAN INTRINSIC HUGE, it might be better to use DLAMCH( 'Overflow' ).
- Instead of calling MAXN, maybe call this variable HUGEVAL. (I agree that MAX is better to describe this variable, but HUGE is what LAPACK and FORTRAN seem to be using, so I think we want to be consistent.)
- Instead of using ==, it might be better to use .EQ. (for consistency throughout LAPACK)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General question. Why does LAPACK not have DISPOSINFTY ? There is DISNAN, but not DISPOSINFTY. Such that the W > MAXN of @angsch would be a DISPOSINFTY( W ). (And we can discuss on the name of this subroutine.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice PR @angsch ! "Correct" behavior of LAPACK routines under NaN and Inf is something we are working on right now, and this is a great contribution!
The first part of the current effort is to define what the "correct" behavior of LAPACK routines under NaN and Inf should be. The second part is to make the "correct" behavior happen in the routines. And finally the third and last part is to write some test that check for "correct" behavior under NaN and Inf.
Perfect timing for this contribution!
As far what the "correct" behavior should be, I certainly agree that the output of SQRT( ( +/- INF ** 2 ) + ( +/- INF ) ** 2 ) ) is better defined as an +INF than a NaN.
Avoid the introduction of NaN by divisons inf / inf
Where should the tests go? The testing directory appears to so far not cover any auxiliary routines. |
Hi @angsch, it is not clear where these tests will go. Maybe in LAPACK/TESTING proper, maybe somewhere else. I think it is great that you are identifying a problem and give a PR with a good solution. It would be good to have the related TESTING but we are not in place yet, so I think the best as far as TESTING goes is to wait. Cheers, Julien. |
Description
If some of the inputs are
inf
,{s,d}lapy{2,3}
and the new{s,d}nrm2
routines return inconsistent results,NaN
in contrast toinf
.inf
inf
This commit adds a check to avoid the divisions
inf / inf
that introduceNaN
.Checklist