Skip to content

Commit

Permalink
Merge pull request #280 from ViralBShah/develop
Browse files Browse the repository at this point in the history
Patch LAPACK XLASD4.f as discussed in JuliaLang/julia#2340
  • Loading branch information
xianyi committed Aug 21, 2013
2 parents c92ae01 + eae6920 commit df554ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lapack-netlib/SRC/dlasd4.f
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ SUBROUTINE DLASD4( N, I, D, Z, DELTA, RHO, SIGMA, WORK, INFO )
*
EPS = DLAMCH( 'Epsilon' )
RHOINV = ONE / RHO
TAU2= ZERO
*
* The case I = N
*
Expand Down Expand Up @@ -275,6 +276,7 @@ SUBROUTINE DLASD4( N, I, D, Z, DELTA, RHO, SIGMA, WORK, INFO )
ELSE
TAU2 = ( A+SQRT( A*A+FOUR*B*C ) ) / ( TWO*C )
END IF
TAU = TAU2 / ( D( N )+SQRT( D( N )*D( N )+TAU2 ) )
END IF
*
* It can be proved that
Expand All @@ -293,6 +295,8 @@ SUBROUTINE DLASD4( N, I, D, Z, DELTA, RHO, SIGMA, WORK, INFO )
ELSE
TAU2 = ( A+SQRT( A*A+FOUR*B*C ) ) / ( TWO*C )
END IF
TAU = TAU2 / ( D( N )+SQRT( D( N )*D( N )+TAU2 ) )

*
* It can be proved that
* D(N)^2 < D(N)^2+TAU2 < SIGMA(N)^2 < D(N)^2+RHO/2
Expand All @@ -301,7 +305,7 @@ SUBROUTINE DLASD4( N, I, D, Z, DELTA, RHO, SIGMA, WORK, INFO )
*
* The following TAU is to approximate SIGMA_n - D( N )
*
TAU = TAU2 / ( D( N )+SQRT( D( N )*D( N )+TAU2 ) )
* TAU = TAU2 / ( D( N )+SQRT( D( N )*D( N )+TAU2 ) )
*
SIGMA = D( N ) + TAU
DO 30 J = 1, N
Expand Down
6 changes: 5 additions & 1 deletion lapack-netlib/SRC/slasd4.f
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ SUBROUTINE SLASD4( N, I, D, Z, DELTA, RHO, SIGMA, WORK, INFO )
*
EPS = SLAMCH( 'Epsilon' )
RHOINV = ONE / RHO
TAU2= ZERO
*
* The case I = N
*
Expand Down Expand Up @@ -275,6 +276,7 @@ SUBROUTINE SLASD4( N, I, D, Z, DELTA, RHO, SIGMA, WORK, INFO )
ELSE
TAU2 = ( A+SQRT( A*A+FOUR*B*C ) ) / ( TWO*C )
END IF
TAU = TAU2 / ( D( N )+SQRT( D( N )*D( N )+TAU2 ) )
END IF
*
* It can be proved that
Expand All @@ -293,6 +295,8 @@ SUBROUTINE SLASD4( N, I, D, Z, DELTA, RHO, SIGMA, WORK, INFO )
ELSE
TAU2 = ( A+SQRT( A*A+FOUR*B*C ) ) / ( TWO*C )
END IF
TAU = TAU2 / ( D( N )+SQRT( D( N )*D( N )+TAU2 ) )

*
* It can be proved that
* D(N)^2 < D(N)^2+TAU2 < SIGMA(N)^2 < D(N)^2+RHO/2
Expand All @@ -301,7 +305,7 @@ SUBROUTINE SLASD4( N, I, D, Z, DELTA, RHO, SIGMA, WORK, INFO )
*
* The following TAU is to approximate SIGMA_n - D( N )
*
TAU = TAU2 / ( D( N )+SQRT( D( N )*D( N )+TAU2 ) )
* TAU = TAU2 / ( D( N )+SQRT( D( N )*D( N )+TAU2 ) )
*
SIGMA = D( N ) + TAU
DO 30 J = 1, N
Expand Down

0 comments on commit df554ae

Please sign in to comment.