LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
sblat1.f
Go to the documentation of this file.
1*> \brief \b SBLAT1
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8* Definition:
9* ===========
10*
11* PROGRAM SBLAT1
12*
13*
14*> \par Purpose:
15* =============
16*>
17*> \verbatim
18*>
19*> Test program for the REAL Level 1 BLAS.
20*>
21*> Based upon the original BLAS test routine together with:
22*> F06EAF Example Program Text
23*> \endverbatim
24*
25* Authors:
26* ========
27*
28*> \author Univ. of Tennessee
29*> \author Univ. of California Berkeley
30*> \author Univ. of Colorado Denver
31*> \author NAG Ltd.
32*
33*> \ingroup single_blas_testing
34*
35* =====================================================================
36 PROGRAM sblat1
37*
38* -- Reference BLAS test routine --
39* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
40* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
41*
42* =====================================================================
43*
44* .. Parameters ..
45 INTEGER nout
46 parameter(nout=6)
47* .. Scalars in Common ..
48 INTEGER icase, incx, incy, n
49 LOGICAL pass
50* .. Local Scalars ..
51 REAL sfac
52 INTEGER ic
53* .. External Subroutines ..
54 EXTERNAL check0, check1, check2, check3, header
55* .. Common blocks ..
56 COMMON /combla/icase, n, incx, incy, pass
57* .. Data statements ..
58 DATA sfac/9.765625e-4/
59* .. Executable Statements ..
60 WRITE (nout,99999)
61 DO 20 ic = 1, 13
62 icase = ic
63 CALL header
64*
65* .. Initialize PASS, INCX, and INCY for a new case. ..
66* .. the value 9999 for INCX or INCY will appear in the ..
67* .. detailed output, if any, for cases that do not involve ..
68* .. these parameters ..
69*
70 pass = .true.
71 incx = 9999
72 incy = 9999
73 IF (icase.EQ.3 .OR. icase.EQ.11) THEN
74 CALL check0(sfac)
75 ELSE IF (icase.EQ.7 .OR. icase.EQ.8 .OR. icase.EQ.9 .OR.
76 + icase.EQ.10) THEN
77 CALL check1(sfac)
78 ELSE IF (icase.EQ.1 .OR. icase.EQ.2 .OR. icase.EQ.5 .OR.
79 + icase.EQ.6 .OR. icase.EQ.12 .OR. icase.EQ.13) THEN
80 CALL check2(sfac)
81 ELSE IF (icase.EQ.4) THEN
82 CALL check3(sfac)
83 END IF
84* -- Print
85 IF (pass) WRITE (nout,99998)
86 20 CONTINUE
87 stop
88*
8999999 FORMAT (' Real BLAS Test Program Results',/1x)
9099998 FORMAT (' ----- PASS -----')
91*
92* End of SBLAT1
93*
94 END
95 SUBROUTINE header
96* .. Parameters ..
97 INTEGER NOUT
98 parameter(nout=6)
99* .. Scalars in Common ..
100 INTEGER ICASE, INCX, INCY, N
101 LOGICAL PASS
102* .. Local Arrays ..
103 CHARACTER*6 L(13)
104* .. Common blocks ..
105 COMMON /combla/icase, n, incx, incy, pass
106* .. Data statements ..
107 DATA l(1)/' SDOT '/
108 DATA l(2)/'SAXPY '/
109 DATA l(3)/'SROTG '/
110 DATA l(4)/' SROT '/
111 DATA l(5)/'SCOPY '/
112 DATA l(6)/'SSWAP '/
113 DATA l(7)/'SNRM2 '/
114 DATA l(8)/'SASUM '/
115 DATA l(9)/'SSCAL '/
116 DATA l(10)/'ISAMAX'/
117 DATA l(11)/'SROTMG'/
118 DATA l(12)/'SROTM '/
119 DATA l(13)/'SDSDOT'/
120* .. Executable Statements ..
121 WRITE (nout,99999) icase, l(icase)
122 RETURN
123*
12499999 FORMAT (/' Test of subprogram number',i3,12x,a6)
125*
126* End of HEADER
127*
128 END
129 SUBROUTINE check0(SFAC)
130* .. Parameters ..
131 INTEGER NOUT
132 parameter(nout=6)
133* .. Scalar Arguments ..
134 REAL SFAC
135* .. Scalars in Common ..
136 INTEGER ICASE, INCX, INCY, N
137 LOGICAL PASS
138* .. Local Scalars ..
139 REAL D12, SA, SB, SC, SS
140 INTEGER I, K
141* .. Local Arrays ..
142 REAL DA1(8), DATRUE(8), DB1(8), DBTRUE(8), DC1(8),
143 + DS1(8), DAB(4,9), DTEMP(9), DTRUE(9,9)
144* .. External Subroutines ..
145 EXTERNAL srotg, srotmg, stest, stest1
146* .. Common blocks ..
147 COMMON /combla/icase, n, incx, incy, pass
148* .. Data statements ..
149 DATA da1/0.3e0, 0.4e0, -0.3e0, -0.4e0, -0.3e0, 0.0e0,
150 + 0.0e0, 1.0e0/
151 DATA db1/0.4e0, 0.3e0, 0.4e0, 0.3e0, -0.4e0, 0.0e0,
152 + 1.0e0, 0.0e0/
153 DATA dc1/0.6e0, 0.8e0, -0.6e0, 0.8e0, 0.6e0, 1.0e0,
154 + 0.0e0, 1.0e0/
155 DATA ds1/0.8e0, 0.6e0, 0.8e0, -0.6e0, 0.8e0, 0.0e0,
156 + 1.0e0, 0.0e0/
157 DATA datrue/0.5e0, 0.5e0, 0.5e0, -0.5e0, -0.5e0,
158 + 0.0e0, 1.0e0, 1.0e0/
159 DATA dbtrue/0.0e0, 0.6e0, 0.0e0, -0.6e0, 0.0e0,
160 + 0.0e0, 1.0e0, 0.0e0/
161* INPUT FOR MODIFIED GIVENS
162 DATA dab/ .1e0,.3e0,1.2e0,.2e0,
163 a .7e0, .2e0, .6e0, 4.2e0,
164 b 0.e0,0.e0,0.e0,0.e0,
165 c 4.e0, -1.e0, 2.e0, 4.e0,
166 d 6.e-10, 2.e-2, 1.e5, 10.e0,
167 e 4.e10, 2.e-2, 1.e-5, 10.e0,
168 f 2.e-10, 4.e-2, 1.e5, 10.e0,
169 g 2.e10, 4.e-2, 1.e-5, 10.e0,
170 h 4.e0, -2.e0, 8.e0, 4.e0 /
171* TRUE RESULTS FOR MODIFIED GIVENS
172 DATA dtrue/0.e0,0.e0, 1.3e0, .2e0, 0.e0,0.e0,0.e0, .5e0, 0.e0,
173 a 0.e0,0.e0, 4.5e0, 4.2e0, 1.e0, .5e0, 0.e0,0.e0,0.e0,
174 b 0.e0,0.e0,0.e0,0.e0, -2.e0, 0.e0,0.e0,0.e0,0.e0,
175 c 0.e0,0.e0,0.e0, 4.e0, -1.e0, 0.e0,0.e0,0.e0,0.e0,
176 d 0.e0, 15.e-3, 0.e0, 10.e0, -1.e0, 0.e0, -1.e-4,
177 e 0.e0, 1.e0,
178 f 0.e0,0.e0, 6144.e-5, 10.e0, -1.e0, 4096.e0, -1.e6,
179 g 0.e0, 1.e0,
180 h 0.e0,0.e0,15.e0,10.e0,-1.e0, 5.e-5, 0.e0,1.e0,0.e0,
181 i 0.e0,0.e0, 15.e0, 10.e0, -1. e0, 5.e5, -4096.e0,
182 j 1.e0, 4096.e-6,
183 k 0.e0,0.e0, 7.e0, 4.e0, 0.e0,0.e0, -.5e0, -.25e0, 0.e0/
184* 4096 = 2 ** 12
185 DATA d12 /4096.e0/
186 dtrue(1,1) = 12.e0 / 130.e0
187 dtrue(2,1) = 36.e0 / 130.e0
188 dtrue(7,1) = -1.e0 / 6.e0
189 dtrue(1,2) = 14.e0 / 75.e0
190 dtrue(2,2) = 49.e0 / 75.e0
191 dtrue(9,2) = 1.e0 / 7.e0
192 dtrue(1,5) = 45.e-11 * (d12 * d12)
193 dtrue(3,5) = 4.e5 / (3.e0 * d12)
194 dtrue(6,5) = 1.e0 / d12
195 dtrue(8,5) = 1.e4 / (3.e0 * d12)
196 dtrue(1,6) = 4.e10 / (1.5e0 * d12 * d12)
197 dtrue(2,6) = 2.e-2 / 1.5e0
198 dtrue(8,6) = 5.e-7 * d12
199 dtrue(1,7) = 4.e0 / 150.e0
200 dtrue(2,7) = (2.e-10 / 1.5e0) * (d12 * d12)
201 dtrue(7,7) = -dtrue(6,5)
202 dtrue(9,7) = 1.e4 / d12
203 dtrue(1,8) = dtrue(1,7)
204 dtrue(2,8) = 2.e10 / (1.5e0 * d12 * d12)
205 dtrue(1,9) = 32.e0 / 7.e0
206 dtrue(2,9) = -16.e0 / 7.e0
207* .. Executable Statements ..
208*
209* Compute true values which cannot be prestored
210* in decimal notation
211*
212 dbtrue(1) = 1.0e0/0.6e0
213 dbtrue(3) = -1.0e0/0.6e0
214 dbtrue(5) = 1.0e0/0.6e0
215*
216 DO 20 k = 1, 8
217* .. Set N=K for identification in output if any ..
218 n = k
219 IF (icase.EQ.3) THEN
220* .. SROTG ..
221 IF (k.GT.8) GO TO 40
222 sa = da1(k)
223 sb = db1(k)
224 CALL srotg(sa,sb,sc,ss)
225 CALL stest1(sa,datrue(k),datrue(k),sfac)
226 CALL stest1(sb,dbtrue(k),dbtrue(k),sfac)
227 CALL stest1(sc,dc1(k),dc1(k),sfac)
228 CALL stest1(ss,ds1(k),ds1(k),sfac)
229 ELSEIF (icase.EQ.11) THEN
230* .. SROTMG ..
231 DO i=1,4
232 dtemp(i)= dab(i,k)
233 dtemp(i+4) = 0.0
234 END DO
235 dtemp(9) = 0.0
236 CALL srotmg(dtemp(1),dtemp(2),dtemp(3),dtemp(4),dtemp(5))
237 CALL stest(9,dtemp,dtrue(1,k),dtrue(1,k),sfac)
238 ELSE
239 WRITE (nout,*) ' Shouldn''t be here in CHECK0'
240 stop
241 END IF
242 20 CONTINUE
243 40 RETURN
244*
245* End of CHECK0
246*
247 END
248 SUBROUTINE check1(SFAC)
249* .. Parameters ..
250 INTEGER NOUT
251 REAL THRESH
252 parameter(nout=6, thresh=10.0e0)
253* .. Scalar Arguments ..
254 REAL SFAC
255* .. Scalars in Common ..
256 INTEGER ICASE, INCX, INCY, N
257 LOGICAL PASS
258* .. Local Scalars ..
259 INTEGER I, IX, LEN, NP1
260* .. Local Arrays ..
261 REAL DTRUE1(5), DTRUE3(5), DTRUE5(8,5,2), DV(8,5,2),
262 + DVR(8), SA(10), STEMP(1), STRUE(8), SX(8),
263 + SXR(15)
264 INTEGER ITRUE2(5), ITRUEC(5)
265* .. External Functions ..
266 REAL SASUM, SNRM2
267 INTEGER ISAMAX
268 EXTERNAL sasum, snrm2, isamax
269* .. External Subroutines ..
270 EXTERNAL itest1, sb1nrm2, sscal, stest, stest1
271* .. Intrinsic Functions ..
272 INTRINSIC max
273* .. Common blocks ..
274 COMMON /combla/icase, n, incx, incy, pass
275* .. Data statements ..
276 DATA sa/0.3e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4.0e0, 4.0e0,
299 + 0.20e0, -0.60e0, 0.30e0, 5.0e0, 5.0e0, 5.0e0,
300 + 5.0e0, 5.0e0, 0.03e0, -0.09e0, 0.15e0, -0.03e0,
301 + 6.0e0, 6.0e0, 6.0e0, 6.0e0, 0.10e0, 8.0e0,
302 + 8.0e0, 8.0e0, 8.0e0, 8.0e0, 8.0e0, 8.0e0,
303 + 0.09e0, 9.0e0, 9.0e0, 9.0e0, 9.0e0, 9.0e0,
304 + 9.0e0, 9.0e0, 0.09e0, 2.0e0, -0.12e0, 2.0e0,
305 + 2.0e0, 2.0e0, 2.0e0, 2.0e0, 0.06e0, 3.0e0,
306 + -0.18e0, 5.0e0, 0.09e0, 2.0e0, 2.0e0, 2.0e0,
307 + 0.03e0, 4.0e0, -0.09e0, 6.0e0, -0.15e0, 7.0e0,
308 + -0.03e0, 3.0e0/
309 DATA itrue2/0, 1, 2, 2, 3/
310 DATA itruec/0, 1, 1, 1, 1/
311* .. Executable Statements ..
312 DO 80 incx = 1, 2
313 DO 60 np1 = 1, 5
314 n = np1 - 1
315 len = 2*max(n,1)
316* .. Set vector arguments ..
317 DO 20 i = 1, len
318 sx(i) = dv(i,np1,incx)
319 20 CONTINUE
320*
321 IF (icase.EQ.7) THEN
322* .. SNRM2 ..
323* Test scaling when some entries are tiny or huge
324 CALL sb1nrm2(n,(incx-2)*2,thresh)
325 CALL sb1nrm2(n,incx,thresh)
326* Test with hardcoded mid range entries
327 stemp(1) = dtrue1(np1)
328 CALL stest1(snrm2(n,sx,incx),stemp(1),stemp,sfac)
329 ELSE IF (icase.EQ.8) THEN
330* .. SASUM ..
331 stemp(1) = dtrue3(np1)
332 CALL stest1(sasum(n,sx,incx),stemp(1),stemp,sfac)
333 ELSE IF (icase.EQ.9) THEN
334* .. SSCAL ..
335 CALL sscal(n,sa((incx-1)*5+np1),sx,incx)
336 DO 40 i = 1, len
337 strue(i) = dtrue5(i,np1,incx)
338 40 CONTINUE
339 CALL stest(len,sx,strue,strue,sfac)
340 ELSE IF (icase.EQ.10) THEN
341* .. ISAMAX ..
342 CALL itest1(isamax(n,sx,incx),itrue2(np1))
343 DO 100 i = 1, len
344 sx(i) = 42.0e0
345 100 CONTINUE
346 CALL itest1(isamax(n,sx,incx),itruec(np1))
347 ELSE
348 WRITE (nout,*) ' Shouldn''t be here in CHECK1'
349 stop
350 END IF
351 60 CONTINUE
352 IF (icase.EQ.10) THEN
353 n = 8
354 ix = 1
355 DO 120 i = 1, n
356 sxr(ix) = dvr(i)
357 ix = ix + incx
358 120 CONTINUE
359 CALL itest1(isamax(n,sxr,incx),3)
360 END IF
361 80 CONTINUE
362 RETURN
363*
364* End of CHECK1
365*
366 END
367 SUBROUTINE check2(SFAC)
368* .. Parameters ..
369 INTEGER NOUT
370 parameter(nout=6)
371* .. Scalar Arguments ..
372 REAL SFAC
373* .. Scalars in Common ..
374 INTEGER ICASE, INCX, INCY, N
375 LOGICAL PASS
376* .. Local Scalars ..
377 REAL SA
378 INTEGER I, J, KI, KN, KNI, KPAR, KSIZE, LENX, LENY,
379 $ LINCX, LINCY, MX, MY
380* .. Local Arrays ..
381 REAL DT10X(7,4,4), DT10Y(7,4,4), DT7(4,4),
382 $ DT8(7,4,4), DX1(7),
383 $ DY1(7), SSIZE1(4), SSIZE2(14,2), SSIZE3(4),
384 $ SSIZE(7), STX(7), STY(7), SX(7), SY(7),
385 $ DPAR(5,4), DT19X(7,4,16),DT19XA(7,4,4),
386 $ DT19XB(7,4,4), DT19XC(7,4,4),DT19XD(7,4,4),
387 $ DT19Y(7,4,16), DT19YA(7,4,4),DT19YB(7,4,4),
388 $ DT19YC(7,4,4), DT19YD(7,4,4), DTEMP(5),
389 $ ST7B(4,4), STY0(1), SX0(1), SY0(1)
390 INTEGER INCXS(4), INCYS(4), LENS(4,2), NS(4)
391* .. External Functions ..
392 REAL SDOT, SDSDOT
393 EXTERNAL sdot, sdsdot
394* .. External Subroutines ..
395 EXTERNAL saxpy, scopy, srotm, sswap, stest, stest1
396* .. Intrinsic Functions ..
397 INTRINSIC abs, min
398* .. Common blocks ..
399 COMMON /combla/icase, n, incx, incy, pass
400* .. Data statements ..
401 equivalence(dt19x(1,1,1),dt19xa(1,1,1)),(dt19x(1,1,5),
402 a dt19xb(1,1,1)),(dt19x(1,1,9),dt19xc(1,1,1)),
403 b (dt19x(1,1,13),dt19xd(1,1,1))
404 equivalence(dt19y(1,1,1),dt19ya(1,1,1)),(dt19y(1,1,5),
405 a dt19yb(1,1,1)),(dt19y(1,1,9),dt19yc(1,1,1)),
406 b (dt19y(1,1,13),dt19yd(1,1,1))
407
408 DATA sa/0.3e0/
409 DATA incxs/1, 2, -2, -1/
410 DATA incys/1, -2, 1, -2/
411 DATA lens/1, 1, 2, 4, 1, 1, 3, 7/
412 DATA ns/0, 1, 2, 4/
413 DATA dx1/0.6e0, 0.1e0, -0.5e0, 0.8e0, 0.9e0, -0.3e0,
414 + -0.4e0/
415 DATA dy1/0.5e0, -0.9e0, 0.3e0, 0.7e0, -0.6e0, 0.2e0,
416 + 0.8e0/
417 DATA dt7/0.0e0, 0.30e0, 0.21e0, 0.62e0, 0.0e0,
418 + 0.30e0, -0.07e0, 0.85e0, 0.0e0, 0.30e0, -0.79e0,
419 + -0.74e0, 0.0e0, 0.30e0, 0.33e0, 1.27e0/
420 DATA st7b/ .1, .4, .31, .72, .1, .4, .03, .95,
421 + .1, .4, -.69, -.64, .1, .4, .43, 1.37/
422 DATA dt8/0.5e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
423 + 0.0e0, 0.68e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
424 + 0.0e0, 0.0e0, 0.68e0, -0.87e0, 0.0e0, 0.0e0,
425 + 0.0e0, 0.0e0, 0.0e0, 0.68e0, -0.87e0, 0.15e0,
426 + 0.94e0, 0.0e0, 0.0e0, 0.0e0, 0.5e0, 0.0e0,
427 + 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.68e0,
428 + 0.0e0,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.5e0, 0.6e0, 0.0e0, 0.0e0,
472 + 0.0e0, 0.5e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
473 + 0.0e0, 0.6e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
474 + 0.0e0, 0.6e0, -0.9e0, 0.1e0, 0.0e0, 0.0e0,
475 + 0.0e0, 0.0e0, 0.6e0, -0.9e0, 0.1e0, 0.7e0,
476 + -0.5e0, 0.2e0, 0.8e0/
477 DATA ssize1/0.0e0, 0.3e0, 1.6e0, 3.2e0/
478 DATA ssize2/0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
479 + 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
480 + 0.0e0, 1.17e0, 1.17e0, 1.17e0, 1.17e0, 1.17e0,
481 + 1.17e0, 1.17e0, 1.17e0, 1.17e0, 1.17e0, 1.17e0,
482 + 1.17e0, 1.17e0, 1.17e0/
483 DATA ssize3/ .1, .4, 1.7, 3.3 /
484*
485* FOR DROTM
486*
487 DATA dpar/-2.e0, 0.e0,0.e0,0.e0,0.e0,
488 a -1.e0, 2.e0, -3.e0, -4.e0, 5.e0,
489 b 0.e0, 0.e0, 2.e0, -3.e0, 0.e0,
490 c 1.e0, 5.e0, 2.e0, 0.e0, -4.e0/
491* TRUE X RESULTS F0R ROTATIONS DROTM
492 DATA dt19xa/.6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
493 a .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
494 b .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
495 c .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
496 d .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
497 e -.8e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
498 f -.9e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
499 g 3.5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
500 h .6e0, .1e0, 0.e0,0.e0,0.e0,0.e0,0.e0,
501 i -.8e0, 3.8e0, 0.e0,0.e0,0.e0,0.e0,0.e0,
502 j -.9e0, 2.8e0, 0.e0,0.e0,0.e0,0.e0,0.e0,
503 k 3.5e0, -.4e0, 0.e0,0.e0,0.e0,0.e0,0.e0,
504 l .6e0, .1e0, -.5e0, .8e0, 0.e0,0.e0,0.e0,
505 m -.8e0, 3.8e0, -2.2e0, -1.2e0, 0.e0,0.e0,0.e0,
506 n -.9e0, 2.8e0, -1.4e0, -1.3e0, 0.e0,0.e0,0.e0,
507 o 3.5e0, -.4e0, -2.2e0, 4.7e0, 0.e0,0.e0,0.e0/
508*
509 DATA dt19xb/.6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
510 a .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
511 b .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
512 c .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
513 d .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
514 e -.8e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
515 f -.9e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
516 g 3.5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
517 h .6e0, .1e0, -.5e0, 0.e0,0.e0,0.e0,0.e0,
518 i 0.e0, .1e0, -3.0e0, 0.e0,0.e0,0.e0,0.e0,
519 j -.3e0, .1e0, -2.0e0, 0.e0,0.e0,0.e0,0.e0,
520 k 3.3e0, .1e0, -2.0e0, 0.e0,0.e0,0.e0,0.e0,
521 l .6e0, .1e0, -.5e0, .8e0, .9e0, -.3e0, -.4e0,
522 m -2.0e0, .1e0, 1.4e0, .8e0, .6e0, -.3e0, -2.8e0,
523 n -1.8e0, .1e0, 1.3e0, .8e0, 0.e0, -.3e0, -1.9e0,
524 o 3.8e0, .1e0, -3.1e0, .8e0, 4.8e0, -.3e0, -1.5e0 /
525*
526 DATA dt19xc/.6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
527 a .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
528 b .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
529 c .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
530 d .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
531 e -.8e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
532 f -.9e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
533 g 3.5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
534 h .6e0, .1e0, -.5e0, 0.e0,0.e0,0.e0,0.e0,
535 i 4.8e0, .1e0, -3.0e0, 0.e0,0.e0,0.e0,0.e0,
536 j 3.3e0, .1e0, -2.0e0, 0.e0,0.e0,0.e0,0.e0,
537 k 2.1e0, .1e0, -2.0e0, 0.e0,0.e0,0.e0,0.e0,
538 l .6e0, .1e0, -.5e0, .8e0, .9e0, -.3e0, -.4e0,
539 m -1.6e0, .1e0, -2.2e0, .8e0, 5.4e0, -.3e0, -2.8e0,
540 n -1.5e0, .1e0, -1.4e0, .8e0, 3.6e0, -.3e0, -1.9e0,
541 o 3.7e0, .1e0, -2.2e0, .8e0, 3.6e0, -.3e0, -1.5e0 /
542*
543 DATA dt19xd/.6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
544 a .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
545 b .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
546 c .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
547 d .6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
548 e -.8e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
549 f -.9e0, 0.e0,0.e0,0.e0,0.e0,0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0, -.7e0, -.7e0, 2.3e0, 0.e0,0.e0,0.e0,
575 o -2.6e0, 3.5e0, -.7e0, -3.6e0, 0.e0,0.e0,0.e0/
576*
577 DATA dt19yb/.5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
578 a .5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
579 b .5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
580 c .5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
581 d .5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
582 e .7e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
583 f 1.7e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
584 g -2.6e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
585 h .5e0, -.9e0, .3e0, 0.e0,0.e0,0.e0,0.e0,
586 i 4.0e0, -.9e0, -.3e0, 0.e0,0.e0,0.e0,0.e0,
587 j -.5e0, -.9e0, 1.5e0, 0.e0,0.e0,0.e0,0.e0,
588 k -1.5e0, -.9e0, -1.8e0, 0.e0,0.e0,0.e0,0.e0,
589 l .5e0, -.9e0, .3e0, .7e0, -.6e0, .2e0, .8e0,
590 m 3.7e0, -.9e0, -1.2e0, .7e0, -1.5e0, .2e0, 2.2e0,
591 n -.3e0, -.9e0, 2.1e0, .7e0, -1.6e0, .2e0, 2.0e0,
592 o -1.6e0, -.9e0, -2.1e0, .7e0, 2.9e0, .2e0, -3.8e0 /
593*
594 DATA dt19yc/.5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
595 a .5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
596 b .5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
597 c .5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
598 d .5e0, 0.e0,0.e0,0.e0,0.e0,0.e0,0.e0,
599 e .7e0, 0.e0,0.e0,0.e0,0.e0,0.e0,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0, 1.6e0,
625 n 1.7e0, -.9e0, .5e0, .7e0, -1.6e0, .2e0, 2.4e0,
626 o -2.6e0, -.9e0, -1.3e0, .7e0, 2.9e0, .2e0, -4.0e0 /
627*
628* .. Executable Statements ..
629*
630 DO 120 ki = 1, 4
631 incx = incxs(ki)
632 incy = incys(ki)
633 mx = abs(incx)
634 my = abs(incy)
635*
636 DO 100 kn = 1, 4
637 n = ns(kn)
638 ksize = min(2,kn)
639 lenx = lens(kn,mx)
640 leny = lens(kn,my)
641* .. Initialize all argument arrays ..
642 DO 20 i = 1, 7
643 sx(i) = dx1(i)
644 sy(i) = dy1(i)
645 20 CONTINUE
646*
647 IF (icase.EQ.1) THEN
648* .. SDOT ..
649 CALL stest1(sdot(n,sx,incx,sy,incy),dt7(kn,ki),ssize1(kn)
650 + ,sfac)
651 ELSE IF (icase.EQ.2) THEN
652* .. SAXPY ..
653 CALL saxpy(n,sa,sx,incx,sy,incy)
654 DO 40 j = 1, leny
655 sty(j) = dt8(j,kn,ki)
656 40 CONTINUE
657 CALL stest(leny,sy,sty,ssize2(1,ksize),sfac)
658 ELSE IF (icase.EQ.5) THEN
659* .. SCOPY ..
660 DO 60 i = 1, 7
661 sty(i) = dt10y(i,kn,ki)
662 60 CONTINUE
663 CALL scopy(n,sx,incx,sy,incy)
664 CALL stest(leny,sy,sty,ssize2(1,1),1.0e0)
665 IF (ki.EQ.1) THEN
666 sx0(1) = 42.0e0
667 sy0(1) = 43.0e0
668 IF (n.EQ.0) THEN
669 sty0(1) = sy0(1)
670 ELSE
671 sty0(1) = sx0(1)
672 END IF
673 lincx = incx
674 incx = 0
675 lincy = incy
676 incy = 0
677 CALL scopy(n,sx0,incx,sy0,incy)
678 CALL stest(1,sy0,sty0,ssize2(1,1),1.0e0)
679 incx = lincx
680 incy = lincy
681 END IF
682 ELSE IF (icase.EQ.6) THEN
683* .. SSWAP ..
684 CALL sswap(n,sx,incx,sy,incy)
685 DO 80 i = 1, 7
686 stx(i) = dt10x(i,kn,ki)
687 sty(i) = dt10y(i,kn,ki)
688 80 CONTINUE
689 CALL stest(lenx,sx,stx,ssize2(1,1),1.0e0)
690 CALL stest(leny,sy,sty,ssize2(1,1),1.0e0)
691 ELSEIF (icase.EQ.12) THEN
692* .. SROTM ..
693 kni=kn+4*(ki-1)
694 DO kpar=1,4
695 DO i=1,7
696 sx(i) = dx1(i)
697 sy(i) = dy1(i)
698 stx(i)= dt19x(i,kpar,kni)
699 sty(i)= dt19y(i,kpar,kni)
700 END DO
701*
702 DO i=1,5
703 dtemp(i) = dpar(i,kpar)
704 END DO
705*
706 DO i=1,lenx
707 ssize(i)=stx(i)
708 END DO
709* SEE REMARK ABOVE ABOUT DT11X(1,2,7)
710* AND DT11X(5,3,8).
711 IF ((kpar .EQ. 2) .AND. (kni .EQ. 7))
712 $ ssize(1) = 2.4e0
713 IF ((kpar .EQ. 3) .AND. (kni .EQ. 8))
714 $ ssize(5) = 1.8e0
715*
716 CALL srotm(n,sx,incx,sy,incy,dtemp)
717 CALL stest(lenx,sx,stx,ssize,sfac)
718 CALL stest(leny,sy,sty,sty,sfac)
719 END DO
720 ELSEIF (icase.EQ.13) THEN
721* .. SDSROT ..
722 CALL stest1 (sdsdot(n,.1,sx,incx,sy,incy),
723 $ st7b(kn,ki),ssize3(kn),sfac)
724 ELSE
725 WRITE (nout,*) ' Shouldn''t be here in CHECK2'
726 stop
727 END IF
728 100 CONTINUE
729 120 CONTINUE
730 RETURN
731*
732* End of CHECK2
733*
734 END
735 SUBROUTINE check3(SFAC)
736* .. Parameters ..
737 INTEGER NOUT
738 parameter(nout=6)
739* .. Scalar Arguments ..
740 REAL SFAC
741* .. Scalars in Common ..
742 INTEGER ICASE, INCX, INCY, N
743 LOGICAL PASS
744* .. Local Scalars ..
745 REAL SC, SS
746 INTEGER I, K, KI, KN, KSIZE, LENX, LENY, MX, MY
747* .. Local Arrays ..
748 REAL COPYX(5), COPYY(5), DT9X(7,4,4), DT9Y(7,4,4),
749 + DX1(7), DY1(7), MWPC(11), MWPS(11), MWPSTX(5),
750 + MWPSTY(5), MWPTX(11,5), MWPTY(11,5), MWPX(5),
751 + MWPY(5), SSIZE2(14,2), STX(7), STY(7), SX(7),
752 + SY(7)
753 INTEGER INCXS(4), INCYS(4), LENS(4,2), MWPINX(11),
754 + MWPINY(11), MWPN(11), NS(4)
755* .. External Subroutines ..
756 EXTERNAL srot, stest
757* .. Intrinsic Functions ..
758 INTRINSIC abs, min
759* .. Common blocks ..
760 COMMON /combla/icase, n, incx, incy, pass
761* .. Data statements ..
762 DATA incxs/1, 2, -2, -1/
763 DATA incys/1, -2, 1, -2/
764 DATA lens/1, 1, 2, 4, 1, 1, 3, 7/
765 DATA ns/0, 1, 2, 4/
766 DATA dx1/0.6e0, 0.1e0, -0.5e0, 0.8e0, 0.9e0, -0.3e0,
767 + -0.4e0/
768 DATA dy1/0.5e0, -0.9e0, 0.3e0, 0.7e0, -0.6e0, 0.2e0,
769 + 0.8e0/
770 DATA sc, ss/0.8e0, 0.6e0/
771 DATA dt9x/0.6e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
772 + 0.0e0, 0.78e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
773 + 0.0e0, 0.0e0, 0.78e0, -0.46e0, 0.0e0, 0.0e0,
774 + 0.0e0, 0.0e0, 0.0e0, 0.78e0, -0.46e0, -0.22e0,
775 + 1.06e0, 0.0e0, 0.0e0, 0.0e0, 0.6e0, 0.0e0,
776 + 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.78e0,
777 + 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
778 + 0.66e0, 0.1e0, -0.1e0, 0.0e0, 0.0e0, 0.0e0,
779 + 0.0e0, 0.96e0, 0.1e0, -0.76e0, 0.8e0, 0.90e0,
780 + -0.3e0, -0.02e0, 0.6e0, 0.0e0, 0.0e0, 0.0e0,
781 + 0.0e0, 0.0e0, 0.0e0, 0.78e0, 0.0e0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0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
805 + 0.04e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
806 + 0.0e0, 0.04e0, -0.9e0, 0.18e0, 0.0e0, 0.0e0,
807 + 0.0e0, 0.0e0, 0.04e0, -0.9e0, 0.18e0, 0.7e0,
808 + -0.18e0, 0.2e0, 0.16e0/
809 DATA ssize2/0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
810 + 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0, 0.0e0,
811 + 0.0e0, 1.17e0, 1.17e0, 1.17e0, 1.17e0, 1.17e0,
812 + 1.17e0, 1.17e0, 1.17e0, 1.17e0, 1.17e0, 1.17e0,
813 + 1.17e0, 1.17e0, 1.17e0/
814* .. Executable Statements ..
815*
816 DO 60 ki = 1, 4
817 incx = incxs(ki)
818 incy = incys(ki)
819 mx = abs(incx)
820 my = abs(incy)
821*
822 DO 40 kn = 1, 4
823 n = ns(kn)
824 ksize = min(2,kn)
825 lenx = lens(kn,mx)
826 leny = lens(kn,my)
827*
828 IF (icase.EQ.4) THEN
829* .. SROT ..
830 DO 20 i = 1, 7
831 sx(i) = dx1(i)
832 sy(i) = dy1(i)
833 stx(i) = dt9x(i,kn,ki)
834 sty(i) = dt9y(i,kn,ki)
835 20 CONTINUE
836 CALL srot(n,sx,incx,sy,incy,sc,ss)
837 CALL stest(lenx,sx,stx,ssize2(1,ksize),sfac)
838 CALL stest(leny,sy,sty,ssize2(1,ksize),sfac)
839 ELSE
840 WRITE (nout,*) ' Shouldn''t be here in CHECK3'
841 stop
842 END IF
843 40 CONTINUE
844 60 CONTINUE
845*
846 mwpc(1) = 1
847 DO 80 i = 2, 11
848 mwpc(i) = 0
849 80 CONTINUE
850 mwps(1) = 0
851 DO 100 i = 2, 6
852 mwps(i) = 1
853 100 CONTINUE
854 DO 120 i = 7, 11
855 mwps(i) = -1
856 120 CONTINUE
857 mwpinx(1) = 1
858 mwpinx(2) = 1
859 mwpinx(3) = 1
860 mwpinx(4) = -1
861 mwpinx(5) = 1
862 mwpinx(6) = -1
863 mwpinx(7) = 1
864 mwpinx(8) = 1
865 mwpinx(9) = -1
866 mwpinx(10) = 1
867 mwpinx(11) = -1
868 mwpiny(1) = 1
869 mwpiny(2) = 1
870 mwpiny(3) = -1
871 mwpiny(4) = -1
872 mwpiny(5) = 2
873 mwpiny(6) = 1
874 mwpiny(7) = 1
875 mwpiny(8) = -1
876 mwpiny(9) = -1
877 mwpiny(10) = 2
878 mwpiny(11) = 1
879 DO 140 i = 1, 11
880 mwpn(i) = 5
881 140 CONTINUE
882 mwpn(5) = 3
883 mwpn(10) = 3
884 DO 160 i = 1, 5
885 mwpx(i) = i
886 mwpy(i) = i
887 mwptx(1,i) = i
888 mwpty(1,i) = i
889 mwptx(2,i) = i
890 mwpty(2,i) = -i
891 mwptx(3,i) = 6 - i
892 mwpty(3,i) = i - 6
893 mwptx(4,i) = i
894 mwpty(4,i) = -i
895 mwptx(6,i) = 6 - i
896 mwpty(6,i) = i - 6
897 mwptx(7,i) = -i
898 mwpty(7,i) = i
899 mwptx(8,i) = i - 6
900 mwpty(8,i) = 6 - i
901 mwptx(9,i) = -i
902 mwpty(9,i) = i
903 mwptx(11,i) = i - 6
904 mwpty(11,i) = 6 - i
905 160 CONTINUE
906 mwptx(5,1) = 1
907 mwptx(5,2) = 3
908 mwptx(5,3) = 5
909 mwptx(5,4) = 4
910 mwptx(5,5) = 5
911 mwpty(5,1) = -1
912 mwpty(5,2) = 2
913 mwpty(5,3) = -2
914 mwpty(5,4) = 4
915 mwpty(5,5) = -3
916 mwptx(10,1) = -1
917 mwptx(10,2) = -3
918 mwptx(10,3) = -5
919 mwptx(10,4) = 4
920 mwptx(10,5) = 5
921 mwpty(10,1) = 1
922 mwpty(10,2) = 2
923 mwpty(10,3) = 2
924 mwpty(10,4) = 4
925 mwpty(10,5) = 3
926 DO 200 i = 1, 11
927 incx = mwpinx(i)
928 incy = mwpiny(i)
929 DO 180 k = 1, 5
930 copyx(k) = mwpx(k)
931 copyy(k) = mwpy(k)
932 mwpstx(k) = mwptx(i,k)
933 mwpsty(k) = mwpty(i,k)
934 180 CONTINUE
935 CALL srot(mwpn(i),copyx,incx,copyy,incy,mwpc(i),mwps(i))
936 CALL stest(5,copyx,mwpstx,mwpstx,sfac)
937 CALL stest(5,copyy,mwpsty,mwpsty,sfac)
938 200 CONTINUE
939 RETURN
940*
941* End of CHECK3
942*
943 END
944 SUBROUTINE stest(LEN,SCOMP,STRUE,SSIZE,SFAC)
945* ********************************* STEST **************************
946*
947* THIS SUBR COMPARES ARRAYS SCOMP() AND STRUE() OF LENGTH LEN TO
948* SEE IF THE TERM BY TERM DIFFERENCES, MULTIPLIED BY SFAC, ARE
949* NEGLIGIBLE.
950*
951* C. L. LAWSON, JPL, 1974 DEC 10
952*
953* .. Parameters ..
954 INTEGER NOUT
955 REAL ZERO
956 parameter(nout=6, zero=0.0e0)
957* .. Scalar Arguments ..
958 REAL SFAC
959 INTEGER LEN
960* .. Array Arguments ..
961 REAL SCOMP(LEN), SSIZE(LEN), STRUE(LEN)
962* .. Scalars in Common ..
963 INTEGER ICASE, INCX, INCY, N
964 LOGICAL PASS
965* .. Local Scalars ..
966 REAL SD
967 INTEGER I
968* .. External Functions ..
969 REAL SDIFF
970 EXTERNAL sdiff
971* .. Intrinsic Functions ..
972 INTRINSIC abs
973* .. Common blocks ..
974 COMMON /combla/icase, n, incx, incy, pass
975* .. Executable Statements ..
976*
977 DO 40 i = 1, len
978 sd = scomp(i) - strue(i)
979 IF (abs(sfac*sd) .LE. abs(ssize(i))*epsilon(zero))
980 + GO TO 40
981*
982* HERE SCOMP(I) IS NOT CLOSE TO STRUE(I).
983*
984 IF ( .NOT. pass) GO TO 20
985* PRINT FAIL MESSAGE AND HEADER.
986 pass = .false.
987 WRITE (nout,99999)
988 WRITE (nout,99998)
989 20 WRITE (nout,99997) icase, n, incx, incy, i, scomp(i),
990 + strue(i), sd, ssize(i)
991 40 CONTINUE
992 RETURN
993*
99499999 FORMAT (' FAIL')
99599998 FORMAT (/' CASE N INCX INCY I ',
996 + ' COMP(I) TRUE(I) DIFFERENCE',
997 + ' SIZE(I)',/1x)
99899997 FORMAT (1x,i4,i3,2i5,i3,2e36.8,2e12.4)
999*
1000* End of STEST
1001*
1002 END
1003 SUBROUTINE stest1(SCOMP1,STRUE1,SSIZE,SFAC)
1004* ************************* STEST1 *****************************
1005*
1006* THIS IS AN INTERFACE SUBROUTINE TO ACCOMMODATE THE FORTRAN
1007* REQUIREMENT THAT WHEN A DUMMY ARGUMENT IS AN ARRAY, THE
1008* ACTUAL ARGUMENT MUST ALSO BE AN ARRAY OR AN ARRAY ELEMENT.
1009*
1010* C.L. LAWSON, JPL, 1978 DEC 6
1011*
1012* .. Scalar Arguments ..
1013 REAL SCOMP1, SFAC, STRUE1
1014* .. Array Arguments ..
1015 REAL SSIZE(*)
1016* .. Local Arrays ..
1017 REAL SCOMP(1), STRUE(1)
1018* .. External Subroutines ..
1019 EXTERNAL stest
1020* .. Executable Statements ..
1021*
1022 scomp(1) = scomp1
1023 strue(1) = strue1
1024 CALL stest(1,scomp,strue,ssize,sfac)
1025*
1026 RETURN
1027*
1028* End of STEST1
1029*
1030 END
1031 REAL function sdiff(sa,sb)
1032* ********************************* SDIFF **************************
1033* COMPUTES DIFFERENCE OF TWO NUMBERS. C. L. LAWSON, JPL 1974 FEB 15
1034*
1035* .. Scalar Arguments ..
1036 REAL sa, sb
1037* .. Executable Statements ..
1038 sdiff = sa - sb
1039 RETURN
1040*
1041* End of SDIFF
1042*
1043 END
1044 SUBROUTINE itest1(ICOMP,ITRUE)
1045* ********************************* ITEST1 *************************
1046*
1047* THIS SUBROUTINE COMPARES THE VARIABLES ICOMP AND ITRUE FOR
1048* EQUALITY.
1049* C. L. LAWSON, JPL, 1974 DEC 10
1050*
1051* .. Parameters ..
1052 INTEGER NOUT
1053 parameter(nout=6)
1054* .. Scalar Arguments ..
1055 INTEGER ICOMP, ITRUE
1056* .. Scalars in Common ..
1057 INTEGER ICASE, INCX, INCY, N
1058 LOGICAL PASS
1059* .. Local Scalars ..
1060 INTEGER ID
1061* .. Common blocks ..
1062 COMMON /combla/icase, n, incx, incy, pass
1063* .. Executable Statements ..
1064*
1065 IF (icomp.EQ.itrue) GO TO 40
1066*
1067* HERE ICOMP IS NOT EQUAL TO ITRUE.
1068*
1069 IF ( .NOT. pass) GO TO 20
1070* PRINT FAIL MESSAGE AND HEADER.
1071 pass = .false.
1072 WRITE (nout,99999)
1073 WRITE (nout,99998)
1074 20 id = icomp - itrue
1075 WRITE (nout,99997) icase, n, incx, incy, icomp, itrue, id
1076 40 CONTINUE
1077 RETURN
1078*
107999999 FORMAT (' FAIL')
108099998 FORMAT (/' CASE N INCX INCY ',
1081 + ' COMP TRUE DIFFERENCE',
1082 + /1x)
108399997 FORMAT (1x,i4,i3,2i5,2i36,i12)
1084*
1085* End of ITEST1
1086*
1087 END
1088 SUBROUTINE sb1nrm2(N,INCX,THRESH)
1089* Compare NRM2 with a reference computation using combinations
1090* of the following values:
1091*
1092* 0, very small, small, ulp, 1, 1/ulp, big, very big, infinity, NaN
1093*
1094* one of these values is used to initialize x(1) and x(2:N) is
1095* filled with random values from [-1,1] scaled by another of
1096* these values.
1097*
1098* This routine is adapted from the test suite provided by
1099* Anderson E. (2017)
1100* Algorithm 978: Safe Scaling in the Level 1 BLAS
1101* ACM Trans Math Softw 44:1--28
1102* https://doi.org/10.1145/3061665
1103*
1104 IMPLICIT NONE
1105* .. Scalar Arguments ..
1106 INTEGER INCX, N
1107 REAL THRESH
1108*
1109* =====================================================================
1110* .. Parameters ..
1111 INTEGER NMAX, NOUT, NV
1112 parameter(nmax=20, nout=6, nv=10)
1113 REAL HALF, ONE, TWO, ZERO
1114 parameter(half=0.5e+0, one=1.0e+0, two= 2.0e+0,
1115 & zero=0.0e+0)
1116* .. External Functions ..
1117 REAL SNRM2
1118 EXTERNAL snrm2
1119* .. Intrinsic Functions ..
1120 INTRINSIC abs, max, min, real, sqrt
1121* .. Model parameters ..
1122 REAL BIGNUM, SAFMAX, SAFMIN, SMLNUM, ULP
1123 parameter(bignum=0.1014120480e+32,
1124 & safmax=0.8507059173e+38,
1125 & safmin=0.1175494351e-37,
1126 & smlnum=0.9860761315e-31,
1127 & ulp=0.1192092896e-06)
1128* .. Local Scalars ..
1129 REAL ROGUE, SNRM, TRAT, V0, V1, WORKSSQ, Y1, Y2,
1130 & YMAX, YMIN, YNRM, ZNRM
1131 INTEGER I, IV, IW, IX
1132 LOGICAL FIRST
1133* .. Local Arrays ..
1134 REAL VALUES(NV), WORK(NMAX), X(NMAX), Z(NMAX)
1135* .. Executable Statements ..
1136 values(1) = zero
1137 values(2) = two*safmin
1138 values(3) = smlnum
1139 values(4) = ulp
1140 values(5) = one
1141 values(6) = one / ulp
1142 values(7) = bignum
1143 values(8) = safmax
1144 values(9) = sxvals(v0,2)
1145 values(10) = sxvals(v0,3)
1146 rogue = -1234.5678e+0
1147 first = .true.
1148*
1149* Check that the arrays are large enough
1150*
1151 IF (n*abs(incx).GT.nmax) THEN
1152 WRITE (nout,99) "SNRM2", nmax, incx, n, n*abs(incx)
1153 RETURN
1154 END IF
1155*
1156* Zero-sized inputs are tested in STEST1.
1157 IF (n.LE.0) THEN
1158 RETURN
1159 END IF
1160*
1161* Generate (N-1) values in (-1,1).
1162*
1163 DO i = 2, n
1164 CALL random_number(work(i))
1165 work(i) = one - two*work(i)
1166 END DO
1167*
1168* Compute the sum of squares of the random values
1169* by an unscaled algorithm.
1170*
1171 workssq = zero
1172 DO i = 2, n
1173 workssq = workssq + work(i)*work(i)
1174 END DO
1175*
1176* Construct the test vector with one known value
1177* and the rest from the random work array multiplied
1178* by a scaling factor.
1179*
1180 DO iv = 1, nv
1181 v0 = values(iv)
1182 IF (abs(v0).GT.one) THEN
1183 v0 = v0*half
1184 END IF
1185 z(1) = v0
1186 DO iw = 1, nv
1187 v1 = values(iw)
1188 IF (abs(v1).GT.one) THEN
1189 v1 = (v1*half) / sqrt(real(n))
1190 END IF
1191 DO i = 2, n
1192 z(i) = v1*work(i)
1193 END DO
1194*
1195* Compute the expected value of the 2-norm
1196*
1197 y1 = abs(v0)
1198 IF (n.GT.1) THEN
1199 y2 = abs(v1)*sqrt(workssq)
1200 ELSE
1201 y2 = zero
1202 END IF
1203 ymin = min(y1, y2)
1204 ymax = max(y1, y2)
1205*
1206* Expected value is NaN if either is NaN. The test
1207* for YMIN == YMAX avoids further computation if both
1208* are infinity.
1209*
1210 IF ((y1.NE.y1).OR.(y2.NE.y2)) THEN
1211* add to propagate NaN
1212 ynrm = y1 + y2
1213 ELSE IF (ymin == ymax) THEN
1214 ynrm = sqrt(two)*ymax
1215 ELSE IF (ymax == zero) THEN
1216 ynrm = zero
1217 ELSE
1218 ynrm = ymax*sqrt(one + (ymin / ymax)**2)
1219 END IF
1220*
1221* Fill the input array to SNRM2 with steps of incx
1222*
1223 DO i = 1, n
1224 x(i) = rogue
1225 END DO
1226 ix = 1
1227 IF (incx.LT.0) ix = 1 - (n-1)*incx
1228 DO i = 1, n
1229 x(ix) = z(i)
1230 ix = ix + incx
1231 END DO
1232*
1233* Call SNRM2 to compute the 2-norm
1234*
1235 snrm = snrm2(n,x,incx)
1236*
1237* Compare SNRM and ZNRM. Roundoff error grows like O(n)
1238* in this implementation so we scale the test ratio accordingly.
1239*
1240 IF (incx.EQ.0) THEN
1241 znrm = sqrt(real(n))*abs(x(1))
1242 ELSE
1243 znrm = ynrm
1244 END IF
1245*
1246* The tests for NaN rely on the compiler not being overly
1247* aggressive and removing the statements altogether.
1248 IF ((snrm.NE.snrm).OR.(znrm.NE.znrm)) THEN
1249 IF ((snrm.NE.snrm).NEQV.(znrm.NE.znrm)) THEN
1250 trat = one / ulp
1251 ELSE
1252 trat = zero
1253 END IF
1254 ELSE IF (snrm == znrm) THEN
1255 trat = zero
1256 ELSE IF (znrm == zero) THEN
1257 trat = snrm / ulp
1258 ELSE
1259 trat = (abs(snrm-znrm) / znrm) / (real(n)*ulp)
1260 END IF
1261 IF ((trat.NE.trat).OR.(trat.GE.thresh)) THEN
1262 IF (first) THEN
1263 first = .false.
1264 WRITE(nout,99999)
1265 END IF
1266 WRITE (nout,98) "SNRM2", n, incx, iv, iw, trat
1267 END IF
1268 END DO
1269 END DO
127099999 FORMAT (' FAIL')
1271 99 FORMAT ( ' Not enough space to test ', a6, ': NMAX = ',i6,
1272 + ', INCX = ',i6,/,' N = ',i6,', must be at least ',i6 )
1273 98 FORMAT( 1x, a6, ': N=', i6,', INCX=', i4, ', IV=', i2, ', IW=',
1274 + i2, ', test=', e15.8 )
1275 RETURN
1276 CONTAINS
1277 REAL FUNCTION SXVALS(XX,K)
1278* .. Scalar Arguments ..
1279 REAL XX
1280 INTEGER K
1281* .. Local Scalars ..
1282 REAL X, Y, YY, Z
1283* .. Intrinsic Functions ..
1284 INTRINSIC huge
1285* .. Executable Statements ..
1286 y = huge(xx)
1287 z = yy
1288 IF (k.EQ.1) THEN
1289 x = -z
1290 ELSE IF (k.EQ.2) THEN
1291 x = z
1292 ELSE IF (k.EQ.3) THEN
1293 x = z / z
1294 END IF
1295 sxvals = x
1296 RETURN
1297 END
1298 END
subroutine stest(len, scomp, strue, ssize, sfac)
Definition cblat1.f:614
subroutine stest1(scomp1, strue1, ssize, sfac)
Definition cblat1.f:673
subroutine itest1(icomp, itrue)
Definition cblat1.f:748
subroutine header
Definition cblat1.f:91
real function sdiff(sa, sb)
Definition cblat1.f:701
subroutine check2(sfac)
Definition cblat1.f:348
subroutine check1(sfac)
Definition cblat1.f:122
subroutine check0(sfac)
Definition dblat1.f:130
subroutine check3(sfac)
Definition dblat1.f:734
subroutine saxpy(n, sa, sx, incx, sy, incy)
SAXPY
Definition saxpy.f:89
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
Definition scopy.f:82
subroutine srot(n, sx, incx, sy, incy, c, s)
SROT
Definition srot.f:92
subroutine srotg(a, b, c, s)
SROTG
Definition srotg.f90:92
subroutine srotm(n, sx, incx, sy, incy, sparam)
SROTM
Definition srotm.f:97
subroutine srotmg(sd1, sd2, sx1, sy1, sparam)
SROTMG
Definition srotmg.f:90
subroutine sscal(n, sa, sx, incx)
SSCAL
Definition sscal.f:79
subroutine sswap(n, sx, incx, sy, incy)
SSWAP
Definition sswap.f:82
subroutine sb1nrm2(n, incx, thresh)
Definition sblat1.f:1089
program sblat1
SBLAT1
Definition sblat1.f:36