]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libquadmath/math/atanq.c
Update most of libquadmath/math/ from glibc, automate update (PR libquadmath/68686).
[thirdparty/gcc.git] / libquadmath / math / atanq.c
index 8eccdc3317dab7bc5b389251e4e1c5e13c1af444..051d30a7b3f78817a8d953f0bfa972f76fb23154 100644 (file)
@@ -1,15 +1,15 @@
 /*                                                     s_atanl.c
  *
- *     Inverse circular tangent for 128-bit __float128 precision
+ *     Inverse circular tangent for 128-bit long double precision
  *      (arctangent)
  *
  *
  *
  * SYNOPSIS:
  *
- * __float128 x, y, atanl();
+ * long double x, y, atanq();
  *
- * y = atanl( x );
+ * y = atanq( x );
  *
  *
  *
@@ -42,7 +42,7 @@
  *
  */
 
-/* Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov> 
+/* Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -55,9 +55,8 @@
     Lesser General Public License for more details.
 
     You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA */
-
+    License along with this library; if not, see
+    <http://www.gnu.org/licenses/>.  */
 
 #include "quadmath-imp.h"
 
@@ -167,7 +166,7 @@ static const __float128
   q4 = 2.173623741810414221251136181221172551416E1Q;
   /* q5 = 1.000000000000000000000000000000000000000E0 */
 
-static const long double huge = 1.0e4930Q;
+static const __float128 huge = 1.0e4930Q;
 
 __float128
 atanq (__float128 x)
@@ -200,6 +199,7 @@ atanq (__float128 x)
 
   if (k <= 0x3fc50000) /* |x| < 2**-58 */
     {
+      math_check_force_underflow (x);
       /* Raise inexact. */
       if (huge + x > 0.0)
        return x;
@@ -227,7 +227,7 @@ atanq (__float128 x)
       /* Index of nearest table element.
         Roundoff to integer is asymmetrical to avoid cancellation when t < 0
          (cf. fdlibm). */
-      k = 8.0Q * x + 0.25Q;
+      k = 8.0 * x + 0.25;
       u = 0.125Q * k;
       /* Small arctan argument.  */
       t = (x - u) / (1.0 + x * u);