Merge commit 'b572c3a256e7bf1e4eecc8c36448c08093240a6a' into stable
[gnulib.git] / lib / sinl.c
index eb0e05b..3949e49 100644 (file)
 /* Specification.  */
 #include <math.h>
 
+#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+
+long double
+sinl (long double x)
+{
+  return sin (x);
+}
+
+#else
+
 /* sinl(x)
  * Return sine function of x.
  *
@@ -49,9 +59,7 @@
  *      TRIG(x) returns trig(x) nearly rounded
  */
 
-#include "trigl.h"
-#include "trigl.c"
-#include "sincosl.c"
+# include "trigl.h"
 
 long double
 sinl (long double x)
@@ -64,8 +72,8 @@ sinl (long double x)
     return x;
 
   /* |x| ~< pi/4 */
-  if (x >= -0.7853981633974483096156608458198757210492 &&
-      x <= 0.7853981633974483096156608458198757210492)
+  if (x >= -0.7853981633974483096156608458198757210492
+      && x <= 0.7853981633974483096156608458198757210492)
     return kernel_sinl (x, z, 0);
 
     /* sinl(Inf) is NaN, sinl(0) is 0 */
@@ -90,17 +98,19 @@ sinl (long double x)
     }
 }
 
+#endif
+
 #if 0
 int
 main (void)
 {
-  printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492));
-  printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *29));
-  printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *2));
-  printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *30));
-  printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *4));
-  printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *32));
-  printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *2/3));
-  printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *4/3));
+  printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492));
+  printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *29));
+  printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *2));
+  printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *30));
+  printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *4));
+  printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *32));
+  printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *2/3));
+  printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *4/3));
 }
 #endif