LAPACK  3.10.1 LAPACK: Linear Algebra PACKage

## ◆ slae2()

 subroutine slae2 ( real A, real B, real C, real RT1, real RT2 )

SLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix.

Download SLAE2 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
``` SLAE2  computes the eigenvalues of a 2-by-2 symmetric matrix
[  A   B  ]
[  B   C  ].
On return, RT1 is the eigenvalue of larger absolute value, and RT2
is the eigenvalue of smaller absolute value.```
Parameters
 [in] A ``` A is REAL The (1,1) element of the 2-by-2 matrix.``` [in] B ``` B is REAL The (1,2) and (2,1) elements of the 2-by-2 matrix.``` [in] C ``` C is REAL The (2,2) element of the 2-by-2 matrix.``` [out] RT1 ``` RT1 is REAL The eigenvalue of larger absolute value.``` [out] RT2 ``` RT2 is REAL The eigenvalue of smaller absolute value.```
Further Details:
```  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.

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.```

Definition at line 101 of file slae2.f.

102 *
103 * -- LAPACK auxiliary routine --
104 * -- LAPACK is a software package provided by Univ. of Tennessee, --
105 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
106 *
107 * .. Scalar Arguments ..
108  REAL A, B, C, RT1, RT2
109 * ..
110 *
111 * =====================================================================
112 *
113 * .. Parameters ..
114  REAL ONE
115  parameter( one = 1.0e0 )
116  REAL TWO
117  parameter( two = 2.0e0 )
118  REAL ZERO
119  parameter( zero = 0.0e0 )
120  REAL HALF
121  parameter( half = 0.5e0 )
122 * ..
123 * .. Local Scalars ..
124  REAL AB, ACMN, ACMX, ADF, DF, RT, SM, TB
125 * ..
126 * .. Intrinsic Functions ..
127  INTRINSIC abs, sqrt
128 * ..
129 * .. Executable Statements ..
130 *
131 * Compute the eigenvalues
132 *
133  sm = a + c
134  df = a - c
135  adf = abs( df )
136  tb = b + b
137  ab = abs( tb )
138  IF( abs( a ).GT.abs( c ) ) THEN
139  acmx = a
140  acmn = c
141  ELSE
142  acmx = c
143  acmn = a
144  END IF
145  IF( adf.GT.ab ) THEN
146  rt = adf*sqrt( one+( ab / adf )**2 )
147  ELSE IF( adf.LT.ab ) THEN
148  rt = ab*sqrt( one+( adf / ab )**2 )
149  ELSE
150 *
151 * Includes case AB=ADF=0
152 *
153  rt = ab*sqrt( two )
154  END IF
155  IF( sm.LT.zero ) THEN
156  rt1 = half*( sm-rt )
157 *
158 * Order of execution important.
159 * To get fully accurate smaller eigenvalue,
160 * next line needs to be executed in higher precision.
161 *
162  rt2 = ( acmx / rt1 )*acmn - ( b / rt1 )*b
163  ELSE IF( sm.GT.zero ) THEN
164  rt1 = half*( sm+rt )
165 *
166 * Order of execution important.
167 * To get fully accurate smaller eigenvalue,
168 * next line needs to be executed in higher precision.
169 *
170  rt2 = ( acmx / rt1 )*acmn - ( b / rt1 )*b
171  ELSE
172 *
173 * Includes case RT1 = RT2 = 0
174 *
175  rt1 = half*rt
176  rt2 = -half*rt
177  END IF
178  RETURN
179 *
180 * End of SLAE2
181 *
Here is the caller graph for this function:
{"ft_lang_label":"__label__en","ft_lang_prob":0.687549,"math_prob":0.9889987,"size":1202,"snap":"2022-40-2023-06","text_gpt3_token_len":366,"char_repetition_ratio":0.13105175,"word_repetition_ratio":0.07804878,"special_character_ratio":0.29201332,"punctuation_ratio":0.1124498,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9891894,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-10-03T15:13:37Z\",\"WARC-Record-ID\":\"<urn:uuid:2b2085e5-003f-41e5-8702-afb5c296f1d7>\",\"Content-Length\":\"19622\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:11a3e85a-8384-4632-9234-4505cfde49de>\",\"WARC-Concurrent-To\":\"<urn:uuid:35c7bebb-07bd-470d-9dcf-8b064d9c2037>\",\"WARC-IP-Address\":\"160.36.131.221\",\"WARC-Target-URI\":\"https://netlib.org/lapack/explore-html/df/dd1/group___o_t_h_e_rauxiliary_gaec32dea47a14590934b8970b078b58fd.html\",\"WARC-Payload-Digest\":\"sha1:PC6SZLKPSKMCOTGIQ2CWZWEIB2TBG3CE\",\"WARC-Block-Digest\":\"sha1:WX2ARKSUS4UQ4YNIXVGDP64WRKGVBXM2\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-40/CC-MAIN-2022-40_segments_1664030337421.33_warc_CC-MAIN-20221003133425-20221003163425-00701.warc.gz\"}"}