F16 Chapter Contents
F16 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF16EHF (BLAS_DWAXPBY)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

F16EHF (BLAS_DWAXPBY) computes the sum of two scaled vectors, preserving input, for real scalars and vectors.

## 2  Specification

 SUBROUTINE F16EHF ( N, ALPHA, X, INCX, BETA, Y, INCY, W, INCW)
 INTEGER N, INCX, INCY, INCW REAL (KIND=nag_wp) ALPHA, X(1+(N-1)*ABS(INCX)), BETA, Y(1+(N-1)*ABS(INCY)), W(1+(N-1)*ABS(INCW))
The routine may be called by its BLAST name blas_dwaxpby.

## 3  Description

F16EHF (BLAS_DWAXPBY) performs the operation
 $w ← αx+βy,$
where $x$ and $y$ are $n$-element real vectors, and $\alpha$ and $\beta$ are real scalars.

## 4  References

Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001) Basic Linear Algebra Subprograms Technical (BLAST) Forum Standard University of Tennessee, Knoxville, Tennessee http://www.netlib.org/blas/blast-forum/blas-report.pdf

## 5  Parameters

1:     N – INTEGERInput
On entry: $n$, the number of elements in $x$, $y$ and $w$.
2:     ALPHA – REAL (KIND=nag_wp)Input
On entry: the scalar $\alpha$.
3:     X($1+\left({\mathbf{N}}-1\right)×\left|{\mathbf{INCX}}\right|$) – REAL (KIND=nag_wp) arrayInput
On entry: the $n$-element vector $x$.
If ${\mathbf{INCX}}>0$, ${x}_{\mathit{i}}$ must be stored in ${\mathbf{X}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{INCX}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
If ${\mathbf{INCX}}<0$, ${x}_{\mathit{i}}$ must be stored in ${\mathbf{X}}\left(1-\left({\mathbf{N}}-\mathit{i}\right)×{\mathbf{INCX}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
Intermediate elements of X are not referenced.
4:     INCX – INTEGERInput
On entry: the increment in the subscripts of X between successive elements of $x$.
Constraint: ${\mathbf{INCX}}\ne 0$.
5:     BETA – REAL (KIND=nag_wp)Input
On entry: the scalar $\beta$.
6:     Y($1+\left({\mathbf{N}}-1\right)×\left|{\mathbf{INCY}}\right|$) – REAL (KIND=nag_wp) arrayInput
On entry: the $n$-element vector $y$.
If ${\mathbf{INCY}}>0$, ${y}_{\mathit{i}}$ must be stored in ${\mathbf{Y}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{INCY}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
If ${\mathbf{INCY}}<0$, ${y}_{\mathit{i}}$ must be stored in ${\mathbf{Y}}\left(1-\left({\mathbf{N}}-\mathit{i}\right)×{\mathbf{INCY}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
Intermediate elements of Y are not referenced.
7:     INCY – INTEGERInput
On entry: the increment in the subscripts of Y between successive elements of $y$.
Constraint: ${\mathbf{INCY}}\ne 0$.
8:     W($1+\left({\mathbf{N}}-1\right)×\left|{\mathbf{INCW}}\right|$) – REAL (KIND=nag_wp) arrayOutput
On exit: the $n$-element vector $w$.
If ${\mathbf{INCW}}>0$, ${w}_{i}$ is in ${\mathbf{W}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{INCW}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
If ${\mathbf{INCW}}<0$, ${w}_{i}$ is in ${\mathbf{W}}\left(1+\left({\mathbf{N}}-\mathit{i}\right)×{\mathbf{INCW}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
Intermediate elements of W are not referenced.
9:     INCW – INTEGERInput
On entry: the increment in the subscripts of W between successive elements of $w$.
Constraint: ${\mathbf{INCW}}\ne 0$.

## 6  Error Indicators and Warnings

If ${\mathbf{INCX}}=0$ or ${\mathbf{INCY}}=0$ or ${\mathbf{INCW}}=0$, an error message is printed and program execution is terminated.

## 7  Accuracy

The BLAS standard requires accurate implementations which avoid unnecessary over/underflow (see Section 2.7 of Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001)).

None.

## 9  Example

This example computes the result of a scaled vector accumulation for
 $α=3, x = -4,2.1,3.7,4.5,-6T , β=-1, y = -3,-2.4,6.4,-5,-5.1T .$

### 9.1  Program Text

Program Text (f16ehfe.f90)

### 9.2  Program Data

Program Data (f16ehfe.d)

### 9.3  Program Results

Program Results (f16ehfe.r)