# NAG FL Interfacef06fjf (dssq)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

f06fjf updates the Euclidean norm of real vector in scaled form.

## 2Specification

Fortran Interface
 Subroutine f06fjf ( n, x, incx, scal,
 Integer, Intent (In) :: n, incx Real (Kind=nag_wp), Intent (In) :: x(*) Real (Kind=nag_wp), Intent (Inout) :: scal, sumsq
#include <nag.h>
 void f06fjf_ (const Integer *n, const double x[], const Integer *incx, double *scal, double *sumsq)
The routine may be called by the names f06fjf or nagf_blas_dssq.

## 3Description

Given an $n$-element real vector $x$, and real scalars $\alpha$ and $\xi$, f06fjf returns updated values $\stackrel{~}{\alpha }$ and $\stackrel{~}{\xi }$ such that
 $α~2ξ~=x12+x22+⋯+xn2+α2ξ.$
f06fjf is designed for use in the safe computation of the Euclidean norm of a real vector, without unnecessary overflow or destructive underflow. An initial call to f06fjf (with $\xi =1$ and $\alpha =0$) may be followed by further calls to f06fjf and finally a call to f06bmf to complete the computation. Multiple calls of f06fjf may be needed if the elements of the vector cannot all be accessed in a single array x.
None.

## 5Arguments

1: $\mathbf{n}$Integer Input
On entry: $n$, the number of elements in $x$.
2: $\mathbf{x}\left(*\right)$Real (Kind=nag_wp) array Input
Note: the dimension of the array x must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{n}}-1\right)×{\mathbf{incx}}\right)$.
On entry: the $n$-element vector $x$. ${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}}$.
Intermediate elements of x are not referenced.
3: $\mathbf{incx}$Integer Input
On entry: the increment in the subscripts of x between successive elements of $x$.
Constraint: ${\mathbf{incx}}>0$.
4: $\mathbf{scal}$Real (Kind=nag_wp) Input/Output
On entry: the scaling factor $\alpha$. On the first call to f06fjf ${\mathbf{scal}}=0.0$.
Constraint: ${\mathbf{scal}}\ge 0.0$.
On exit: the updated scaling factor $\stackrel{~}{\alpha }=\underset{i}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\left(\alpha ,|{x}_{i}|\right)$.
5: $\mathbf{sumsq}$Real (Kind=nag_wp) Input/Output
On entry: the scaled sum of squares $\xi$. On the first call to f06fjf ${\mathbf{sumsq}}=1.0$.
Constraint: ${\mathbf{sumsq}}\ge 1.0$.
On exit: the updated scaled sum of squares $\stackrel{~}{\xi }$, satisfying: $1\le \stackrel{~}{\xi }\le \xi +n$.

None.

Not applicable.