01:       SUBROUTINE CLA_WWADDW( N, X, Y, W )
02: *
03: *     -- LAPACK routine (version 3.2)                                 --
04: *     -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and --
05: *     -- Jason Riedy of Univ. of California Berkeley.                 --
06: *     -- November 2008                                                --
07: *
08: *     -- LAPACK is a software package provided by Univ. of Tennessee, --
09: *     -- Univ. of California Berkeley and NAG Ltd.                    --
10: *
11:       IMPLICIT NONE
12: *     ..
13: *     .. Scalar Arguments ..
14:       INTEGER            N
15: *     ..
16: *     .. Array Arguments ..
17:       COMPLEX            X( * ), Y( * ), W( * )
18: *     ..
19: *
20: *     Purpose
21: *     =======
22: *
23: *     CLA_WWADDW adds a vector W into a doubled-single vector (X, Y).
24: *
25: *     This works for all extant IBM's hex and binary floating point
26: *     arithmetics, but not for decimal.
27: *
28: *     Arguments
29: *     =========
30: *
31: *     N      (input) INTEGER
32: *            The length of vectors X, Y, and W.
33: *
34: *     X, Y   (input/output) COMPLEX array, length N
35: *            The doubled-single accumulation vector.
36: *
37: *     W      (input) COMPLEX array, length N
38: *            The vector to be added.
39: *     ..
40: *     .. Local Scalars ..
41:       COMPLEX            S
42:       INTEGER            I
43: *     ..
44: *     .. Executable Statements ..
45: *
46:       DO 10 I = 1, N
47:         S = X(I) + W(I)
48:         S = (S + S) - S
49:         Y(I) = ((X(I) - S) + W(I)) + Y(I)
50:         X(I) = S
51:    10 CONTINUE
52:       RETURN
53:       END
54: