A02ACF (PDF version)
A02 Chapter Contents
A02 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

A02ACF

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.

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

A02ACF divides one complex number, x=xr,xi, by a second complex number, y=yr,yi, returning the result in z=zr,zi.

2  Specification

SUBROUTINE A02ACF ( XR, XI, YR, YI, ZR, ZI)
REAL (KIND=nag_wp)  XR, XI, YR, YI, ZR, ZI

3  Description

The result z is calculated using Smith's algorithm with scaling, from Li et al. (2002), which ensures that no unnecessary overflow or underflow occurs at intermediate stages of the computation.

4  References

Li X S, Demmel J W, Bailey D H, Henry G, Hida Y, Iskandar J, Kahan W, Kapur A, Martin M C, Tung T and Yoo D J (2002) Design, implementation and testing of extended and mixed precision BLAS ACM Trans. Math. Soft. 28(2) 152–205

5  Parameters

1:     XR – REAL (KIND=nag_wp)Input
2:     XI – REAL (KIND=nag_wp)Input
On entry: xr and xi, the real and imaginary parts of x, respectively.
3:     YR – REAL (KIND=nag_wp)Input
4:     YI – REAL (KIND=nag_wp)Input
On entry: yr and yi, the real and imaginary parts of y, respectively.
5:     ZR – REAL (KIND=nag_wp)Output
6:     ZI – REAL (KIND=nag_wp)Output
On exit: zr and zi, the real and imaginary parts of z, respectively.

6  Error Indicators and Warnings

None.

7  Accuracy

The result should be correct to machine precision.

8  Further Comments

The time taken by A02ACF is negligible.
This routine must not be called with YR=0.0 and YI=0.0.

9  Example

This example finds the value of -1.7+2.6i/-3.1-0.9i.

9.1  Program Text

Program Text (a02acfe.f90)

9.2  Program Data

Program Data (a02acfe.d)

9.3  Program Results

Program Results (a02acfe.r)


A02ACF (PDF version)
A02 Chapter Contents
A02 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012