Skip to content

Incorrect function arguments in tstiee.f compared to description in comments #435

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

Closed
nicdin opened this issue Sep 1, 2020 · 1 comment
Closed
Milestone

Comments

@nicdin
Copy link

nicdin commented Sep 1, 2020

I think I have spotted an error in tstiee.f, where the comments about what functions calls are doing do not match what the calls are actually doing.

On lines 603-619 of tstiee.f in the function ILAENV there are calls to the function IEEECK:

*
*     ISPEC = 10: ieee NaN arithmetic can be trusted not to trap
*
      ILAENV = 1
      IF (ILAENV .EQ. 1) THEN
         ILAENV = IEEECK( 0, 0.0, 1.0 )
      ENDIF
      RETURN
*
 1100 CONTINUE
*
*     ISPEC = 11: infinity arithmetic can be trusted not to trap
*
      ILAENV = 1
      IF (ILAENV .EQ. 1) THEN
         ILAENV = IEEECK( 1, 0.0, 1.0 )
      ENDIF

According to the comment starting on line 645 the first parameter (ISPEC) of IEEECK has the following meanings:

*  ISPEC   (input) INTEGER
*          Specifies whether to test just for inifinity arithmetic
*          or whether to test for infinity and NaN arithmetic.
*          = 0: Verify infinity arithmetic only.
*          = 1: Verify infinity and NaN arithmetic.

Therefore I think the parameters are the wrong way round in the calls to IEECK: in the first call, to check NaN arithmetic the call should be:

         ILAENV = IEEECK( 1, 0.0, 1.0 )

because calling IEEECK with ISPEC=0 (as the code currently does) will mean it exits before the code checking NaN arithmetic is reached (see line 725 of tstiee.f).

The second call, to check infinity arithmetic, should be:

         ILAENV = IEEECK( 0, 0.0, 1.0 )
langou added a commit that referenced this issue Feb 26, 2021
langou added a commit that referenced this issue Mar 2, 2021
…--issue479--issue435

Fix ieee check and ilaenv -- fix issue #479  and issue #435
@langou
Copy link
Contributor

langou commented Mar 2, 2021

Hi @nicdin, thanks a lot, this is fixed in #498, I am closing this issue now. @langou

@langou langou closed this as completed Mar 2, 2021
@julielangou julielangou added this to the LAPACK 3.9.1 milestone Mar 25, 2021
christoph-conrads pushed a commit to christoph-conrads/lapack that referenced this issue May 23, 2021
christoph-conrads pushed a commit to christoph-conrads/lapack that referenced this issue May 23, 2021
…ee-check--ilaenv--issue479--issue435

Fix ieee check and ilaenv -- fix issue Reference-LAPACK#479  and issue Reference-LAPACK#435
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants