1 // Copyright ©2016 The Gonum Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
9 // Dlae2 computes the eigenvalues of a 2×2 symmetric matrix
12 // and returns the eigenvalue with the larger absolute value as rt1 and the
15 // Dlae2 is an internal routine. It is exported for testing purposes.
16 func (impl Implementation) Dlae2(a, b, c float64) (rt1, rt2 float64) {
24 if math.Abs(a) > math.Abs(c) {
30 rt = adf * math.Sqrt(1+(ab/adf)*(ab/adf))
32 rt = ab * math.Sqrt(1+(adf/ab)*(adf/ab))
38 rt2 = (acmx/rt1)*acmn - (b/rt1)*b
43 rt2 = (acmx/rt1)*acmn - (b/rt1)*b