diff --git a/books/bookvol10.5.pamphlet b/books/bookvol10.5.pamphlet
index 6fe24a4..eb448e3 100644
--- a/books/bookvol10.5.pamphlet
+++ b/books/bookvol10.5.pamphlet
@@ -348,7 +348,7 @@ For complex symmetric matrices, TRANSx=H is not allowed.
 )set message auto off
 )clear all
 
---S 1 of 127
+--S 1 of 136
 t1:Complex DoubleFloat := complex(1.0,0)
 --R 
 --R
@@ -356,7 +356,7 @@ t1:Complex DoubleFloat := complex(1.0,0)
 --R                                                   Type: Complex(DoubleFloat)
 --E 1
 
---S 2 of 127
+--S 2 of 136
 dcabs1(t1)
 --R 
 --R
@@ -364,7 +364,7 @@ dcabs1(t1)
 --R                                                            Type: DoubleFloat
 --E 2
 
---S 3 of 127
+--S 3 of 136
 t2:Complex DoubleFloat := complex(1.0,1.0)
 --R 
 --R
@@ -372,7 +372,7 @@ t2:Complex DoubleFloat := complex(1.0,1.0)
 --R                                                   Type: Complex(DoubleFloat)
 --E 3
 
---S 4 of 127
+--S 4 of 136
 dcabs1(t2)
 --R 
 --R
@@ -380,7 +380,7 @@ dcabs1(t2)
 --R                                                            Type: DoubleFloat
 --E 4
 
---S 5 of 127
+--S 5 of 136
 t3:Complex DoubleFloat := complex(1.0,-1.0)
 --R 
 --R
@@ -388,7 +388,7 @@ t3:Complex DoubleFloat := complex(1.0,-1.0)
 --R                                                   Type: Complex(DoubleFloat)
 --E 5
 
---S 6 of 127
+--S 6 of 136
 dcabs1(t3)
 --R 
 --R
@@ -396,7 +396,7 @@ dcabs1(t3)
 --R                                                            Type: DoubleFloat
 --E 6
 
---S 7 of 127
+--S 7 of 136
 t4:Complex DoubleFloat := complex(-1.0,-1.0)
 --R 
 --R
@@ -404,7 +404,7 @@ t4:Complex DoubleFloat := complex(-1.0,-1.0)
 --R                                                   Type: Complex(DoubleFloat)
 --E 7
 
---S 8 of 127
+--S 8 of 136
 dcabs1(t4)
 --R 
 --R
@@ -412,7 +412,7 @@ dcabs1(t4)
 --R                                                            Type: DoubleFloat
 --E 8
 
---S 9 of 127
+--S 9 of 136
 t5:Complex DoubleFloat := complex(-2.0,-2.0)
 --R 
 --R
@@ -420,7 +420,7 @@ t5:Complex DoubleFloat := complex(-2.0,-2.0)
 --R                                                   Type: Complex(DoubleFloat)
 --E 9
 
---S 10 of 127
+--S 10 of 136
 dcabs1(t5)
 --R 
 --R
@@ -430,196 +430,196 @@ dcabs1(t5)
 
 )clear all
 
---S 11 of 127 
+--S 11 of 136 
 a:PRIMARR(DFLOAT):=[ [1.0,2.0,3.0,4,0,5,0,6,0] ]
 --R
 --R   (1)  [1.,2.,3.,4.,0.,5.,0.,6.,0.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 11
 
---S 12 of 127 
+--S 12 of 136 
 dasum(3,a,-1) -- 0.0   neg incx
 --R
 --R   (2)  0.
 --R                                                            Type: DoubleFloat
 --E 12
 
---S 13 of 127 
+--S 13 of 136 
 dasum(3,a,0) --  0.0   zero incx
 --R
 --R   (3)  0.
 --R                                                            Type: DoubleFloat
 --E 13
 
---S 14 of 127 
+--S 14 of 136 
 dasum(-1,a,1) -- 0.0   neg elements
 --R
 --R   (4)  0.
 --R                                                            Type: DoubleFloat
 --E 14
 
---S 15 of 127 
+--S 15 of 136 
 dasum(0,a,1) --  0.0   no elements
 --R
 --R   (5)  0.
 --R                                                            Type: DoubleFloat
 --E 15
 
---S 16 of 127 
+--S 16 of 136 
 dasum(1,a,1) --  1.0   1.0
 --R
 --R   (6)  1.
 --R                                                            Type: DoubleFloat
 --E 16
 
---S 17 of 127 
+--S 17 of 136 
 dasum(2,a,1) --  3.0   1.0+2.0
 --R
 --R   (7)  3.
 --R                                                            Type: DoubleFloat
 --E 17
 
---S 18 of 127 
+--S 18 of 136 
 dasum(3,a,1) --  6.0   1.0+2.0+3.0
 --R
 --R   (8)  6.
 --R                                                            Type: DoubleFloat
 --E 18
 
---S 19 of 127 
+--S 19 of 136 
 dasum(4,a,1) -- 10.0   1.0+2.0+3.0+4.0
 --R
 --R   (9)  10.
 --R                                                            Type: DoubleFloat
 --E 19
 
---S 20 of 127 
+--S 20 of 136 
 dasum(5,a,1) -- 15.0   1.0+2.0+3.0+4.0+5.0
 --R
 --R   (10)  10.
 --R                                                            Type: DoubleFloat
 --E 20
 
---S 21 of 127 
+--S 21 of 136 
 dasum(6,a,1) -- 21.0   1.0+2.0+3.0+4.0+5.0+6.0
 --R
 --R   (11)  15.
 --R                                                            Type: DoubleFloat
 --E 21
 
---S 22 of 127 
+--S 22 of 136 
 dasum(7,a,1) -- 21.0   1.0+2.0+3.0+4.0+5.0+6.0
 --R
 --R   (12)  15.
 --R                                                            Type: DoubleFloat
 --E 22
 
---S 23 of 127 
+--S 23 of 136 
 dasum(1,a,2) --  1.0   1.0
 --R
 --R   (13)  1.
 --R                                                            Type: DoubleFloat
 --E 23
 
---S 24 of 127 
+--S 24 of 136 
 dasum(2,a,2) --  4.0   1.0+3.0
 --R
 --R   (14)  4.
 --R                                                            Type: DoubleFloat
 --E 24
 
---S 25 of 127 
+--S 25 of 136 
 dasum(3,a,2) --  9.0   1.0+3.0+5.0
 --R
 --R   (15)  4.
 --R                                                            Type: DoubleFloat
 --E 25
 
---S 26 of 127 
+--S 26 of 136 
 dasum(4,a,2) --  9.0   1.0+3.0+5.0
 --R
 --R   (16)  4.
 --R                                                            Type: DoubleFloat
 --E 26
 
---S 27 of 127 
+--S 27 of 136 
 dasum(1,a,3) --  1.0   1.0
 --R
 --R   (17)  1.
 --R                                                            Type: DoubleFloat
 --E 27
 
---S 28 of 127 
+--S 28 of 136 
 dasum(2,a,3) --  5.0   1.0+4.0
 --R
 --R   (18)  5.
 --R                                                            Type: DoubleFloat
 --E 28
 
---S 29 of 127 
+--S 29 of 136 
 dasum(3,a,3) --  5.0   1.0+4.0
 --R
 --R   (19)  5.
 --R                                                            Type: DoubleFloat
 --E 29
 
---S 30 of 127 
+--S 30 of 136 
 dasum(1,a,4) --  1.0   1.0
 --R
 --R   (20)  1.
 --R                                                            Type: DoubleFloat
 --E 30
 
---S 31 of 127 
+--S 31 of 136 
 dasum(2,a,4) --  6.0   1.0+5.0
 --R
 --R   (21)  1.
 --R                                                            Type: DoubleFloat
 --E 31
 
---S 32 of 127 
+--S 32 of 136 
 dasum(3,a,4) --  6.0   1.0+5.0
 --R
 --R   (22)  1.
 --R                                                            Type: DoubleFloat
 --E 32
 
---S 33 of 127 
+--S 33 of 136 
 dasum(1,a,5) --  1.0   1.0
 --R
 --R   (23)  1.
 --R                                                            Type: DoubleFloat
 --E 33
 
---S 34 of 127 
+--S 34 of 136 
 dasum(2,a,5) --  7.0   1.0+6.0
 --R
 --R   (24)  6.
 --R                                                            Type: DoubleFloat
 --E 34
 
---S 35 of 127 
+--S 35 of 136 
 dasum(3,a,5) --  7.0   1.0+6.0
 --R
 --R   (25)  6.
 --R                                                            Type: DoubleFloat
 --E 35
 
---S 36 of 127 
+--S 36 of 136 
 dasum(1,a,6) --  1.0   1.0
 --R
 --R   (26)  1.
 --R                                                            Type: DoubleFloat
 --E 36
 
---S 37 of 127 
+--S 37 of 136 
 dasum(2,a,6) --  1.0   1.0
 --R
 --R   (27)  1.
 --R                                                            Type: DoubleFloat
 --E 37
 
---S 38 of 127 
+--S 38 of 136 
 dasum(1,a,7) --  1.0   1.0
 --R
 --R   (28)  1.
@@ -628,7 +628,7 @@ dasum(1,a,7) --  1.0   1.0
 
 )clear all
 
---S 39 of 127
+--S 39 of 136
 a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -636,7 +636,7 @@ a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 39
 
---S 40 of 127
+--S 40 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -644,7 +644,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 40
 
---S 41 of 127
+--S 41 of 136
 daxpy(3,2.0,a,1,b,1)
 --R 
 --R
@@ -652,7 +652,7 @@ daxpy(3,2.0,a,1,b,1)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 41
 
---S 42 of 127
+--S 42 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -660,7 +660,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 42
 
---S 43 of 127
+--S 43 of 136
 daxpy(7,2.0,a,1,b,1)
 --R 
 --R
@@ -668,7 +668,7 @@ daxpy(7,2.0,a,1,b,1)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 43
 
---S 44 of 127
+--S 44 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -681,7 +681,7 @@ Note that Axiom properly handles array indexes that are out of bounds.
 The BLAS daxpy routine cannot check this condition.
 \begin{chunk}{BlasLevelOne.input}
 
---S 45 of 127
+--S 45 of 136
 daxpy(8,2.0,a,1,b,1)
 --R 
 --R
@@ -689,7 +689,7 @@ daxpy(8,2.0,a,1,b,1)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 45
 
---S 46 of 127
+--S 46 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -697,7 +697,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 46
 
---S 47 of 127
+--S 47 of 136
 daxpy(3,2.0,a,3,b,3)
 --R 
 --R
@@ -705,7 +705,7 @@ daxpy(3,2.0,a,3,b,3)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 47
 
---S 48 of 127
+--S 48 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -713,7 +713,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 48
 
---S 49 of 127
+--S 49 of 136
 daxpy(4,2.0,a,2,b,2)
 --R 
 --R
@@ -721,7 +721,7 @@ daxpy(4,2.0,a,2,b,2)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 49
 
---S 50 of 127
+--S 50 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -729,7 +729,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 50
 
---S 51 of 127
+--S 51 of 136
 daxpy(5,2.0,a,2,b,2)
 --R 
 --R
@@ -737,7 +737,7 @@ daxpy(5,2.0,a,2,b,2)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 51
 
---S 52 of 127
+--S 52 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -745,7 +745,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 52
 
---S 53 of 127
+--S 53 of 136
 daxpy(3,2.0,a,2,b,2)
 --R 
 --R
@@ -753,7 +753,7 @@ daxpy(3,2.0,a,2,b,2)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 53
 
---S 54 of 127
+--S 54 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -761,7 +761,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 54
 
---S 55 of 127
+--S 55 of 136
 daxpy(3,-2.0,a,2,b,2)
 --R 
 --R
@@ -769,7 +769,7 @@ daxpy(3,-2.0,a,2,b,2)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 55
 
---S 56 of 127
+--S 56 of 136
 a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
 --R 
 --R
@@ -777,7 +777,7 @@ a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 56
 
---S 57 of 127
+--S 57 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
 --R 
 --R
@@ -785,7 +785,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 57
 
---S 58 of 127
+--S 58 of 136
 daxpy(3,-2.0,a,1,b,2)
 --R 
 --R
@@ -793,7 +793,7 @@ daxpy(3,-2.0,a,1,b,2)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 58
 
---S 59 of 127
+--S 59 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -801,7 +801,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 59
 
---S 60 of 127
+--S 60 of 136
 daxpy(3,0.0,a,1,b,2)
 --R 
 --R
@@ -811,7 +811,7 @@ daxpy(3,0.0,a,1,b,2)
 
 )clear all
 
---S 61 of 127
+--S 61 of 136
 a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R 
 --R
@@ -819,7 +819,7 @@ a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 61
 
---S 62 of 127
+--S 62 of 136
 b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R 
 --R
@@ -827,7 +827,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 62
 
---S 63 of 127
+--S 63 of 136
 dcopy(3,a,1,b,1)
 --R 
 --R
@@ -835,7 +835,7 @@ dcopy(3,a,1,b,1)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 63
 
---S 64 of 127
+--S 64 of 136
 b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R 
 --R
@@ -843,7 +843,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 64
 
---S 65 of 127
+--S 65 of 136
 dcopy(7,a,1,b,1)
 --R 
 --R
@@ -851,7 +851,7 @@ dcopy(7,a,1,b,1)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 65
 
---S 66 of 127
+--S 66 of 136
 b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R 
 --R
@@ -859,7 +859,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 66
 
---S 67 of 127
+--S 67 of 136
 dcopy(8,a,1,b,1)
 --R 
 --R
@@ -867,7 +867,7 @@ dcopy(8,a,1,b,1)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 67
 
---S 68 of 127
+--S 68 of 136
 b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R 
 --R
@@ -875,7 +875,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 68
 
---S 69 of 127
+--S 69 of 136
 dcopy(3,a,3,b,3)
 --R 
 --R
@@ -883,7 +883,7 @@ dcopy(3,a,3,b,3)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 69
 
---S 70 of 127
+--S 70 of 136
 b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R 
 --R
@@ -891,7 +891,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 70
 
---S 71 of 127
+--S 71 of 136
 dcopy(4,a,2,b,2)
 --R 
 --R
@@ -899,7 +899,7 @@ dcopy(4,a,2,b,2)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 71
 
---S 72 of 127
+--S 72 of 136
 b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R 
 --R
@@ -907,7 +907,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 72
 
---S 73 of 127
+--S 73 of 136
 dcopy(5,a,2,b,2)
 --R 
 --R
@@ -915,7 +915,7 @@ dcopy(5,a,2,b,2)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 73
 
---S 74 of 127
+--S 74 of 136
 b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R 
 --R
@@ -923,7 +923,7 @@ b:PRIMARR(DFLOAT):=[ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 74
 
---S 75 of 127
+--S 75 of 136
 dcopy(3,a,2,b,2)
 --R 
 --R
@@ -931,7 +931,7 @@ dcopy(3,a,2,b,2)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 75
 
---S 76 of 127
+--S 76 of 136
 a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
 --R 
 --R
@@ -939,7 +939,7 @@ a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 76
 
---S 77 of 127
+--S 77 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
 --R 
 --R
@@ -947,7 +947,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 77
 
---S 78 of 127
+--S 78 of 136
 dcopy(3,a,1,b,1)
 --R 
 --R
@@ -955,7 +955,7 @@ dcopy(3,a,1,b,1)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 78
 
---S 79 of 127
+--S 79 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
 --R 
 --R
@@ -963,7 +963,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 79
 
---S 80 of 127
+--S 80 of 136
 dcopy(3,a,1,b,2)
 --R 
 --R
@@ -971,7 +971,7 @@ dcopy(3,a,1,b,2)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 80
 
---S 81 of 127
+--S 81 of 136
 a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
 --R 
 --R
@@ -979,7 +979,7 @@ a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 81
 
---S 82 of 127
+--S 82 of 136
 b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
 --R 
 --R
@@ -987,7 +987,7 @@ b:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0] ]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 82
 
---S 83 of 127
+--S 83 of 136
 dcopy(5,a,1,b,1)
 --R 
 --R
@@ -997,63 +997,63 @@ dcopy(5,a,1,b,1)
 
 )clear all
 
---S 84 of 127
+--S 84 of 136
 a:PRIMARR(DFLOAT):=[ [ 1.0, 2.0, 3.0, 4.0, 5.0] ]
 --R
 --R   (1)  [1.,2.,3.,4.,5.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 84
 
---S 85 of 127
+--S 85 of 136
 b:PRIMARR(DFLOAT):=[ [ 5.0, 6.0, 7.0, 8.0, 9.0] ]
 --R
 --R   (2)  [5.,6.,7.,8.,9.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 85
 
---S 86 of 127
+--S 86 of 136
 ddot(0,a,1,b,1)
 --R
 --R   (3)  0.
 --R                                                            Type: DoubleFloat
 --E 86
 
---S 87 of 127
+--S 87 of 136
 ddot(3,a,1,b,1)
 --R
 --R   (4)  38.
 --R                                                            Type: DoubleFloat
 --E 87
 
---S 88 of 127
+--S 88 of 136
 ddot(3,a,1,b,2)
 --R
 --R   (5)  46.
 --R                                                            Type: DoubleFloat
 --E 88
 
---S 89 of 127
+--S 89 of 136
 ddot(3,a,2,b,1)
 --R
 --R   (6)  58.
 --R                                                            Type: DoubleFloat
 --E 89
 
---S 90 of 127
+--S 90 of 136
 ddot(3,a,1,b,-2)
 --R
 --R   (7)  38.
 --R                                                            Type: DoubleFloat
 --E 90
 
---S 91 of 127
+--S 91 of 136
 ddot(3,a,-2,b,1)
 --R
 --R   (8)  50.
 --R                                                            Type: DoubleFloat
 --E 91
 
---S 92 of 127
+--S 92 of 136
 ddot(3,a,-2,b,-2)
 --R
 --R   (9)  71.
@@ -1062,28 +1062,28 @@ ddot(3,a,-2,b,-2)
 
 )clear all
 
---S 93 of 127
+--S 93 of 136
 a:PRIMARR(DFLOAT):=[ [ 3.0, -4.0, 5.0, -7.0, 9.0] ]
 --R
 --R   (1)  [3.,- 4.,5.,- 7.,9.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 93
 
---S 94 of 127
+--S 94 of 136
 dnrm2(3,a,1)
 --R
 --R   (2)  7.0710678118654755
 --R                                                            Type: DoubleFloat
 --E 94
 
---S 95 of 127
+--S 95 of 136
 dnrm2(5,a,1)
 --R
 --R   (3)  13.416407864998739
 --R                                                            Type: DoubleFloat
 --E 95
 
---S 96 of 127
+--S 96 of 136
 dnrm2(3,a,2)
 --R
 --R   (4)  10.723805294763608
@@ -1091,7 +1091,7 @@ dnrm2(3,a,2)
 --E 96
 
 )clear all
---S 97 of 127
+--S 97 of 136
 a:MATRIX(DFLOAT):=[[6,5,0],[5,1,4],[0,4,3]] 
 --R
 --R        +6.  5.  0.+
@@ -1102,7 +1102,7 @@ a:MATRIX(DFLOAT):=[[6,5,0],[5,1,4],[0,4,3]]
 --R                                                    Type: Matrix(DoubleFloat)
 --E 97
 
---S 98 of 127
+--S 98 of 136
 t1:=drotg(elt(a,1,1),elt(a,1,2),0.0,0.0)
 --R
 --R   (2)
@@ -1111,7 +1111,7 @@ t1:=drotg(elt(a,1,1),elt(a,1,2),0.0,0.0)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 98
 
---S 99 of 127
+--S 99 of 136
 g1:MATRIX(DFLOAT):=[[elt(t1,2), elt(t1,3),0.0],_
                     [-elt(t1,3),elt(t1,2),0.0],_
                     [0.0,       0.0,      1.0]]
@@ -1125,7 +1125,7 @@ g1:MATRIX(DFLOAT):=[[elt(t1,2), elt(t1,3),0.0],_
 --R                                                    Type: Matrix(DoubleFloat)
 --E 99
 
---S 100 of 127
+--S 100 of 136
 t2:=g1*a
 --R
 --R        +   7.810249675906654       4.4812907976513596   2.5607375986579197+
@@ -1136,7 +1136,7 @@ t2:=g1*a
 --R                                                    Type: Matrix(DoubleFloat)
 --E 100
 
---S 101 of 127
+--S 101 of 136
 t3:=drotg(elt(t2,2,2),elt(a,3,2),0.0,0.0)
 --R
 --R   (5)
@@ -1145,7 +1145,7 @@ t3:=drotg(elt(t2,2,2),elt(a,3,2),0.0,0.0)
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 101
 
---S 102 of 127
+--S 102 of 136
 g2:MATRIX(DFLOAT):=[[1.0, 0.0,      0.0],_
                     [0.0, elt(t3,2),elt(t3,3)],_
                     [0.0,-elt(t3,3),elt(t3,2)]]
@@ -1159,7 +1159,7 @@ g2:MATRIX(DFLOAT):=[[1.0, 0.0,      0.0],_
 --R                                                    Type: Matrix(DoubleFloat)
 --E 102
 
---S 103 of 127
+--S 103 of 136
 g2*g1*a
 --R
 --R        +   7.810249675906654      4.4812907976513596   2.5607375986579197 +
@@ -1170,7 +1170,7 @@ g2*g1*a
 --R                                                    Type: Matrix(DoubleFloat)
 --E 103
 
---S 104 of 127
+--S 104 of 136
 q:=transpose(g1)*transpose(g2)
 --R
 --R        +0.76822127959737585   0.33265417936007158    0.54697098874441952 +
@@ -1183,21 +1183,21 @@ q:=transpose(g1)*transpose(g2)
 
 )clear all
 
---S 105 of 127
+--S 105 of 136
 dx:PRIMARR(DFLOAT):=[[6,0, 1.0, 4.0, -1.0, -1.0]] 
 --R
 --R   (1)  [6.,0.,1.,4.,- 1.,- 1.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 105
 
---S 106 of 127
+--S 106 of 136
 dy:PRIMARR(DFLOAT):=[[5.0, 1.0, -4.0, 4.0, -4.0]] 
 --R
 --R   (2)  [5.,1.,- 4.,4.,- 4.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 106
 
---S 107 of 127
+--S 107 of 136
 drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate by 45 degrees 
 --R
 --R   (3)
@@ -1212,7 +1212,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate by 45 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 107
 
---S 108 of 127
+--S 108 of 136
 [dx,dy] -- note that the input arguments, dx and dy were modified
 --R
 --R   (4)
@@ -1227,7 +1227,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate by 45 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 108
 
---S 109 of 127
+--S 109 of 136
 drot(5,dx,1,dy,1,0.707106781,-0.707106781) -- rotate by -45 degrees 
 --R
 --R   (5)
@@ -1242,7 +1242,7 @@ drot(5,dx,1,dy,1,0.707106781,-0.707106781) -- rotate by -45 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 109
 
---S 110 of 127
+--S 110 of 136
 [dx,dy] -- note that the input arguments, dx and dy were modified
 --R
 --R   (6)
@@ -1257,21 +1257,21 @@ drot(5,dx,1,dy,1,0.707106781,-0.707106781) -- rotate by -45 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 110
 
---S 111 of 127
+--S 111 of 136
 dx:PRIMARR(DFLOAT):=[[6,0, 1.0, 4.0, -1.0, -1.0]] 
 --R
 --R   (7)  [6.,0.,1.,4.,- 1.,- 1.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 111
 
---S 112 of 127
+--S 112 of 136
 dy:PRIMARR(DFLOAT):=[[5.0, 1.0, -4.0, 4.0, -4.0]] 
 --R
 --R   (8)  [5.,1.,- 4.,4.,- 4.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 112
 
---S 113 of 127
+--S 113 of 136
 drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate by 45 degrees 
 --R
 --R   (9)
@@ -1286,7 +1286,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate by 45 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 113
 
---S 114 of 127
+--S 114 of 136
 drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 90 degrees
 --R
 --R   (10)
@@ -1301,7 +1301,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 90 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 114
 
---S 115 of 127
+--S 115 of 136
 drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 135 degrees
 --R
 --R   (11)
@@ -1316,7 +1316,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 135 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 115
 
---S 116 of 127
+--S 116 of 136
 drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 180 degrees
 --R
 --R   (12)
@@ -1331,7 +1331,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 180 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 116
 
---S 117 of 127
+--S 117 of 136
 drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 225 degrees 
 --R
 --R   (13)
@@ -1346,7 +1346,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 225 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 117
 
---S 118 of 127
+--S 118 of 136
 drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 270 degrees 
 --R
 --R   (14)
@@ -1361,7 +1361,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 270 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 118
 
---S 119 of 127
+--S 119 of 136
 drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 315 degrees 
 --R
 --R   (15)
@@ -1376,7 +1376,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 315 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 119
 
---S 120 of 127
+--S 120 of 136
 drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 360 degrees 
 --R
 --R   (16)
@@ -1391,7 +1391,7 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 360 degrees
 --R                                      Type: List(PrimitiveArray(DoubleFloat))
 --E 120
 
---S 121 of 127
+--S 121 of 136
 [dx,dy] -- note that the input arguments, dx and dy were modified
 --R
 --R   (17)
@@ -1407,48 +1407,113 @@ drot(5,dx,1,dy,1,0.707106781,0.707106781) -- rotate to 360 degrees
 --E 121
 
 )clear all
---S 122 of 127
+--S 122 of 136
 dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
 --R
 --R   (1)  [1.,2.,3.,4.,5.,6.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 122
 
---S 123 of 127
+--S 123 of 136
 dscal(6,2.0,dx,1)
 --R
 --R   (2)  [2.,4.,6.,8.,10.,12.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 123
 
---S 124 of 127
+--S 124 of 136
 dx
 --R
 --R   (3)  [2.,4.,6.,8.,10.,12.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 124
 
---S 125 of 127
+--S 125 of 136
 dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
 --R
 --R   (4)  [1.,2.,3.,4.,5.,6.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 125
 
---S 126 of 127
+--S 126 of 136
 dscal(3,0.5,dx,1)
 --R
 --R   (5)  [0.5,1.,1.5,4.,5.,6.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 126
 
---S 127 of 127
+--S 127 of 136
 dx
 --R
 --R   (6)  [0.5,1.,1.5,4.,5.,6.]
 --R                                            Type: PrimitiveArray(DoubleFloat)
 --E 127
 
+)clear all
+
+--S 128 of 136
+dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0,  5.0]]
+--R
+--R   (1)  [1.,2.,3.,4.,5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 128
+
+--S 129 of 136
+dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
+--R
+--R   (2)  [9.,8.,7.,6.,- 5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 129
+
+--S 130 of 136
+dswap(5,dx,1,dy,1)
+--R
+--R   (3)  [[9.,8.,7.,6.,- 5.],[1.,2.,3.,4.,5.]]
+--R                                      Type: List(PrimitiveArray(DoubleFloat))
+--E 130
+
+--S 131 of 136
+dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0,  5.0]]
+--R
+--R   (4)  [1.,2.,3.,4.,5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 131
+
+--S 132 of 136
+dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
+--R
+--R   (5)  [9.,8.,7.,6.,- 5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 132
+
+--S 133 of 136
+dswap(3,dx,2,dy,2)
+--R
+--R   (6)  [[9.,2.,7.,4.,- 5.],[1.,8.,3.,6.,5.]]
+--R                                      Type: List(PrimitiveArray(DoubleFloat))
+--E 133
+
+--S 134 of 136
+dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0,  5.0]]
+--R
+--R   (7)  [1.,2.,3.,4.,5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 134
+
+--S 135 of 136
+dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
+--R
+--R   (8)  [9.,8.,7.,6.,- 5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 135
+
+--S 136 of 136
+dswap(5,dx,1,dy,-1)
+--R
+--R   (9)  [[9.,8.,7.,6.,- 5.],[1.,2.,3.,4.,5.]]
+--R                                      Type: List(PrimitiveArray(DoubleFloat))
+--E 136
+
 )spool
 )lisp (bye)
 \end{chunk}
@@ -1618,6 +1683,20 @@ BlasLevelOne() : Exports == Implementation where
       ++X dscal(3,0.5,dx,1)
       ++X dx
 
+    dswap: (SI, DX, SI, DX, SI) -> LDX
+      ++ dswap swaps elements from the first vector with the second
+      ++ Note that the arrays are modified in place.
+      ++
+      ++X dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
+      ++X dy:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
+      ++X dswap(5,dx,1,dy,1)
+      ++X dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
+      ++X dy:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
+      ++X dswap(3,dx,2,dy,2)
+      ++X dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
+      ++X dy:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
+      ++X dswap(5,dx,1,dy,-1)
+
   Implementation  == add
 
       dcabs1(z:CDF):DF == 
@@ -1638,6 +1717,8 @@ BlasLevelOne() : Exports == Implementation where
         DROT(n,dx,incx,dy,incy,c,s)$Lisp
       dscal(n:SI,da:DF,dx:DX,incx:SI):DX ==
         DSCAL(n,da,dx,incx)$Lisp
+      dswap(n:SI,dx:DX,incx:SI,dy:DX,incy:SI):LDX ==
+        DSWAP(n,dx,incx,dy,incx)$Lisp
 
 \end{chunk}
 \begin{chunk}{BLAS1.dotabb}
@@ -6169,6 +6250,69 @@ a(4)= 4.000 a(5)= 5.000 a(6)= 6.000
 )set message auto off
 )clear all
 
+--S 1 of 9
+dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0,  5.0]]
+--R
+--R   (1)  [1.,2.,3.,4.,5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 1
+
+--S 2 of 9
+dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
+--R
+--R   (2)  [9.,8.,7.,6.,- 5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 2
+
+--S 3 of 9
+dswap(5,dx,1,dy,1)
+--R
+--R   (3)  [[9.,8.,7.,6.,- 5.],[1.,2.,3.,4.,5.]]
+--R                                      Type: List(PrimitiveArray(DoubleFloat))
+--E 3
+
+--S 4 of 9
+dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0,  5.0]]
+--R
+--R   (4)  [1.,2.,3.,4.,5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 4
+
+--S 5 of 9
+dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
+--R
+--R   (5)  [9.,8.,7.,6.,- 5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 5
+
+--S 6 of 9
+dswap(3,dx,2,dy,2)
+--R
+--R   (6)  [[9.,2.,7.,4.,- 5.],[1.,8.,3.,6.,5.]]
+--R                                      Type: List(PrimitiveArray(DoubleFloat))
+--E 6
+
+--S 7 of 9
+dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0,  5.0]]
+--R
+--R   (7)  [1.,2.,3.,4.,5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 7
+
+--S 8 of 9
+dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
+--R
+--R   (8)  [9.,8.,7.,6.,- 5.]
+--R                                            Type: PrimitiveArray(DoubleFloat)
+--E 8
+
+--S 9 of 9
+dswap(5,dx,1,dy,-1)
+--R
+--R   (9)  [[9.,8.,7.,6.,- 5.],[1.,2.,3.,4.,5.]]
+--R                                      Type: List(PrimitiveArray(DoubleFloat))
+--E 9
+
 )spool
 )lisp (bye)
 \end{chunk}
@@ -6177,6 +6321,43 @@ a(4)= 4.000 a(5)= 5.000 a(6)= 6.000
 dswap examples
 ====================================================================
 
+dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0,  5.0]]
+
+  [1.,2.,3.,4.,5.]
+
+dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
+
+  [9.,8.,7.,6.,- 5.]
+
+dswap(5,dx,1,dy,1)
+
+  [[9.,8.,7.,6.,- 5.],[1.,2.,3.,4.,5.]]
+
+dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0,  5.0]]
+
+  [1.,2.,3.,4.,5.]
+
+dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
+
+  [9.,8.,7.,6.,- 5.]
+
+dswap(3,dx,2,dy,2)
+
+  [[9.,2.,7.,4.,- 5.],[1.,8.,3.,6.,5.]]
+
+dx:PRIMARR(DFLOAT):=[[1.0, 2.0, 3.0, 4.0,  5.0]]
+
+  [1.,2.,3.,4.,5.]
+
+dy:PRIMARR(DFLOAT):=[[9.0, 8.0, 7.0, 6.0, -5.0]]
+
+  [9.,8.,7.,6.,- 5.]
+
+dswap(5,dx,1,dy,-1)
+
+ [[9.,8.,7.,6.,- 5.],[1.,2.,3.,4.,5.]]
+
+
 ====================================================================
 Man Page Details
 ====================================================================
@@ -6293,100 +6474,136 @@ c
 
 \end{chunk}
 
+There appears to be a bit of confusion using negative increments.
+The fortran code does not work as I would have guessed.
+I don't understand what it was intended to do.
+
+\begin{chunk}{dswap example}
+       program dswapEX
+*      Tim Daly May 6, 2012
+*      unit tests for BLAS dswap
+       double precision a(5)
+       double precision b(5)
+       a = (/ 1.0D0, 2.0D0, 3.0D0, 4.0D0,  5.0D0/)
+       b = (/ 9.0D0, 8.0D0, 7.0D0, 6.0D0, -5.0D0/)
+
+       write(6,10)
+ 10    format(/,"before:")
+       write(6,100)a(1),a(2),a(3),a(4),a(5)
+ 100   format("dx=(/",f6.3,", ",f6.3,", ",f6.3,", ",f6.3,", ",f6.3,"/)")
+       write(6,101)b(1),b(2),b(3),b(4),b(5)
+ 101   format("dy=(/",f6.3,", ",f6.3,", ",f6.3,", ",f6.3,", ",f6.3,"/)")
+       write(6,11)
+ 11    format(/,"swap all elements from dx to dy");
+       call dswap(5,a,1,b,1)
+       write(6,100)a(1),a(2),a(3),a(4),a(5)
+       write(6,101)b(1),b(2),b(3),b(4),b(5)
+
+       write(6,10)
+       a = (/ 1.0D0, 2.0D0, 3.0D0, 4.0D0,  5.0D0/)
+       b = (/ 9.0D0, 8.0D0, 7.0D0, 6.0D0, -5.0D0/)
+       write(6,100)a(1),a(2),a(3),a(4),a(5)
+       write(6,101)b(1),b(2),b(3),b(4),b(5)
+       write(6,20)
+ 20    format(/,"swap every other element from dx to dy");
+       a = (/ 1.0D0, 2.0D0, 3.0D0, 4.0D0,  5.0D0/)
+       b = (/ 9.0D0, 8.0D0, 7.0D0, 6.0D0, -5.0D0/)
+       call dswap(3,a,2,b,2)
+       write(6,100)a(1),a(2),a(3),a(4),a(5)
+       write(6,101)b(1),b(2),b(3),b(4),b(5)
+
+       write(6,10)
+       a = (/ 1.0D0, 2.0D0, 3.0D0, 4.0D0,  5.0D0/)
+       b = (/ 9.0D0, 8.0D0, 7.0D0, 6.0D0, -5.0D0/)
+       write(6,100)a(1),a(2),a(3),a(4),a(5)
+       write(6,101)b(1),b(2),b(3),b(4),b(5)
+       write(6,22)
+ 22    format(/,"swap and reverse elements dx to dy");
+       a = (/ 1.0D0, 2.0D0, 3.0D0, 4.0D0,  5.0D0/)
+       b = (/ 9.0D0, 8.0D0, 7.0D0, 6.0D0, -5.0D0/)
+       call dswap(5,a,1,b,-1)
+       write(6,100)a(1),a(2),a(3),a(4),a(5)
+       write(6,101)b(1),b(2),b(3),b(4),b(5)
+
+       stop
+       end 
+\end{chunk}
+
+\begin{verbatim}
+gcc -o dswapEX dswapEX.f -lgfortran dswap.o && ./dswapEX
+
+before:
+dx=(/ 1.000,  2.000,  3.000,  4.000,  5.000/)
+dy=(/ 9.000,  8.000,  7.000,  6.000, -5.000/)
+
+swap all elements from dx to dy
+dx=(/ 9.000,  8.000,  7.000,  6.000, -5.000/)
+dy=(/ 1.000,  2.000,  3.000,  4.000,  5.000/)
+
+before:
+dx=(/ 1.000,  2.000,  3.000,  4.000,  5.000/)
+dy=(/ 9.000,  8.000,  7.000,  6.000, -5.000/)
+
+swap every other element from dx to dy
+dx=(/ 9.000,  2.000,  7.000,  4.000, -5.000/)
+dy=(/ 1.000,  8.000,  3.000,  6.000,  5.000/)
+
+before:
+dx=(/ 1.000,  2.000,  3.000,  4.000,  5.000/)
+dy=(/ 9.000,  8.000,  7.000,  6.000, -5.000/)
+
+swap and reverse elements dx to dy
+dx=(/-5.000,  6.000,  7.000,  8.000,  9.000/)
+dy=(/ 5.000,  4.000,  3.000,  2.000,  1.000/)
+
+\end{verbatim}
+
 \begin{chunk}{BLAS 1 dswap}
 (defun dswap (n dx incx dy incy)
-  (declare (type (simple-array double-float (*)) dy dx)
-           (type fixnum incy incx n))
-  (f2cl-lib:with-multi-array-data
-      ((dx double-float dx-%data% dx-%offset%)
-       (dy double-float dy-%data% dy-%offset%))
-    (prog ((i 0) (ix 0) (iy 0) (m 0) (mp1 0) (dtemp 0.0))
-      (declare (type (double-float) dtemp)
-               (type fixnum mp1 m iy ix i))
-      (if (<= n 0) (go end_label))
-      (if (and (= incx 1) (= incy 1)) (go label20))
-      (setf ix 1)
-      (setf iy 1)
-      (if (< incx 0)
-          (setf ix
-                  (f2cl-lib:int-add
-                   (f2cl-lib:int-mul (the fixnum (1- n)) incx)
-                   1)))
-      (if (< incy 0)
-          (setf iy
-                  (f2cl-lib:int-add
-                   (f2cl-lib:int-mul (the fixnum (1- n)) incy)
-                   1)))
-      (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
-                    ((> i n) nil)
-        (tagbody
-          (setf dtemp (f2cl-lib:fref dx-%data% (ix) ((1 *)) dx-%offset%))
-          (setf (f2cl-lib:fref dx-%data% (ix) ((1 *)) dx-%offset%)
-                  (f2cl-lib:fref dy-%data% (iy) ((1 *)) dy-%offset%))
-          (setf (f2cl-lib:fref dy-%data% (iy) ((1 *)) dy-%offset%) dtemp)
-          (setf ix (f2cl-lib:int-add ix incx))
-          (setf iy (f2cl-lib:int-add iy incy))))
-      (go end_label)
- label20
-      (setf m (mod n 3))
-      (if (= m 0) (go label40))
-      (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
-                    ((> i m) nil)
-        (tagbody
-          (setf dtemp (f2cl-lib:fref dx-%data% (i) ((1 *)) dx-%offset%))
-          (setf (f2cl-lib:fref dx-%data% (i) ((1 *)) dx-%offset%)
-                  (f2cl-lib:fref dy-%data% (i) ((1 *)) dy-%offset%))
-          (setf (f2cl-lib:fref dy-%data% (i) ((1 *)) dy-%offset%) dtemp)))
-      (if (< n 3) (go end_label))
- label40
-      (setf mp1 (f2cl-lib:int-add m 1))
-      (f2cl-lib:fdo (i mp1 (f2cl-lib:int-add i 3))
-                    ((> i n) nil)
-        (tagbody
-          (setf dtemp (f2cl-lib:fref dx-%data% (i) ((1 *)) dx-%offset%))
-          (setf (f2cl-lib:fref dx-%data% (i) ((1 *)) dx-%offset%)
-                  (f2cl-lib:fref dy-%data% (i) ((1 *)) dy-%offset%))
-          (setf (f2cl-lib:fref dy-%data% (i) ((1 *)) dy-%offset%) dtemp)
-          (setf dtemp
-                  (f2cl-lib:fref dx-%data%
-                                 ((f2cl-lib:int-add i 1))
-                                 ((1 *))
-                                 dx-%offset%))
-          (setf (f2cl-lib:fref dx-%data%
-                               ((f2cl-lib:int-add i 1))
-                               ((1 *))
-                               dx-%offset%)
-                  (f2cl-lib:fref dy-%data%
-                                 ((f2cl-lib:int-add i 1))
-                                 ((1 *))
-                                 dy-%offset%))
-          (setf (f2cl-lib:fref dy-%data%
-                               ((f2cl-lib:int-add i 1))
-                               ((1 *))
-                               dy-%offset%)
-                  dtemp)
-          (setf dtemp
-                  (f2cl-lib:fref dx-%data%
-                                 ((f2cl-lib:int-add i 2))
-                                 ((1 *))
-                                 dx-%offset%))
-          (setf (f2cl-lib:fref dx-%data%
-                               ((f2cl-lib:int-add i 2))
-                               ((1 *))
-                               dx-%offset%)
-                  (f2cl-lib:fref dy-%data%
-                                 ((f2cl-lib:int-add i 2))
-                                 ((1 *))
-                                 dy-%offset%))
-          (setf (f2cl-lib:fref dy-%data%
-                               ((f2cl-lib:int-add i 2))
-                               ((1 *))
-                               dy-%offset%)
-                  dtemp)))
- end_label
-      (return (values nil nil nil nil nil)))))
+; Tim Daly May 6, 2012
+ (declare (type (simple-array double-float (*)) dy dx)
+          (type fixnum incy incx n))
+ (let ((ix 0) (iy 0) (limitx (length dx)) (limity (length dy))
+       (dtemp 0.0d0))
+ (declare (type (double-float) dtemp) (type fixnum ix iy limitx limity))
+  (when (> n 0)
+   (when (< incx 0)
+    (setf ix (the fixnum (* (the fixnum (1+ (the fixnum (- n)))) incx))))
+   (when (< incy 0)
+    (setf iy (the fixnum (* (the fixnum (1+ (the fixnum (- n)))) incy))))
+   (do ((i 0 (1+ i)))
+       ((or (>= i n) (>= i limitx) (>= i limity)))
+     (setf dtemp (svref dx ix))
+     (setf (svref dx ix) (svref dy iy))
+     (setf (svref dy iy) dtemp)
+     (setf ix (the fixnum (+ ix incx)))
+     (setf iy (the fixnum (+ iy incy)))))
+  (list dx dy)))
+\end{chunk}
+
+\begin{chunk}{BLAS 1 dswap lisp test}
+(load "dswap.lisp")
+(setq a (vector 1.0d0 2.0d0 3.0d0 4.0d0 5.0d0)) 
+; #(1.0 2.0 3.0 4.0 5.0)
+(setq b (vector 9.0d0 8.0d0 7.0d0 6.0d0 -5.0d0))
+; #(9.0 8.0 7.0 6.0 -5.0)
+(dswap 5 a 1 b 1)
+; (#(9.0 8.0 7.0 6.0 -5.0) #(1.0 2.0 3.0 4.0 5.0))
+(setq a (vector 1.0d0 2.0d0 3.0d0 4.0d0 5.0d0)) 
+; #(1.0 2.0 3.0 4.0 5.0)
+(setq b (vector 9.0d0 8.0d0 7.0d0 6.0d0 -5.0d0))
+; #(9.0 8.0 7.0 6.0 -5.0)
+(dswap 3 a 2 b 2)
+; (#(9.0 2.0 7.0 4.0 -5.0) #(1.0 8.0 3.0 6.0 5.0))
+(setq a (vector 1.0d0 2.0d0 3.0d0 4.0d0 5.0d0)) 
+; #(1.0 2.0 3.0 4.0 5.0)
+(setq b (vector 9.0d0 8.0d0 7.0d0 6.0d0 -5.0d0))
+; #(9.0 8.0 7.0 6.0 -5.0)
+(dswap 5 a 1 b -1)
+; (#(-5.0 6.0 7.0 8.0 9.0) #(5.0 4.0 3.0 2.0 1.0))
 
 \end{chunk}
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{dzasum BLAS}
 %\pagehead{dzasum}{dzasum}
@@ -138555,12 +138772,12 @@ Warning:  Types of argument 1 in call to ZLARFB do not match.
 \getchunk{BLAS 1 drotg}
 \getchunk{BLAS 1 drot}
 \getchunk{BLAS 1 dscal}
+\getchunk{BLAS 1 dswap}
 \end{chunk}
 \begin{chunk}{untested}
 \getchunk{BLAS lsame}
 \getchunk{BLAS xerbla}
 
-\getchunk{BLAS 1 dswap}
 \getchunk{BLAS 1 dzasum}
 \getchunk{BLAS 1 dznrm2}
 \getchunk{BLAS 1 icamax}
diff --git a/changelog b/changelog
index 00893e5..e6fea88 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20120506 tpd src/axiom-website/patches.html 20120507.01.tpd.patch
+20120507 tpd books/bookvol10.5 BLAS1 dswap
 20120506 tpd src/axiom-website/patches.html 20120506.01.tpd.patch
 20120506 tpd books/bookvol10.5 BLAS1 dscal
 20120505 tpd src/axiom-website/patches.html 20120505.01.tpd.patch
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index ffb14d6..cce9313 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -3906,5 +3906,7 @@ books/bookvol10.5 BLAS1 drotg<br/>
 books/bookvol10.5 BLAS1 drot<br/>
 <a href="patches/20120506.01.tpd.patch">20120506.01.tpd.patch</a>
 books/bookvol10.5 BLAS1 dscal<br/>
+<a href="patches/20120507.01.tpd.patch">20120507.01.tpd.patch</a>
+books/bookvol10.5 BLAS1 dswap<br/>
  </body>
 </html>
