# ?laev2

Computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix.

## Syntax

call slaev2( a, b, c, rt1, rt2, cs1, sn1 )

call dlaev2( a, b, c, rt1, rt2, cs1, sn1 )

call claev2( a, b, c, rt1, rt2, cs1, sn1 )

call zlaev2( a, b, c, rt1, rt2, cs1, sn1 )

## Description

This routine performs the eigendecomposition of a 2-by-2 symmetric matrix

(for claev2/zlaev2).

On return, rt1 is the eigenvalue of larger absolute value, rt2 of smaller absolute value, and (cs1, sn1) is the unit right eigenvector for rt1, giving the decomposition

(for slaev2/dlaev2),

or

(for claev2/zlaev2).

## Input Parameters

a, b, c

  REAL for slaev2

  DOUBLE PRECISION for dlaev2

  COMPLEX for claev2

  COMPLEX*16 for zlaev2.

  Elements of the input matrix.

## Output Parameters

rt1, rt2

  REAL for slaev2/claev2

  DOUBLE PRECISION for dlaev2/zlaev2.

  Eigenvalues of larger and smaller absolute value, respectively.

cs1

  REAL for slaev2/claev2

  DOUBLE PRECISION for dlaev2/zlaev2.

sn1

  REAL for slaev2

  DOUBLE PRECISION for dlaev2

  COMPLEX for claev2

  COMPLEX*16 for zlaev2.

  The vector (cs1, sn1) is the unit right eigenvector for rt1.

## Application Notes

rt1 is accurate to a few ulps barring over/underflow. rt2 may be inaccurate if there is massive cancellation in the determinant `a*c-b*b`; higher precision or correctly rounded or correctly truncated arithmetic would be needed to compute rt2 accurately in all cases. cs1 and sn1 are accurate to a few ulps barring over/underflow. Overflow is possible only if rt1 is within a factor of 5 of overflow. Underflow is harmless if the input data is 0 or exceeds underflow_threshold / macheps.

Parent topic: Auxiliary Routines