aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6/libstdc++-v3/include/tr1
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.6/libstdc++-v3/include/tr1')
-rw-r--r--gcc-4.6/libstdc++-v3/include/tr1/complex9
-rw-r--r--gcc-4.6/libstdc++-v3/include/tr1/poly_hermite.tcc4
2 files changed, 5 insertions, 8 deletions
diff --git a/gcc-4.6/libstdc++-v3/include/tr1/complex b/gcc-4.6/libstdc++-v3/include/tr1/complex
index fc213b8..689ea16 100644
--- a/gcc-4.6/libstdc++-v3/include/tr1/complex
+++ b/gcc-4.6/libstdc++-v3/include/tr1/complex
@@ -185,12 +185,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
std::complex<_Tp>
__complex_acosh(const std::complex<_Tp>& __z)
{
- std::complex<_Tp> __t((__z.real() - __z.imag())
- * (__z.real() + __z.imag()) - _Tp(1.0),
- _Tp(2.0) * __z.real() * __z.imag());
- __t = std::sqrt(__t);
-
- return std::log(__t + __z);
+ // Kahan's formula.
+ return _Tp(2.0) * std::log(std::sqrt(_Tp(0.5) * (__z + _Tp(1.0)))
+ + std::sqrt(_Tp(0.5) * (__z - _Tp(1.0))));
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
diff --git a/gcc-4.6/libstdc++-v3/include/tr1/poly_hermite.tcc b/gcc-4.6/libstdc++-v3/include/tr1/poly_hermite.tcc
index e86b377..95e8079 100644
--- a/gcc-4.6/libstdc++-v3/include/tr1/poly_hermite.tcc
+++ b/gcc-4.6/libstdc++-v3/include/tr1/poly_hermite.tcc
@@ -1,6 +1,6 @@
// Special functions -*- C++ -*-
-// Copyright (C) 2006, 2007, 2008, 2009, 2010
+// Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -84,7 +84,7 @@ namespace tr1
unsigned int __i;
for (__H_nm2 = __H_0, __H_nm1 = __H_1, __i = 2; __i <= __n; ++__i)
{
- __H_n = 2 * (__x * __H_nm1 + (__i - 1) * __H_nm2);
+ __H_n = 2 * (__x * __H_nm1 - (__i - 1) * __H_nm2);
__H_nm2 = __H_nm1;
__H_nm1 = __H_n;
}