diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-10-26 23:57:58 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-10-26 23:57:58 +0000 |
commit | d8f412571f8768df2d3239e72392dfeabbad1559 (patch) | |
tree | 19d182df05ead7ff8ba7ee00a7d57555e1383fdf /libgo/go/cmath | |
parent | e0c39d66d4f0607177b1cf8995dda56a667e07b3 (diff) | |
download | gcc-d8f412571f8768df2d3239e72392dfeabbad1559.zip gcc-d8f412571f8768df2d3239e72392dfeabbad1559.tar.gz gcc-d8f412571f8768df2d3239e72392dfeabbad1559.tar.bz2 |
Update Go library to last weekly.
From-SVN: r180552
Diffstat (limited to 'libgo/go/cmath')
-rw-r--r-- | libgo/go/cmath/asin.go | 4 | ||||
-rw-r--r-- | libgo/go/cmath/sin.go | 2 | ||||
-rw-r--r-- | libgo/go/cmath/sqrt.go | 6 | ||||
-rw-r--r-- | libgo/go/cmath/tan.go | 10 |
4 files changed, 11 insertions, 11 deletions
diff --git a/libgo/go/cmath/asin.go b/libgo/go/cmath/asin.go index d6a3ca4..01ce80a 100644 --- a/libgo/go/cmath/asin.go +++ b/libgo/go/cmath/asin.go @@ -50,7 +50,7 @@ import "math" // Asin returns the inverse sine of x. func Asin(x complex128) complex128 { if imag(x) == 0 { - if math.Fabs(real(x)) > 1 { + if math.Abs(real(x)) > 1 { return complex(math.Pi/2, 0) // DOMAIN error } return complex(math.Asin(real(x)), 0) @@ -67,7 +67,7 @@ func Asin(x complex128) complex128 { func Asinh(x complex128) complex128 { // TODO check range if imag(x) == 0 { - if math.Fabs(real(x)) > 1 { + if math.Abs(real(x)) > 1 { return complex(math.Pi/2, 0) // DOMAIN error } return complex(math.Asinh(real(x)), 0) diff --git a/libgo/go/cmath/sin.go b/libgo/go/cmath/sin.go index 8900ecd..486b717 100644 --- a/libgo/go/cmath/sin.go +++ b/libgo/go/cmath/sin.go @@ -122,7 +122,7 @@ func Cosh(x complex128) complex128 { // calculate sinh and cosh func sinhcosh(x float64) (sh, ch float64) { - if math.Fabs(x) <= 0.5 { + if math.Abs(x) <= 0.5 { return math.Sinh(x), math.Cosh(x) } e := math.Exp(x) diff --git a/libgo/go/cmath/sqrt.go b/libgo/go/cmath/sqrt.go index e77a9b9..4e7e805 100644 --- a/libgo/go/cmath/sqrt.go +++ b/libgo/go/cmath/sqrt.go @@ -76,7 +76,7 @@ func Sqrt(x complex128) complex128 { b := imag(x) var scale float64 // Rescale to avoid internal overflow or underflow. - if math.Fabs(a) > 4 || math.Fabs(b) > 4 { + if math.Abs(a) > 4 || math.Abs(b) > 4 { a *= 0.25 b *= 0.25 scale = 2 @@ -89,11 +89,11 @@ func Sqrt(x complex128) complex128 { var t float64 if a > 0 { t = math.Sqrt(0.5*r + 0.5*a) - r = scale * math.Fabs((0.5*b)/t) + r = scale * math.Abs((0.5*b)/t) t *= scale } else { r = math.Sqrt(0.5*r - 0.5*a) - t = scale * math.Fabs((0.5*b)/r) + t = scale * math.Abs((0.5*b)/r) r *= scale } if b < 0 { diff --git a/libgo/go/cmath/tan.go b/libgo/go/cmath/tan.go index 94b5175..67dc22a 100644 --- a/libgo/go/cmath/tan.go +++ b/libgo/go/cmath/tan.go @@ -58,7 +58,7 @@ import "math" // Tan returns the tangent of x. func Tan(x complex128) complex128 { d := math.Cos(2*real(x)) + math.Cosh(2*imag(x)) - if math.Fabs(d) < 0.25 { + if math.Abs(d) < 0.25 { d = tanSeries(x) } if d == 0 { @@ -109,8 +109,8 @@ func reducePi(x float64) float64 { // Taylor series expansion for cosh(2y) - cos(2x) func tanSeries(z complex128) float64 { const MACHEP = 1.0 / (1 << 53) - x := math.Fabs(2 * real(z)) - y := math.Fabs(2 * imag(z)) + x := math.Abs(2 * real(z)) + y := math.Abs(2 * imag(z)) x = reducePi(x) x = x * x y = y * y @@ -139,7 +139,7 @@ func tanSeries(z complex128) float64 { t = y2 - x2 t /= f d += t - if math.Fabs(t/d) <= MACHEP { + if math.Abs(t/d) <= MACHEP { break } } @@ -174,7 +174,7 @@ func tanSeries(z complex128) float64 { // Cot returns the cotangent of x. func Cot(x complex128) complex128 { d := math.Cosh(2*imag(x)) - math.Cos(2*real(x)) - if math.Fabs(d) < 0.25 { + if math.Abs(d) < 0.25 { d = tanSeries(x) } if d == 0 { |