]> gcc.gnu.org Git - gcc.git/commitdiff
Rollback bad commits! Sorry!
authorEdward Smith-Rowland <emsr@gcc.gnu.org>
Mon, 7 May 2018 16:13:48 +0000 (16:13 +0000)
committerEdward Smith-Rowland <emsr@gcc.gnu.org>
Mon, 7 May 2018 16:13:48 +0000 (16:13 +0000)
From-SVN: r260003

libstdc++-v3/include/bits/random.tcc
libstdc++-v3/include/std/complex
libstdc++-v3/include/tr1/bessel_function.tcc
libstdc++-v3/testsuite/special_functions/08_cyl_bessel_j/check_value.cc
libstdc++-v3/testsuite/special_functions/10_cyl_neumann/check_value.cc
libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_value.cc
libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_value.cc

index f398150d41605bad62c8b0c75f2f1feaec89450f..6db900cc0cd94fa31289f3354d4d5af3755cbc6f 100644 (file)
@@ -2408,7 +2408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                  __v = __v * __v * __v;
                  __u = __aurng();
                }
-             while (__u > result_type(1.0) - 0.0331 * __n * __n * __n * __n
+             while (__u > result_type(1.0) - 0.331 * __n * __n * __n * __n
                     && (std::log(__u) > (0.5 * __n * __n + __a1
                                          * (1.0 - __v + std::log(__v)))));
 
@@ -2429,7 +2429,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                  __v = __v * __v * __v;
                  __u = __aurng();
                }
-             while (__u > result_type(1.0) - 0.0331 * __n * __n * __n * __n
+             while (__u > result_type(1.0) - 0.331 * __n * __n * __n * __n
                     && (std::log(__u) > (0.5 * __n * __n + __a1
                                          * (1.0 - __v + std::log(__v)))));
 
index 54f2b9db898d91e66353cbb01e0798c560f5430e..2e2c2c06560680b288cb2617ffce7a53e264ac81 100644 (file)
@@ -70,7 +70,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   ///  Return phase angle of @a z.
   template<typename _Tp> _Tp arg(const complex<_Tp>&);
   ///  Return @a z magnitude squared.
-  template<typename _Tp> _Tp _GLIBCXX_CONSTEXPR norm(const complex<_Tp>&);
+  template<typename _Tp> _Tp norm(const complex<_Tp>&);
 
   ///  Return complex conjugate of @a z.
   template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&);
@@ -322,7 +322,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   //@{
   ///  Return new complex value @a x plus @a y.
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __x;
@@ -331,7 +331,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator+(const complex<_Tp>& __x, const _Tp& __y)
     {
       complex<_Tp> __r = __x;
@@ -340,7 +340,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator+(const _Tp& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __y;
@@ -352,7 +352,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   //@{
   ///  Return new complex value @a x minus @a y.
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __x;
@@ -361,7 +361,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator-(const complex<_Tp>& __x, const _Tp& __y)
     {
       complex<_Tp> __r = __x;
@@ -370,7 +370,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator-(const _Tp& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r(__x, -__y.imag());
@@ -382,7 +382,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   //@{
   ///  Return new complex value @a x times @a y.
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __x;
@@ -391,7 +391,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    inline _GLIBCXX_CONSTEXPR complex<_Tp>
+    inline complex<_Tp>
     operator*(const complex<_Tp>& __x, const _Tp& __y)
     {
       complex<_Tp> __r = __x;
@@ -400,7 +400,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator*(const _Tp& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __y;
@@ -412,7 +412,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   //@{
   ///  Return new complex value @a x divided by @a y.
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator/(const complex<_Tp>& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __x;
@@ -421,7 +421,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator/(const complex<_Tp>& __x, const _Tp& __y)
     {
       complex<_Tp> __r = __x;
@@ -430,7 +430,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator/(const _Tp& __x, const complex<_Tp>& __y)
     {
       complex<_Tp> __r = __x;
@@ -441,30 +441,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   ///  Return @a x.
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator+(const complex<_Tp>& __x)
     { return __x; }
 
   ///  Return complex negation of @a x.
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline complex<_Tp>
+    inline complex<_Tp>
     operator-(const complex<_Tp>& __x)
     {  return complex<_Tp>(-__x.real(), -__x.imag()); }
 
   //@{
   ///  Return true if @a x is equal to @a y.
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline bool
+    inline _GLIBCXX_CONSTEXPR bool
     operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
     { return __x.real() == __y.real() && __x.imag() == __y.imag(); }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline bool
+    inline _GLIBCXX_CONSTEXPR bool
     operator==(const complex<_Tp>& __x, const _Tp& __y)
     { return __x.real() == __y && __x.imag() == _Tp(); }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline bool
+    inline _GLIBCXX_CONSTEXPR bool
     operator==(const _Tp& __x, const complex<_Tp>& __y)
     { return __x == __y.real() && _Tp() == __y.imag(); }
   //@}
@@ -472,17 +472,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   //@{
   ///  Return false if @a x is equal to @a y.
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline bool
+    inline _GLIBCXX_CONSTEXPR bool
     operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
     { return __x.real() != __y.real() || __x.imag() != __y.imag(); }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline bool
+    inline _GLIBCXX_CONSTEXPR bool
     operator!=(const complex<_Tp>& __x, const _Tp& __y)
     { return __x.real() != __y || __x.imag() != _Tp(); }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline bool
+    inline _GLIBCXX_CONSTEXPR bool
     operator!=(const _Tp& __x, const complex<_Tp>& __y)
     { return __x != __y.real() || _Tp() != __y.imag(); }
   //@}
@@ -658,7 +658,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct _Norm_helper
     {
       template<typename _Tp>
-        static _GLIBCXX_CONSTEXPR inline _Tp _S_do_it(const complex<_Tp>& __z)
+        static inline _Tp _S_do_it(const complex<_Tp>& __z)
         {
           const _Tp __x = __z.real();
           const _Tp __y = __z.imag();
@@ -670,7 +670,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct _Norm_helper<true>
     {
       template<typename _Tp>
-        static _GLIBCXX_CONSTEXPR inline _Tp _S_do_it(const complex<_Tp>& __z)
+        static inline _Tp _S_do_it(const complex<_Tp>& __z)
         {
           _Tp __res = std::abs(__z);
           return __res * __res;
@@ -678,7 +678,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline _Tp
+    inline _Tp
     norm(const complex<_Tp>& __z)
     {
       return _Norm_helper<__is_floating<_Tp>::__value
@@ -1866,7 +1866,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { return _Tp(); }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline typename __gnu_cxx::__promote<_Tp>::__type
+    inline typename __gnu_cxx::__promote<_Tp>::__type
     norm(_Tp __x)
     {
       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
@@ -1905,11 +1905,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   // Forward declarations.
   // DR 781.
-  template<typename _Tp>
-    _GLIBCXX_CONSTEXPR std::complex<_Tp> proj(const std::complex<_Tp>&);
+  template<typename _Tp> std::complex<_Tp> proj(const std::complex<_Tp>&);
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR std::complex<_Tp>
+    std::complex<_Tp>
     __complex_proj(const std::complex<_Tp>& __z)
     {
       const _Tp __den = (__z.real() * __z.real()
@@ -1920,25 +1919,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
 #if _GLIBCXX_USE_C99_COMPLEX
-  _GLIBCXX_CONSTEXPR inline __complex__ float
+  inline __complex__ float
   __complex_proj(__complex__ float __z)
   { return __builtin_cprojf(__z); }
 
-  _GLIBCXX_CONSTEXPR inline __complex__ double
+  inline __complex__ double
   __complex_proj(__complex__ double __z)
   { return __builtin_cproj(__z); }
 
-  _GLIBCXX_CONSTEXPR inline __complex__ long double
+  inline __complex__ long double
   __complex_proj(const __complex__ long double& __z)
   { return __builtin_cprojl(__z); }
 
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline std::complex<_Tp>
+    inline std::complex<_Tp>
     proj(const std::complex<_Tp>& __z)
     { return __complex_proj(__z.__rep()); }
 #else
   template<typename _Tp>
-    _GLIBCXX_CONSTEXPR inline std::complex<_Tp>
+    inline std::complex<_Tp>
     proj(const std::complex<_Tp>& __z)
     { return __complex_proj(__z); }
 #endif
index 1ae88a3c95228fd878112c2b7f64bb4cd4bf00ef..26c66cabe29e13bd0c8275a3402963c193a4cfad 100644 (file)
@@ -353,47 +353,21 @@ namespace tr1
      *   @param  __x   The argument of the Bessel functions.
      *   @param  __Jnu  The output Bessel function of the first kind.
      *   @param  __Nnu  The output Neumann function (Bessel function of the second kind).
-     *
-     *  Adapted for libstdc++ from GNU GSL version 2.4 specfunc/bessel_j.c
-     *  Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003 Gerard Jungman
      */
     template <typename _Tp>
     void
     __cyl_bessel_jn_asymp(_Tp __nu, _Tp __x, _Tp & __Jnu, _Tp & __Nnu)
     {
       const _Tp __mu   = _Tp(4) * __nu * __nu;
-      const _Tp __8x = _Tp(8) * __x;
-
-      _Tp __P = _Tp(0);
-      _Tp __Q = _Tp(0);
-
-      _Tp k = _Tp(0);
-      _Tp __term = _Tp(1);
-
-      int __epsP = 0;
-      int __epsQ = 0;
-
-      _Tp __eps = std::numeric_limits<_Tp>::epsilon();
-
-      do
-        {
-          __term *= (k == 0) ? _Tp(1) : -(__mu - (2 * k - 1) * (2 * k - 1)) / (k * __8x);
-          __epsP = std::abs(__term) < std::abs(__eps * __P);
-          __P += __term;
-
-          k++;
-
-          __term *= (__mu - (2 * k - 1) * (2 * k - 1)) / (k * __8x);
-          __epsQ = std::abs(__term) < std::abs(__eps * __Q);
-          __Q += __term;
-
-          if (__epsP && __epsQ && k > __nu / 2.)
-            break;
-
-          k++;
-        }
-      while (k < 1000);
-
+      const _Tp __mum1 = __mu - _Tp(1);
+      const _Tp __mum9 = __mu - _Tp(9);
+      const _Tp __mum25 = __mu - _Tp(25);
+      const _Tp __mum49 = __mu - _Tp(49);
+      const _Tp __xx = _Tp(64) * __x * __x;
+      const _Tp __P = _Tp(1) - __mum1 * __mum9 / (_Tp(2) * __xx)
+                    * (_Tp(1) - __mum25 * __mum49 / (_Tp(12) * __xx));
+      const _Tp __Q = __mum1 / (_Tp(8) * __x)
+                    * (_Tp(1) - __mum9 * __mum25 / (_Tp(6) * __xx));
 
       const _Tp __chi = __x - (__nu + _Tp(0.5L))
                             * __numeric_constants<_Tp>::__pi_2();
index 74c08d021dc86aab89d7a17ba2e5811bee32b2e9..475c6dcaa4a777b008ba0006846784f21aec9d1a 100644 (file)
@@ -698,26 +698,6 @@ data026[21] =
 };
 const double toler026 = 1.0000000000000006e-11;
 
-// Test data for nu=100.00000000000000.
-// max(|f - f_GSL|): 2.5857788132910287e-14
-// max(|f - f_GSL| / |f_GSL|): 1.6767662425535933e-11
-const testcase_cyl_bessel_j<double>
-data027[11] =
-{
-  { 0.0116761350077845, 100.0000000000000000, 1000.0000000000000000, 0.0 },
-  {-0.0116998547780258, 100.0000000000000000, 1100.0000000000000000, 0.0 },
-  {-0.0228014834050837, 100.0000000000000000, 1200.0000000000000000, 0.0 },
-  {-0.0169735007873739, 100.0000000000000000, 1300.0000000000000000, 0.0 },
-  {-0.0014154528803530, 100.0000000000000000, 1400.0000000000000000, 0.0 },
-  { 0.0133337265844988, 100.0000000000000000, 1500.0000000000000000, 0.0 },
-  { 0.0198025620201474, 100.0000000000000000, 1600.0000000000000000, 0.0 },
-  { 0.0161297712798388, 100.0000000000000000, 1700.0000000000000000, 0.0 },
-  { 0.0053753369281577, 100.0000000000000000, 1800.0000000000000000, 0.0 },
-  {-0.0069238868725646, 100.0000000000000000, 1900.0000000000000000, 0.0 },
-  {-0.0154878717200738, 100.0000000000000000, 2000.0000000000000000, 0.0 },
-};
-const double toler027 = 1.0000000000000006e-10;
-
 template<typename Ret, unsigned int Num>
   void
   test(const testcase_cyl_bessel_j<Ret> (&data)[Num], Ret toler)
@@ -768,6 +748,5 @@ main()
   test(data024, toler024);
   test(data025, toler025);
   test(data026, toler026);
-  test(data027, toler027);
   return 0;
 }
index cde8cf611f9fd6afd5ca4c9b20db2842c5a8d430..da1250278d55860f025d41c1b8f110b8fccdba81 100644 (file)
@@ -742,26 +742,6 @@ data028[20] =
 };
 const double toler028 = 1.0000000000000006e-11;
 
-// Test data for nu=100.00000000000000.
-// max(|f - f_GSL|): 3.1049815496508870e-14
-// max(|f - f_GSL| / |f_GSL|): 8.4272302674970308e-12
-const testcase_cyl_neumann<double>
-data029[11] =
-{
-  {-0.0224386882577326, 100.0000000000000000, 1000.0000000000000000, 0.0 },
-  {-0.0210775951598200, 100.0000000000000000, 1100.0000000000000000, 0.0 },
-  {-0.0035299439206693, 100.0000000000000000, 1200.0000000000000000, 0.0 },
-  { 0.0142500193265366, 100.0000000000000000, 1300.0000000000000000, 0.0 },
-  { 0.0213046790897353, 100.0000000000000000, 1400.0000000000000000, 0.0 },
-  { 0.0157343950779022, 100.0000000000000000, 1500.0000000000000000, 0.0 },
-  { 0.0025544633636228, 100.0000000000000000, 1600.0000000000000000, 0.0 },
-  {-0.0107220455248494, 100.0000000000000000, 1700.0000000000000000, 0.0 },
-  {-0.0180369192432256, 100.0000000000000000, 1800.0000000000000000, 0.0 },
-  {-0.0169584155930798, 100.0000000000000000, 1900.0000000000000000, 0.0 },
-  {-0.0088788704566206, 100.0000000000000000, 2000.0000000000000000, 0.0 },
-};
-const double toler029 = 1.0000000000000006e-11;
-
 template<typename Ret, unsigned int Num>
   void
   test(const testcase_cyl_neumann<Ret> (&data)[Num], Ret toler)
@@ -814,6 +794,5 @@ main()
   test(data026, toler026);
   test(data027, toler027);
   test(data028, toler028);
-  test(data029, toler029);
   return 0;
 }
index 82141c89ee9d790d4c5ec7fa7cf0e577f00da395..06a2d192df0b1e7a67d5c36178fd1dcf852769e4 100644 (file)
@@ -698,26 +698,6 @@ data026[21] =
 };
 const double toler026 = 1.0000000000000006e-11;
 
-// Test data for nu=100.00000000000000.
-// max(|f - f_GSL|): 2.5857788132910287e-14
-// max(|f - f_GSL| / |f_GSL|): 1.6767662425535933e-11
-const testcase_cyl_bessel_j<double>
-data027[11] =
-{
-  { 0.0116761350077845, 100.0000000000000000, 1000.0000000000000000, 0.0 },
-  {-0.0116998547780258, 100.0000000000000000, 1100.0000000000000000, 0.0 },
-  {-0.0228014834050837, 100.0000000000000000, 1200.0000000000000000, 0.0 },
-  {-0.0169735007873739, 100.0000000000000000, 1300.0000000000000000, 0.0 },
-  {-0.0014154528803530, 100.0000000000000000, 1400.0000000000000000, 0.0 },
-  { 0.0133337265844988, 100.0000000000000000, 1500.0000000000000000, 0.0 },
-  { 0.0198025620201474, 100.0000000000000000, 1600.0000000000000000, 0.0 },
-  { 0.0161297712798388, 100.0000000000000000, 1700.0000000000000000, 0.0 },
-  { 0.0053753369281577, 100.0000000000000000, 1800.0000000000000000, 0.0 },
-  {-0.0069238868725646, 100.0000000000000000, 1900.0000000000000000, 0.0 },
-  {-0.0154878717200738, 100.0000000000000000, 2000.0000000000000000, 0.0 },
-};
-const double toler027 = 1.0000000000000006e-10;
-
 template<typename Ret, unsigned int Num>
   void
   test(const testcase_cyl_bessel_j<Ret> (&data)[Num], Ret toler)
@@ -768,6 +748,5 @@ main()
   test(data024, toler024);
   test(data025, toler025);
   test(data026, toler026);
-  test(data027, toler027);
   return 0;
 }
index 86678be73e1e3bb4a9886e19554baa3343081321..3c0cbe7b977093bfb4761fc1e446ad26d5e1f9f0 100644 (file)
@@ -742,26 +742,6 @@ data028[20] =
 };
 const double toler028 = 1.0000000000000006e-11;
 
-// Test data for nu=100.00000000000000.
-// max(|f - f_GSL|): 3.1049815496508870e-14
-// max(|f - f_GSL| / |f_GSL|): 8.4272302674970308e-12
-const testcase_cyl_neumann<double>
-data029[11] =
-{
-  {-0.0224386882577326, 100.0000000000000000, 1000.0000000000000000, 0.0 },
-  {-0.0210775951598200, 100.0000000000000000, 1100.0000000000000000, 0.0 },
-  {-0.0035299439206693, 100.0000000000000000, 1200.0000000000000000, 0.0 },
-  { 0.0142500193265366, 100.0000000000000000, 1300.0000000000000000, 0.0 },
-  { 0.0213046790897353, 100.0000000000000000, 1400.0000000000000000, 0.0 },
-  { 0.0157343950779022, 100.0000000000000000, 1500.0000000000000000, 0.0 },
-  { 0.0025544633636228, 100.0000000000000000, 1600.0000000000000000, 0.0 },
-  {-0.0107220455248494, 100.0000000000000000, 1700.0000000000000000, 0.0 },
-  {-0.0180369192432256, 100.0000000000000000, 1800.0000000000000000, 0.0 },
-  {-0.0169584155930798, 100.0000000000000000, 1900.0000000000000000, 0.0 },
-  {-0.0088788704566206, 100.0000000000000000, 2000.0000000000000000, 0.0 },
-};
-const double toler029 = 1.0000000000000006e-11;
-
 template<typename Ret, unsigned int Num>
   void
   test(const testcase_cyl_neumann<Ret> (&data)[Num], Ret toler)
@@ -814,6 +794,5 @@ main()
   test(data026, toler026);
   test(data027, toler027);
   test(data028, toler028);
-  test(data029, toler029);
   return 0;
 }
This page took 0.086479 seconds and 5 git commands to generate.