bug found by Themos Tsikas fron NAG Ltd
authorlangou <langou@users.noreply.github.com>
Mon, 16 Jun 2014 12:16:58 +0000 (12:16 +0000)
committerlangou <langou@users.noreply.github.com>
Mon, 16 Jun 2014 12:16:58 +0000 (12:16 +0000)
LAPACK FORUM topic #4558

Hello

In zlanhf.f, first executable statements
Code: Select all
      IF( N.EQ.0 ) THEN
         ZLANHF = ZERO
         RETURN
      ELSE IF( N.EQ.1 ) THEN
         ZLANHF = ABS(A(0))
         RETURN
      END IF

When N=1, we should be ignoring any imaginary part (as we do for general diagonal elements later on) and so it should read
Code: Select all
      IF( N.EQ.0 ) THEN
         ZLANHF = ZERO
         RETURN
      ELSE IF( N.EQ.1 ) THEN
         ZLANHF = ABS(DBLE(A(0)))
         RETURN
      END IF

Themos Tsikas
NAG Ltd

SRC/clanhf.f
SRC/zlanhf.f

index f7bd4fb55156c0f88a87c8fe3191a1e82c80fa58..cbcb7ecec4028aeac310c36398bb6002b28178ca 100644 (file)
          CLANHF = ZERO
          RETURN
       ELSE IF( N.EQ.1 ) THEN
-         CLANHF = ABS( A(0) )
+         CLANHF = ABS(REAL(A(0)))
          RETURN
       END IF
 *
index 8f781dd79f17238218a775e20bfd10618d43e3b8..99b3f3c1e9195ae138580db04a1da3914bd2f0a8 100644 (file)
          ZLANHF = ZERO
          RETURN
       ELSE IF( N.EQ.1 ) THEN
-         ZLANHF = ABS( A(0) )
+         ZLANHF = ABS(DBLE(A(0)))
          RETURN
       END IF
 *