Skip to content

Commit 9db9ff8

Browse files
Serguei PatchkovskiiSerguei Patchkovskii
authored andcommitted
Updated values of TWOPI and PIOVER2 to 39 significant digits,
to prevent accuracy loss when REAL or DOUBLE PRECISION types correspond to an extended precision real kind. These constants should be sufficient to work with 128-bit extended-IEEE data type. Rebuilding the modified source using the default gfortran make.inc (with gfortran 7.5.0) does not add any new test failures. The only test failure, which is also present in the master baranch, is: ZDRGEV3: ZGGEV31 returned INFO= 7. N= 12, JTYPE= 16, ISEED=( 2855, 3551, 2406, 2393) Additionally, included a sample build file for quadruple-precision compilation using gfortran (version 4.7 or later). With this config file, both REAL and DOUBLE PRECISION are mapped onto a 128-bit REAL(16) type, with the corresponding change to the COMPLEX and COMPLEX*16. There are numerical failure 6 failures for each type, all in *GBSVX type 6 matrix, with S/D routines losing 4 significant digits, and C/Z routines 5 digits relative to the expected result. I am not really qualified to debug this failure ...
1 parent f53dd49 commit 9db9ff8

29 files changed

+151
-50
lines changed

INSTALL/make.inc.gfortran-quad

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
####################################################################
2+
# LAPACK make include file. #
3+
# LAPACK, Version 3.7.0 #
4+
# November 2017 #
5+
####################################################################
6+
7+
SHELL = /bin/sh
8+
9+
# CC is the C compiler, normally invoked with options CFLAGS.
10+
#
11+
CC = gcc
12+
CFLAGS = -O3
13+
14+
# Modify the FC and FFLAGS definitions to the desired compiler
15+
# and desired compiler options for your machine. NOOPT refers to
16+
# the compiler options desired when NO OPTIMIZATION is selected.
17+
#
18+
# Note: During a regular execution, LAPACK might create NaN and Inf
19+
# and handle these quantities appropriately. As a consequence, one
20+
# should not compile LAPACK with flags such as -ffpe-trap=overflow.
21+
#
22+
# The -freal-4-real-16 -freal-8-real-16 flags instruct gfortran
23+
# to treal REAL, DOUBLE PRECISION, and corresponding COMPLEX
24+
# declarations as 128-bit floating-point types. These flags
25+
# are supported from gfortran 4.7 on. Please note that both
26+
# s*/c* and d*/z* entry points will expect 128-bit floating-point
27+
# type.
28+
#
29+
FC = gfortran
30+
FFLAGS = -O2 -frecursive -freal-4-real-16 -freal-8-real-16
31+
FFLAGS_DRV = $(FFLAGS)
32+
FFLAGS_NOOPT = -O0 -frecursive -freal-4-real-16 -freal-8-real-16
33+
34+
# Define LDFLAGS to the desired linker options for your machine.
35+
#
36+
LDFLAGS =
37+
38+
# The archiver and the flag(s) to use when building an archive
39+
# (library). If your system has no ranlib, set RANLIB = echo.
40+
#
41+
AR = ar
42+
ARFLAGS = cr
43+
RANLIB = ranlib
44+
45+
# Timer for the SECOND and DSECND routines
46+
#
47+
# Default: SECOND and DSECND will use a call to the
48+
# EXTERNAL FUNCTION ETIME
49+
#TIMER = EXT_ETIME
50+
# For RS6K: SECOND and DSECND will use a call to the
51+
# EXTERNAL FUNCTION ETIME_
52+
#TIMER = EXT_ETIME_
53+
# For gfortran compiler: SECOND and DSECND will use a call to the
54+
# INTERNAL FUNCTION ETIME
55+
#TIMER = INT_ETIME
56+
# If your Fortran compiler does not provide etime (like Nag Fortran
57+
# Compiler, etc...) SECOND and DSECND will use a call to the
58+
# INTERNAL FUNCTION CPU_TIME
59+
#TIMER = INT_CPU_TIME
60+
# If none of these work, you can use the NONE value.
61+
# In that case, SECOND and DSECND will always return 0.
62+
TIMER = NONE
63+
64+
# Uncomment the following line to include deprecated routines in
65+
# the LAPACK library.
66+
#
67+
#BUILD_DEPRECATED = Yes
68+
69+
# LAPACKE has the interface to some routines from tmglib.
70+
# If LAPACKE_WITH_TMG is defined, add those routines to LAPACKE.
71+
#
72+
#LAPACKE_WITH_TMG = Yes
73+
74+
# Location of the extended-precision BLAS (XBLAS) Fortran library
75+
# used for building and testing extended-precision routines. The
76+
# relevant routines will be compiled and XBLAS will be linked only
77+
# if USEXBLAS is defined.
78+
#
79+
#USEXBLAS = Yes
80+
#XBLASLIB = -lxblas
81+
82+
# The location of the libraries to which you will link. (The
83+
# machine-specific, optimized BLAS library should be used whenever
84+
# possible.)
85+
#
86+
BLASLIB = $(TOPSRCDIR)/librefblas.a
87+
CBLASLIB = $(TOPSRCDIR)/libcblas.a
88+
LAPACKLIB = $(TOPSRCDIR)/liblapack.a
89+
TMGLIB = $(TOPSRCDIR)/libtmglib.a
90+
LAPACKELIB = $(TOPSRCDIR)/liblapacke.a

SRC/cbbcsd.f

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,13 @@ SUBROUTINE CBBCSD( JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS, M, P, Q,
354354
* .. Parameters ..
355355
INTEGER MAXITR
356356
PARAMETER ( MAXITR = 6 )
357-
REAL HUNDRED, MEIGHTH, ONE, PIOVER2, TEN, ZERO
357+
REAL HUNDRED, MEIGHTH, ONE, TEN, ZERO
358358
PARAMETER ( HUNDRED = 100.0E0, MEIGHTH = -0.125E0,
359-
$ ONE = 1.0E0, PIOVER2 = 1.57079632679489662E0,
360-
$ TEN = 10.0E0, ZERO = 0.0E0 )
359+
$ ONE = 1.0E0, TEN = 10.0E0, ZERO = 0.0E0 )
361360
COMPLEX NEGONECOMPLEX
362361
PARAMETER ( NEGONECOMPLEX = (-1.0E0,0.0E0) )
362+
REAL PIOVER2
363+
PARAMETER ( PIOVER2 = 1.57079632679489661923132169163975144210E0 )
363364
* ..
364365
* .. Local Scalars ..
365366
LOGICAL COLMAJOR, LQUERY, RESTART11, RESTART12,

SRC/clarnv.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ SUBROUTINE CLARNV( IDIST, ISEED, N, X )
120120
INTEGER LV
121121
PARAMETER ( LV = 128 )
122122
REAL TWOPI
123-
PARAMETER ( TWOPI = 6.2831853071795864769252867663E+0 )
123+
PARAMETER ( TWOPI = 6.28318530717958647692528676655900576839E+0 )
124124
* ..
125125
* .. Local Scalars ..
126126
INTEGER I, IL, IV

SRC/dbbcsd.f

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,13 @@ SUBROUTINE DBBCSD( JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS, M, P, Q,
354354
* .. Parameters ..
355355
INTEGER MAXITR
356356
PARAMETER ( MAXITR = 6 )
357-
DOUBLE PRECISION HUNDRED, MEIGHTH, ONE, PIOVER2, TEN, ZERO
357+
DOUBLE PRECISION HUNDRED, MEIGHTH, ONE, TEN, ZERO
358358
PARAMETER ( HUNDRED = 100.0D0, MEIGHTH = -0.125D0,
359-
$ ONE = 1.0D0, PIOVER2 = 1.57079632679489662D0,
360-
$ TEN = 10.0D0, ZERO = 0.0D0 )
359+
$ ONE = 1.0D0, TEN = 10.0D0, ZERO = 0.0D0 )
361360
DOUBLE PRECISION NEGONE
362361
PARAMETER ( NEGONE = -1.0D0 )
362+
DOUBLE PRECISION PIOVER2
363+
PARAMETER ( PIOVER2 = 1.57079632679489661923132169163975144210D0 )
363364
* ..
364365
* .. Local Scalars ..
365366
LOGICAL COLMAJOR, LQUERY, RESTART11, RESTART12,

SRC/dlarnv.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ SUBROUTINE DLARNV( IDIST, ISEED, N, X )
118118
INTEGER LV
119119
PARAMETER ( LV = 128 )
120120
DOUBLE PRECISION TWOPI
121-
PARAMETER ( TWOPI = 6.2831853071795864769252867663D+0 )
121+
PARAMETER ( TWOPI = 6.28318530717958647692528676655900576839D+0 )
122122
* ..
123123
* .. Local Scalars ..
124124
INTEGER I, IL, IL2, IV

SRC/sbbcsd.f

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,13 @@ SUBROUTINE SBBCSD( JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS, M, P, Q,
354354
* .. Parameters ..
355355
INTEGER MAXITR
356356
PARAMETER ( MAXITR = 6 )
357-
REAL HUNDRED, MEIGHTH, ONE, PIOVER2, TEN, ZERO
357+
REAL HUNDRED, MEIGHTH, ONE, TEN, ZERO
358358
PARAMETER ( HUNDRED = 100.0E0, MEIGHTH = -0.125E0,
359-
$ ONE = 1.0E0, PIOVER2 = 1.57079632679489662E0,
360-
$ TEN = 10.0E0, ZERO = 0.0E0 )
359+
$ ONE = 1.0E0, TEN = 10.0E0, ZERO = 0.0E0 )
361360
REAL NEGONE
362361
PARAMETER ( NEGONE = -1.0E0 )
362+
REAL PIOVER2
363+
PARAMETER ( PIOVER2 = 1.57079632679489661923132169163975144210E0 )
363364
* ..
364365
* .. Local Scalars ..
365366
LOGICAL COLMAJOR, LQUERY, RESTART11, RESTART12,

SRC/slarnv.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ SUBROUTINE SLARNV( IDIST, ISEED, N, X )
118118
INTEGER LV
119119
PARAMETER ( LV = 128 )
120120
REAL TWOPI
121-
PARAMETER ( TWOPI = 6.2831853071795864769252867663E+0 )
121+
PARAMETER ( TWOPI = 6.28318530717958647692528676655900576839E+0 )
122122
* ..
123123
* .. Local Scalars ..
124124
INTEGER I, IL, IL2, IV

SRC/zbbcsd.f

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,13 @@ SUBROUTINE ZBBCSD( JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS, M, P, Q,
354354
* .. Parameters ..
355355
INTEGER MAXITR
356356
PARAMETER ( MAXITR = 6 )
357-
DOUBLE PRECISION HUNDRED, MEIGHTH, ONE, PIOVER2, TEN, ZERO
357+
DOUBLE PRECISION HUNDRED, MEIGHTH, ONE, TEN, ZERO
358358
PARAMETER ( HUNDRED = 100.0D0, MEIGHTH = -0.125D0,
359-
$ ONE = 1.0D0, PIOVER2 = 1.57079632679489662D0,
360-
$ TEN = 10.0D0, ZERO = 0.0D0 )
359+
$ ONE = 1.0D0, TEN = 10.0D0, ZERO = 0.0D0 )
361360
COMPLEX*16 NEGONECOMPLEX
362361
PARAMETER ( NEGONECOMPLEX = (-1.0D0,0.0D0) )
362+
DOUBLE PRECISION PIOVER2
363+
PARAMETER ( PIOVER2 = 1.57079632679489661923132169163975144210D0 )
363364
* ..
364365
* .. Local Scalars ..
365366
LOGICAL COLMAJOR, LQUERY, RESTART11, RESTART12,

SRC/zlarnv.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ SUBROUTINE ZLARNV( IDIST, ISEED, N, X )
120120
INTEGER LV
121121
PARAMETER ( LV = 128 )
122122
DOUBLE PRECISION TWOPI
123-
PARAMETER ( TWOPI = 6.2831853071795864769252867663D+0 )
123+
PARAMETER ( TWOPI = 6.28318530717958647692528676655900576839D+0 )
124124
* ..
125125
* .. Local Scalars ..
126126
INTEGER I, IL, IV

TESTING/EIG/cckcsd.f

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,14 @@ SUBROUTINE CCKCSD( NM, MVAL, PVAL, QVAL, NMATS, ISEED, THRESH,
208208
PARAMETER ( NTESTS = 15 )
209209
INTEGER NTYPES
210210
PARAMETER ( NTYPES = 4 )
211-
REAL GAPDIGIT, ORTH, PIOVER2, REALONE, REALZERO, TEN
211+
REAL GAPDIGIT, ORTH, REALONE, REALZERO, TEN
212212
PARAMETER ( GAPDIGIT = 10.0E0, ORTH = 1.0E-4,
213-
$ PIOVER2 = 1.57079632679489662E0,
214213
$ REALONE = 1.0E0, REALZERO = 0.0E0,
215214
$ TEN = 10.0E0 )
216215
COMPLEX ONE, ZERO
217216
PARAMETER ( ONE = (1.0E0,0.0E0), ZERO = (0.0E0,0.0E0) )
217+
REAL PIOVER2
218+
PARAMETER ( PIOVER2 = 1.57079632679489661923132169163975144210E0 )
218219
* ..
219220
* .. Local Scalars ..
220221
LOGICAL FIRSTT

0 commit comments

Comments
 (0)