]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/tr1/ell_integral.tcc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / include / tr1 / ell_integral.tcc
index 09bda9aa90b94f801ee9bf31404d202d3c4cd3ea..3706d8a033ad5686ad6f8cf1d77c8be617f3d2dc 100644 (file)
@@ -1,7 +1,6 @@
 // Special functions -*- C++ -*-
 
-// Copyright (C) 2006, 2007, 2008, 2009
-// Free Software Foundation, Inc.
+// Copyright (C) 2006-2020 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -25,7 +24,7 @@
 
 /** @file tr1/ell_integral.tcc
  *  This is an internal header file, included by other library headers.
- *  You should not attempt to use it directly.
+ *  Do not attempt to use it directly. @headername{tr1/cmath}
  */
 
 //
 #ifndef _GLIBCXX_TR1_ELL_INTEGRAL_TCC
 #define _GLIBCXX_TR1_ELL_INTEGRAL_TCC 1
 
-namespace std
+namespace std _GLIBCXX_VISIBILITY(default)
 {
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#if _GLIBCXX_USE_STD_SPEC_FUNCS
+#elif defined(_GLIBCXX_TR1_CMATH)
 namespace tr1
 {
-
+#else
+# error do not include this header directly, use <cmath> or <tr1/cmath>
+#endif
   // [5.2] Special functions
 
   // Implementation-space details.
   namespace __detail
   {
-
     /**
      *   @brief Return the Carlson elliptic function @f$ R_F(x,y,z) @f$
      *          of the first kind.
@@ -71,7 +75,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __ellint_rf(const _Tp __x, const _Tp __y, const _Tp __z)
+    __ellint_rf(_Tp __x, _Tp __y, _Tp __z)
     {
       const _Tp __min = std::numeric_limits<_Tp>::min();
       const _Tp __max = std::numeric_limits<_Tp>::max();
@@ -150,7 +154,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __comp_ellint_1_series(const _Tp __k)
+    __comp_ellint_1_series(_Tp __k)
     {
 
       const _Tp __kk = __k * __k;
@@ -188,7 +192,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __comp_ellint_1(const _Tp __k)
+    __comp_ellint_1(_Tp __k)
     {
 
       if (__isnan(__k))
@@ -216,7 +220,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __ellint_1(const _Tp __k, const _Tp __phi)
+    __ellint_1(_Tp __k, _Tp __phi)
     {
 
       if (__isnan(__k) || __isnan(__phi))
@@ -263,7 +267,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __comp_ellint_2_series(const _Tp __k)
+    __comp_ellint_2_series(_Tp __k)
     {
 
       const _Tp __kk = __k * __k;
@@ -311,7 +315,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __ellint_rd(const _Tp __x, const _Tp __y, const _Tp __z)
+    __ellint_rd(_Tp __x, _Tp __y, _Tp __z)
     {
       const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
       const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6));
@@ -366,18 +370,17 @@ namespace tr1
               __zn = __c0 * (__zn + __lambda);
             }
 
-         // Note: __ea is an SPU badname.
-          _Tp __eaa = __xndev * __yndev;
+          _Tp __ea = __xndev * __yndev;
           _Tp __eb = __zndev * __zndev;
-          _Tp __ec = __eaa - __eb;
-          _Tp __ed = __eaa - _Tp(6) * __eb;
+          _Tp __ec = __ea - __eb;
+          _Tp __ed = __ea - _Tp(6) * __eb;
           _Tp __ef = __ed + __ec + __ec;
           _Tp __s1 = __ed * (-__c1 + __c3 * __ed
                                    / _Tp(3) - _Tp(3) * __c4 * __zndev * __ef
                                    / _Tp(2));
           _Tp __s2 = __zndev
                    * (__c2 * __ef
-                    + __zndev * (-__c3 * __ec - __zndev * __c4 - __eaa));
+                    + __zndev * (-__c3 * __ec - __zndev * __c4 - __ea));
 
           return _Tp(3) * __sigma + __power4 * (_Tp(1) + __s1 + __s2)
                                         / (__mu * std::sqrt(__mu));
@@ -399,7 +402,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __comp_ellint_2(const _Tp __k)
+    __comp_ellint_2(_Tp __k)
     {
 
       if (__isnan(__k))
@@ -433,7 +436,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __ellint_2(const _Tp __k, const _Tp __phi)
+    __ellint_2(_Tp __k, _Tp __phi)
     {
 
       if (__isnan(__k) || __isnan(__phi))
@@ -492,7 +495,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __ellint_rc(const _Tp __x, const _Tp __y)
+    __ellint_rc(_Tp __x, _Tp __y)
     {
       const _Tp __min = std::numeric_limits<_Tp>::min();
       const _Tp __max = std::numeric_limits<_Tp>::max();
@@ -563,7 +566,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __ellint_rj(const _Tp __x, const _Tp __y, const _Tp __z, const _Tp __p)
+    __ellint_rj(_Tp __x, _Tp __y, _Tp __z, _Tp __p)
     {
       const _Tp __min = std::numeric_limits<_Tp>::min();
       const _Tp __max = std::numeric_limits<_Tp>::max();
@@ -630,17 +633,16 @@ namespace tr1
               __pn = __c0 * (__pn + __lambda);
             }
 
-         // Note: __ea is an SPU badname.
-          _Tp __eaa = __xndev * (__yndev + __zndev) + __yndev * __zndev;
+          _Tp __ea = __xndev * (__yndev + __zndev) + __yndev * __zndev;
           _Tp __eb = __xndev * __yndev * __zndev;
           _Tp __ec = __pndev * __pndev;
-          _Tp __e2 = __eaa - _Tp(3) * __ec;
-          _Tp __e3 = __eb + _Tp(2) * __pndev * (__eaa - __ec);
+          _Tp __e2 = __ea - _Tp(3) * __ec;
+          _Tp __e3 = __eb + _Tp(2) * __pndev * (__ea - __ec);
           _Tp __s1 = _Tp(1) + __e2 * (-__c1 + _Tp(3) * __c3 * __e2 / _Tp(4)
                             - _Tp(3) * __c4 * __e3 / _Tp(2));
           _Tp __s2 = __eb * (__c2 / _Tp(2)
                    + __pndev * (-__c3 - __c3 + __pndev * __c4));
-          _Tp __s3 = __pndev * __eaa * (__c2 - __pndev * __c3)
+          _Tp __s3 = __pndev * __ea * (__c2 - __pndev * __c3)
                    - __c2 * __pndev * __ec;
 
           return _Tp(3) * __sigma + __power4 * (__s1 + __s2 + __s3)
@@ -667,7 +669,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __comp_ellint_3(const _Tp __k, const _Tp __nu)
+    __comp_ellint_3(_Tp __k, _Tp __nu)
     {
 
       if (__isnan(__k) || __isnan(__nu))
@@ -681,8 +683,8 @@ namespace tr1
           const _Tp __kk = __k * __k;
 
           return __ellint_rf(_Tp(0), _Tp(1) - __kk, _Tp(1))
-               - __nu
-               * __ellint_rj(_Tp(0), _Tp(1) - __kk, _Tp(1), _Tp(1) + __nu)
+               + __nu
+               * __ellint_rj(_Tp(0), _Tp(1) - __kk, _Tp(1), _Tp(1) - __nu)
                / _Tp(3);
         }
     }
@@ -707,7 +709,7 @@ namespace tr1
      */
     template<typename _Tp>
     _Tp
-    __ellint_3(const _Tp __k, const _Tp __nu, const _Tp __phi)
+    __ellint_3(_Tp __k, _Tp __nu, _Tp __phi)
     {
 
       if (__isnan(__k) || __isnan(__nu) || __isnan(__phi))
@@ -731,9 +733,9 @@ namespace tr1
 
           const _Tp __Pi = __s
                          * __ellint_rf(__cc, _Tp(1) - __kk * __ss, _Tp(1))
-                         - __nu * __sss
+                         + __nu * __sss
                          * __ellint_rj(__cc, _Tp(1) - __kk * __ss, _Tp(1),
-                                       _Tp(1) + __nu * __ss) / _Tp(3);
+                                       _Tp(1) - __nu * __ss) / _Tp(3);
 
           if (__n == 0)
             return __Pi;
@@ -741,9 +743,12 @@ namespace tr1
             return __Pi + _Tp(2) * __n * __comp_ellint_3(__k, __nu);
         }
     }
+  } // namespace __detail
+#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
+} // namespace tr1
+#endif
 
-  } // namespace std::tr1::__detail
-}
+_GLIBCXX_END_NAMESPACE_VERSION
 }
 
 #endif // _GLIBCXX_TR1_ELL_INTEGRAL_TCC