Remove DOS line endings.


git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@618 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-crt/math/acosf.c b/mingw-w64-crt/math/acosf.c
index ec6825d..12500c8 100644
--- a/mingw-w64-crt/math/acosf.c
+++ b/mingw-w64-crt/math/acosf.c
@@ -1,28 +1,28 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written by J.T. Conklin <jtc@netbsd.org>.

- * Public domain.

- */

-

-#include <math.h>

-

-float

-acosf (float x)

-{

-  float res;

-

-  /* acosl = atanl (sqrtl(1 - x^2) / x) */

-  asm (	"fld	%%st\n\t"

-	"fmul	%%st(0)\n\t"		/* x^2 */

-	"fld1\n\t"

-	"fsubp\n\t"			/* 1 - x^2 */

-	"fsqrt\n\t"			/* sqrtl (1 - x^2) */

-	"fxch	%%st(1)\n\t"

-	"fpatan"

-	: "=t" (res) : "0" (x) : "st(1)");

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <math.h>
+
+float
+acosf (float x)
+{
+  float res;
+
+  /* acosl = atanl (sqrtl(1 - x^2) / x) */
+  asm (	"fld	%%st\n\t"
+	"fmul	%%st(0)\n\t"		/* x^2 */
+	"fld1\n\t"
+	"fsubp\n\t"			/* 1 - x^2 */
+	"fsqrt\n\t"			/* sqrtl (1 - x^2) */
+	"fxch	%%st(1)\n\t"
+	"fpatan"
+	: "=t" (res) : "0" (x) : "st(1)");
+  return res;
+}
diff --git a/mingw-w64-crt/math/acosh.c b/mingw-w64-crt/math/acosh.c
index a880ca5..270b2a4 100644
--- a/mingw-w64-crt/math/acosh.c
+++ b/mingw-w64-crt/math/acosh.c
@@ -1,31 +1,31 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-#include "fastmath.h"

-

-/* acosh(x) = log (x + sqrt(x * x - 1)) */

-double acosh (double x)

-{

-  if (isnan (x)) 

-    return x;

-

-  if (x < 1.0)

-    {

-      errno = EDOM;

-      return nan("");

-    }

-

-  if (x > 0x1p32)

-    /*  Avoid overflow (and unnecessary calculation when

-        sqrt (x * x - 1) == x). GCC optimizes by replacing

-        the long double M_LN2 const with a fldln2 insn.  */ 

-    return __fast_log (x) + 6.9314718055994530941723E-1L;

-

-  /* Since  x >= 1, the arg to log will always be greater than

-     the fyl2xp1 limit (approx 0.29) so just use logl. */ 

-  return __fast_log (x + __fast_sqrt((x + 1.0) * (x - 1.0)));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+#include "fastmath.h"
+
+/* acosh(x) = log (x + sqrt(x * x - 1)) */
+double acosh (double x)
+{
+  if (isnan (x)) 
+    return x;
+
+  if (x < 1.0)
+    {
+      errno = EDOM;
+      return nan("");
+    }
+
+  if (x > 0x1p32)
+    /*  Avoid overflow (and unnecessary calculation when
+        sqrt (x * x - 1) == x). GCC optimizes by replacing
+        the long double M_LN2 const with a fldln2 insn.  */ 
+    return __fast_log (x) + 6.9314718055994530941723E-1L;
+
+  /* Since  x >= 1, the arg to log will always be greater than
+     the fyl2xp1 limit (approx 0.29) so just use logl. */ 
+  return __fast_log (x + __fast_sqrt((x + 1.0) * (x - 1.0)));
+}
diff --git a/mingw-w64-crt/math/acoshf.c b/mingw-w64-crt/math/acoshf.c
index 255c520..34a6ced 100644
--- a/mingw-w64-crt/math/acoshf.c
+++ b/mingw-w64-crt/math/acoshf.c
@@ -1,30 +1,30 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-#include "fastmath.h"

-

-/* acosh(x) = log (x + sqrt(x * x - 1)) */

-float acoshf (float x)

-{

-  if (isnan (x)) 

-    return x;

-  if (x < 1.0f)

-    {

-      errno = EDOM;

-      return nan("");

-    }

-

- if (x > 0x1p32f)

-    /*  Avoid overflow (and unnecessary calculation when

-        sqrt (x * x - 1) == x). GCC optimizes by replacing

-        the long double M_LN2 const with a fldln2 insn.  */ 

-    return __fast_log (x) + 6.9314718055994530941723E-1L;

-

-  /* Since  x >= 1, the arg to log will always be greater than

-     the fyl2xp1 limit (approx 0.29) so just use logl. */ 

-  return __fast_log (x + __fast_sqrt((x + 1.0) * (x - 1.0)));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+#include "fastmath.h"
+
+/* acosh(x) = log (x + sqrt(x * x - 1)) */
+float acoshf (float x)
+{
+  if (isnan (x)) 
+    return x;
+  if (x < 1.0f)
+    {
+      errno = EDOM;
+      return nan("");
+    }
+
+ if (x > 0x1p32f)
+    /*  Avoid overflow (and unnecessary calculation when
+        sqrt (x * x - 1) == x). GCC optimizes by replacing
+        the long double M_LN2 const with a fldln2 insn.  */ 
+    return __fast_log (x) + 6.9314718055994530941723E-1L;
+
+  /* Since  x >= 1, the arg to log will always be greater than
+     the fyl2xp1 limit (approx 0.29) so just use logl. */ 
+  return __fast_log (x + __fast_sqrt((x + 1.0) * (x - 1.0)));
+}
diff --git a/mingw-w64-crt/math/acoshl.c b/mingw-w64-crt/math/acoshl.c
index af9f08a..ec51d3c 100644
--- a/mingw-w64-crt/math/acoshl.c
+++ b/mingw-w64-crt/math/acoshl.c
@@ -1,32 +1,32 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-#include "fastmath.h"

-

-/* acosh(x) = log (x + sqrt(x * x - 1)) */

-long double acoshl (long double x)

-{

-  if (isnan (x)) 

-    return x;

-

-  if (x < 1.0L)

-    {

-      errno = EDOM;

-      return nanl("");

-    }

-  if (x > 0x1p32L)

-    /* Avoid overflow (and unnecessary calculation when

-       sqrt (x * x - 1) == x).

-       The M_LN2 define doesn't have enough precison for

-       long double so use this one. GCC optimizes by replacing

-       the const with a fldln2 insn. */

-    return __fast_logl (x) + 6.9314718055994530941723E-1L;

-

-   /* Since  x >= 1, the arg to log will always be greater than

-      the fyl2xp1 limit (approx 0.29) so just use logl. */ 

-   return __fast_logl (x + __fast_sqrtl((x + 1.0L) * (x - 1.0L)));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+#include "fastmath.h"
+
+/* acosh(x) = log (x + sqrt(x * x - 1)) */
+long double acoshl (long double x)
+{
+  if (isnan (x)) 
+    return x;
+
+  if (x < 1.0L)
+    {
+      errno = EDOM;
+      return nanl("");
+    }
+  if (x > 0x1p32L)
+    /* Avoid overflow (and unnecessary calculation when
+       sqrt (x * x - 1) == x).
+       The M_LN2 define doesn't have enough precison for
+       long double so use this one. GCC optimizes by replacing
+       the const with a fldln2 insn. */
+    return __fast_logl (x) + 6.9314718055994530941723E-1L;
+
+   /* Since  x >= 1, the arg to log will always be greater than
+      the fyl2xp1 limit (approx 0.29) so just use logl. */ 
+   return __fast_logl (x + __fast_sqrtl((x + 1.0L) * (x - 1.0L)));
+}
diff --git a/mingw-w64-crt/math/acosl.c b/mingw-w64-crt/math/acosl.c
index 047e192..3f4ff9e 100644
--- a/mingw-w64-crt/math/acosl.c
+++ b/mingw-w64-crt/math/acosl.c
@@ -1,20 +1,20 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-long double acosl (long double x)

-{

-  long double res;

-

-  /* acosl = atanl (sqrtl(1 - x^2) / x) */

-  asm (	"fld	%%st\n\t"

-	"fmul	%%st(0)\n\t"		/* x^2 */

-	"fld1\n\t"

-	"fsubp\n\t"			/* 1 - x^2 */

-	"fsqrt\n\t"			/* sqrtl (1 - x^2) */

-	"fxch	%%st(1)\n\t"

-	"fpatan"

-	: "=t" (res) : "0" (x) : "st(1)");

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+long double acosl (long double x)
+{
+  long double res;
+
+  /* acosl = atanl (sqrtl(1 - x^2) / x) */
+  asm (	"fld	%%st\n\t"
+	"fmul	%%st(0)\n\t"		/* x^2 */
+	"fld1\n\t"
+	"fsubp\n\t"			/* 1 - x^2 */
+	"fsqrt\n\t"			/* sqrtl (1 - x^2) */
+	"fxch	%%st(1)\n\t"
+	"fpatan"
+	: "=t" (res) : "0" (x) : "st(1)");
+  return res;
+}
diff --git a/mingw-w64-crt/math/asinf.c b/mingw-w64-crt/math/asinf.c
index 673206b..3346f84 100644
--- a/mingw-w64-crt/math/asinf.c
+++ b/mingw-w64-crt/math/asinf.c
@@ -1,25 +1,25 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written by J.T. Conklin <jtc@netbsd.org>.

- * Public domain.

- */

-

-/* asin = atan (x / sqrt(1 - x^2)) */

-

-float asinf (float x)

-{

-  float res;

-

-  asm (	"fld	%%st\n\t"

-	"fmul	%%st(0)\n\t"			/* x^2 */

-	"fld1\n\t"

-	"fsubp\n\t"				/* 1 - x^2 */

-	"fsqrt\n\t"				/* sqrt (1 - x^2) */

-	"fpatan"

-	: "=t" (res) : "0" (x) : "st(1)");

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+/* asin = atan (x / sqrt(1 - x^2)) */
+
+float asinf (float x)
+{
+  float res;
+
+  asm (	"fld	%%st\n\t"
+	"fmul	%%st(0)\n\t"			/* x^2 */
+	"fld1\n\t"
+	"fsubp\n\t"				/* 1 - x^2 */
+	"fsqrt\n\t"				/* sqrt (1 - x^2) */
+	"fpatan"
+	: "=t" (res) : "0" (x) : "st(1)");
+  return res;
+}
diff --git a/mingw-w64-crt/math/asinh.c b/mingw-w64-crt/math/asinh.c
index 71adb9c..29e4d0b 100644
--- a/mingw-w64-crt/math/asinh.c
+++ b/mingw-w64-crt/math/asinh.c
@@ -1,33 +1,33 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-#include "fastmath.h"

-

- /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */

-double asinh(double x)

-{

-  double z;

-  if (!isfinite (x))

-    return x;

-  z = fabs (x);

-

-  /* Avoid setting FPU underflow exception flag in x * x. */

-#if 0

-  if ( z < 0x1p-32)

-    return x;

-#endif

-

-  /* Use log1p to avoid cancellation with small x. Put

-     x * x in denom, so overflow is harmless. 

-     asinh(x) = log1p (x + sqrt (x * x + 1.0) - 1.0)

-              = log1p (x + x * x / (sqrt (x * x + 1.0) + 1.0))  */

-

-  z = __fast_log1p (z + z * z / (__fast_sqrt (z * z + 1.0) + 1.0));

-

-  return ( x > 0.0 ? z : -z);

-}

-

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+#include "fastmath.h"
+
+ /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */
+double asinh(double x)
+{
+  double z;
+  if (!isfinite (x))
+    return x;
+  z = fabs (x);
+
+  /* Avoid setting FPU underflow exception flag in x * x. */
+#if 0
+  if ( z < 0x1p-32)
+    return x;
+#endif
+
+  /* Use log1p to avoid cancellation with small x. Put
+     x * x in denom, so overflow is harmless. 
+     asinh(x) = log1p (x + sqrt (x * x + 1.0) - 1.0)
+              = log1p (x + x * x / (sqrt (x * x + 1.0) + 1.0))  */
+
+  z = __fast_log1p (z + z * z / (__fast_sqrt (z * z + 1.0) + 1.0));
+
+  return ( x > 0.0 ? z : -z);
+}
+
diff --git a/mingw-w64-crt/math/asinhf.c b/mingw-w64-crt/math/asinhf.c
index b49742c..9aa30c5 100644
--- a/mingw-w64-crt/math/asinhf.c
+++ b/mingw-w64-crt/math/asinhf.c
@@ -1,33 +1,33 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-#include "fastmath.h"

-

- /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */

-float asinhf(float x)

-{

-  float z;

-  if (!isfinite (x))

-    return x;

-  z = fabsf (x);

-

-  /* Avoid setting FPU underflow exception flag in x * x. */

-#if 0

-  if ( z < 0x1p-32)

-    return x;

-#endif

-

-

-  /* Use log1p to avoid cancellation with small x. Put

-     x * x in denom, so overflow is harmless. 

-     asinh(x) = log1p (x + sqrt (x * x + 1.0) - 1.0)

-              = log1p (x + x * x / (sqrt (x * x + 1.0) + 1.0))  */

-

-  z = __fast_log1p (z + z * z / (__fast_sqrt (z * z + 1.0) + 1.0));

-

-  return ( x > 0.0 ? z : -z);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+#include "fastmath.h"
+
+ /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */
+float asinhf(float x)
+{
+  float z;
+  if (!isfinite (x))
+    return x;
+  z = fabsf (x);
+
+  /* Avoid setting FPU underflow exception flag in x * x. */
+#if 0
+  if ( z < 0x1p-32)
+    return x;
+#endif
+
+
+  /* Use log1p to avoid cancellation with small x. Put
+     x * x in denom, so overflow is harmless. 
+     asinh(x) = log1p (x + sqrt (x * x + 1.0) - 1.0)
+              = log1p (x + x * x / (sqrt (x * x + 1.0) + 1.0))  */
+
+  z = __fast_log1p (z + z * z / (__fast_sqrt (z * z + 1.0) + 1.0));
+
+  return ( x > 0.0 ? z : -z);
+}
diff --git a/mingw-w64-crt/math/asinhl.c b/mingw-w64-crt/math/asinhl.c
index 6e33133..ce5772c 100644
--- a/mingw-w64-crt/math/asinhl.c
+++ b/mingw-w64-crt/math/asinhl.c
@@ -1,33 +1,33 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-#include "fastmath.h"

-

- /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */

-long double asinhl(long double x)

-{

-  long double z;

-  if (!isfinite (x))

-    return x;

-

-  z = fabsl (x);

-

-  /* Avoid setting FPU underflow exception flag in x * x. */

-#if 0

-  if ( z < 0x1p-32)

-    return x;

-#endif

-

-  /* Use log1p to avoid cancellation with small x. Put

-     x * x in denom, so overflow is harmless. 

-     asinh(x) = log1p (x + sqrt (x * x + 1.0) - 1.0)

-              = log1p (x + x * x / (sqrt (x * x + 1.0) + 1.0))  */

-

-  z = __fast_log1pl (z + z * z / (__fast_sqrtl (z * z + 1.0L) + 1.0L));

-

-  return ( x > 0.0 ? z : -z);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+#include "fastmath.h"
+
+ /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */
+long double asinhl(long double x)
+{
+  long double z;
+  if (!isfinite (x))
+    return x;
+
+  z = fabsl (x);
+
+  /* Avoid setting FPU underflow exception flag in x * x. */
+#if 0
+  if ( z < 0x1p-32)
+    return x;
+#endif
+
+  /* Use log1p to avoid cancellation with small x. Put
+     x * x in denom, so overflow is harmless. 
+     asinh(x) = log1p (x + sqrt (x * x + 1.0) - 1.0)
+              = log1p (x + x * x / (sqrt (x * x + 1.0) + 1.0))  */
+
+  z = __fast_log1pl (z + z * z / (__fast_sqrtl (z * z + 1.0L) + 1.0L));
+
+  return ( x > 0.0 ? z : -z);
+}
diff --git a/mingw-w64-crt/math/asinl.c b/mingw-w64-crt/math/asinl.c
index 5850fbf..b0afb66 100644
--- a/mingw-w64-crt/math/asinl.c
+++ b/mingw-w64-crt/math/asinl.c
@@ -1,26 +1,26 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written by J.T. Conklin <jtc@netbsd.org>.

- * Public domain.

- * Adapted for long double type by Danny Smith <dannysmith@users.sourceforge.net>.

- */

-

-/* asin = atan (x / sqrt(1 - x^2)) */

-

-long double asinl (long double x)

-{

-  long double res;

-

-  asm (	"fld	%%st\n\t"

-	"fmul	%%st(0)\n\t"			/* x^2 */

-	"fld1\n\t"

-	"fsubp\n\t"				/* 1 - x^2 */

-	"fsqrt\n\t"				/* sqrt (1 - x^2) */

-	"fpatan"

-	: "=t" (res) : "0" (x) : "st(1)");

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for long double type by Danny Smith <dannysmith@users.sourceforge.net>.
+ */
+
+/* asin = atan (x / sqrt(1 - x^2)) */
+
+long double asinl (long double x)
+{
+  long double res;
+
+  asm (	"fld	%%st\n\t"
+	"fmul	%%st(0)\n\t"			/* x^2 */
+	"fld1\n\t"
+	"fsubp\n\t"				/* 1 - x^2 */
+	"fsqrt\n\t"				/* sqrt (1 - x^2) */
+	"fpatan"
+	: "=t" (res) : "0" (x) : "st(1)");
+  return res;
+}
diff --git a/mingw-w64-crt/math/atan2f.c b/mingw-w64-crt/math/atan2f.c
index ef378ee..8ecc18c 100644
--- a/mingw-w64-crt/math/atan2f.c
+++ b/mingw-w64-crt/math/atan2f.c
@@ -1,20 +1,20 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written by J.T. Conklin <jtc@netbsd.org>.

- * Public domain.

- *

- */

-

-#include <math.h>

-

-float

-atan2f (float y, float x)

-{

-  float res;

-  asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)");

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ *
+ */
+
+#include <math.h>
+
+float
+atan2f (float y, float x)
+{
+  float res;
+  asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)");
+  return res;
+}
diff --git a/mingw-w64-crt/math/atan2l.c b/mingw-w64-crt/math/atan2l.c
index 71324fa..b03039c 100644
--- a/mingw-w64-crt/math/atan2l.c
+++ b/mingw-w64-crt/math/atan2l.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-long double

-atan2l (long double y, long double x)

-{

-  long double res;

-  asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)");

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+long double
+atan2l (long double y, long double x)
+{
+  long double res;
+  asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)");
+  return res;
+}
diff --git a/mingw-w64-crt/math/atanf.c b/mingw-w64-crt/math/atanf.c
index eca3e04..c466304 100644
--- a/mingw-w64-crt/math/atanf.c
+++ b/mingw-w64-crt/math/atanf.c
@@ -1,22 +1,22 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written by J.T. Conklin <jtc@netbsd.org>.

- * Public domain.

- *

- */

-

-#include <math.h>

-

-float

-atanf (float x)

-{

-  float res;

-

-  asm ("fld1\n\t"

-       "fpatan" : "=t" (res) : "0" (x));

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ *
+ */
+
+#include <math.h>
+
+float
+atanf (float x)
+{
+  float res;
+
+  asm ("fld1\n\t"
+       "fpatan" : "=t" (res) : "0" (x));
+  return res;
+}
diff --git a/mingw-w64-crt/math/atanh.c b/mingw-w64-crt/math/atanh.c
index d94f018..0b40a64 100644
--- a/mingw-w64-crt/math/atanh.c
+++ b/mingw-w64-crt/math/atanh.c
@@ -1,36 +1,36 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-#include "fastmath.h"

-

-/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */

-

-double atanh(double x)

-{

-  double z;

-  if (isnan (x))

-    return x;

-  z = fabs (x);

-  if (z == 1.0)

-    {

-      errno  = ERANGE;

-      return (x > 0 ? INFINITY : -INFINITY);

-    }

-  if (z > 1.0)

-    {

-      errno = EDOM;

-      return nan("");

-    }

-  /* Rearrange formula to avoid precision loss for small x.

-

-  atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x))

-	   = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0)

-           = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x)) 

-           = 0.5 * log1p ((2.0 * x ) / (1.0 - x))  */

-  z = 0.5 * __fast_log1p ((z + z) / (1.0 - z));

-  return x >= 0 ? z : -z;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+#include "fastmath.h"
+
+/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */
+
+double atanh(double x)
+{
+  double z;
+  if (isnan (x))
+    return x;
+  z = fabs (x);
+  if (z == 1.0)
+    {
+      errno  = ERANGE;
+      return (x > 0 ? INFINITY : -INFINITY);
+    }
+  if (z > 1.0)
+    {
+      errno = EDOM;
+      return nan("");
+    }
+  /* Rearrange formula to avoid precision loss for small x.
+
+  atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x))
+	   = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0)
+           = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x)) 
+           = 0.5 * log1p ((2.0 * x ) / (1.0 - x))  */
+  z = 0.5 * __fast_log1p ((z + z) / (1.0 - z));
+  return x >= 0 ? z : -z;
+}
diff --git a/mingw-w64-crt/math/atanhf.c b/mingw-w64-crt/math/atanhf.c
index 79678c2..5ef70ba 100644
--- a/mingw-w64-crt/math/atanhf.c
+++ b/mingw-w64-crt/math/atanhf.c
@@ -1,35 +1,35 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-#include "fastmath.h"

-

-/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */

-float atanhf (float x)

-{

-  float z;

-  if (isnan (x))

-    return x;

-  z = fabsf (x);

-  if (z == 1.0)

-    {

-      errno  = ERANGE;

-      return (x > 0 ? INFINITY : -INFINITY);

-    }

-  if ( z > 1.0)

-    {

-      errno = EDOM;

-      return nanf("");

-    }

-  /* Rearrange formula to avoid precision loss for small x.

-

-  atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x))

-	   = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0)

-           = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x)) 

-           = 0.5 * log1p ((2.0 * x ) / (1.0 - x))  */

-  z = 0.5 * __fast_log1p ((z + z) / (1.0 - z));

-  return x >= 0 ? z : -z;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+#include "fastmath.h"
+
+/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */
+float atanhf (float x)
+{
+  float z;
+  if (isnan (x))
+    return x;
+  z = fabsf (x);
+  if (z == 1.0)
+    {
+      errno  = ERANGE;
+      return (x > 0 ? INFINITY : -INFINITY);
+    }
+  if ( z > 1.0)
+    {
+      errno = EDOM;
+      return nanf("");
+    }
+  /* Rearrange formula to avoid precision loss for small x.
+
+  atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x))
+	   = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0)
+           = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x)) 
+           = 0.5 * log1p ((2.0 * x ) / (1.0 - x))  */
+  z = 0.5 * __fast_log1p ((z + z) / (1.0 - z));
+  return x >= 0 ? z : -z;
+}
diff --git a/mingw-w64-crt/math/atanhl.c b/mingw-w64-crt/math/atanhl.c
index ebc2372..4636e88 100644
--- a/mingw-w64-crt/math/atanhl.c
+++ b/mingw-w64-crt/math/atanhl.c
@@ -1,34 +1,34 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-#include "fastmath.h"

-

-/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */

-long double atanhl (long double x)

-{

-  long double z;

-  if (isnan (x))

-    return x;

-  z = fabsl (x);

-  if (z == 1.0L)

-    {

-      errno  = ERANGE;

-      return (x > 0 ? INFINITY : -INFINITY);

-    }

-  if ( z > 1.0L)

-    {

-      errno = EDOM;

-      return nanl("");

-    }

-  /* Rearrange formula to avoid precision loss for small x.

-  atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x))

- 	   = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0)

-           = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x)) 

-           = 0.5 * log1p ((2.0 * x ) / (1.0 - x))  */

-  z = 0.5L * __fast_log1pl ((z + z) / (1.0L - z));

-  return x >= 0 ? z : -z;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+#include "fastmath.h"
+
+/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */
+long double atanhl (long double x)
+{
+  long double z;
+  if (isnan (x))
+    return x;
+  z = fabsl (x);
+  if (z == 1.0L)
+    {
+      errno  = ERANGE;
+      return (x > 0 ? INFINITY : -INFINITY);
+    }
+  if ( z > 1.0L)
+    {
+      errno = EDOM;
+      return nanl("");
+    }
+  /* Rearrange formula to avoid precision loss for small x.
+  atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x))
+ 	   = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0)
+           = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x)) 
+           = 0.5 * log1p ((2.0 * x ) / (1.0 - x))  */
+  z = 0.5L * __fast_log1pl ((z + z) / (1.0L - z));
+  return x >= 0 ? z : -z;
+}
diff --git a/mingw-w64-crt/math/atanl.c b/mingw-w64-crt/math/atanl.c
index 340691e..3b0243c 100644
--- a/mingw-w64-crt/math/atanl.c
+++ b/mingw-w64-crt/math/atanl.c
@@ -1,15 +1,15 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-long double

-atanl (long double x)

-{

-  long double res;

-

-  asm ("fld1\n\t"

-       "fpatan"

-       : "=t" (res) : "0" (x));

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+long double
+atanl (long double x)
+{
+  long double res;
+
+  asm ("fld1\n\t"
+       "fpatan"
+       : "=t" (res) : "0" (x));
+  return res;
+}
diff --git a/mingw-w64-crt/math/cbrt.c b/mingw-w64-crt/math/cbrt.c
index d9565b3..290bf62 100644
--- a/mingw-w64-crt/math/cbrt.c
+++ b/mingw-w64-crt/math/cbrt.c
@@ -1,115 +1,115 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include "cephes_mconf.h"

-

-static const double CBRT2  = 1.2599210498948731647672;

-static const double CBRT4  = 1.5874010519681994747517;

-static const double CBRT2I = 0.79370052598409973737585;

-static const double CBRT4I = 0.62996052494743658238361;

-

-#ifndef __MINGW32__

-#ifdef ANSIPROT

-extern double frexp ( double, int * );

-extern double ldexp ( double, int );

-extern int isnan ( double );

-extern int isfinite ( double );

-#else

-double frexp(), ldexp();

-int isnan(), isfinite();

-#endif

-#endif

-

-double cbrt(x)

-double x;

-{

-int e, rem, sign;

-double z;

-

-#ifdef __MINGW32__

-if (!isfinite (x) || x == 0 )

-  return x;

-#else

-

-#ifdef NANS

-if( isnan(x) )

-  return x;

-#endif

-#ifdef INFINITIES

-if( !isfinite(x) )

-  return x;

-#endif

-if( x == 0 )

-	return( x );

-

-#endif /* __MINGW32__ */

-

-if( x > 0 )

-	sign = 1;

-else

-	{

-	sign = -1;

-	x = -x;

-	}

-

-z = x;

-/* extract power of 2, leaving

- * mantissa between 0.5 and 1

- */

-x = frexp( x, &e );

-

-/* Approximate cube root of number between .5 and 1,

- * peak relative error = 9.2e-6

- */

-x = (((-1.3466110473359520655053e-1  * x

-      + 5.4664601366395524503440e-1) * x

-      - 9.5438224771509446525043e-1) * x

-      + 1.1399983354717293273738e0 ) * x

-      + 4.0238979564544752126924e-1;

-

-/* exponent divided by 3 */

-if( e >= 0 )

-	{

-	rem = e;

-	e /= 3;

-	rem -= 3*e;

-	if( rem == 1 )

-		x *= CBRT2;

-	else if( rem == 2 )

-		x *= CBRT4;

-	}

-

-

-/* argument less than 1 */

-

-else

-	{

-	e = -e;

-	rem = e;

-	e /= 3;

-	rem -= 3*e;

-	if( rem == 1 )

-		x *= CBRT2I;

-	else if( rem == 2 )

-		x *= CBRT4I;

-	e = -e;

-	}

-

-/* multiply by power of 2 */

-x = ldexp( x, e );

-

-/* Newton iteration */

-x -= ( x - (z/(x*x)) )*0.33333333333333333333;

-#ifdef DEC

-x -= ( x - (z/(x*x)) )/3.0;

-#else

-x -= ( x - (z/(x*x)) )*0.33333333333333333333;

-#endif

-

-if( sign < 0 )

-	x = -x;

-return(x);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include "cephes_mconf.h"
+
+static const double CBRT2  = 1.2599210498948731647672;
+static const double CBRT4  = 1.5874010519681994747517;
+static const double CBRT2I = 0.79370052598409973737585;
+static const double CBRT4I = 0.62996052494743658238361;
+
+#ifndef __MINGW32__
+#ifdef ANSIPROT
+extern double frexp ( double, int * );
+extern double ldexp ( double, int );
+extern int isnan ( double );
+extern int isfinite ( double );
+#else
+double frexp(), ldexp();
+int isnan(), isfinite();
+#endif
+#endif
+
+double cbrt(x)
+double x;
+{
+int e, rem, sign;
+double z;
+
+#ifdef __MINGW32__
+if (!isfinite (x) || x == 0 )
+  return x;
+#else
+
+#ifdef NANS
+if( isnan(x) )
+  return x;
+#endif
+#ifdef INFINITIES
+if( !isfinite(x) )
+  return x;
+#endif
+if( x == 0 )
+	return( x );
+
+#endif /* __MINGW32__ */
+
+if( x > 0 )
+	sign = 1;
+else
+	{
+	sign = -1;
+	x = -x;
+	}
+
+z = x;
+/* extract power of 2, leaving
+ * mantissa between 0.5 and 1
+ */
+x = frexp( x, &e );
+
+/* Approximate cube root of number between .5 and 1,
+ * peak relative error = 9.2e-6
+ */
+x = (((-1.3466110473359520655053e-1  * x
+      + 5.4664601366395524503440e-1) * x
+      - 9.5438224771509446525043e-1) * x
+      + 1.1399983354717293273738e0 ) * x
+      + 4.0238979564544752126924e-1;
+
+/* exponent divided by 3 */
+if( e >= 0 )
+	{
+	rem = e;
+	e /= 3;
+	rem -= 3*e;
+	if( rem == 1 )
+		x *= CBRT2;
+	else if( rem == 2 )
+		x *= CBRT4;
+	}
+
+
+/* argument less than 1 */
+
+else
+	{
+	e = -e;
+	rem = e;
+	e /= 3;
+	rem -= 3*e;
+	if( rem == 1 )
+		x *= CBRT2I;
+	else if( rem == 2 )
+		x *= CBRT4I;
+	e = -e;
+	}
+
+/* multiply by power of 2 */
+x = ldexp( x, e );
+
+/* Newton iteration */
+x -= ( x - (z/(x*x)) )*0.33333333333333333333;
+#ifdef DEC
+x -= ( x - (z/(x*x)) )/3.0;
+#else
+x -= ( x - (z/(x*x)) )*0.33333333333333333333;
+#endif
+
+if( sign < 0 )
+	x = -x;
+return(x);
+}
diff --git a/mingw-w64-crt/math/cbrtf.c b/mingw-w64-crt/math/cbrtf.c
index b27d131..cb3d59b 100644
--- a/mingw-w64-crt/math/cbrtf.c
+++ b/mingw-w64-crt/math/cbrtf.c
@@ -1,78 +1,78 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include "cephes_mconf.h"

-

-static const float CBRT2 = 1.25992104989487316477;

-static const float CBRT4 = 1.58740105196819947475;

-

-float cbrtf (float x)

-{

-int e, rem, sign;

-float z;

-if (!isfinite (x) || x == 0.0F )

-  return x;

-if( x > 0 )

-	sign = 1;

-else

-	{

-	sign = -1;

-	x = -x;

-	}

-

-z = x;

-/* extract power of 2, leaving

- * mantissa between 0.5 and 1

- */

-x = frexpf( x, &e );

-

-/* Approximate cube root of number between .5 and 1,

- * peak relative error = 9.2e-6

- */

-x = (((-0.13466110473359520655053  * x

-      + 0.54664601366395524503440 ) * x

-      - 0.95438224771509446525043 ) * x

-      + 1.1399983354717293273738  ) * x

-      + 0.40238979564544752126924;

-

-/* exponent divided by 3 */

-if( e >= 0 )

-	{

-	rem = e;

-	e /= 3;

-	rem -= 3*e;

-	if( rem == 1 )

-		x *= CBRT2;

-	else if( rem == 2 )

-		x *= CBRT4;

-	}

-

-

-/* argument less than 1 */

-

-else

-	{

-	e = -e;

-	rem = e;

-	e /= 3;

-	rem -= 3*e;

-	if( rem == 1 )

-		x /= CBRT2;

-	else if( rem == 2 )

-		x /= CBRT4;

-	e = -e;

-	}

-

-/* multiply by power of 2 */

-x = ldexpf( x, e );

-

-/* Newton iteration */

-x -= ( x - (z/(x*x)) ) * 0.333333333333;

-

-if( sign < 0 )

-	x = -x;

-return(x);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include "cephes_mconf.h"
+
+static const float CBRT2 = 1.25992104989487316477;
+static const float CBRT4 = 1.58740105196819947475;
+
+float cbrtf (float x)
+{
+int e, rem, sign;
+float z;
+if (!isfinite (x) || x == 0.0F )
+  return x;
+if( x > 0 )
+	sign = 1;
+else
+	{
+	sign = -1;
+	x = -x;
+	}
+
+z = x;
+/* extract power of 2, leaving
+ * mantissa between 0.5 and 1
+ */
+x = frexpf( x, &e );
+
+/* Approximate cube root of number between .5 and 1,
+ * peak relative error = 9.2e-6
+ */
+x = (((-0.13466110473359520655053  * x
+      + 0.54664601366395524503440 ) * x
+      - 0.95438224771509446525043 ) * x
+      + 1.1399983354717293273738  ) * x
+      + 0.40238979564544752126924;
+
+/* exponent divided by 3 */
+if( e >= 0 )
+	{
+	rem = e;
+	e /= 3;
+	rem -= 3*e;
+	if( rem == 1 )
+		x *= CBRT2;
+	else if( rem == 2 )
+		x *= CBRT4;
+	}
+
+
+/* argument less than 1 */
+
+else
+	{
+	e = -e;
+	rem = e;
+	e /= 3;
+	rem -= 3*e;
+	if( rem == 1 )
+		x /= CBRT2;
+	else if( rem == 2 )
+		x /= CBRT4;
+	e = -e;
+	}
+
+/* multiply by power of 2 */
+x = ldexpf( x, e );
+
+/* Newton iteration */
+x -= ( x - (z/(x*x)) ) * 0.333333333333;
+
+if( sign < 0 )
+	x = -x;
+return(x);
+}
diff --git a/mingw-w64-crt/math/cbrtl.c b/mingw-w64-crt/math/cbrtl.c
index b193176..dc7bae4 100644
--- a/mingw-w64-crt/math/cbrtl.c
+++ b/mingw-w64-crt/math/cbrtl.c
@@ -1,83 +1,83 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-static const long double CBRT2  = 1.2599210498948731647672L;

-static const long double CBRT4  = 1.5874010519681994747517L;

-static const long double CBRT2I = 0.79370052598409973737585L;

-static const long double CBRT4I = 0.62996052494743658238361L;

-

-extern long double ldexpl(long double,int);

-

-long double cbrtl(x)

-long double x;

-{

-int e, rem, sign;

-long double z;

-

-if (!isfinite (x) || x == 0.0L)

-	return(x);

-

-if( x > 0 )

-	sign = 1;

-else

-	{

-	sign = -1;

-	x = -x;

-	}

-

-z = x;

-/* extract power of 2, leaving

- * mantissa between 0.5 and 1

- */

-x = frexpl( x, &e );

-

-/* Approximate cube root of number between .5 and 1,

- * peak relative error = 1.2e-6

- */

-x = (((( 1.3584464340920900529734e-1L * x

-       - 6.3986917220457538402318e-1L) * x

-       + 1.2875551670318751538055e0L) * x

-       - 1.4897083391357284957891e0L) * x

-       + 1.3304961236013647092521e0L) * x

-       + 3.7568280825958912391243e-1L;

-

-/* exponent divided by 3 */

-if( e >= 0 )

-	{

-	rem = e;

-	e /= 3;

-	rem -= 3*e;

-	if( rem == 1 )

-		x *= CBRT2;

-	else if( rem == 2 )

-		x *= CBRT4;

-	}

-else

-	{ /* argument less than 1 */

-	e = -e;

-	rem = e;

-	e /= 3;

-	rem -= 3*e;

-	if( rem == 1 )

-		x *= CBRT2I;

-	else if( rem == 2 )

-		x *= CBRT4I;

-	e = -e;

-	}

-

-/* multiply by power of 2 */

-x = ldexpl( x, e );

-

-/* Newton iteration */

-

-x -= ( x - (z/(x*x)) )*0.3333333333333333333333L;

-x -= ( x - (z/(x*x)) )*0.3333333333333333333333L;

-

-if( sign < 0 )

-	x = -x;

-return(x);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+static const long double CBRT2  = 1.2599210498948731647672L;
+static const long double CBRT4  = 1.5874010519681994747517L;
+static const long double CBRT2I = 0.79370052598409973737585L;
+static const long double CBRT4I = 0.62996052494743658238361L;
+
+extern long double ldexpl(long double,int);
+
+long double cbrtl(x)
+long double x;
+{
+int e, rem, sign;
+long double z;
+
+if (!isfinite (x) || x == 0.0L)
+	return(x);
+
+if( x > 0 )
+	sign = 1;
+else
+	{
+	sign = -1;
+	x = -x;
+	}
+
+z = x;
+/* extract power of 2, leaving
+ * mantissa between 0.5 and 1
+ */
+x = frexpl( x, &e );
+
+/* Approximate cube root of number between .5 and 1,
+ * peak relative error = 1.2e-6
+ */
+x = (((( 1.3584464340920900529734e-1L * x
+       - 6.3986917220457538402318e-1L) * x
+       + 1.2875551670318751538055e0L) * x
+       - 1.4897083391357284957891e0L) * x
+       + 1.3304961236013647092521e0L) * x
+       + 3.7568280825958912391243e-1L;
+
+/* exponent divided by 3 */
+if( e >= 0 )
+	{
+	rem = e;
+	e /= 3;
+	rem -= 3*e;
+	if( rem == 1 )
+		x *= CBRT2;
+	else if( rem == 2 )
+		x *= CBRT4;
+	}
+else
+	{ /* argument less than 1 */
+	e = -e;
+	rem = e;
+	e /= 3;
+	rem -= 3*e;
+	if( rem == 1 )
+		x *= CBRT2I;
+	else if( rem == 2 )
+		x *= CBRT4I;
+	e = -e;
+	}
+
+/* multiply by power of 2 */
+x = ldexpl( x, e );
+
+/* Newton iteration */
+
+x -= ( x - (z/(x*x)) )*0.3333333333333333333333L;
+x -= ( x - (z/(x*x)) )*0.3333333333333333333333L;
+
+if( sign < 0 )
+	x = -x;
+return(x);
+}
diff --git a/mingw-w64-crt/math/ceilf.c b/mingw-w64-crt/math/ceilf.c
index 192de0b..2b60b01 100644
--- a/mingw-w64-crt/math/ceilf.c
+++ b/mingw-w64-crt/math/ceilf.c
@@ -1,11 +1,11 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float ceilf(float _X)

-{

-  return ((float)ceil((double)_X));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float ceilf(float _X)
+{
+  return ((float)ceil((double)_X));
+}
diff --git a/mingw-w64-crt/math/cephes_emath.c b/mingw-w64-crt/math/cephes_emath.c
index 54a7c96..77b0b9a 100644
--- a/mingw-w64-crt/math/cephes_emath.c
+++ b/mingw-w64-crt/math/cephes_emath.c
@@ -1,1295 +1,1295 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_emath.h"

-

-/*

- * The constants are for 64 bit precision.

- */

-

-

-/* Move in external format number,

- * converting it to internal format.

- */

-void __emovi(const short unsigned int * __restrict__ a,

-		  short unsigned int * __restrict__ b)

-{

-register const unsigned short *p;

-register unsigned short *q;

-int i;

-

-q = b;

-p = a + (NE-1);	/* point to last word of external number */

-/* get the sign bit */

-if( *p & 0x8000 )

-	*q++ = 0xffff;

-else

-	*q++ = 0;

-/* get the exponent */

-*q = *p--;

-*q++ &= 0x7fff;	/* delete the sign bit */

-#ifdef INFINITY

-if( (*(q-1) & 0x7fff) == 0x7fff )

-	{

-#ifdef NANS

-	if( __eisnan(a) )

-		{

-		*q++ = 0;

-		for( i=3; i<NI; i++ )

-			*q++ = *p--;

-		return;

-		}

-#endif

-	for( i=2; i<NI; i++ )

-		*q++ = 0;

-	return;

-	}

-#endif

-/* clear high guard word */

-*q++ = 0;

-/* move in the significand */

-for( i=0; i<NE-1; i++ )

-	*q++ = *p--;

-/* clear low guard word */

-*q = 0;

-}

-

-

-/*

-;	Add significands

-;	x + y replaces y

-*/

-

-void __eaddm(const short unsigned int * __restrict__ x,

-		  short unsigned int * __restrict__ y)

-{

-register unsigned long a;

-int i;

-unsigned int carry;

-

-x += NI-1;

-y += NI-1;

-carry = 0;

-for( i=M; i<NI; i++ )

-	{

-	a = (unsigned long )(*x) + (unsigned long )(*y) + carry;

-	if( a & 0x10000 )

-		carry = 1;

-	else

-		carry = 0;

-	*y = (unsigned short )a;

-	--x;

-	--y;

-	}

-}

-

-/*

-;	Subtract significands

-;	y - x replaces y

-*/

-

-void __esubm(const short unsigned int * __restrict__ x,

-		  short unsigned int * __restrict__ y)

-{

-unsigned long a;

-int i;

-unsigned int carry;

-

-x += NI-1;

-y += NI-1;

-carry = 0;

-for( i=M; i<NI; i++ )

-	{

-	a = (unsigned long )(*y) - (unsigned long )(*x) - carry;

-	if( a & 0x10000 )

-		carry = 1;

-	else

-		carry = 0;

-	*y = (unsigned short )a;

-	--x;

-	--y;

-	}

-}

-

-

-/* Multiply significand of e-type number b

-by 16-bit quantity a, e-type result to c. */

-

-static void __m16m(short unsigned int a,

-		 short unsigned int *  __restrict__ b,

-		 short unsigned int *  __restrict__ c)

-{

-register unsigned short *pp;

-register unsigned long carry;

-unsigned short *ps;

-unsigned short p[NI];

-unsigned long aa, m;

-int i;

-

-aa = a;

-pp = &p[NI-2];

-*pp++ = 0;

-*pp = 0;

-ps = &b[NI-1];

-

-for( i=M+1; i<NI; i++ )

-	{

-	if( *ps == 0 )

-		{

-		--ps;

-		--pp;

-		*(pp-1) = 0;

-		}

-	else

-		{

-		m = (unsigned long) aa * *ps--;

-		carry = (m & 0xffff) + *pp;

-		*pp-- = (unsigned short )carry;

-		carry = (carry >> 16) + (m >> 16) + *pp;

-		*pp = (unsigned short )carry;

-		*(pp-1) = carry >> 16;

-		}

-	}

-for( i=M; i<NI; i++ )

-	c[i] = p[i];

-}

-

-

-/* Divide significands. Neither the numerator nor the denominator

-is permitted to have its high guard word nonzero.  */

-

-

-int __edivm(short unsigned int * __restrict__ den,

-		 short unsigned int * __restrict__ num)

-{

-int i;

-register unsigned short *p;

-unsigned long tnum;

-unsigned short j, tdenm, tquot;

-unsigned short tprod[NI+1];

-unsigned short equot[NI];

-

-p = &equot[0];

-*p++ = num[0];

-*p++ = num[1];

-

-for( i=M; i<NI; i++ )

-	{

-	*p++ = 0;

-	}

-__eshdn1( num );

-tdenm = den[M+1];

-for( i=M; i<NI; i++ )

-	{

-	/* Find trial quotient digit (the radix is 65536). */

-	tnum = (((unsigned long) num[M]) << 16) + num[M+1];

-

-	/* Do not execute the divide instruction if it will overflow. */

-        if( (tdenm * 0xffffUL) < tnum )

-		tquot = 0xffff;

-	else

-		tquot = tnum / tdenm;

-

-		/* Prove that the divide worked. */

-/*

-	tcheck = (unsigned long )tquot * tdenm;

-	if( tnum - tcheck > tdenm )

-		tquot = 0xffff;

-*/

-	/* Multiply denominator by trial quotient digit. */

-	__m16m( tquot, den, tprod );

-	/* The quotient digit may have been overestimated. */

-	if( __ecmpm( tprod, num ) > 0 )

-		{

-		tquot -= 1;

-		__esubm( den, tprod );

-		if( __ecmpm( tprod, num ) > 0 )

-			{

-			tquot -= 1;

-			__esubm( den, tprod );

-			}

-		}

-	__esubm( tprod, num );

-	equot[i] = tquot;

-	__eshup6(num);

-	}

-/* test for nonzero remainder after roundoff bit */

-p = &num[M];

-j = 0;

-for( i=M; i<NI; i++ )

-	{

-	j |= *p++;

-	}

-if( j )

-	j = 1;

-

-for( i=0; i<NI; i++ )

-	num[i] = equot[i];

-

-return( (int )j );

-}

-

-

-

-/* Multiply significands */

-int __emulm(const short unsigned int * __restrict__ a,

-		 short unsigned int * __restrict__ b)

-{

-const unsigned short *p;

-unsigned short *q;

-unsigned short pprod[NI];

-unsigned short equot[NI];

-unsigned short j;

-int i;

-

-equot[0] = b[0];

-equot[1] = b[1];

-for( i=M; i<NI; i++ )

-	equot[i] = 0;

-

-j = 0;

-p = &a[NI-1];

-q = &equot[NI-1];

-for( i=M+1; i<NI; i++ )

-	{

-	if( *p == 0 )

-		{

-		--p;

-		}

-	else

-		{

-		__m16m( *p--, b, pprod );

-		__eaddm(pprod, equot);

-		}

-	j |= *q;

-	__eshdn6(equot);

-	}

-

-for( i=0; i<NI; i++ )

-	b[i] = equot[i];

-

-/* return flag for lost nonzero bits */

-return( (int)j );

-}

-

-

-

-/*

- * Normalize and round off.

- *

- * The internal format number to be rounded is "s".

- * Input "lost" indicates whether the number is exact.

- * This is the so-called sticky bit.

- *

- * Input "subflg" indicates whether the number was obtained

- * by a subtraction operation.  In that case if lost is nonzero

- * then the number is slightly smaller than indicated.

- *

- * Input "exp" is the biased exponent, which may be negative.

- * the exponent field of "s" is ignored but is replaced by

- * "exp" as adjusted by normalization and rounding.

- *

- * Input "rcntrl" is the rounding control.

- *

- * Input "rnprc" is precison control (64 or NBITS).

- */

-

-void __emdnorm(short unsigned int *s, int lost, int subflg, int exp, int rcntrl, int rndprc)

-{

-int i, j;

-unsigned short r;

-int rw = NI-1; /* low guard word */

-int re = NI-2;

-const unsigned short rmsk = 0xffff;

-const unsigned short rmbit = 0x8000;

-#if NE == 6

-unsigned short rbit[NI] = {0,0,0,0,0,0,0,1,0};

-#else

-unsigned short rbit[NI] = {0,0,0,0,0,0,0,0,0,0,0,1,0};

-#endif

-

-/* Normalize */

-j = __enormlz( s );

-

-/* a blank significand could mean either zero or infinity. */

-#ifndef INFINITY

-if( j > NBITS )

-	{

-	__ecleazs( s );

-	return;

-	}

-#endif

-exp -= j;

-#ifndef INFINITY

-if( exp >= 32767L )

-	goto overf;

-#else

-if( (j > NBITS) && (exp < 32767L) )

-	{

-	__ecleazs( s );

-	return;

-	}

-#endif

-if( exp < 0L )

-	{

-	if( exp > (long )(-NBITS-1) )

-		{

-		j = (int )exp;

-		i = __eshift( s, j );

-		if( i )

-			lost = 1;

-		}

-	else

-		{

-		__ecleazs( s );

-		return;

-		}

-	}

-/* Round off, unless told not to by rcntrl. */

-if( rcntrl == 0 )

-	goto mdfin;

-if (rndprc == 64)

-  {

-    rw = 7;

-    re = 6;

-    rbit[NI-2] = 0;

-    rbit[6] = 1;

-  }

-

-/* Shift down 1 temporarily if the data structure has an implied

- * most significant bit and the number is denormal.

- * For rndprc = 64 or NBITS, there is no implied bit.

- * But Intel long double denormals lose one bit of significance even so.

- */

-#if IBMPC

-if( (exp <= 0) && (rndprc != NBITS) )

-#else

-if( (exp <= 0) && (rndprc != 64) && (rndprc != NBITS) )

-#endif

-	{

-	lost |= s[NI-1] & 1;

-	__eshdn1(s);

-	}

-/* Clear out all bits below the rounding bit,

- * remembering in r if any were nonzero.

- */

-r = s[rw] & rmsk;

-if( rndprc < NBITS )

-	{

-	i = rw + 1;

-	while( i < NI )

-		{

-		if( s[i] )

-			r |= 1;

-		s[i] = 0;

-		++i;

-		}

-	}

-s[rw] &= (rmsk ^ 0xffff);

-if( (r & rmbit) != 0 )

-	{

-	if( r == rmbit )

-		{

-		if( lost == 0 )

-			{ /* round to even */

-			if( (s[re] & 1) == 0 )

-				goto mddone;

-			}

-		else

-			{

-			if( subflg != 0 )

-				goto mddone;

-			}

-		}

-	__eaddm( rbit, s );

-	}

-mddone:

-#if IBMPC

-if( (exp <= 0) && (rndprc != NBITS) )

-#else

-if( (exp <= 0) && (rndprc != 64) && (rndprc != NBITS) )

-#endif

-	{

-	__eshup1(s);

-	}

-if( s[2] != 0 )

-	{ /* overflow on roundoff */

-	__eshdn1(s);

-	exp += 1;

-	}

-mdfin:

-s[NI-1] = 0;

-if( exp >= 32767L )

-	{

-#ifndef INFINITY

-overf:

-#endif

-#ifdef INFINITY

-	s[1] = 32767;

-	for( i=2; i<NI-1; i++ )

-		s[i] = 0;

-#else

-	s[1] = 32766;

-	s[2] = 0;

-	for( i=M+1; i<NI-1; i++ )

-		s[i] = 0xffff;

-	s[NI-1] = 0;

-	if( (rndprc < 64) || (rndprc == 113) )

-		s[rw] &= (rmsk ^ 0xffff);

-#endif

-	return;

-	}

-if( exp < 0 )

-	s[1] = 0;

-else

-	s[1] = (unsigned short )exp;

-}

-

-

-/*

-;	Multiply.

-;

-;	unsigned short a[NE], b[NE], c[NE];

-;	emul( a, b, c );	c = b * a

-*/

-void __emul(const short unsigned int *a,

-		 const short unsigned int *b,

-		 short unsigned int *c)

-{

-unsigned short ai[NI], bi[NI];

-int i, j;

-long lt, lta, ltb;

-

-#ifdef NANS

-/* NaN times anything is the same NaN. */

-if( __eisnan(a) )

-	{

-	__emov(a,c);

-	return;

-	}

-if( __eisnan(b) )

-	{

-	__emov(b,c);

-	return;

-	}

-/* Zero times infinity is a NaN. */

-if( (__eisinf(a) && __eiiszero(b))

-	|| (__eisinf(b) && __eiiszero(a)) )

-	{

-	mtherr( "emul", DOMAIN );

-	__enan_NBITS( c );

-	return;

-	}

-#endif

-/* Infinity times anything else is infinity. */

-#ifdef INFINITY

-if( __eisinf(a) || __eisinf(b) )

-	{

-	if( __eisneg(a) ^ __eisneg(b) )

-		*(c+(NE-1)) = 0x8000;

-	else

-		*(c+(NE-1)) = 0;

-	__einfin(c);

-	return;

-	}

-#endif

-__emovi( a, ai );

-__emovi( b, bi );

-lta = ai[E];

-ltb = bi[E];

-if( ai[E] == 0 )

-	{

-	for( i=1; i<NI-1; i++ )

-		{

-		if( ai[i] != 0 )

-			{

-			lta -= __enormlz( ai );

-			goto mnzer1;

-			}

-		}

-	__eclear(c);

-	return;

-	}

-mnzer1:

-

-if( bi[E] == 0 )

-	{

-	for( i=1; i<NI-1; i++ )

-		{

-		if( bi[i] != 0 )

-			{

-			ltb -= __enormlz( bi );

-			goto mnzer2;

-			}

-		}

-	__eclear(c);

-	return;

-	}

-mnzer2:

-

-/* Multiply significands */

-j = __emulm( ai, bi );

-/* calculate exponent */

-lt = lta + ltb - (EXONE - 1);

-__emdnorm( bi, j, 0, lt, 64, NBITS );

-/* calculate sign of product */

-if( ai[0] == bi[0] )

-	bi[0] = 0;

-else

-	bi[0] = 0xffff;

-__emovo( bi, c );

-}

-

-

-/* move out internal format to ieee long double */

-void __toe64(short unsigned int *a, short unsigned int *b)

-{

-register unsigned short *p, *q;

-unsigned short i;

-

-#ifdef NANS

-if( __eiisnan(a) )

-	{

-	__enan_64( b );

-	return;

-	}

-#endif

-#ifdef IBMPC

-/* Shift Intel denormal significand down 1.  */

-if( a[E] == 0 )

-  __eshdn1(a);

-#endif

-p = a;

-#ifdef MIEEE

-q = b;

-#else

-q = b + 4; /* point to output exponent */

-#if 1

-/* NOTE: if data type is 96 bits wide, clear the last word here. */

-*(q+1)= 0;

-#endif

-#endif

-

-/* combine sign and exponent */

-i = *p++;

-#ifdef MIEEE

-if( i )

-	*q++ = *p++ | 0x8000;

-else

-	*q++ = *p++;

-*q++ = 0;

-#else

-if( i )

-	*q-- = *p++ | 0x8000;

-else

-	*q-- = *p++;

-#endif

-/* skip over guard word */

-++p;

-/* move the significand */

-#ifdef MIEEE

-for( i=0; i<4; i++ )

-	*q++ = *p++;

-#else

-#ifdef INFINITY

-if (__eiisinf (a))

-        {

-	/* Intel long double infinity.  */

-	*q-- = 0x8000;

-	*q-- = 0;

-	*q-- = 0;

-	*q = 0;

-	return;

-	}

-#endif

-for( i=0; i<4; i++ )

-	*q-- = *p++;

-#endif

-}

-

-

-/* Compare two e type numbers.

- *

- * unsigned short a[NE], b[NE];

- * ecmp( a, b );

- *

- *  returns +1 if a > b

- *           0 if a == b

- *          -1 if a < b

- *          -2 if either a or b is a NaN.

- */

-int __ecmp(const short unsigned int * __restrict__ a,

-		const short unsigned int *  __restrict__ b)

-{

-unsigned short ai[NI], bi[NI];

-register unsigned short *p, *q;

-register int i;

-int msign;

-

-#ifdef NANS

-if (__eisnan (a)  || __eisnan (b))

-	return( -2 );

-#endif

-__emovi( a, ai );

-p = ai;

-__emovi( b, bi );

-q = bi;

-

-if( *p != *q )

-	{ /* the signs are different */

-/* -0 equals + 0 */

-	for( i=1; i<NI-1; i++ )

-		{

-		if( ai[i] != 0 )

-			goto nzro;

-		if( bi[i] != 0 )

-			goto nzro;

-		}

-	return(0);

-nzro:

-	if( *p == 0 )

-		return( 1 );

-	else

-		return( -1 );

-	}

-/* both are the same sign */

-if( *p == 0 )

-	msign = 1;

-else

-	msign = -1;

-i = NI-1;

-do

-	{

-	if( *p++ != *q++ )

-		{

-		goto diff;

-		}

-	}

-while( --i > 0 );

-

-return(0);	/* equality */

-

-

-

-diff:

-

-if( *(--p) > *(--q) )

-	return( msign );		/* p is bigger */

-else

-	return( -msign );	/* p is littler */

-}

-

-/*

-;	Shift significand

-;

-;	Shifts significand area up or down by the number of bits

-;	given by the variable sc.

-*/

-int __eshift(short unsigned int *x, int sc)

-{

-unsigned short lost;

-unsigned short *p;

-

-if( sc == 0 )

-	return( 0 );

-

-lost = 0;

-p = x + NI-1;

-

-if( sc < 0 )

-	{

-	sc = -sc;

-	while( sc >= 16 )

-		{

-		lost |= *p;	/* remember lost bits */

-		__eshdn6(x);

-		sc -= 16;

-		}

-

-	while( sc >= 8 )

-		{

-		lost |= *p & 0xff;

-		__eshdn8(x);

-		sc -= 8;

-		}

-

-	while( sc > 0 )

-		{

-		lost |= *p & 1;

-		__eshdn1(x);

-		sc -= 1;

-		}

-	}

-else

-	{

-	while( sc >= 16 )

-		{

-		__eshup6(x);

-		sc -= 16;

-		}

-

-	while( sc >= 8 )

-		{

-		__eshup8(x);

-		sc -= 8;

-		}

-

-	while( sc > 0 )

-		{

-		__eshup1(x);

-		sc -= 1;

-		}

-	}

-if( lost )

-	lost = 1;

-return( (int )lost );

-}

-

-

-

-/*

-;	normalize

-;

-; Shift normalizes the significand area pointed to by argument

-; shift count (up = positive) is returned.

-*/

-int __enormlz(short unsigned int *x)

-{

-register unsigned short *p;

-int sc;

-

-sc = 0;

-p = &x[M];

-if( *p != 0 )

-	goto normdn;

-++p;

-if( *p & 0x8000 )

-	return( 0 );	/* already normalized */

-while( *p == 0 )

-	{

-	__eshup6(x);

-	sc += 16;

-/* With guard word, there are NBITS+16 bits available.

- * return true if all are zero.

- */

-	if( sc > NBITS )

-		return( sc );

-	}

-/* see if high byte is zero */

-while( (*p & 0xff00) == 0 )

-	{

-	__eshup8(x);

-	sc += 8;

-	}

-/* now shift 1 bit at a time */

-while( (*p  & 0x8000) == 0)

-	{

-	__eshup1(x);

-	sc += 1;

-	if( sc > (NBITS+16) )

-		{

-		mtherr( "enormlz", UNDERFLOW );

-		return( sc );

-		}

-	}

-return( sc );

-

-/* Normalize by shifting down out of the high guard word

-   of the significand */

-normdn:

-

-if( *p & 0xff00 )

-	{

-	__eshdn8(x);

-	sc -= 8;

-	}

-while( *p != 0 )

-	{

-	__eshdn1(x);

-	sc -= 1;

-

-	if( sc < -NBITS )

-		{

-		mtherr( "enormlz", OVERFLOW );

-		return( sc );

-		}

-	}

-return( sc );

-}

-

-

-/* Move internal format number out,

- * converting it to external format.

- */

-void __emovo(const short unsigned int * __restrict__ a,

-		  short unsigned int * __restrict__ b)

-{

-register const unsigned short *p;

-register unsigned short *q;

-unsigned short i;

-

-p = a;

-q = b + (NE-1); /* point to output exponent */

-/* combine sign and exponent */

-i = *p++;

-if( i )

-	*q-- = *p++ | 0x8000;

-else

-	*q-- = *p++;

-#ifdef INFINITY

-if( *(p-1) == 0x7fff )

-	{

-#ifdef NANS

-	if( __eiisnan(a) )

-		{

-		__enan_NBITS( b );

-		return;

-		}

-#endif

-	__einfin(b);

-	return;

-	}

-#endif

-/* skip over guard word */

-++p;

-/* move the significand */

-for( i=0; i<NE-1; i++ )

-	*q-- = *p++;

-}

-

-

-#if USE_LDTOA

-

-

-void __eiremain(short unsigned int *den, short unsigned int *num,

-	 short unsigned int *equot )

-{

-long ld, ln;

-unsigned short j;

-

-ld = den[E];

-ld -= __enormlz( den );

-ln = num[E];

-ln -= __enormlz( num );

-__ecleaz( equot );

-while( ln >= ld )

-	{

-	if( __ecmpm(den,num) <= 0 )

-		{

-		__esubm(den, num);

-		j = 1;

-		}

-	else

-		{

-		j = 0;

-		}

-	__eshup1(equot);

-	equot[NI-1] |= j;

-	__eshup1(num);

-	ln -= 1;

-	}

-__emdnorm( num, 0, 0, ln, 0, NBITS );

-}

-

-

-void __eadd1(const short unsigned int *  __restrict__ a,

-		  const short unsigned int *  __restrict__ b,

-		  short unsigned int *  __restrict__ c,

-		  int subflg)

-{

-unsigned short ai[NI], bi[NI], ci[NI];

-int i, lost, j, k;

-long lt, lta, ltb;

-

-#ifdef INFINITY

-if( __eisinf(a) )

-	{

-	__emov(a,c);

-	if( subflg )

-		__eneg(c);

-	return;

-	}

-if( __eisinf(b) )

-	{

-	__emov(b,c);

-	return;

-	}

-#endif

-__emovi( a, ai );

-__emovi( b, bi );

-if( sub )

-	ai[0] = ~ai[0];

-

-/* compare exponents */

-lta = ai[E];

-ltb = bi[E];

-lt = lta - ltb;

-if( lt > 0L )

-	{	/* put the larger number in bi */

-	__emovz( bi, ci );

-	__emovz( ai, bi );

-	__emovz( ci, ai );

-	ltb = bi[E];

-	lt = -lt;

-	}

-lost = 0;

-if( lt != 0L )

-	{

-	if( lt < (long )(-NBITS-1) )

-		goto done;	/* answer same as larger addend */

-	k = (int )lt;

-	lost = __eshift( ai, k ); /* shift the smaller number down */

-	}

-else

-	{

-/* exponents were the same, so must compare significands */

-	i = __ecmpm( ai, bi );

-	if( i == 0 )

-		{ /* the numbers are identical in magnitude */

-		/* if different signs, result is zero */

-		if( ai[0] != bi[0] )

-			{

-			__eclear(c);

-			return;

-			}

-		/* if same sign, result is double */

-		/* double denomalized tiny number */

-		if( (bi[E] == 0) && ((bi[3] & 0x8000) == 0) )

-			{

-			__eshup1( bi );

-			goto done;

-			}

-		/* add 1 to exponent unless both are zero! */

-		for( j=1; j<NI-1; j++ )

-			{

-			if( bi[j] != 0 )

-				{

-/* This could overflow, but let emovo take care of that. */

-				ltb += 1;

-				break;

-				}

-			}

-		bi[E] = (unsigned short )ltb;

-		goto done;

-		}

-	if( i > 0 )

-		{	/* put the larger number in bi */

-		__emovz( bi, ci );

-		__emovz( ai, bi );

-		__emovz( ci, ai );

-		}

-	}

-if( ai[0] == bi[0] )

-	{

-	__eaddm( ai, bi );

-	subflg = 0;

-	}

-else

-	{

-	__esubm( ai, bi );

-	subflg = 1;

-	}

-__emdnorm( bi, lost, subflg, ltb, 64, NBITS);

-

-done:

-__emovo( bi, c );

-}

-

-

-/* y = largest integer not greater than x

- * (truncated toward minus infinity)

- *

- * unsigned short x[NE], y[NE]

- *

- * efloor( x, y );

- */

-

-

-void __efloor(short unsigned int *x, short unsigned int *y)

-{

-register unsigned short *p;

-int e, expon, i;

-unsigned short f[NE];

-const unsigned short bmask[] = {

-0xffff,

-0xfffe,

-0xfffc,

-0xfff8,

-0xfff0,

-0xffe0,

-0xffc0,

-0xff80,

-0xff00,

-0xfe00,

-0xfc00,

-0xf800,

-0xf000,

-0xe000,

-0xc000,

-0x8000,

-0x0000,

-};

-

-__emov( x, f ); /* leave in external format */

-expon = (int )f[NE-1];

-e = (expon & 0x7fff) - (EXONE - 1);

-if( e <= 0 )

-	{

-	__eclear(y);

-	goto isitneg;

-	}

-/* number of bits to clear out */

-e = NBITS - e;

-__emov( f, y );

-if( e <= 0 )

-	return;

-

-p = &y[0];

-while( e >= 16 )

-	{

-	*p++ = 0;

-	e -= 16;

-	}

-/* clear the remaining bits */

-*p &= bmask[e];

-/* truncate negatives toward minus infinity */

-isitneg:

-

-if( (unsigned short )expon & (unsigned short )0x8000 )

-	{

-	for( i=0; i<NE-1; i++ )

-		{

-		if( f[i] != y[i] )

-			{

-			__esub( __eone, y, y );

-			break;

-			}

-		}

-	}

-}

-

-/*

-;	Subtract external format numbers.

-;

-;	unsigned short a[NE], b[NE], c[NE];

-;	esub( a, b, c );	 c = b - a

-*/

-

-

-void __esub(const short unsigned int *  a,

-		 const short unsigned int *  b,

-		 short unsigned int *  c)

-{

-

-#ifdef NANS

-if( __eisnan(a) )

-	{

-	__emov (a, c);

-	return;

-	}

-if( __eisnan(b) )

-	{

-	__emov(b,c);

-	return;

-	}

-/* Infinity minus infinity is a NaN.

- * Test for subtracting infinities of the same sign.

- */

-if( __eisinf(a) && __eisinf(b) && ((__eisneg (a) ^ __eisneg (b)) == 0))

-	{

-	mtherr( "esub", DOMAIN );

-	__enan_NBITS( c );

-	return;

-	}

-#endif

-__eadd1( a, b, c, 1 );

-}

-

-

-

-/*

-;	Divide.

-;

-;	unsigned short a[NI], b[NI], c[NI];

-;	ediv( a, b, c );	c = b / a

-*/

-

-void __ediv(const short unsigned int *a,

-		 const short unsigned int *b,

-		 short unsigned int *c)

-{

-unsigned short ai[NI], bi[NI];

-int i;

-long lt, lta, ltb;

-

-#ifdef NANS

-/* Return any NaN input. */

-if( __eisnan(a) )

-	{

-	__emov(a,c);

-	return;

-	}

-if( __eisnan(b) )

-	{

-	__emov(b,c);

-	return;

-	}

-/* Zero over zero, or infinity over infinity, is a NaN. */

-if( (__eiszero(a) && __eiszero(b))

-	|| (__eisinf (a) && __eisinf (b)) )

-	{

-	mtherr( "ediv", DOMAIN );

-	__enan_NBITS( c );

-	return;

-	}

-#endif

-/* Infinity over anything else is infinity. */

-#ifdef INFINITY

-if( __eisinf(b) )

-	{

-	if( __eisneg(a) ^ __eisneg(b) )

-		*(c+(NE-1)) = 0x8000;

-	else

-		*(c+(NE-1)) = 0;

-	__einfin(c);

-	return;

-	}

-if( __eisinf(a) )

-	{

-	__eclear(c);

-	return;

-	}

-#endif

-__emovi( a, ai );

-__emovi( b, bi );

-lta = ai[E];

-ltb = bi[E];

-if( bi[E] == 0 )

-	{ /* See if numerator is zero. */

-	for( i=1; i<NI-1; i++ )

-		{

-		if( bi[i] != 0 )

-			{

-			ltb -= __enormlz( bi );

-			goto dnzro1;

-			}

-		}

-	__eclear(c);

-	return;

-	}

-dnzro1:

-

-if( ai[E] == 0 )

-	{	/* possible divide by zero */

-	for( i=1; i<NI-1; i++ )

-		{

-		if( ai[i] != 0 )

-			{

-			lta -= __enormlz( ai );

-			goto dnzro2;

-			}

-		}

-	if( ai[0] == bi[0] )

-		*(c+(NE-1)) = 0;

-	else

-		*(c+(NE-1)) = 0x8000;

-	__einfin(c);

-	mtherr( "ediv", SING );

-	return;

-	}

-dnzro2:

-

-i = __edivm( ai, bi );

-/* calculate exponent */

-lt = ltb - lta + EXONE;

-__emdnorm( bi, i, 0, lt, 64, NBITS );

-/* set the sign */

-if( ai[0] == bi[0] )

-	bi[0] = 0;

-else

-	bi[0] = 0Xffff;

-__emovo( bi, c );

-}

-

-void __e64toe(short unsigned int *pe, short unsigned int *y)

-{

-unsigned short yy[NI];

-unsigned short *p, *q, *e;

-int i;

-

-e = pe;

-p = yy;

-for( i=0; i<NE-5; i++ )

-	*p++ = 0;

-#ifdef IBMPC

-for( i=0; i<5; i++ )

-	*p++ = *e++;

-#endif

-#ifdef DEC

-for( i=0; i<5; i++ )

-	*p++ = *e++;

-#endif

-#ifdef MIEEE

-p = &yy[0] + (NE-1);

-*p-- = *e++;

-++e;

-for( i=0; i<4; i++ )

-	*p-- = *e++;

-#endif

-

-#ifdef IBMPC

-/* For Intel long double, shift denormal significand up 1

-   -- but only if the top significand bit is zero.  */

-if((yy[NE-1] & 0x7fff) == 0 && (yy[NE-2] & 0x8000) == 0)

-  {

-    unsigned short temp[NI+1];

-    __emovi(yy, temp);

-    __eshup1(temp);

-    __emovo(temp,y);

-    return;

-  }

-#endif

-#ifdef INFINITY

-/* Point to the exponent field.  */

-p = &yy[NE-1];

-if( *p == 0x7fff )

-	{

-#ifdef NANS

-#ifdef IBMPC

-	for( i=0; i<4; i++ )

-		{

-		if((i != 3 && pe[i] != 0)

-		   /* Check for Intel long double infinity pattern.  */

-		   || (i == 3 && pe[i] != 0x8000))

-			{

-			__enan_NBITS( y );

-			return;

-			}

-		}

-#else

-	for( i=1; i<=4; i++ )

-		{

-		if( pe[i] != 0 )

-			{

-			__enan_NBITS( y );

-			return;

-			}

-		}

-#endif

-#endif /* NANS */

-	__eclear( y );

-	__einfin( y );

-	if( *p & 0x8000 )

-		__eneg(y);

-	return;

-	}

-#endif

-p = yy;

-q = y;

-for( i=0; i<NE; i++ )

-	*q++ = *p++;

-}

-

-#endif /* USE_LDTOA */ 

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_emath.h"
+
+/*
+ * The constants are for 64 bit precision.
+ */
+
+
+/* Move in external format number,
+ * converting it to internal format.
+ */
+void __emovi(const short unsigned int * __restrict__ a,
+		  short unsigned int * __restrict__ b)
+{
+register const unsigned short *p;
+register unsigned short *q;
+int i;
+
+q = b;
+p = a + (NE-1);	/* point to last word of external number */
+/* get the sign bit */
+if( *p & 0x8000 )
+	*q++ = 0xffff;
+else
+	*q++ = 0;
+/* get the exponent */
+*q = *p--;
+*q++ &= 0x7fff;	/* delete the sign bit */
+#ifdef INFINITY
+if( (*(q-1) & 0x7fff) == 0x7fff )
+	{
+#ifdef NANS
+	if( __eisnan(a) )
+		{
+		*q++ = 0;
+		for( i=3; i<NI; i++ )
+			*q++ = *p--;
+		return;
+		}
+#endif
+	for( i=2; i<NI; i++ )
+		*q++ = 0;
+	return;
+	}
+#endif
+/* clear high guard word */
+*q++ = 0;
+/* move in the significand */
+for( i=0; i<NE-1; i++ )
+	*q++ = *p--;
+/* clear low guard word */
+*q = 0;
+}
+
+
+/*
+;	Add significands
+;	x + y replaces y
+*/
+
+void __eaddm(const short unsigned int * __restrict__ x,
+		  short unsigned int * __restrict__ y)
+{
+register unsigned long a;
+int i;
+unsigned int carry;
+
+x += NI-1;
+y += NI-1;
+carry = 0;
+for( i=M; i<NI; i++ )
+	{
+	a = (unsigned long )(*x) + (unsigned long )(*y) + carry;
+	if( a & 0x10000 )
+		carry = 1;
+	else
+		carry = 0;
+	*y = (unsigned short )a;
+	--x;
+	--y;
+	}
+}
+
+/*
+;	Subtract significands
+;	y - x replaces y
+*/
+
+void __esubm(const short unsigned int * __restrict__ x,
+		  short unsigned int * __restrict__ y)
+{
+unsigned long a;
+int i;
+unsigned int carry;
+
+x += NI-1;
+y += NI-1;
+carry = 0;
+for( i=M; i<NI; i++ )
+	{
+	a = (unsigned long )(*y) - (unsigned long )(*x) - carry;
+	if( a & 0x10000 )
+		carry = 1;
+	else
+		carry = 0;
+	*y = (unsigned short )a;
+	--x;
+	--y;
+	}
+}
+
+
+/* Multiply significand of e-type number b
+by 16-bit quantity a, e-type result to c. */
+
+static void __m16m(short unsigned int a,
+		 short unsigned int *  __restrict__ b,
+		 short unsigned int *  __restrict__ c)
+{
+register unsigned short *pp;
+register unsigned long carry;
+unsigned short *ps;
+unsigned short p[NI];
+unsigned long aa, m;
+int i;
+
+aa = a;
+pp = &p[NI-2];
+*pp++ = 0;
+*pp = 0;
+ps = &b[NI-1];
+
+for( i=M+1; i<NI; i++ )
+	{
+	if( *ps == 0 )
+		{
+		--ps;
+		--pp;
+		*(pp-1) = 0;
+		}
+	else
+		{
+		m = (unsigned long) aa * *ps--;
+		carry = (m & 0xffff) + *pp;
+		*pp-- = (unsigned short )carry;
+		carry = (carry >> 16) + (m >> 16) + *pp;
+		*pp = (unsigned short )carry;
+		*(pp-1) = carry >> 16;
+		}
+	}
+for( i=M; i<NI; i++ )
+	c[i] = p[i];
+}
+
+
+/* Divide significands. Neither the numerator nor the denominator
+is permitted to have its high guard word nonzero.  */
+
+
+int __edivm(short unsigned int * __restrict__ den,
+		 short unsigned int * __restrict__ num)
+{
+int i;
+register unsigned short *p;
+unsigned long tnum;
+unsigned short j, tdenm, tquot;
+unsigned short tprod[NI+1];
+unsigned short equot[NI];
+
+p = &equot[0];
+*p++ = num[0];
+*p++ = num[1];
+
+for( i=M; i<NI; i++ )
+	{
+	*p++ = 0;
+	}
+__eshdn1( num );
+tdenm = den[M+1];
+for( i=M; i<NI; i++ )
+	{
+	/* Find trial quotient digit (the radix is 65536). */
+	tnum = (((unsigned long) num[M]) << 16) + num[M+1];
+
+	/* Do not execute the divide instruction if it will overflow. */
+        if( (tdenm * 0xffffUL) < tnum )
+		tquot = 0xffff;
+	else
+		tquot = tnum / tdenm;
+
+		/* Prove that the divide worked. */
+/*
+	tcheck = (unsigned long )tquot * tdenm;
+	if( tnum - tcheck > tdenm )
+		tquot = 0xffff;
+*/
+	/* Multiply denominator by trial quotient digit. */
+	__m16m( tquot, den, tprod );
+	/* The quotient digit may have been overestimated. */
+	if( __ecmpm( tprod, num ) > 0 )
+		{
+		tquot -= 1;
+		__esubm( den, tprod );
+		if( __ecmpm( tprod, num ) > 0 )
+			{
+			tquot -= 1;
+			__esubm( den, tprod );
+			}
+		}
+	__esubm( tprod, num );
+	equot[i] = tquot;
+	__eshup6(num);
+	}
+/* test for nonzero remainder after roundoff bit */
+p = &num[M];
+j = 0;
+for( i=M; i<NI; i++ )
+	{
+	j |= *p++;
+	}
+if( j )
+	j = 1;
+
+for( i=0; i<NI; i++ )
+	num[i] = equot[i];
+
+return( (int )j );
+}
+
+
+
+/* Multiply significands */
+int __emulm(const short unsigned int * __restrict__ a,
+		 short unsigned int * __restrict__ b)
+{
+const unsigned short *p;
+unsigned short *q;
+unsigned short pprod[NI];
+unsigned short equot[NI];
+unsigned short j;
+int i;
+
+equot[0] = b[0];
+equot[1] = b[1];
+for( i=M; i<NI; i++ )
+	equot[i] = 0;
+
+j = 0;
+p = &a[NI-1];
+q = &equot[NI-1];
+for( i=M+1; i<NI; i++ )
+	{
+	if( *p == 0 )
+		{
+		--p;
+		}
+	else
+		{
+		__m16m( *p--, b, pprod );
+		__eaddm(pprod, equot);
+		}
+	j |= *q;
+	__eshdn6(equot);
+	}
+
+for( i=0; i<NI; i++ )
+	b[i] = equot[i];
+
+/* return flag for lost nonzero bits */
+return( (int)j );
+}
+
+
+
+/*
+ * Normalize and round off.
+ *
+ * The internal format number to be rounded is "s".
+ * Input "lost" indicates whether the number is exact.
+ * This is the so-called sticky bit.
+ *
+ * Input "subflg" indicates whether the number was obtained
+ * by a subtraction operation.  In that case if lost is nonzero
+ * then the number is slightly smaller than indicated.
+ *
+ * Input "exp" is the biased exponent, which may be negative.
+ * the exponent field of "s" is ignored but is replaced by
+ * "exp" as adjusted by normalization and rounding.
+ *
+ * Input "rcntrl" is the rounding control.
+ *
+ * Input "rnprc" is precison control (64 or NBITS).
+ */
+
+void __emdnorm(short unsigned int *s, int lost, int subflg, int exp, int rcntrl, int rndprc)
+{
+int i, j;
+unsigned short r;
+int rw = NI-1; /* low guard word */
+int re = NI-2;
+const unsigned short rmsk = 0xffff;
+const unsigned short rmbit = 0x8000;
+#if NE == 6
+unsigned short rbit[NI] = {0,0,0,0,0,0,0,1,0};
+#else
+unsigned short rbit[NI] = {0,0,0,0,0,0,0,0,0,0,0,1,0};
+#endif
+
+/* Normalize */
+j = __enormlz( s );
+
+/* a blank significand could mean either zero or infinity. */
+#ifndef INFINITY
+if( j > NBITS )
+	{
+	__ecleazs( s );
+	return;
+	}
+#endif
+exp -= j;
+#ifndef INFINITY
+if( exp >= 32767L )
+	goto overf;
+#else
+if( (j > NBITS) && (exp < 32767L) )
+	{
+	__ecleazs( s );
+	return;
+	}
+#endif
+if( exp < 0L )
+	{
+	if( exp > (long )(-NBITS-1) )
+		{
+		j = (int )exp;
+		i = __eshift( s, j );
+		if( i )
+			lost = 1;
+		}
+	else
+		{
+		__ecleazs( s );
+		return;
+		}
+	}
+/* Round off, unless told not to by rcntrl. */
+if( rcntrl == 0 )
+	goto mdfin;
+if (rndprc == 64)
+  {
+    rw = 7;
+    re = 6;
+    rbit[NI-2] = 0;
+    rbit[6] = 1;
+  }
+
+/* Shift down 1 temporarily if the data structure has an implied
+ * most significant bit and the number is denormal.
+ * For rndprc = 64 or NBITS, there is no implied bit.
+ * But Intel long double denormals lose one bit of significance even so.
+ */
+#if IBMPC
+if( (exp <= 0) && (rndprc != NBITS) )
+#else
+if( (exp <= 0) && (rndprc != 64) && (rndprc != NBITS) )
+#endif
+	{
+	lost |= s[NI-1] & 1;
+	__eshdn1(s);
+	}
+/* Clear out all bits below the rounding bit,
+ * remembering in r if any were nonzero.
+ */
+r = s[rw] & rmsk;
+if( rndprc < NBITS )
+	{
+	i = rw + 1;
+	while( i < NI )
+		{
+		if( s[i] )
+			r |= 1;
+		s[i] = 0;
+		++i;
+		}
+	}
+s[rw] &= (rmsk ^ 0xffff);
+if( (r & rmbit) != 0 )
+	{
+	if( r == rmbit )
+		{
+		if( lost == 0 )
+			{ /* round to even */
+			if( (s[re] & 1) == 0 )
+				goto mddone;
+			}
+		else
+			{
+			if( subflg != 0 )
+				goto mddone;
+			}
+		}
+	__eaddm( rbit, s );
+	}
+mddone:
+#if IBMPC
+if( (exp <= 0) && (rndprc != NBITS) )
+#else
+if( (exp <= 0) && (rndprc != 64) && (rndprc != NBITS) )
+#endif
+	{
+	__eshup1(s);
+	}
+if( s[2] != 0 )
+	{ /* overflow on roundoff */
+	__eshdn1(s);
+	exp += 1;
+	}
+mdfin:
+s[NI-1] = 0;
+if( exp >= 32767L )
+	{
+#ifndef INFINITY
+overf:
+#endif
+#ifdef INFINITY
+	s[1] = 32767;
+	for( i=2; i<NI-1; i++ )
+		s[i] = 0;
+#else
+	s[1] = 32766;
+	s[2] = 0;
+	for( i=M+1; i<NI-1; i++ )
+		s[i] = 0xffff;
+	s[NI-1] = 0;
+	if( (rndprc < 64) || (rndprc == 113) )
+		s[rw] &= (rmsk ^ 0xffff);
+#endif
+	return;
+	}
+if( exp < 0 )
+	s[1] = 0;
+else
+	s[1] = (unsigned short )exp;
+}
+
+
+/*
+;	Multiply.
+;
+;	unsigned short a[NE], b[NE], c[NE];
+;	emul( a, b, c );	c = b * a
+*/
+void __emul(const short unsigned int *a,
+		 const short unsigned int *b,
+		 short unsigned int *c)
+{
+unsigned short ai[NI], bi[NI];
+int i, j;
+long lt, lta, ltb;
+
+#ifdef NANS
+/* NaN times anything is the same NaN. */
+if( __eisnan(a) )
+	{
+	__emov(a,c);
+	return;
+	}
+if( __eisnan(b) )
+	{
+	__emov(b,c);
+	return;
+	}
+/* Zero times infinity is a NaN. */
+if( (__eisinf(a) && __eiiszero(b))
+	|| (__eisinf(b) && __eiiszero(a)) )
+	{
+	mtherr( "emul", DOMAIN );
+	__enan_NBITS( c );
+	return;
+	}
+#endif
+/* Infinity times anything else is infinity. */
+#ifdef INFINITY
+if( __eisinf(a) || __eisinf(b) )
+	{
+	if( __eisneg(a) ^ __eisneg(b) )
+		*(c+(NE-1)) = 0x8000;
+	else
+		*(c+(NE-1)) = 0;
+	__einfin(c);
+	return;
+	}
+#endif
+__emovi( a, ai );
+__emovi( b, bi );
+lta = ai[E];
+ltb = bi[E];
+if( ai[E] == 0 )
+	{
+	for( i=1; i<NI-1; i++ )
+		{
+		if( ai[i] != 0 )
+			{
+			lta -= __enormlz( ai );
+			goto mnzer1;
+			}
+		}
+	__eclear(c);
+	return;
+	}
+mnzer1:
+
+if( bi[E] == 0 )
+	{
+	for( i=1; i<NI-1; i++ )
+		{
+		if( bi[i] != 0 )
+			{
+			ltb -= __enormlz( bi );
+			goto mnzer2;
+			}
+		}
+	__eclear(c);
+	return;
+	}
+mnzer2:
+
+/* Multiply significands */
+j = __emulm( ai, bi );
+/* calculate exponent */
+lt = lta + ltb - (EXONE - 1);
+__emdnorm( bi, j, 0, lt, 64, NBITS );
+/* calculate sign of product */
+if( ai[0] == bi[0] )
+	bi[0] = 0;
+else
+	bi[0] = 0xffff;
+__emovo( bi, c );
+}
+
+
+/* move out internal format to ieee long double */
+void __toe64(short unsigned int *a, short unsigned int *b)
+{
+register unsigned short *p, *q;
+unsigned short i;
+
+#ifdef NANS
+if( __eiisnan(a) )
+	{
+	__enan_64( b );
+	return;
+	}
+#endif
+#ifdef IBMPC
+/* Shift Intel denormal significand down 1.  */
+if( a[E] == 0 )
+  __eshdn1(a);
+#endif
+p = a;
+#ifdef MIEEE
+q = b;
+#else
+q = b + 4; /* point to output exponent */
+#if 1
+/* NOTE: if data type is 96 bits wide, clear the last word here. */
+*(q+1)= 0;
+#endif
+#endif
+
+/* combine sign and exponent */
+i = *p++;
+#ifdef MIEEE
+if( i )
+	*q++ = *p++ | 0x8000;
+else
+	*q++ = *p++;
+*q++ = 0;
+#else
+if( i )
+	*q-- = *p++ | 0x8000;
+else
+	*q-- = *p++;
+#endif
+/* skip over guard word */
+++p;
+/* move the significand */
+#ifdef MIEEE
+for( i=0; i<4; i++ )
+	*q++ = *p++;
+#else
+#ifdef INFINITY
+if (__eiisinf (a))
+        {
+	/* Intel long double infinity.  */
+	*q-- = 0x8000;
+	*q-- = 0;
+	*q-- = 0;
+	*q = 0;
+	return;
+	}
+#endif
+for( i=0; i<4; i++ )
+	*q-- = *p++;
+#endif
+}
+
+
+/* Compare two e type numbers.
+ *
+ * unsigned short a[NE], b[NE];
+ * ecmp( a, b );
+ *
+ *  returns +1 if a > b
+ *           0 if a == b
+ *          -1 if a < b
+ *          -2 if either a or b is a NaN.
+ */
+int __ecmp(const short unsigned int * __restrict__ a,
+		const short unsigned int *  __restrict__ b)
+{
+unsigned short ai[NI], bi[NI];
+register unsigned short *p, *q;
+register int i;
+int msign;
+
+#ifdef NANS
+if (__eisnan (a)  || __eisnan (b))
+	return( -2 );
+#endif
+__emovi( a, ai );
+p = ai;
+__emovi( b, bi );
+q = bi;
+
+if( *p != *q )
+	{ /* the signs are different */
+/* -0 equals + 0 */
+	for( i=1; i<NI-1; i++ )
+		{
+		if( ai[i] != 0 )
+			goto nzro;
+		if( bi[i] != 0 )
+			goto nzro;
+		}
+	return(0);
+nzro:
+	if( *p == 0 )
+		return( 1 );
+	else
+		return( -1 );
+	}
+/* both are the same sign */
+if( *p == 0 )
+	msign = 1;
+else
+	msign = -1;
+i = NI-1;
+do
+	{
+	if( *p++ != *q++ )
+		{
+		goto diff;
+		}
+	}
+while( --i > 0 );
+
+return(0);	/* equality */
+
+
+
+diff:
+
+if( *(--p) > *(--q) )
+	return( msign );		/* p is bigger */
+else
+	return( -msign );	/* p is littler */
+}
+
+/*
+;	Shift significand
+;
+;	Shifts significand area up or down by the number of bits
+;	given by the variable sc.
+*/
+int __eshift(short unsigned int *x, int sc)
+{
+unsigned short lost;
+unsigned short *p;
+
+if( sc == 0 )
+	return( 0 );
+
+lost = 0;
+p = x + NI-1;
+
+if( sc < 0 )
+	{
+	sc = -sc;
+	while( sc >= 16 )
+		{
+		lost |= *p;	/* remember lost bits */
+		__eshdn6(x);
+		sc -= 16;
+		}
+
+	while( sc >= 8 )
+		{
+		lost |= *p & 0xff;
+		__eshdn8(x);
+		sc -= 8;
+		}
+
+	while( sc > 0 )
+		{
+		lost |= *p & 1;
+		__eshdn1(x);
+		sc -= 1;
+		}
+	}
+else
+	{
+	while( sc >= 16 )
+		{
+		__eshup6(x);
+		sc -= 16;
+		}
+
+	while( sc >= 8 )
+		{
+		__eshup8(x);
+		sc -= 8;
+		}
+
+	while( sc > 0 )
+		{
+		__eshup1(x);
+		sc -= 1;
+		}
+	}
+if( lost )
+	lost = 1;
+return( (int )lost );
+}
+
+
+
+/*
+;	normalize
+;
+; Shift normalizes the significand area pointed to by argument
+; shift count (up = positive) is returned.
+*/
+int __enormlz(short unsigned int *x)
+{
+register unsigned short *p;
+int sc;
+
+sc = 0;
+p = &x[M];
+if( *p != 0 )
+	goto normdn;
+++p;
+if( *p & 0x8000 )
+	return( 0 );	/* already normalized */
+while( *p == 0 )
+	{
+	__eshup6(x);
+	sc += 16;
+/* With guard word, there are NBITS+16 bits available.
+ * return true if all are zero.
+ */
+	if( sc > NBITS )
+		return( sc );
+	}
+/* see if high byte is zero */
+while( (*p & 0xff00) == 0 )
+	{
+	__eshup8(x);
+	sc += 8;
+	}
+/* now shift 1 bit at a time */
+while( (*p  & 0x8000) == 0)
+	{
+	__eshup1(x);
+	sc += 1;
+	if( sc > (NBITS+16) )
+		{
+		mtherr( "enormlz", UNDERFLOW );
+		return( sc );
+		}
+	}
+return( sc );
+
+/* Normalize by shifting down out of the high guard word
+   of the significand */
+normdn:
+
+if( *p & 0xff00 )
+	{
+	__eshdn8(x);
+	sc -= 8;
+	}
+while( *p != 0 )
+	{
+	__eshdn1(x);
+	sc -= 1;
+
+	if( sc < -NBITS )
+		{
+		mtherr( "enormlz", OVERFLOW );
+		return( sc );
+		}
+	}
+return( sc );
+}
+
+
+/* Move internal format number out,
+ * converting it to external format.
+ */
+void __emovo(const short unsigned int * __restrict__ a,
+		  short unsigned int * __restrict__ b)
+{
+register const unsigned short *p;
+register unsigned short *q;
+unsigned short i;
+
+p = a;
+q = b + (NE-1); /* point to output exponent */
+/* combine sign and exponent */
+i = *p++;
+if( i )
+	*q-- = *p++ | 0x8000;
+else
+	*q-- = *p++;
+#ifdef INFINITY
+if( *(p-1) == 0x7fff )
+	{
+#ifdef NANS
+	if( __eiisnan(a) )
+		{
+		__enan_NBITS( b );
+		return;
+		}
+#endif
+	__einfin(b);
+	return;
+	}
+#endif
+/* skip over guard word */
+++p;
+/* move the significand */
+for( i=0; i<NE-1; i++ )
+	*q-- = *p++;
+}
+
+
+#if USE_LDTOA
+
+
+void __eiremain(short unsigned int *den, short unsigned int *num,
+	 short unsigned int *equot )
+{
+long ld, ln;
+unsigned short j;
+
+ld = den[E];
+ld -= __enormlz( den );
+ln = num[E];
+ln -= __enormlz( num );
+__ecleaz( equot );
+while( ln >= ld )
+	{
+	if( __ecmpm(den,num) <= 0 )
+		{
+		__esubm(den, num);
+		j = 1;
+		}
+	else
+		{
+		j = 0;
+		}
+	__eshup1(equot);
+	equot[NI-1] |= j;
+	__eshup1(num);
+	ln -= 1;
+	}
+__emdnorm( num, 0, 0, ln, 0, NBITS );
+}
+
+
+void __eadd1(const short unsigned int *  __restrict__ a,
+		  const short unsigned int *  __restrict__ b,
+		  short unsigned int *  __restrict__ c,
+		  int subflg)
+{
+unsigned short ai[NI], bi[NI], ci[NI];
+int i, lost, j, k;
+long lt, lta, ltb;
+
+#ifdef INFINITY
+if( __eisinf(a) )
+	{
+	__emov(a,c);
+	if( subflg )
+		__eneg(c);
+	return;
+	}
+if( __eisinf(b) )
+	{
+	__emov(b,c);
+	return;
+	}
+#endif
+__emovi( a, ai );
+__emovi( b, bi );
+if( sub )
+	ai[0] = ~ai[0];
+
+/* compare exponents */
+lta = ai[E];
+ltb = bi[E];
+lt = lta - ltb;
+if( lt > 0L )
+	{	/* put the larger number in bi */
+	__emovz( bi, ci );
+	__emovz( ai, bi );
+	__emovz( ci, ai );
+	ltb = bi[E];
+	lt = -lt;
+	}
+lost = 0;
+if( lt != 0L )
+	{
+	if( lt < (long )(-NBITS-1) )
+		goto done;	/* answer same as larger addend */
+	k = (int )lt;
+	lost = __eshift( ai, k ); /* shift the smaller number down */
+	}
+else
+	{
+/* exponents were the same, so must compare significands */
+	i = __ecmpm( ai, bi );
+	if( i == 0 )
+		{ /* the numbers are identical in magnitude */
+		/* if different signs, result is zero */
+		if( ai[0] != bi[0] )
+			{
+			__eclear(c);
+			return;
+			}
+		/* if same sign, result is double */
+		/* double denomalized tiny number */
+		if( (bi[E] == 0) && ((bi[3] & 0x8000) == 0) )
+			{
+			__eshup1( bi );
+			goto done;
+			}
+		/* add 1 to exponent unless both are zero! */
+		for( j=1; j<NI-1; j++ )
+			{
+			if( bi[j] != 0 )
+				{
+/* This could overflow, but let emovo take care of that. */
+				ltb += 1;
+				break;
+				}
+			}
+		bi[E] = (unsigned short )ltb;
+		goto done;
+		}
+	if( i > 0 )
+		{	/* put the larger number in bi */
+		__emovz( bi, ci );
+		__emovz( ai, bi );
+		__emovz( ci, ai );
+		}
+	}
+if( ai[0] == bi[0] )
+	{
+	__eaddm( ai, bi );
+	subflg = 0;
+	}
+else
+	{
+	__esubm( ai, bi );
+	subflg = 1;
+	}
+__emdnorm( bi, lost, subflg, ltb, 64, NBITS);
+
+done:
+__emovo( bi, c );
+}
+
+
+/* y = largest integer not greater than x
+ * (truncated toward minus infinity)
+ *
+ * unsigned short x[NE], y[NE]
+ *
+ * efloor( x, y );
+ */
+
+
+void __efloor(short unsigned int *x, short unsigned int *y)
+{
+register unsigned short *p;
+int e, expon, i;
+unsigned short f[NE];
+const unsigned short bmask[] = {
+0xffff,
+0xfffe,
+0xfffc,
+0xfff8,
+0xfff0,
+0xffe0,
+0xffc0,
+0xff80,
+0xff00,
+0xfe00,
+0xfc00,
+0xf800,
+0xf000,
+0xe000,
+0xc000,
+0x8000,
+0x0000,
+};
+
+__emov( x, f ); /* leave in external format */
+expon = (int )f[NE-1];
+e = (expon & 0x7fff) - (EXONE - 1);
+if( e <= 0 )
+	{
+	__eclear(y);
+	goto isitneg;
+	}
+/* number of bits to clear out */
+e = NBITS - e;
+__emov( f, y );
+if( e <= 0 )
+	return;
+
+p = &y[0];
+while( e >= 16 )
+	{
+	*p++ = 0;
+	e -= 16;
+	}
+/* clear the remaining bits */
+*p &= bmask[e];
+/* truncate negatives toward minus infinity */
+isitneg:
+
+if( (unsigned short )expon & (unsigned short )0x8000 )
+	{
+	for( i=0; i<NE-1; i++ )
+		{
+		if( f[i] != y[i] )
+			{
+			__esub( __eone, y, y );
+			break;
+			}
+		}
+	}
+}
+
+/*
+;	Subtract external format numbers.
+;
+;	unsigned short a[NE], b[NE], c[NE];
+;	esub( a, b, c );	 c = b - a
+*/
+
+
+void __esub(const short unsigned int *  a,
+		 const short unsigned int *  b,
+		 short unsigned int *  c)
+{
+
+#ifdef NANS
+if( __eisnan(a) )
+	{
+	__emov (a, c);
+	return;
+	}
+if( __eisnan(b) )
+	{
+	__emov(b,c);
+	return;
+	}
+/* Infinity minus infinity is a NaN.
+ * Test for subtracting infinities of the same sign.
+ */
+if( __eisinf(a) && __eisinf(b) && ((__eisneg (a) ^ __eisneg (b)) == 0))
+	{
+	mtherr( "esub", DOMAIN );
+	__enan_NBITS( c );
+	return;
+	}
+#endif
+__eadd1( a, b, c, 1 );
+}
+
+
+
+/*
+;	Divide.
+;
+;	unsigned short a[NI], b[NI], c[NI];
+;	ediv( a, b, c );	c = b / a
+*/
+
+void __ediv(const short unsigned int *a,
+		 const short unsigned int *b,
+		 short unsigned int *c)
+{
+unsigned short ai[NI], bi[NI];
+int i;
+long lt, lta, ltb;
+
+#ifdef NANS
+/* Return any NaN input. */
+if( __eisnan(a) )
+	{
+	__emov(a,c);
+	return;
+	}
+if( __eisnan(b) )
+	{
+	__emov(b,c);
+	return;
+	}
+/* Zero over zero, or infinity over infinity, is a NaN. */
+if( (__eiszero(a) && __eiszero(b))
+	|| (__eisinf (a) && __eisinf (b)) )
+	{
+	mtherr( "ediv", DOMAIN );
+	__enan_NBITS( c );
+	return;
+	}
+#endif
+/* Infinity over anything else is infinity. */
+#ifdef INFINITY
+if( __eisinf(b) )
+	{
+	if( __eisneg(a) ^ __eisneg(b) )
+		*(c+(NE-1)) = 0x8000;
+	else
+		*(c+(NE-1)) = 0;
+	__einfin(c);
+	return;
+	}
+if( __eisinf(a) )
+	{
+	__eclear(c);
+	return;
+	}
+#endif
+__emovi( a, ai );
+__emovi( b, bi );
+lta = ai[E];
+ltb = bi[E];
+if( bi[E] == 0 )
+	{ /* See if numerator is zero. */
+	for( i=1; i<NI-1; i++ )
+		{
+		if( bi[i] != 0 )
+			{
+			ltb -= __enormlz( bi );
+			goto dnzro1;
+			}
+		}
+	__eclear(c);
+	return;
+	}
+dnzro1:
+
+if( ai[E] == 0 )
+	{	/* possible divide by zero */
+	for( i=1; i<NI-1; i++ )
+		{
+		if( ai[i] != 0 )
+			{
+			lta -= __enormlz( ai );
+			goto dnzro2;
+			}
+		}
+	if( ai[0] == bi[0] )
+		*(c+(NE-1)) = 0;
+	else
+		*(c+(NE-1)) = 0x8000;
+	__einfin(c);
+	mtherr( "ediv", SING );
+	return;
+	}
+dnzro2:
+
+i = __edivm( ai, bi );
+/* calculate exponent */
+lt = ltb - lta + EXONE;
+__emdnorm( bi, i, 0, lt, 64, NBITS );
+/* set the sign */
+if( ai[0] == bi[0] )
+	bi[0] = 0;
+else
+	bi[0] = 0Xffff;
+__emovo( bi, c );
+}
+
+void __e64toe(short unsigned int *pe, short unsigned int *y)
+{
+unsigned short yy[NI];
+unsigned short *p, *q, *e;
+int i;
+
+e = pe;
+p = yy;
+for( i=0; i<NE-5; i++ )
+	*p++ = 0;
+#ifdef IBMPC
+for( i=0; i<5; i++ )
+	*p++ = *e++;
+#endif
+#ifdef DEC
+for( i=0; i<5; i++ )
+	*p++ = *e++;
+#endif
+#ifdef MIEEE
+p = &yy[0] + (NE-1);
+*p-- = *e++;
+++e;
+for( i=0; i<4; i++ )
+	*p-- = *e++;
+#endif
+
+#ifdef IBMPC
+/* For Intel long double, shift denormal significand up 1
+   -- but only if the top significand bit is zero.  */
+if((yy[NE-1] & 0x7fff) == 0 && (yy[NE-2] & 0x8000) == 0)
+  {
+    unsigned short temp[NI+1];
+    __emovi(yy, temp);
+    __eshup1(temp);
+    __emovo(temp,y);
+    return;
+  }
+#endif
+#ifdef INFINITY
+/* Point to the exponent field.  */
+p = &yy[NE-1];
+if( *p == 0x7fff )
+	{
+#ifdef NANS
+#ifdef IBMPC
+	for( i=0; i<4; i++ )
+		{
+		if((i != 3 && pe[i] != 0)
+		   /* Check for Intel long double infinity pattern.  */
+		   || (i == 3 && pe[i] != 0x8000))
+			{
+			__enan_NBITS( y );
+			return;
+			}
+		}
+#else
+	for( i=1; i<=4; i++ )
+		{
+		if( pe[i] != 0 )
+			{
+			__enan_NBITS( y );
+			return;
+			}
+		}
+#endif
+#endif /* NANS */
+	__eclear( y );
+	__einfin( y );
+	if( *p & 0x8000 )
+		__eneg(y);
+	return;
+	}
+#endif
+p = yy;
+q = y;
+for( i=0; i<NE; i++ )
+	*q++ = *p++;
+}
+
+#endif /* USE_LDTOA */ 
diff --git a/mingw-w64-crt/math/copysign.c b/mingw-w64-crt/math/copysign.c
index 983a508..aae39e5 100644
--- a/mingw-w64-crt/math/copysign.c
+++ b/mingw-w64-crt/math/copysign.c
@@ -1,15 +1,15 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-double copysign(double x, double y)

-{

-  unsigned int hx,hy;

-  hx = ((unsigned int *)&x)[1];

-  hy = ((unsigned int *)&y)[1];

-  ((unsigned int *)&x)[1] =  (hx & 0x7fffffff) | (hy & 0x80000000);

-  return x;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+double copysign(double x, double y)
+{
+  unsigned int hx,hy;
+  hx = ((unsigned int *)&x)[1];
+  hy = ((unsigned int *)&y)[1];
+  ((unsigned int *)&x)[1] =  (hx & 0x7fffffff) | (hy & 0x80000000);
+  return x;
+}
diff --git a/mingw-w64-crt/math/copysignf.c b/mingw-w64-crt/math/copysignf.c
index b87736f..44586cf 100644
--- a/mingw-w64-crt/math/copysignf.c
+++ b/mingw-w64-crt/math/copysignf.c
@@ -1,19 +1,19 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-typedef union ui_f {

-	float f;

-	unsigned int ui;

-} ui_f;

-

-float copysignf(float aX, float aY)

-{

-  ui_f x,y;

-  x.f=aX; y.f=aY;

-  x.ui= (x.ui & 0x7fffffff) | (y.ui & 0x80000000);

-  return x.f;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+typedef union ui_f {
+	float f;
+	unsigned int ui;
+} ui_f;
+
+float copysignf(float aX, float aY)
+{
+  ui_f x,y;
+  x.f=aX; y.f=aY;
+  x.ui= (x.ui & 0x7fffffff) | (y.ui & 0x80000000);
+  return x.f;
+}
diff --git a/mingw-w64-crt/math/coshf.c b/mingw-w64-crt/math/coshf.c
index fcd70dd..32e3534 100644
--- a/mingw-w64-crt/math/coshf.c
+++ b/mingw-w64-crt/math/coshf.c
@@ -1,8 +1,8 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-float coshf (float x)

-  {return (float) cosh (x);}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+float coshf (float x)
+  {return (float) cosh (x);}
diff --git a/mingw-w64-crt/math/coshl.c b/mingw-w64-crt/math/coshl.c
index ffc4bdb..c3fb112 100644
--- a/mingw-w64-crt/math/coshl.c
+++ b/mingw-w64-crt/math/coshl.c
@@ -1,45 +1,45 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-#ifndef _SET_ERRNO

-#define _SET_ERRNO(x)

-#endif

-

-long double coshl(x)

-long double x;

-{

-long double y;

-

-#ifdef NANS

-if( isnanl(x) )

-	{

-	_SET_ERRNO(EDOM);

-	return(x);

-  	}

-#endif

-if( x < 0 )

-	x = -x;

-if( x > (MAXLOGL + LOGE2L) )

-	{

-	mtherr( "coshl", OVERFLOW );

-	_SET_ERRNO(ERANGE);

-#ifdef INFINITIES

-	return( INFINITYL );

-#else

-	return( MAXNUML );

-#endif

-	}	

-if( x >= (MAXLOGL - LOGE2L) )

-	{

-	y = expl(0.5L * x);

-	y = (0.5L * y) * y;

-	return(y);

-	}

-y = expl(x);

-y = 0.5L * (y + 1.0L / y);

-return( y );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+#ifndef _SET_ERRNO
+#define _SET_ERRNO(x)
+#endif
+
+long double coshl(x)
+long double x;
+{
+long double y;
+
+#ifdef NANS
+if( isnanl(x) )
+	{
+	_SET_ERRNO(EDOM);
+	return(x);
+  	}
+#endif
+if( x < 0 )
+	x = -x;
+if( x > (MAXLOGL + LOGE2L) )
+	{
+	mtherr( "coshl", OVERFLOW );
+	_SET_ERRNO(ERANGE);
+#ifdef INFINITIES
+	return( INFINITYL );
+#else
+	return( MAXNUML );
+#endif
+	}	
+if( x >= (MAXLOGL - LOGE2L) )
+	{
+	y = expl(0.5L * x);
+	y = (0.5L * y) * y;
+	return(y);
+	}
+y = expl(x);
+y = 0.5L * (y + 1.0L / y);
+return( y );
+}
diff --git a/mingw-w64-crt/math/erfl.c b/mingw-w64-crt/math/erfl.c
index 2e54114..e520b83 100644
--- a/mingw-w64-crt/math/erfl.c
+++ b/mingw-w64-crt/math/erfl.c
@@ -1,306 +1,306 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*							erfl.c

- *

- *	Error function

- *

- *

- *

- * SYNOPSIS:

- *

- * long double x, y, erfl();

- *

- * y = erfl( x );

- *

- *

- *

- * DESCRIPTION:

- *

- * The integral is

- *

- *                           x 

- *                            -

- *                 2         | |          2

- *   erf(x)  =  --------     |    exp( - t  ) dt.

- *              sqrt(pi)   | |

- *                          -

- *                           0

- *

- * The magnitude of x is limited to about 106.56 for IEEE

- * arithmetic; 1 or -1 is returned outside this range.

- *

- * For 0 <= |x| < 1, erf(x) = x * P6(x^2)/Q6(x^2);

- * Otherwise: erf(x) = 1 - erfc(x).

- *

- *

- *

- * ACCURACY:

- *

- *                      Relative error:

- * arithmetic   domain     # trials      peak         rms

- *    IEEE      0,1         50000       2.0e-19     5.7e-20

- *

- */

-

-/*							erfcl.c

- *

- *	Complementary error function

- *

- *

- *

- * SYNOPSIS:

- *

- * long double x, y, erfcl();

- *

- * y = erfcl( x );

- *

- *

- *

- * DESCRIPTION:

- *

- *

- *  1 - erf(x) =

- *

- *                           inf. 

- *                             -

- *                  2         | |          2

- *   erfc(x)  =  --------     |    exp( - t  ) dt

- *               sqrt(pi)   | |

- *                           -

- *                            x

- *

- *

- * For small x, erfc(x) = 1 - erf(x); otherwise rational

- * approximations are computed.

- *

- * A special function expx2l.c is used to suppress error amplification

- * in computing exp(-x^2).

- *

- *

- * ACCURACY:

- *

- *                      Relative error:

- * arithmetic   domain     # trials      peak         rms

- *    IEEE      0,13        50000      8.4e-19      9.7e-20

- *    IEEE      6,106.56    20000      2.9e-19      7.1e-20

- *

- *

- * ERROR MESSAGES:

- *

- *   message          condition              value returned

- * erfcl underflow    x^2 > MAXLOGL              0.0

- *

- *

- */

-

-

-/*

-Modified from file ndtrl.c

-Cephes Math Library Release 2.3:  January, 1995

-Copyright 1984, 1995 by Stephen L. Moshier

-*/

-

-#include <math.h>

-#include "cephes_mconf.h"

-

-long double erfl(long double x);

-

-/* erfc(x) = exp(-x^2) P(1/x)/Q(1/x)

-   1/8 <= 1/x <= 1

-   Peak relative error 5.8e-21  */

-

-static const unsigned short P[] = {

-0x4bf0,0x9ad8,0x7a03,0x86c7,0x401d, XPD

-0xdf23,0xd843,0x4032,0x8881,0x401e, XPD

-0xd025,0xcfd5,0x8494,0x88d3,0x401e, XPD

-0xb6d0,0xc92b,0x5417,0xacb1,0x401d, XPD

-0xada8,0x356a,0x4982,0x94a6,0x401c, XPD

-0x4e13,0xcaee,0x9e31,0xb258,0x401a, XPD

-0x5840,0x554d,0x37a3,0x9239,0x4018, XPD

-0x3b58,0x3da2,0xaf02,0x9780,0x4015, XPD

-0x0144,0x489e,0xbe68,0x9c31,0x4011, XPD

-0x333b,0xd9e6,0xd404,0x986f,0xbfee, XPD

-};

-static const unsigned short Q[] = {

-/* 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD */

-0x0e43,0x302d,0x79ed,0x86c7,0x401d, XPD

-0xf817,0x9128,0xc0f8,0xd48b,0x401e, XPD

-0x8eae,0x8dad,0x6eb4,0x9aa2,0x401f, XPD

-0x00e7,0x7595,0xcd06,0x88bb,0x401f, XPD

-0x4991,0xcfda,0x52f1,0xa2a9,0x401e, XPD

-0xc39d,0xe415,0xc43d,0x87c0,0x401d, XPD

-0xa75d,0x436f,0x30dd,0xa027,0x401b, XPD

-0xc4cb,0x305a,0xbf78,0x8220,0x4019, XPD

-0x3708,0x33b1,0x07fa,0x8644,0x4016, XPD

-0x24fa,0x96f6,0x7153,0x8a6c,0x4012, XPD

-};

-

-/* erfc(x) = exp(-x^2) 1/x R(1/x^2) / S(1/x^2)

-   1/128 <= 1/x < 1/8

-   Peak relative error 1.9e-21  */

-

-static const unsigned short R[] = {

-0x260a,0xab95,0x2fc7,0xe7c4,0x4000, XPD

-0x4761,0x613e,0xdf6d,0xe58e,0x4001, XPD

-0x0615,0x4b00,0x575f,0xdc7b,0x4000, XPD

-0x521d,0x8527,0x3435,0x8dc2,0x3ffe, XPD

-0x22cf,0xc711,0x6c5b,0xdcfb,0x3ff9, XPD

-};

-static const unsigned short S[] = {

-/* 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD */

-0x5de6,0x17d7,0x54d6,0xaba9,0x4002, XPD

-0x55d5,0xd300,0xe71e,0xf564,0x4002, XPD

-0xb611,0x8f76,0xf020,0xd255,0x4001, XPD

-0x3684,0x3798,0xb793,0x80b0,0x3fff, XPD

-0xf5af,0x2fb2,0x1e57,0xc3d7,0x3ffa, XPD

-};

-

-/* erf(x)  = x T(x^2)/U(x^2)

-   0 <= x <= 1

-   Peak relative error 7.6e-23  */

-

-static const unsigned short T[] = {

-0xfd7a,0x3a1a,0x705b,0xe0c4,0x3ffb, XPD

-0x3128,0xc337,0x3716,0xace5,0x4001, XPD

-0x9517,0x4e93,0x540e,0x8f97,0x4007, XPD

-0x6118,0x6059,0x9093,0xa757,0x400a, XPD

-0xb954,0xa987,0xc60c,0xbc83,0x400e, XPD

-0x7a56,0xe45a,0xa4bd,0x975b,0x4010, XPD

-0xc446,0x6bab,0x0b2a,0x86d0,0x4013, XPD

-};

-

-static const unsigned short U[] = {

-/* 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD */

-0x3453,0x1f8e,0xf688,0xb507,0x4004, XPD

-0x71ac,0xb12f,0x21ca,0xf2e2,0x4008, XPD

-0xffe8,0x9cac,0x3b84,0xc2ac,0x400c, XPD

-0x481d,0x445b,0xc807,0xc232,0x400f, XPD

-0x9ad5,0x1aef,0x45b1,0xe25e,0x4011, XPD

-0x71a7,0x1cad,0x012e,0xeef3,0x4012, XPD

-};

-

-/*							expx2l.c

- *

- *	Exponential of squared argument

- *

- *

- *

- * SYNOPSIS:

- *

- * long double x, y, expmx2l();

- * int sign;

- *

- * y = expx2l( x );

- *

- *

- *

- * DESCRIPTION:

- *

- * Computes y = exp(x*x) while suppressing error amplification

- * that would ordinarily arise from the inexactness of the

- * exponential argument x*x.

- *

- *

- *

- * ACCURACY:

- *

- *                      Relative error:

- * arithmetic      domain        # trials      peak         rms

- *   IEEE     -106.566, 106.566    10^5       1.6e-19     4.4e-20

- *

- */

-

-#define M 32768.0L

-#define MINV 3.0517578125e-5L

-

-static long double expx2l (long double x)

-{

-  long double u, u1, m, f;

-

-  x = fabsl (x);

-  /* Represent x as an exact multiple of M plus a residual.

-     M is a power of 2 chosen so that exp(m * m) does not overflow

-     or underflow and so that |x - m| is small.  */

-  m = MINV * floorl(M * x + 0.5L);

-  f = x - m;

-

-  /* x^2 = m^2 + 2mf + f^2 */

-  u = m * m;

-  u1 = 2 * m * f  +  f * f;

-

-  if ((u+u1) > MAXLOGL)

-    return (INFINITYL);

-

-  /* u is exact, u1 is small.  */

-  u = expl(u) * expl(u1);

-  return(u);

-}

-

-long double erfcl(long double a)

-{

-long double p,q,x,y,z;

-

-if (isinf (a))

-	return (signbit (a) ? 2.0 : 0.0);

-

-x = fabsl (a);

-

-if (x < 1.0L)

-	return (1.0L - erfl(a));

-

-z = a * a;

-

-if( z  > MAXLOGL )

-	{

-under:

-	mtherr( "erfcl", UNDERFLOW );

-        errno = ERANGE;

-	return (signbit (a) ? 2.0 : 0.0);

-	}

-

-/* Compute z = expl(a * a).  */

-z = expx2l (a);

-y = 1.0L/x;

-

-if (x < 8.0L)

-	{

-	p = polevll (y, P, 9);

-	q = p1evll (y, Q, 10);

-	}

-else

-	{

-	q = y * y;

-	p = y * polevll (q, R, 4);

-	q = p1evll (q, S, 5);

-	}

-y = p/(q * z);

-

-if (a < 0.0L)

-	y = 2.0L - y;

-

-if (y == 0.0L)

-	goto under;

-

-return (y);

-}

-

-long double erfl(long double x)

-{

-long double y, z;

-

-if( x == 0.0L )

-	return (x);

-

-if (isinf (x))

-	return (signbit (x) ?  -1.0L : 1.0L);

-

-if (fabsl(x) > 1.0L)

-	return (1.0L - erfcl (x));

-

-z = x * x;

-y = x * polevll( z, T, 6 ) / p1evll( z, U, 6 );

-return( y );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*							erfl.c
+ *
+ *	Error function
+ *
+ *
+ *
+ * SYNOPSIS:
+ *
+ * long double x, y, erfl();
+ *
+ * y = erfl( x );
+ *
+ *
+ *
+ * DESCRIPTION:
+ *
+ * The integral is
+ *
+ *                           x 
+ *                            -
+ *                 2         | |          2
+ *   erf(x)  =  --------     |    exp( - t  ) dt.
+ *              sqrt(pi)   | |
+ *                          -
+ *                           0
+ *
+ * The magnitude of x is limited to about 106.56 for IEEE
+ * arithmetic; 1 or -1 is returned outside this range.
+ *
+ * For 0 <= |x| < 1, erf(x) = x * P6(x^2)/Q6(x^2);
+ * Otherwise: erf(x) = 1 - erfc(x).
+ *
+ *
+ *
+ * ACCURACY:
+ *
+ *                      Relative error:
+ * arithmetic   domain     # trials      peak         rms
+ *    IEEE      0,1         50000       2.0e-19     5.7e-20
+ *
+ */
+
+/*							erfcl.c
+ *
+ *	Complementary error function
+ *
+ *
+ *
+ * SYNOPSIS:
+ *
+ * long double x, y, erfcl();
+ *
+ * y = erfcl( x );
+ *
+ *
+ *
+ * DESCRIPTION:
+ *
+ *
+ *  1 - erf(x) =
+ *
+ *                           inf. 
+ *                             -
+ *                  2         | |          2
+ *   erfc(x)  =  --------     |    exp( - t  ) dt
+ *               sqrt(pi)   | |
+ *                           -
+ *                            x
+ *
+ *
+ * For small x, erfc(x) = 1 - erf(x); otherwise rational
+ * approximations are computed.
+ *
+ * A special function expx2l.c is used to suppress error amplification
+ * in computing exp(-x^2).
+ *
+ *
+ * ACCURACY:
+ *
+ *                      Relative error:
+ * arithmetic   domain     # trials      peak         rms
+ *    IEEE      0,13        50000      8.4e-19      9.7e-20
+ *    IEEE      6,106.56    20000      2.9e-19      7.1e-20
+ *
+ *
+ * ERROR MESSAGES:
+ *
+ *   message          condition              value returned
+ * erfcl underflow    x^2 > MAXLOGL              0.0
+ *
+ *
+ */
+
+
+/*
+Modified from file ndtrl.c
+Cephes Math Library Release 2.3:  January, 1995
+Copyright 1984, 1995 by Stephen L. Moshier
+*/
+
+#include <math.h>
+#include "cephes_mconf.h"
+
+long double erfl(long double x);
+
+/* erfc(x) = exp(-x^2) P(1/x)/Q(1/x)
+   1/8 <= 1/x <= 1
+   Peak relative error 5.8e-21  */
+
+static const unsigned short P[] = {
+0x4bf0,0x9ad8,0x7a03,0x86c7,0x401d, XPD
+0xdf23,0xd843,0x4032,0x8881,0x401e, XPD
+0xd025,0xcfd5,0x8494,0x88d3,0x401e, XPD
+0xb6d0,0xc92b,0x5417,0xacb1,0x401d, XPD
+0xada8,0x356a,0x4982,0x94a6,0x401c, XPD
+0x4e13,0xcaee,0x9e31,0xb258,0x401a, XPD
+0x5840,0x554d,0x37a3,0x9239,0x4018, XPD
+0x3b58,0x3da2,0xaf02,0x9780,0x4015, XPD
+0x0144,0x489e,0xbe68,0x9c31,0x4011, XPD
+0x333b,0xd9e6,0xd404,0x986f,0xbfee, XPD
+};
+static const unsigned short Q[] = {
+/* 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD */
+0x0e43,0x302d,0x79ed,0x86c7,0x401d, XPD
+0xf817,0x9128,0xc0f8,0xd48b,0x401e, XPD
+0x8eae,0x8dad,0x6eb4,0x9aa2,0x401f, XPD
+0x00e7,0x7595,0xcd06,0x88bb,0x401f, XPD
+0x4991,0xcfda,0x52f1,0xa2a9,0x401e, XPD
+0xc39d,0xe415,0xc43d,0x87c0,0x401d, XPD
+0xa75d,0x436f,0x30dd,0xa027,0x401b, XPD
+0xc4cb,0x305a,0xbf78,0x8220,0x4019, XPD
+0x3708,0x33b1,0x07fa,0x8644,0x4016, XPD
+0x24fa,0x96f6,0x7153,0x8a6c,0x4012, XPD
+};
+
+/* erfc(x) = exp(-x^2) 1/x R(1/x^2) / S(1/x^2)
+   1/128 <= 1/x < 1/8
+   Peak relative error 1.9e-21  */
+
+static const unsigned short R[] = {
+0x260a,0xab95,0x2fc7,0xe7c4,0x4000, XPD
+0x4761,0x613e,0xdf6d,0xe58e,0x4001, XPD
+0x0615,0x4b00,0x575f,0xdc7b,0x4000, XPD
+0x521d,0x8527,0x3435,0x8dc2,0x3ffe, XPD
+0x22cf,0xc711,0x6c5b,0xdcfb,0x3ff9, XPD
+};
+static const unsigned short S[] = {
+/* 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD */
+0x5de6,0x17d7,0x54d6,0xaba9,0x4002, XPD
+0x55d5,0xd300,0xe71e,0xf564,0x4002, XPD
+0xb611,0x8f76,0xf020,0xd255,0x4001, XPD
+0x3684,0x3798,0xb793,0x80b0,0x3fff, XPD
+0xf5af,0x2fb2,0x1e57,0xc3d7,0x3ffa, XPD
+};
+
+/* erf(x)  = x T(x^2)/U(x^2)
+   0 <= x <= 1
+   Peak relative error 7.6e-23  */
+
+static const unsigned short T[] = {
+0xfd7a,0x3a1a,0x705b,0xe0c4,0x3ffb, XPD
+0x3128,0xc337,0x3716,0xace5,0x4001, XPD
+0x9517,0x4e93,0x540e,0x8f97,0x4007, XPD
+0x6118,0x6059,0x9093,0xa757,0x400a, XPD
+0xb954,0xa987,0xc60c,0xbc83,0x400e, XPD
+0x7a56,0xe45a,0xa4bd,0x975b,0x4010, XPD
+0xc446,0x6bab,0x0b2a,0x86d0,0x4013, XPD
+};
+
+static const unsigned short U[] = {
+/* 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD */
+0x3453,0x1f8e,0xf688,0xb507,0x4004, XPD
+0x71ac,0xb12f,0x21ca,0xf2e2,0x4008, XPD
+0xffe8,0x9cac,0x3b84,0xc2ac,0x400c, XPD
+0x481d,0x445b,0xc807,0xc232,0x400f, XPD
+0x9ad5,0x1aef,0x45b1,0xe25e,0x4011, XPD
+0x71a7,0x1cad,0x012e,0xeef3,0x4012, XPD
+};
+
+/*							expx2l.c
+ *
+ *	Exponential of squared argument
+ *
+ *
+ *
+ * SYNOPSIS:
+ *
+ * long double x, y, expmx2l();
+ * int sign;
+ *
+ * y = expx2l( x );
+ *
+ *
+ *
+ * DESCRIPTION:
+ *
+ * Computes y = exp(x*x) while suppressing error amplification
+ * that would ordinarily arise from the inexactness of the
+ * exponential argument x*x.
+ *
+ *
+ *
+ * ACCURACY:
+ *
+ *                      Relative error:
+ * arithmetic      domain        # trials      peak         rms
+ *   IEEE     -106.566, 106.566    10^5       1.6e-19     4.4e-20
+ *
+ */
+
+#define M 32768.0L
+#define MINV 3.0517578125e-5L
+
+static long double expx2l (long double x)
+{
+  long double u, u1, m, f;
+
+  x = fabsl (x);
+  /* Represent x as an exact multiple of M plus a residual.
+     M is a power of 2 chosen so that exp(m * m) does not overflow
+     or underflow and so that |x - m| is small.  */
+  m = MINV * floorl(M * x + 0.5L);
+  f = x - m;
+
+  /* x^2 = m^2 + 2mf + f^2 */
+  u = m * m;
+  u1 = 2 * m * f  +  f * f;
+
+  if ((u+u1) > MAXLOGL)
+    return (INFINITYL);
+
+  /* u is exact, u1 is small.  */
+  u = expl(u) * expl(u1);
+  return(u);
+}
+
+long double erfcl(long double a)
+{
+long double p,q,x,y,z;
+
+if (isinf (a))
+	return (signbit (a) ? 2.0 : 0.0);
+
+x = fabsl (a);
+
+if (x < 1.0L)
+	return (1.0L - erfl(a));
+
+z = a * a;
+
+if( z  > MAXLOGL )
+	{
+under:
+	mtherr( "erfcl", UNDERFLOW );
+        errno = ERANGE;
+	return (signbit (a) ? 2.0 : 0.0);
+	}
+
+/* Compute z = expl(a * a).  */
+z = expx2l (a);
+y = 1.0L/x;
+
+if (x < 8.0L)
+	{
+	p = polevll (y, P, 9);
+	q = p1evll (y, Q, 10);
+	}
+else
+	{
+	q = y * y;
+	p = y * polevll (q, R, 4);
+	q = p1evll (q, S, 5);
+	}
+y = p/(q * z);
+
+if (a < 0.0L)
+	y = 2.0L - y;
+
+if (y == 0.0L)
+	goto under;
+
+return (y);
+}
+
+long double erfl(long double x)
+{
+long double y, z;
+
+if( x == 0.0L )
+	return (x);
+
+if (isinf (x))
+	return (signbit (x) ?  -1.0L : 1.0L);
+
+if (fabsl(x) > 1.0L)
+	return (1.0L - erfcl (x));
+
+z = x * x;
+y = x * polevll( z, T, 6 ) / p1evll( z, U, 6 );
+return( y );
+}
diff --git a/mingw-w64-crt/math/expf.c b/mingw-w64-crt/math/expf.c
index ddb3c26..593050a 100644
--- a/mingw-w64-crt/math/expf.c
+++ b/mingw-w64-crt/math/expf.c
@@ -1,8 +1,8 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-float expf (float x)

-  {return (float) exp (x);}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+float expf (float x)
+  {return (float) exp (x);}
diff --git a/mingw-w64-crt/math/expl.c b/mingw-w64-crt/math/expl.c
index ce83144..aefb133 100644
--- a/mingw-w64-crt/math/expl.c
+++ b/mingw-w64-crt/math/expl.c
@@ -1,52 +1,52 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include "cephes_mconf.h"  /* for max and min log thresholds */

-

-static long double c0 = 1.44268798828125L;

-static long double c1 = 7.05260771340735992468e-6L;

-

-static long double

-__expl (long double x)

-{

-  long double res;

-  asm ("fldl2e\n\t"             /* 1  log2(e)         */

-       "fmul %%st(1),%%st\n\t"  /* 1  x log2(e)       */

-       "frndint\n\t"            /* 1  i               */

-       "fld %%st(1)\n\t"        /* 2  x               */

-       "frndint\n\t"            /* 2  xi              */

-       "fld %%st(1)\n\t"        /* 3  i               */

-       "fldt %2\n\t"            /* 4  c0              */

-       "fld %%st(2)\n\t"        /* 5  xi              */

-       "fmul %%st(1),%%st\n\t"  /* 5  c0 xi           */

-       "fsubp %%st,%%st(2)\n\t" /* 4  f = c0 xi  - i  */

-       "fld %%st(4)\n\t"        /* 5  x               */

-       "fsub %%st(3),%%st\n\t"  /* 5  xf = x - xi     */

-       "fmulp %%st,%%st(1)\n\t" /* 4  c0 xf           */

-       "faddp %%st,%%st(1)\n\t" /* 3  f = f + c0 xf   */

-       "fldt %3\n\t"            /* 4                  */

-       "fmul %%st(4),%%st\n\t"  /* 4  c1 * x          */

-       "faddp %%st,%%st(1)\n\t" /* 3  f = f + c1 * x  */

-       "f2xm1\n\t"		/* 3 2^(fract(x * log2(e))) - 1 */

-       "fld1\n\t"               /* 4 1.0              */

-       "faddp\n\t"		/* 3 2^(fract(x * log2(e))) */

-       "fstp	%%st(1)\n\t"    /* 2  */

-       "fscale\n\t"	        /* 2 scale factor is st(1); e^x */

-       "fstp	%%st(1)\n\t"    /* 1  */

-       "fstp	%%st(1)\n\t"    /* 0  */

-       : "=t" (res) : "0" (x), "m" (c0), "m" (c1) : "ax", "dx");

-  return res;

-}

-

-long double expl (long double x)

-{

-  if (x > MAXLOGL)

-    return INFINITY;

-  else if (x < MINLOGL)

-    return 0.0L;

-  else

-    return __expl (x);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include "cephes_mconf.h"  /* for max and min log thresholds */
+
+static long double c0 = 1.44268798828125L;
+static long double c1 = 7.05260771340735992468e-6L;
+
+static long double
+__expl (long double x)
+{
+  long double res;
+  asm ("fldl2e\n\t"             /* 1  log2(e)         */
+       "fmul %%st(1),%%st\n\t"  /* 1  x log2(e)       */
+       "frndint\n\t"            /* 1  i               */
+       "fld %%st(1)\n\t"        /* 2  x               */
+       "frndint\n\t"            /* 2  xi              */
+       "fld %%st(1)\n\t"        /* 3  i               */
+       "fldt %2\n\t"            /* 4  c0              */
+       "fld %%st(2)\n\t"        /* 5  xi              */
+       "fmul %%st(1),%%st\n\t"  /* 5  c0 xi           */
+       "fsubp %%st,%%st(2)\n\t" /* 4  f = c0 xi  - i  */
+       "fld %%st(4)\n\t"        /* 5  x               */
+       "fsub %%st(3),%%st\n\t"  /* 5  xf = x - xi     */
+       "fmulp %%st,%%st(1)\n\t" /* 4  c0 xf           */
+       "faddp %%st,%%st(1)\n\t" /* 3  f = f + c0 xf   */
+       "fldt %3\n\t"            /* 4                  */
+       "fmul %%st(4),%%st\n\t"  /* 4  c1 * x          */
+       "faddp %%st,%%st(1)\n\t" /* 3  f = f + c1 * x  */
+       "f2xm1\n\t"		/* 3 2^(fract(x * log2(e))) - 1 */
+       "fld1\n\t"               /* 4 1.0              */
+       "faddp\n\t"		/* 3 2^(fract(x * log2(e))) */
+       "fstp	%%st(1)\n\t"    /* 2  */
+       "fscale\n\t"	        /* 2 scale factor is st(1); e^x */
+       "fstp	%%st(1)\n\t"    /* 1  */
+       "fstp	%%st(1)\n\t"    /* 0  */
+       : "=t" (res) : "0" (x), "m" (c0), "m" (c1) : "ax", "dx");
+  return res;
+}
+
+long double expl (long double x)
+{
+  if (x > MAXLOGL)
+    return INFINITY;
+  else if (x < MINLOGL)
+    return 0.0L;
+  else
+    return __expl (x);
+}
diff --git a/mingw-w64-crt/math/expm1.c b/mingw-w64-crt/math/expm1.c
index f3e61f1..85f27b5 100644
--- a/mingw-w64-crt/math/expm1.c
+++ b/mingw-w64-crt/math/expm1.c
@@ -1,33 +1,33 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written 2005 by Gregory W. Chicares <chicares@cox.net>.

- * Adapted to double by Danny Smith <dannysmith@users.sourceforge.net>. 

- * Public domain.

- *

- * F2XM1's input is constrained to (-1, +1), so the domain of

- * 'x * LOG2EL' is (-LOGE2L, +LOGE2L). Outside that domain,

- * delegating to exp() handles C99 7.12.6.3/2 range errors.

- *

- * Constants from moshier.net, file cephes/ldouble/constl.c,

- * are used instead of M_LN2 and M_LOG2E, which would not be

- * visible with 'gcc std=c99'.  The use of these extended precision

- * constants also allows gcc to replace them with x87 opcodes.

- */

-

-#include <math.h> /* expl() */

-#include "cephes_mconf.h"

-double expm1 (double x)

-{

-  if (fabs(x) < LOGE2L)

-    {

-      x *= LOG2EL;

-      __asm__("f2xm1" : "=t" (x) : "0" (x));

-      return x;

-    }

-  else

-    return exp(x) - 1.0;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written 2005 by Gregory W. Chicares <chicares@cox.net>.
+ * Adapted to double by Danny Smith <dannysmith@users.sourceforge.net>. 
+ * Public domain.
+ *
+ * F2XM1's input is constrained to (-1, +1), so the domain of
+ * 'x * LOG2EL' is (-LOGE2L, +LOGE2L). Outside that domain,
+ * delegating to exp() handles C99 7.12.6.3/2 range errors.
+ *
+ * Constants from moshier.net, file cephes/ldouble/constl.c,
+ * are used instead of M_LN2 and M_LOG2E, which would not be
+ * visible with 'gcc std=c99'.  The use of these extended precision
+ * constants also allows gcc to replace them with x87 opcodes.
+ */
+
+#include <math.h> /* expl() */
+#include "cephes_mconf.h"
+double expm1 (double x)
+{
+  if (fabs(x) < LOGE2L)
+    {
+      x *= LOG2EL;
+      __asm__("f2xm1" : "=t" (x) : "0" (x));
+      return x;
+    }
+  else
+    return exp(x) - 1.0;
+}
diff --git a/mingw-w64-crt/math/expm1f.c b/mingw-w64-crt/math/expm1f.c
index 8ae6876..9f32a9b 100644
--- a/mingw-w64-crt/math/expm1f.c
+++ b/mingw-w64-crt/math/expm1f.c
@@ -1,34 +1,34 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written 2005 by Gregory W. Chicares <chicares@cox.net>.

- * Adapted to float by Danny Smith <dannysmith@users.sourceforge.net>. 

- * Public domain.

- *

- * F2XM1's input is constrained to (-1, +1), so the domain of

- * 'x * LOG2EL' is (-LOGE2L, +LOGE2L). Outside that domain,

- * delegating to exp() handles C99 7.12.6.3/2 range errors.

- *

- * Constants from moshier.net, file cephes/ldouble/constl.c,

- * are used instead of M_LN2 and M_LOG2E, which would not be

- * visible with 'gcc std=c99'. The use of these extended precision

- * constants also allows gcc to replace them with x87 opcodes.

- */

-

-#include <math.h> /* expl() */

-#include "cephes_mconf.h"

-

-float expm1f (float x)

-{

-  if (fabsf(x) < LOGE2L)

-    {

-      x *= LOG2EL;

-      __asm__("f2xm1" : "=t" (x) : "0" (x));

-      return x;

-    }

-  else

-    return expf(x) - 1.0F;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written 2005 by Gregory W. Chicares <chicares@cox.net>.
+ * Adapted to float by Danny Smith <dannysmith@users.sourceforge.net>. 
+ * Public domain.
+ *
+ * F2XM1's input is constrained to (-1, +1), so the domain of
+ * 'x * LOG2EL' is (-LOGE2L, +LOGE2L). Outside that domain,
+ * delegating to exp() handles C99 7.12.6.3/2 range errors.
+ *
+ * Constants from moshier.net, file cephes/ldouble/constl.c,
+ * are used instead of M_LN2 and M_LOG2E, which would not be
+ * visible with 'gcc std=c99'. The use of these extended precision
+ * constants also allows gcc to replace them with x87 opcodes.
+ */
+
+#include <math.h> /* expl() */
+#include "cephes_mconf.h"
+
+float expm1f (float x)
+{
+  if (fabsf(x) < LOGE2L)
+    {
+      x *= LOG2EL;
+      __asm__("f2xm1" : "=t" (x) : "0" (x));
+      return x;
+    }
+  else
+    return expf(x) - 1.0F;
+}
diff --git a/mingw-w64-crt/math/expm1l.c b/mingw-w64-crt/math/expm1l.c
index 1b4120f..264a788 100644
--- a/mingw-w64-crt/math/expm1l.c
+++ b/mingw-w64-crt/math/expm1l.c
@@ -1,34 +1,34 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written 2005 by Gregory W. Chicares <chicares@cox.net> with

- * help from Danny Smith. dannysmith@users.sourceforge.net>.

- * Public domain.

- *

- * F2XM1's input is constrained to (-1, +1), so the domain of

- * 'x * LOG2EL' is (-LOGE2L, +LOGE2L). Outside that domain,

- * delegating to expl() handles C99 7.12.6.3/2 range errors.

- *

- * Constants from moshier.net, file cephes/ldouble/constl.c,

- * are used instead of M_LN2 and M_LOG2E, which would not be

- * visible with 'gcc std=c99'.  The use of these extended precision

- * constants also allows gcc to replace them with x87 opcodes.

- */

-

-#include <math.h> /* expl() */

-#include "cephes_mconf.h"

-

-long double expm1l (long double x)

-{

-  if (fabsl(x) < LOGE2L)

-    {

-      x *= LOG2EL;

-      __asm__("f2xm1" : "=t" (x) : "0" (x));

-      return x;

-    }

-  else

-    return expl(x) - 1.0L;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written 2005 by Gregory W. Chicares <chicares@cox.net> with
+ * help from Danny Smith. dannysmith@users.sourceforge.net>.
+ * Public domain.
+ *
+ * F2XM1's input is constrained to (-1, +1), so the domain of
+ * 'x * LOG2EL' is (-LOGE2L, +LOGE2L). Outside that domain,
+ * delegating to expl() handles C99 7.12.6.3/2 range errors.
+ *
+ * Constants from moshier.net, file cephes/ldouble/constl.c,
+ * are used instead of M_LN2 and M_LOG2E, which would not be
+ * visible with 'gcc std=c99'.  The use of these extended precision
+ * constants also allows gcc to replace them with x87 opcodes.
+ */
+
+#include <math.h> /* expl() */
+#include "cephes_mconf.h"
+
+long double expm1l (long double x)
+{
+  if (fabsl(x) < LOGE2L)
+    {
+      x *= LOG2EL;
+      __asm__("f2xm1" : "=t" (x) : "0" (x));
+      return x;
+    }
+  else
+    return expl(x) - 1.0L;
+}
diff --git a/mingw-w64-crt/math/fabs.c b/mingw-w64-crt/math/fabs.c
index 691b971..29d1528 100644
--- a/mingw-w64-crt/math/fabs.c
+++ b/mingw-w64-crt/math/fabs.c
@@ -1,15 +1,15 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-double

-fabs (double x)

-{

-  double res;

-

-  asm ("fabs;" : "=t" (res) : "0" (x));

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+double
+fabs (double x)
+{
+  double res;
+
+  asm ("fabs;" : "=t" (res) : "0" (x));
+  return res;
+}
diff --git a/mingw-w64-crt/math/fabsf.c b/mingw-w64-crt/math/fabsf.c
index 3fad334..b229514 100644
--- a/mingw-w64-crt/math/fabsf.c
+++ b/mingw-w64-crt/math/fabsf.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-float

-fabsf (float x)

-{

-  float res;

-  asm ("fabs;" : "=t" (res) : "0" (x));

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+float
+fabsf (float x)
+{
+  float res;
+  asm ("fabs;" : "=t" (res) : "0" (x));
+  return res;
+}
diff --git a/mingw-w64-crt/math/fabsl.c b/mingw-w64-crt/math/fabsl.c
index 20c2c29..0be4834 100644
--- a/mingw-w64-crt/math/fabsl.c
+++ b/mingw-w64-crt/math/fabsl.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-long double

-fabsl (long double x)

-{

-  long double res;

-  asm ("fabs;" : "=t" (res) : "0" (x));

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+long double
+fabsl (long double x)
+{
+  long double res;
+  asm ("fabs;" : "=t" (res) : "0" (x));
+  return res;
+}
diff --git a/mingw-w64-crt/math/fdim.c b/mingw-w64-crt/math/fdim.c
index 24067f5..4b10249 100644
--- a/mingw-w64-crt/math/fdim.c
+++ b/mingw-w64-crt/math/fdim.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-double

-fdim (double x, double y)

-{

-  return  (isgreater(x, y) ? (x - y) : 0.0);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+double
+fdim (double x, double y)
+{
+  return  (isgreater(x, y) ? (x - y) : 0.0);
+}
diff --git a/mingw-w64-crt/math/fdimf.c b/mingw-w64-crt/math/fdimf.c
index 9a3b73f..ddcd4a7 100644
--- a/mingw-w64-crt/math/fdimf.c
+++ b/mingw-w64-crt/math/fdimf.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float

-fdimf (float x, float y)

-{

-  return  (isgreater(x, y) ? (x - y) : 0.0F);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float
+fdimf (float x, float y)
+{
+  return  (isgreater(x, y) ? (x - y) : 0.0F);
+}
diff --git a/mingw-w64-crt/math/fdiml.c b/mingw-w64-crt/math/fdiml.c
index 617b184..0953d6b 100644
--- a/mingw-w64-crt/math/fdiml.c
+++ b/mingw-w64-crt/math/fdiml.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long double

-fdiml (long double x, long double y)

-{

-   return  (isgreater(x, y) ? (x - y) : 0.0L);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long double
+fdiml (long double x, long double y)
+{
+   return  (isgreater(x, y) ? (x - y) : 0.0L);
+}
diff --git a/mingw-w64-crt/math/floorf.c b/mingw-w64-crt/math/floorf.c
index 36e7edd..9a3aaa5 100644
--- a/mingw-w64-crt/math/floorf.c
+++ b/mingw-w64-crt/math/floorf.c
@@ -1,11 +1,11 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float floorf(float _X)

-{

-  return ((float)floor((double)_X));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float floorf(float _X)
+{
+  return ((float)floor((double)_X));
+}
diff --git a/mingw-w64-crt/math/fmal.c b/mingw-w64-crt/math/fmal.c
index 8ed9802..9247539 100644
--- a/mingw-w64-crt/math/fmal.c
+++ b/mingw-w64-crt/math/fmal.c
@@ -1,10 +1,10 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-long double

-fmal ( long double _x,  long double _y,  long double _z)

-{

-  return ((_x * _y) + _z);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+long double
+fmal ( long double _x,  long double _y,  long double _z)
+{
+  return ((_x * _y) + _z);
+}
diff --git a/mingw-w64-crt/math/fmax.c b/mingw-w64-crt/math/fmax.c
index 9331ad4..b3c5cab 100644
--- a/mingw-w64-crt/math/fmax.c
+++ b/mingw-w64-crt/math/fmax.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-double

-fmax (double _x, double _y)

-{

-   return ( isgreaterequal (_x, _y)|| __isnan (_y) ?  _x : _y );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+double
+fmax (double _x, double _y)
+{
+   return ( isgreaterequal (_x, _y)|| __isnan (_y) ?  _x : _y );
+}
diff --git a/mingw-w64-crt/math/fmaxf.c b/mingw-w64-crt/math/fmaxf.c
index 411e649..0ac3b1f 100644
--- a/mingw-w64-crt/math/fmaxf.c
+++ b/mingw-w64-crt/math/fmaxf.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float

-fmaxf (float _x, float _y)

-{

-  return (( isgreaterequal(_x, _y) || __isnanf (_y)) ?  _x : _y );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float
+fmaxf (float _x, float _y)
+{
+  return (( isgreaterequal(_x, _y) || __isnanf (_y)) ?  _x : _y );
+}
diff --git a/mingw-w64-crt/math/fmaxl.c b/mingw-w64-crt/math/fmaxl.c
index 7fbee2f..40d4008 100644
--- a/mingw-w64-crt/math/fmaxl.c
+++ b/mingw-w64-crt/math/fmaxl.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long double

-fmaxl (long double _x, long double  _y)

-{

-  return (( isgreaterequal(_x, _y) || __isnanl (_y)) ?  _x : _y );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long double
+fmaxl (long double _x, long double  _y)
+{
+  return (( isgreaterequal(_x, _y) || __isnanl (_y)) ?  _x : _y );
+}
diff --git a/mingw-w64-crt/math/fmin.c b/mingw-w64-crt/math/fmin.c
index 99fe451..b15a3c7 100644
--- a/mingw-w64-crt/math/fmin.c
+++ b/mingw-w64-crt/math/fmin.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-double

-fmin (double _x, double _y)

-{

-  return ((islessequal(_x, _y) || __isnan (_y)) ? _x : _y );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+double
+fmin (double _x, double _y)
+{
+  return ((islessequal(_x, _y) || __isnan (_y)) ? _x : _y );
+}
diff --git a/mingw-w64-crt/math/fminf.c b/mingw-w64-crt/math/fminf.c
index 3bfd9cf..36d90ef 100644
--- a/mingw-w64-crt/math/fminf.c
+++ b/mingw-w64-crt/math/fminf.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float

-fminf (float _x, float _y)

-{

-  return ((islessequal(_x, _y) || _isnanf (_y)) ? _x : _y );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float
+fminf (float _x, float _y)
+{
+  return ((islessequal(_x, _y) || _isnanf (_y)) ? _x : _y );
+}
diff --git a/mingw-w64-crt/math/fminl.c b/mingw-w64-crt/math/fminl.c
index aad128a..63f23cd 100644
--- a/mingw-w64-crt/math/fminl.c
+++ b/mingw-w64-crt/math/fminl.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long double

-fminl (long double _x, long double _y)

-{

-  return ((islessequal(_x, _y) || __isnanl (_y)) ? _x : _y );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long double
+fminl (long double _x, long double _y)
+{
+  return ((islessequal(_x, _y) || __isnanl (_y)) ? _x : _y );
+}
diff --git a/mingw-w64-crt/math/fmodf.c b/mingw-w64-crt/math/fmodf.c
index d28bae9..5d3f1b2 100644
--- a/mingw-w64-crt/math/fmodf.c
+++ b/mingw-w64-crt/math/fmodf.c
@@ -1,28 +1,28 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written by J.T. Conklin <jtc@netbsd.org>.

- * Public domain.

- *

- * Adapted for float type by Danny Smith

- *  <dannysmith@users.sourceforge.net>.

- */

-

-#include <math.h>

-

-float

-fmodf (float x, float y)

-{

-  float res;

-

-  asm ("1:\tfprem\n\t"

-       "fstsw   %%ax\n\t"

-       "sahf\n\t"

-       "jp      1b\n\t"

-       "fstp    %%st(1)"

-       : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)");

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ *
+ * Adapted for float type by Danny Smith
+ *  <dannysmith@users.sourceforge.net>.
+ */
+
+#include <math.h>
+
+float
+fmodf (float x, float y)
+{
+  float res;
+
+  asm ("1:\tfprem\n\t"
+       "fstsw   %%ax\n\t"
+       "sahf\n\t"
+       "jp      1b\n\t"
+       "fstp    %%st(1)"
+       : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)");
+  return res;
+}
diff --git a/mingw-w64-crt/math/fmodl.c b/mingw-w64-crt/math/fmodl.c
index ab9104d..b49a8db 100644
--- a/mingw-w64-crt/math/fmodl.c
+++ b/mingw-w64-crt/math/fmodl.c
@@ -1,18 +1,18 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-long double

-fmodl (long double x, long double y)

-{

-  long double res;

-

-  asm ("1:\tfprem\n\t"

-       "fstsw   %%ax\n\t"

-       "sahf\n\t"

-       "jp      1b\n\t"

-       "fstp    %%st(1)"

-       : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)");

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+long double
+fmodl (long double x, long double y)
+{
+  long double res;
+
+  asm ("1:\tfprem\n\t"
+       "fstsw   %%ax\n\t"
+       "sahf\n\t"
+       "jp      1b\n\t"
+       "fstp    %%st(1)"
+       : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)");
+  return res;
+}
diff --git a/mingw-w64-crt/math/fp_consts.c b/mingw-w64-crt/math/fp_consts.c
index bf3cf28..8880836 100644
--- a/mingw-w64-crt/math/fp_consts.c
+++ b/mingw-w64-crt/math/fp_consts.c
@@ -1,18 +1,18 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "fp_consts.h"

-const union _ieee_rep __QNAN = { __DOUBLE_QNAN_REP };

-const union _ieee_rep __SNAN = { __DOUBLE_SNAN_REP };

-const union _ieee_rep __INF = { __DOUBLE_INF_REP };

-const union _ieee_rep __DENORM = { __DOUBLE_DENORM_REP };

-

-/* ISO C99 */

-#undef nan

-/* FIXME */

-double nan (const char * tagp __attribute__((unused)) )

-	{ return __QNAN.double_val; } 

-

-

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "fp_consts.h"
+const union _ieee_rep __QNAN = { __DOUBLE_QNAN_REP };
+const union _ieee_rep __SNAN = { __DOUBLE_SNAN_REP };
+const union _ieee_rep __INF = { __DOUBLE_INF_REP };
+const union _ieee_rep __DENORM = { __DOUBLE_DENORM_REP };
+
+/* ISO C99 */
+#undef nan
+/* FIXME */
+double nan (const char * tagp __attribute__((unused)) )
+	{ return __QNAN.double_val; } 
+
+
diff --git a/mingw-w64-crt/math/fp_constsf.c b/mingw-w64-crt/math/fp_constsf.c
index a28e836..bb5da65 100644
--- a/mingw-w64-crt/math/fp_constsf.c
+++ b/mingw-w64-crt/math/fp_constsf.c
@@ -1,17 +1,17 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "fp_consts.h"

-

-const union _ieee_rep __QNANF = { __FLOAT_QNAN_REP };   

-const union _ieee_rep __SNANF = { __FLOAT_SNAN_REP };   

-const union _ieee_rep __INFF = { __FLOAT_INF_REP };   

-const union _ieee_rep __DENORMF = { __FLOAT_DENORM_REP };   

-

-/* ISO C99 */

-#undef nanf

-/* FIXME */

-float nanf(const char * tagp __attribute__((unused)) )

-  { return __QNANF.float_val;}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "fp_consts.h"
+
+const union _ieee_rep __QNANF = { __FLOAT_QNAN_REP };   
+const union _ieee_rep __SNANF = { __FLOAT_SNAN_REP };   
+const union _ieee_rep __INFF = { __FLOAT_INF_REP };   
+const union _ieee_rep __DENORMF = { __FLOAT_DENORM_REP };   
+
+/* ISO C99 */
+#undef nanf
+/* FIXME */
+float nanf(const char * tagp __attribute__((unused)) )
+  { return __QNANF.float_val;}
diff --git a/mingw-w64-crt/math/fp_constsl.c b/mingw-w64-crt/math/fp_constsl.c
index 134a4af..3fffcbb 100644
--- a/mingw-w64-crt/math/fp_constsl.c
+++ b/mingw-w64-crt/math/fp_constsl.c
@@ -1,17 +1,17 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "fp_consts.h"

-

-const union _ieee_rep __QNANL = { __LONG_DOUBLE_QNAN_REP };

-const union _ieee_rep __SNANL  = { __LONG_DOUBLE_SNAN_REP };

-const union _ieee_rep __INFL = { __LONG_DOUBLE_INF_REP };

-const union _ieee_rep __DENORML = { __LONG_DOUBLE_DENORM_REP };

-

-

-#undef nanl

-/* FIXME */

-long double nanl (const char * tagp __attribute__((unused)) )

-  { return __QNANL.ldouble_val; } 

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "fp_consts.h"
+
+const union _ieee_rep __QNANL = { __LONG_DOUBLE_QNAN_REP };
+const union _ieee_rep __SNANL  = { __LONG_DOUBLE_SNAN_REP };
+const union _ieee_rep __INFL = { __LONG_DOUBLE_INF_REP };
+const union _ieee_rep __DENORML = { __LONG_DOUBLE_DENORM_REP };
+
+
+#undef nanl
+/* FIXME */
+long double nanl (const char * tagp __attribute__((unused)) )
+  { return __QNANL.ldouble_val; } 
diff --git a/mingw-w64-crt/math/fpclassify.c b/mingw-w64-crt/math/fpclassify.c
index 1471767..2523dd5 100644
--- a/mingw-w64-crt/math/fpclassify.c
+++ b/mingw-w64-crt/math/fpclassify.c
@@ -1,25 +1,25 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-/* 'fxam' sets FPU flags C3,C2,C0   'fstsw' stores: 

- FP_NAN			001		0x0100

- FP_NORMAL		010		0x0400

- FP_INFINITE		011		0x0500

- FP_ZERO		100		0x4000

- FP_SUBNORMAL		110		0x4400

-

-and sets C1 flag (signbit) if neg */

-

-int __fpclassify (double _x){

-  unsigned short sw;

-  __asm__ (

-	"fxam; fstsw %%ax;"

-	: "=a" (sw)

-	: "t" (_x)

-	);

-  return sw & (FP_NAN | FP_NORMAL | FP_ZERO );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+/* 'fxam' sets FPU flags C3,C2,C0   'fstsw' stores: 
+ FP_NAN			001		0x0100
+ FP_NORMAL		010		0x0400
+ FP_INFINITE		011		0x0500
+ FP_ZERO		100		0x4000
+ FP_SUBNORMAL		110		0x4400
+
+and sets C1 flag (signbit) if neg */
+
+int __fpclassify (double _x){
+  unsigned short sw;
+  __asm__ (
+	"fxam; fstsw %%ax;"
+	: "=a" (sw)
+	: "t" (_x)
+	);
+  return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
+}
diff --git a/mingw-w64-crt/math/fpclassifyf.c b/mingw-w64-crt/math/fpclassifyf.c
index 1648d71..279b398 100644
--- a/mingw-w64-crt/math/fpclassifyf.c
+++ b/mingw-w64-crt/math/fpclassifyf.c
@@ -1,15 +1,15 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-int __fpclassifyf (float _x){

-  unsigned short sw;

-  __asm__ (

-	"fxam; fstsw %%ax;"

-	: "=a" (sw)

-	: "t" (_x)

-	);

-  return sw & (FP_NAN | FP_NORMAL | FP_ZERO );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+int __fpclassifyf (float _x){
+  unsigned short sw;
+  __asm__ (
+	"fxam; fstsw %%ax;"
+	: "=a" (sw)
+	: "t" (_x)
+	);
+  return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
+}
diff --git a/mingw-w64-crt/math/fpclassifyl.c b/mingw-w64-crt/math/fpclassifyl.c
index a93b3c1..bef3db8 100644
--- a/mingw-w64-crt/math/fpclassifyl.c
+++ b/mingw-w64-crt/math/fpclassifyl.c
@@ -1,15 +1,15 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-int __fpclassifyl (long double _x){

-  unsigned short sw;

-  __asm__ (

-	"fxam; fstsw %%ax;"

-	: "=a" (sw)

-	: "t" (_x)

-	);

-  return sw & (FP_NAN | FP_NORMAL | FP_ZERO );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+int __fpclassifyl (long double _x){
+  unsigned short sw;
+  __asm__ (
+	"fxam; fstsw %%ax;"
+	: "=a" (sw)
+	: "t" (_x)
+	);
+  return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
+}
diff --git a/mingw-w64-crt/math/frexpf.c b/mingw-w64-crt/math/frexpf.c
index a10bd31..0a20f6d 100644
--- a/mingw-w64-crt/math/frexpf.c
+++ b/mingw-w64-crt/math/frexpf.c
@@ -1,9 +1,9 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-extern double __cdecl frexp(double _X,int *_Y);

-

-float frexpf (float x, int* expn)

-  {return (float)frexp(x, expn);}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+extern double __cdecl frexp(double _X,int *_Y);
+
+float frexpf (float x, int* expn)
+  {return (float)frexp(x, expn);}
diff --git a/mingw-w64-crt/math/fucom.c b/mingw-w64-crt/math/fucom.c
index 5243635..88c84b0 100644
--- a/mingw-w64-crt/math/fucom.c
+++ b/mingw-w64-crt/math/fucom.c
@@ -1,16 +1,16 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-int 

-__fp_unordered_compare (long double x,  long double y){

-  unsigned short retval;

-  __asm__ (

-	"fucom %%st(1);"

-	"fnstsw;"

-	: "=a" (retval)

-	: "t" (x), "u" (y)

-	);

-  return retval;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+int 
+__fp_unordered_compare (long double x,  long double y){
+  unsigned short retval;
+  __asm__ (
+	"fucom %%st(1);"
+	"fnstsw;"
+	: "=a" (retval)
+	: "t" (x), "u" (y)
+	);
+  return retval;
+}
diff --git a/mingw-w64-crt/math/hypotf.c b/mingw-w64-crt/math/hypotf.c
index 0477ddd..9bbd2a7 100644
--- a/mingw-w64-crt/math/hypotf.c
+++ b/mingw-w64-crt/math/hypotf.c
@@ -1,9 +1,9 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float hypotf (float x, float y)

-  { return (float) _hypot (x, y);}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float hypotf (float x, float y)
+  { return (float) _hypot (x, y);}
diff --git a/mingw-w64-crt/math/hypotl.c b/mingw-w64-crt/math/hypotl.c
index 41760cc..ac70cb5 100644
--- a/mingw-w64-crt/math/hypotl.c
+++ b/mingw-w64-crt/math/hypotl.c
@@ -1,78 +1,78 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <float.h>

-#include <errno.h>

-

-/*

-This implementation is based largely on Cephes library

-function cabsl (cmplxl.c), which bears the following notice:

-

-Cephes Math Library Release 2.1:  January, 1989

-Copyright 1984, 1987, 1989 by Stephen L. Moshier

-Direct inquiries to 30 Frost Street, Cambridge, MA 02140

-*/

-

-/*

-   Modified for use in libmingwex.a

-   02 Sept 2002  Danny Smith  <dannysmith@users.sourceforege.net>

-   Calls to ldexpl replaced by logbl and calls to frexpl replaced

-   by scalbnl to avoid duplicated range checks.

-*/

-

-extern long double __INFL;

-#define PRECL 32

-

-long double

-hypotl (long double x, long double y)

-{

-  int exx;

-  int eyy;

-  int  scale;

-  long double xx =fabsl(x);

-  long double yy =fabsl(y);

-  if (!isfinite(xx) || !isfinite(yy))

-    return  xx + yy; /* Return INF or NAN. */

-

-  if (xx == 0.0L)

-     return yy;

-  if (yy == 0.0L)

-     return xx;

-

-  /* Get exponents */

-  exx =  logbl (xx);

-  eyy =  logbl (yy);

-

-  /* Check if large differences in scale */

-  scale = exx - eyy;

-  if ( scale > PRECL)

-     return xx;

-  if ( scale < -PRECL)

-     return yy;

-

-  /* Exponent of approximate geometric mean (x 2) */

-  scale = (exx + eyy) >> 1;

-

-  /*  Rescale: Geometric mean is now about 2 */  

-  x = scalbnl(xx, -scale);

-  y = scalbnl(yy, -scale);

-

-  xx = sqrtl(x * x  + y * y);

-

-  /* Check for overflow and underflow */

-  exx = logbl(xx);   

-  exx += scale;

-    if (exx > LDBL_MAX_EXP)

-    {

-      errno = ERANGE; 

-      return __INFL;

-    }

-  if (exx < LDBL_MIN_EXP)

-    return 0.0L;

-

-  /* Undo scaling */

-  return (scalbnl (xx, scale));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <float.h>
+#include <errno.h>
+
+/*
+This implementation is based largely on Cephes library
+function cabsl (cmplxl.c), which bears the following notice:
+
+Cephes Math Library Release 2.1:  January, 1989
+Copyright 1984, 1987, 1989 by Stephen L. Moshier
+Direct inquiries to 30 Frost Street, Cambridge, MA 02140
+*/
+
+/*
+   Modified for use in libmingwex.a
+   02 Sept 2002  Danny Smith  <dannysmith@users.sourceforege.net>
+   Calls to ldexpl replaced by logbl and calls to frexpl replaced
+   by scalbnl to avoid duplicated range checks.
+*/
+
+extern long double __INFL;
+#define PRECL 32
+
+long double
+hypotl (long double x, long double y)
+{
+  int exx;
+  int eyy;
+  int  scale;
+  long double xx =fabsl(x);
+  long double yy =fabsl(y);
+  if (!isfinite(xx) || !isfinite(yy))
+    return  xx + yy; /* Return INF or NAN. */
+
+  if (xx == 0.0L)
+     return yy;
+  if (yy == 0.0L)
+     return xx;
+
+  /* Get exponents */
+  exx =  logbl (xx);
+  eyy =  logbl (yy);
+
+  /* Check if large differences in scale */
+  scale = exx - eyy;
+  if ( scale > PRECL)
+     return xx;
+  if ( scale < -PRECL)
+     return yy;
+
+  /* Exponent of approximate geometric mean (x 2) */
+  scale = (exx + eyy) >> 1;
+
+  /*  Rescale: Geometric mean is now about 2 */  
+  x = scalbnl(xx, -scale);
+  y = scalbnl(yy, -scale);
+
+  xx = sqrtl(x * x  + y * y);
+
+  /* Check for overflow and underflow */
+  exx = logbl(xx);   
+  exx += scale;
+    if (exx > LDBL_MAX_EXP)
+    {
+      errno = ERANGE; 
+      return __INFL;
+    }
+  if (exx < LDBL_MIN_EXP)
+    return 0.0L;
+
+  /* Undo scaling */
+  return (scalbnl (xx, scale));
+}
diff --git a/mingw-w64-crt/math/isnan.c b/mingw-w64-crt/math/isnan.c
index 4a06e2f..1dbff0f 100644
--- a/mingw-w64-crt/math/isnan.c
+++ b/mingw-w64-crt/math/isnan.c
@@ -1,19 +1,19 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-int

-__isnan (double _x)

-{

-  unsigned short _sw;

-  __asm__ ("fxam;"

-	   "fstsw %%ax": "=a" (_sw) : "t" (_x));

-  return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))

-    == FP_NAN;

-}

-

-#undef isnan

-int __attribute__ ((alias ("__isnan"))) isnan (double);

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+int
+__isnan (double _x)
+{
+  unsigned short _sw;
+  __asm__ ("fxam;"
+	   "fstsw %%ax": "=a" (_sw) : "t" (_x));
+  return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
+    == FP_NAN;
+}
+
+#undef isnan
+int __attribute__ ((alias ("__isnan"))) isnan (double);
diff --git a/mingw-w64-crt/math/isnanf.c b/mingw-w64-crt/math/isnanf.c
index 0acc9a8..7623424 100644
--- a/mingw-w64-crt/math/isnanf.c
+++ b/mingw-w64-crt/math/isnanf.c
@@ -1,17 +1,17 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-int

-__isnanf (float _x)

-{

-  unsigned short _sw;

-  __asm__ ("fxam;"

-	   "fstsw %%ax": "=a" (_sw) : "t" (_x) );

-  return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))

-    == FP_NAN;

-}

-

-int __attribute__ ((alias ("__isnanf"))) isnanf (float);

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+int
+__isnanf (float _x)
+{
+  unsigned short _sw;
+  __asm__ ("fxam;"
+	   "fstsw %%ax": "=a" (_sw) : "t" (_x) );
+  return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
+    == FP_NAN;
+}
+
+int __attribute__ ((alias ("__isnanf"))) isnanf (float);
diff --git a/mingw-w64-crt/math/isnanl.c b/mingw-w64-crt/math/isnanl.c
index a0b083d..f0a9b58 100644
--- a/mingw-w64-crt/math/isnanl.c
+++ b/mingw-w64-crt/math/isnanl.c
@@ -1,18 +1,18 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-int

-__isnanl (long double _x)

-{

-  unsigned short _sw;

-  __asm__ ("fxam;"

-	   "fstsw %%ax": "=a" (_sw) : "t" (_x));

-  return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))

-    == FP_NAN;

-}

-

-int __attribute__ ((alias ("__isnanl"))) isnanl (long double);

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+int
+__isnanl (long double _x)
+{
+  unsigned short _sw;
+  __asm__ ("fxam;"
+	   "fstsw %%ax": "=a" (_sw) : "t" (_x));
+  return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
+    == FP_NAN;
+}
+
+int __attribute__ ((alias ("__isnanl"))) isnanl (long double);
diff --git a/mingw-w64-crt/math/ldexpf.c b/mingw-w64-crt/math/ldexpf.c
index 63470f7..3d82e00 100644
--- a/mingw-w64-crt/math/ldexpf.c
+++ b/mingw-w64-crt/math/ldexpf.c
@@ -1,8 +1,8 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-extern double __cdecl ldexp(double _X,int _Y);

-float ldexpf (float x, int expn)

-  {return (float) ldexp (x, expn);}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+extern double __cdecl ldexp(double _X,int _Y);
+float ldexpf (float x, int expn)
+  {return (float) ldexp (x, expn);}
diff --git a/mingw-w64-crt/math/ldexpl.c b/mingw-w64-crt/math/ldexpl.c
index 7f7fd13..f291198 100644
--- a/mingw-w64-crt/math/ldexpl.c
+++ b/mingw-w64-crt/math/ldexpl.c
@@ -1,23 +1,23 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-

-long double ldexpl(long double x, int expn)

-{

-  long double res;

-  if (!isfinite (x) || x == 0.0L)

-    return x;

-

-  __asm__ ("fscale"

-  	    : "=t" (res)

-	    : "0" (x), "u" ((long double) expn));

-

-  if (!isfinite (res) || res == 0.0L)

-    errno = ERANGE;

-

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+
+long double ldexpl(long double x, int expn)
+{
+  long double res;
+  if (!isfinite (x) || x == 0.0L)
+    return x;
+
+  __asm__ ("fscale"
+  	    : "=t" (res)
+	    : "0" (x), "u" ((long double) expn));
+
+  if (!isfinite (res) || res == 0.0L)
+    errno = ERANGE;
+
+  return res;
+}
diff --git a/mingw-w64-crt/math/lgamma.c b/mingw-w64-crt/math/lgamma.c
index dd3c426..93ef0eb 100644
--- a/mingw-w64-crt/math/lgamma.c
+++ b/mingw-w64-crt/math/lgamma.c
@@ -1,281 +1,281 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-/* A[]: Stirling's formula expansion of log gamma

- * B[], C[]: log gamma function between 2 and 3

- */

-#ifdef UNK

-static double A[] = {

- 8.11614167470508450300E-4,

--5.95061904284301438324E-4,

- 7.93650340457716943945E-4,

--2.77777777730099687205E-3,

- 8.33333333333331927722E-2

-};

-static double B[] = {

--1.37825152569120859100E3,

--3.88016315134637840924E4,

--3.31612992738871184744E5,

--1.16237097492762307383E6,

--1.72173700820839662146E6,

--8.53555664245765465627E5

-};

-static double C[] = {

-/* 1.00000000000000000000E0, */

--3.51815701436523470549E2,

--1.70642106651881159223E4,

--2.20528590553854454839E5,

--1.13933444367982507207E6,

--2.53252307177582951285E6,

--2.01889141433532773231E6

-};

-/* log( sqrt( 2*pi ) ) */

-static double LS2PI  =  0.91893853320467274178;

-#define MAXLGM 2.556348e305

-static double LOGPI = 1.14472988584940017414;

-#endif

-

-#ifdef DEC

-static const unsigned short A[] = {

-0035524,0141201,0034633,0031405,

-0135433,0176755,0126007,0045030,

-0035520,0006371,0003342,0172730,

-0136066,0005540,0132605,0026407,

-0037252,0125252,0125252,0125132

-};

-static const unsigned short B[] = {

-0142654,0044014,0077633,0035410,

-0144027,0110641,0125335,0144760,

-0144641,0165637,0142204,0047447,

-0145215,0162027,0146246,0155211,

-0145322,0026110,0010317,0110130,

-0145120,0061472,0120300,0025363

-};

-static const unsigned short C[] = {

-/*0040200,0000000,0000000,0000000*/

-0142257,0164150,0163630,0112622,

-0143605,0050153,0156116,0135272,

-0144527,0056045,0145642,0062332,

-0145213,0012063,0106250,0001025,

-0145432,0111254,0044577,0115142,

-0145366,0071133,0050217,0005122

-};

-/* log( sqrt( 2*pi ) ) */

-static const unsigned short LS2P[] = {040153,037616,041445,0172645,};

-#define LS2PI *(double *)LS2P

-#define MAXLGM 2.035093e36

-static const unsigned short LPI[4] = {

-0040222,0103202,0043475,0006750,

-};

-#define LOGPI *(double *)LPI

-

-#endif

-

-#ifdef IBMPC

-static const unsigned short A[] = {

-0x6661,0x2733,0x9850,0x3f4a,

-0xe943,0xb580,0x7fbd,0xbf43,

-0x5ebb,0x20dc,0x019f,0x3f4a,

-0xa5a1,0x16b0,0xc16c,0xbf66,

-0x554b,0x5555,0x5555,0x3fb5

-};

-static const unsigned short B[] = {

-0x6761,0x8ff3,0x8901,0xc095,

-0xb93e,0x355b,0xf234,0xc0e2,

-0x89e5,0xf890,0x3d73,0xc114,

-0xdb51,0xf994,0xbc82,0xc131,

-0xf20b,0x0219,0x4589,0xc13a,

-0x055e,0x5418,0x0c67,0xc12a

-};

-static const unsigned short C[] = {

-/*0x0000,0x0000,0x0000,0x3ff0,*/

-0x12b2,0x1cf3,0xfd0d,0xc075,

-0xd757,0x7b89,0xaa0d,0xc0d0,

-0x4c9b,0xb974,0xeb84,0xc10a,

-0x0043,0x7195,0x6286,0xc131,

-0xf34c,0x892f,0x5255,0xc143,

-0xe14a,0x6a11,0xce4b,0xc13e

-};

-/* log( sqrt( 2*pi ) ) */

-static const union

-{

-  unsigned short  s[4];

-  double d;

-} ls2p  =  {{0xbeb5,0xc864,0x67f1,0x3fed}};

-#define LS2PI   (ls2p.d)

-#define MAXLGM 2.556348e305

-/* log (pi) */

-static const union

-{

-  unsigned short s[4];

-  double d;

-} lpi  =  {{0xa1bd,0x48e7,0x50d0,0x3ff2}};

-#define LOGPI (lpi.d)

-#endif

-

-#ifdef MIEEE

-static const unsigned short A[] = {

-0x3f4a,0x9850,0x2733,0x6661,

-0xbf43,0x7fbd,0xb580,0xe943,

-0x3f4a,0x019f,0x20dc,0x5ebb,

-0xbf66,0xc16c,0x16b0,0xa5a1,

-0x3fb5,0x5555,0x5555,0x554b

-};

-static const unsigned short B[] = {

-0xc095,0x8901,0x8ff3,0x6761,

-0xc0e2,0xf234,0x355b,0xb93e,

-0xc114,0x3d73,0xf890,0x89e5,

-0xc131,0xbc82,0xf994,0xdb51,

-0xc13a,0x4589,0x0219,0xf20b,

-0xc12a,0x0c67,0x5418,0x055e

-};

-static const unsigned short C[] = {

-0xc075,0xfd0d,0x1cf3,0x12b2,

-0xc0d0,0xaa0d,0x7b89,0xd757,

-0xc10a,0xeb84,0xb974,0x4c9b,

-0xc131,0x6286,0x7195,0x0043,

-0xc143,0x5255,0x892f,0xf34c,

-0xc13e,0xce4b,0x6a11,0xe14a

-};

-/* log( sqrt( 2*pi ) ) */

-static const union

-{

-  unsigned short  s[4];

-  double d;

-} ls2p  =  {{0x3fed,0x67f1,0xc864,0xbeb5}};

-#define LS2PI  ls2p.d

-#define MAXLGM 2.556348e305

-/* log (pi) */

-static const union

-{

-  unsigned short s[4];

-  double d;

-} lpi  =  {{0x3ff2, 0x50d0, 0x48e7, 0xa1bd}};

-#define LOGPI (lpi.d)

-#endif

-

-

-/* Logarithm of gamma function */

-/* Reentrant version */ 

-

-double __lgamma_r(double x, int* sgngam)

-{

-double p, q, u, w, z;

-int i;

-

-*sgngam = 1;

-#ifdef NANS

-if( isnan(x) )

-	return(x);

-#endif

-

-#ifdef INFINITIES

-if( !isfinite(x) )

-	return(INFINITY);

-#endif

-

-if( x < -34.0 )

-	{

-	q = -x;

-	w = __lgamma_r(q, sgngam); /* note this modifies sgngam! */

-	p = floor(q);

-	if( p == q )

-		{

-lgsing:

-		_SET_ERRNO(EDOM);

-		mtherr( "lgam", SING );

-#ifdef INFINITIES

-		return (INFINITY);

-#else

-		return (MAXNUM);

-#endif

-		}

-	i = p;

-	if( (i & 1) == 0 )

-		*sgngam = -1;

-	else

-		*sgngam = 1;

-	z = q - p;

-	if( z > 0.5 )

-		{

-		p += 1.0;

-		z = p - q;

-		}

-	z = q * sin( PI * z );

-	if( z == 0.0 )

-		goto lgsing;

-/*	z = log(PI) - log( z ) - w;*/

-	z = LOGPI - log( z ) - w;

-	return( z );

-	}

-

-if( x < 13.0 )

-	{

-	z = 1.0;

-	p = 0.0;

-	u = x;

-	while( u >= 3.0 )

-		{

-		p -= 1.0;

-		u = x + p;

-		z *= u;

-		}

-	while( u < 2.0 )

-		{

-		if( u == 0.0 )

-			goto lgsing;

-		z /= u;

-		p += 1.0;

-		u = x + p;

-		}

-	if( z < 0.0 )

-		{

-		*sgngam = -1;

-		z = -z;

-		}

-	else

-		*sgngam = 1;

-	if( u == 2.0 )

-		return( log(z) );

-	p -= 2.0;

-	x = x + p;

-	p = x * polevl( x, B, 5 ) / p1evl( x, C, 6);

-	return( log(z) + p );

-	}

-

-if( x > MAXLGM )

-	{

-	_SET_ERRNO(ERANGE);

-	mtherr( "lgamma", OVERFLOW );

-#ifdef INFINITIES

-	return( *sgngam * INFINITY );

-#else

-	return( *sgngam * MAXNUM );

-#endif

-	}

-

-q = ( x - 0.5 ) * log(x) - x + LS2PI;

-if( x > 1.0e8 )

-	return( q );

-

-p = 1.0/(x*x);

-if( x >= 1000.0 )

-	q += ((   7.9365079365079365079365e-4 * p

-		- 2.7777777777777777777778e-3) *p

-		+ 0.0833333333333333333333) / x;

-else

-	q += polevl( p, A, 4 ) / x;

-return( q );

-}

-

-/* This is the C99 version */

-

-double lgamma(double x)

-{

-  int local_sgngam=0;

-  return (__lgamma_r(x, &local_sgngam));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+/* A[]: Stirling's formula expansion of log gamma
+ * B[], C[]: log gamma function between 2 and 3
+ */
+#ifdef UNK
+static double A[] = {
+ 8.11614167470508450300E-4,
+-5.95061904284301438324E-4,
+ 7.93650340457716943945E-4,
+-2.77777777730099687205E-3,
+ 8.33333333333331927722E-2
+};
+static double B[] = {
+-1.37825152569120859100E3,
+-3.88016315134637840924E4,
+-3.31612992738871184744E5,
+-1.16237097492762307383E6,
+-1.72173700820839662146E6,
+-8.53555664245765465627E5
+};
+static double C[] = {
+/* 1.00000000000000000000E0, */
+-3.51815701436523470549E2,
+-1.70642106651881159223E4,
+-2.20528590553854454839E5,
+-1.13933444367982507207E6,
+-2.53252307177582951285E6,
+-2.01889141433532773231E6
+};
+/* log( sqrt( 2*pi ) ) */
+static double LS2PI  =  0.91893853320467274178;
+#define MAXLGM 2.556348e305
+static double LOGPI = 1.14472988584940017414;
+#endif
+
+#ifdef DEC
+static const unsigned short A[] = {
+0035524,0141201,0034633,0031405,
+0135433,0176755,0126007,0045030,
+0035520,0006371,0003342,0172730,
+0136066,0005540,0132605,0026407,
+0037252,0125252,0125252,0125132
+};
+static const unsigned short B[] = {
+0142654,0044014,0077633,0035410,
+0144027,0110641,0125335,0144760,
+0144641,0165637,0142204,0047447,
+0145215,0162027,0146246,0155211,
+0145322,0026110,0010317,0110130,
+0145120,0061472,0120300,0025363
+};
+static const unsigned short C[] = {
+/*0040200,0000000,0000000,0000000*/
+0142257,0164150,0163630,0112622,
+0143605,0050153,0156116,0135272,
+0144527,0056045,0145642,0062332,
+0145213,0012063,0106250,0001025,
+0145432,0111254,0044577,0115142,
+0145366,0071133,0050217,0005122
+};
+/* log( sqrt( 2*pi ) ) */
+static const unsigned short LS2P[] = {040153,037616,041445,0172645,};
+#define LS2PI *(double *)LS2P
+#define MAXLGM 2.035093e36
+static const unsigned short LPI[4] = {
+0040222,0103202,0043475,0006750,
+};
+#define LOGPI *(double *)LPI
+
+#endif
+
+#ifdef IBMPC
+static const unsigned short A[] = {
+0x6661,0x2733,0x9850,0x3f4a,
+0xe943,0xb580,0x7fbd,0xbf43,
+0x5ebb,0x20dc,0x019f,0x3f4a,
+0xa5a1,0x16b0,0xc16c,0xbf66,
+0x554b,0x5555,0x5555,0x3fb5
+};
+static const unsigned short B[] = {
+0x6761,0x8ff3,0x8901,0xc095,
+0xb93e,0x355b,0xf234,0xc0e2,
+0x89e5,0xf890,0x3d73,0xc114,
+0xdb51,0xf994,0xbc82,0xc131,
+0xf20b,0x0219,0x4589,0xc13a,
+0x055e,0x5418,0x0c67,0xc12a
+};
+static const unsigned short C[] = {
+/*0x0000,0x0000,0x0000,0x3ff0,*/
+0x12b2,0x1cf3,0xfd0d,0xc075,
+0xd757,0x7b89,0xaa0d,0xc0d0,
+0x4c9b,0xb974,0xeb84,0xc10a,
+0x0043,0x7195,0x6286,0xc131,
+0xf34c,0x892f,0x5255,0xc143,
+0xe14a,0x6a11,0xce4b,0xc13e
+};
+/* log( sqrt( 2*pi ) ) */
+static const union
+{
+  unsigned short  s[4];
+  double d;
+} ls2p  =  {{0xbeb5,0xc864,0x67f1,0x3fed}};
+#define LS2PI   (ls2p.d)
+#define MAXLGM 2.556348e305
+/* log (pi) */
+static const union
+{
+  unsigned short s[4];
+  double d;
+} lpi  =  {{0xa1bd,0x48e7,0x50d0,0x3ff2}};
+#define LOGPI (lpi.d)
+#endif
+
+#ifdef MIEEE
+static const unsigned short A[] = {
+0x3f4a,0x9850,0x2733,0x6661,
+0xbf43,0x7fbd,0xb580,0xe943,
+0x3f4a,0x019f,0x20dc,0x5ebb,
+0xbf66,0xc16c,0x16b0,0xa5a1,
+0x3fb5,0x5555,0x5555,0x554b
+};
+static const unsigned short B[] = {
+0xc095,0x8901,0x8ff3,0x6761,
+0xc0e2,0xf234,0x355b,0xb93e,
+0xc114,0x3d73,0xf890,0x89e5,
+0xc131,0xbc82,0xf994,0xdb51,
+0xc13a,0x4589,0x0219,0xf20b,
+0xc12a,0x0c67,0x5418,0x055e
+};
+static const unsigned short C[] = {
+0xc075,0xfd0d,0x1cf3,0x12b2,
+0xc0d0,0xaa0d,0x7b89,0xd757,
+0xc10a,0xeb84,0xb974,0x4c9b,
+0xc131,0x6286,0x7195,0x0043,
+0xc143,0x5255,0x892f,0xf34c,
+0xc13e,0xce4b,0x6a11,0xe14a
+};
+/* log( sqrt( 2*pi ) ) */
+static const union
+{
+  unsigned short  s[4];
+  double d;
+} ls2p  =  {{0x3fed,0x67f1,0xc864,0xbeb5}};
+#define LS2PI  ls2p.d
+#define MAXLGM 2.556348e305
+/* log (pi) */
+static const union
+{
+  unsigned short s[4];
+  double d;
+} lpi  =  {{0x3ff2, 0x50d0, 0x48e7, 0xa1bd}};
+#define LOGPI (lpi.d)
+#endif
+
+
+/* Logarithm of gamma function */
+/* Reentrant version */ 
+
+double __lgamma_r(double x, int* sgngam)
+{
+double p, q, u, w, z;
+int i;
+
+*sgngam = 1;
+#ifdef NANS
+if( isnan(x) )
+	return(x);
+#endif
+
+#ifdef INFINITIES
+if( !isfinite(x) )
+	return(INFINITY);
+#endif
+
+if( x < -34.0 )
+	{
+	q = -x;
+	w = __lgamma_r(q, sgngam); /* note this modifies sgngam! */
+	p = floor(q);
+	if( p == q )
+		{
+lgsing:
+		_SET_ERRNO(EDOM);
+		mtherr( "lgam", SING );
+#ifdef INFINITIES
+		return (INFINITY);
+#else
+		return (MAXNUM);
+#endif
+		}
+	i = p;
+	if( (i & 1) == 0 )
+		*sgngam = -1;
+	else
+		*sgngam = 1;
+	z = q - p;
+	if( z > 0.5 )
+		{
+		p += 1.0;
+		z = p - q;
+		}
+	z = q * sin( PI * z );
+	if( z == 0.0 )
+		goto lgsing;
+/*	z = log(PI) - log( z ) - w;*/
+	z = LOGPI - log( z ) - w;
+	return( z );
+	}
+
+if( x < 13.0 )
+	{
+	z = 1.0;
+	p = 0.0;
+	u = x;
+	while( u >= 3.0 )
+		{
+		p -= 1.0;
+		u = x + p;
+		z *= u;
+		}
+	while( u < 2.0 )
+		{
+		if( u == 0.0 )
+			goto lgsing;
+		z /= u;
+		p += 1.0;
+		u = x + p;
+		}
+	if( z < 0.0 )
+		{
+		*sgngam = -1;
+		z = -z;
+		}
+	else
+		*sgngam = 1;
+	if( u == 2.0 )
+		return( log(z) );
+	p -= 2.0;
+	x = x + p;
+	p = x * polevl( x, B, 5 ) / p1evl( x, C, 6);
+	return( log(z) + p );
+	}
+
+if( x > MAXLGM )
+	{
+	_SET_ERRNO(ERANGE);
+	mtherr( "lgamma", OVERFLOW );
+#ifdef INFINITIES
+	return( *sgngam * INFINITY );
+#else
+	return( *sgngam * MAXNUM );
+#endif
+	}
+
+q = ( x - 0.5 ) * log(x) - x + LS2PI;
+if( x > 1.0e8 )
+	return( q );
+
+p = 1.0/(x*x);
+if( x >= 1000.0 )
+	q += ((   7.9365079365079365079365e-4 * p
+		- 2.7777777777777777777778e-3) *p
+		+ 0.0833333333333333333333) / x;
+else
+	q += polevl( p, A, 4 ) / x;
+return( q );
+}
+
+/* This is the C99 version */
+
+double lgamma(double x)
+{
+  int local_sgngam=0;
+  return (__lgamma_r(x, &local_sgngam));
+}
diff --git a/mingw-w64-crt/math/lgammaf.c b/mingw-w64-crt/math/lgammaf.c
index 33e8351..f79aae8 100644
--- a/mingw-w64-crt/math/lgammaf.c
+++ b/mingw-w64-crt/math/lgammaf.c
@@ -1,188 +1,188 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/* log gamma(x+2), -.5 < x < .5 */

-static const float B[] = {

- 6.055172732649237E-004,

--1.311620815545743E-003,

- 2.863437556468661E-003,

--7.366775108654962E-003,

- 2.058355474821512E-002,

--6.735323259371034E-002,

- 3.224669577325661E-001,

- 4.227843421859038E-001

-};

-

-/* log gamma(x+1), -.25 < x < .25 */

-static const float C[] = {

- 1.369488127325832E-001,

--1.590086327657347E-001,

- 1.692415923504637E-001,

--2.067882815621965E-001,

- 2.705806208275915E-001,

--4.006931650563372E-001,

- 8.224670749082976E-001,

--5.772156501719101E-001

-};

-

-/* log( sqrt( 2*pi ) ) */

-static const float LS2PI  =  0.91893853320467274178;

-#define MAXLGM 2.035093e36

-static const float PIINV =  0.318309886183790671538;

-

-#include "cephes_mconf.h"

-

-/* Reentrant version */ 

-/* Logarithm of gamma function */

-

-float __lgammaf_r( float x, int* sgngamf )

-{

-float p, q, w, z;

-float nx, tx;

-int i, direction;

-

-*sgngamf = 1;

-#ifdef NANS

-if( isnan(x) )

-	return(x);

-#endif

-

-#ifdef INFINITIES

-if( !isfinite(x) )

-	return(x);

-#endif

-

-

-if( x < 0.0 )

-	{

-	q = -x;

-	w = __lgammaf_r(q, sgngamf); /* note this modifies sgngam! */

-	p = floorf(q);

-	if( p == q )

-		{

-lgsing:

-		_SET_ERRNO(EDOM);

-		mtherr( "lgamf", SING );

-#ifdef INFINITIES

-		return (INFINITYF);

-#else

-	return( *sgngamf * MAXNUMF );

-#endif

-		}

-	i = p;

-	if( (i & 1) == 0 )

-		*sgngamf = -1;

-	else

-		*sgngamf = 1;

-	z = q - p;

-	if( z > 0.5 )

-		{

-		p += 1.0;

-		z = p - q;

-		}

-	z = q * sinf( PIF * z );

-	if( z == 0.0 )

-		goto lgsing;

-	z = -logf( PIINV*z ) - w;

-	return( z );

-	}

-

-if( x < 6.5 )

-	{

-	direction = 0;

-	z = 1.0;

-	tx = x;

-	nx = 0.0;

-	if( x >= 1.5 )

-		{

-		while( tx > 2.5 )

-			{

-			nx -= 1.0;

-			tx = x + nx;

-			z *=tx;

-			}

-		x += nx - 2.0;

-iv1r5:

-		p = x * polevlf( x, B, 7 );

-		goto cont;

-		}

-	if( x >= 1.25 )

-		{

-		z *= x;

-		x -= 1.0; /* x + 1 - 2 */

-		direction = 1;

-		goto iv1r5;

-		}

-	if( x >= 0.75 )

-		{

-		x -= 1.0;

-		p = x * polevlf( x, C, 7 );

-		q = 0.0;

-		goto contz;

-		}

-	while( tx < 1.5 )

-		{

-		if( tx == 0.0 )

-			goto lgsing;

-		z *=tx;

-		nx += 1.0;

-		tx = x + nx;

-		}

-	direction = 1;

-	x += nx - 2.0;

-	p = x * polevlf( x, B, 7 );

-

-cont:

-	if( z < 0.0 )

-		{

-		*sgngamf = -1;

-		z = -z;

-		}

-	else

-		{

-		*sgngamf = 1;

-		}

-	q = logf(z);

-	if( direction )

-		q = -q;

-contz:

-	return( p + q );

-	}

-

-if( x > MAXLGM )

-	{

-	_SET_ERRNO(ERANGE);

-	mtherr( "lgamf", OVERFLOW );

-#ifdef INFINITIES

-	return( *sgngamf * INFINITYF );

-#else

-	return( *sgngamf * MAXNUMF );

-#endif

-

-	}

-

-/* Note, though an asymptotic formula could be used for x >= 3,

- * there is cancellation error in the following if x < 6.5.  */

-q = LS2PI - x;

-q += ( x - 0.5 ) * logf(x);

-

-if( x <= 1.0e4 )

-	{

-	z = 1.0/x;

-	p = z * z;

-	q += ((    6.789774945028216E-004 * p

-		 - 2.769887652139868E-003 ) * p

-		+  8.333316229807355E-002 ) * z;

-	}

-return( q );

-}

-

-/* This is the C99 version */

-

-float lgammaf(float x)

-{

-  int local_sgngamf=0;

-  return (__lgammaf_r(x, &local_sgngamf));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/* log gamma(x+2), -.5 < x < .5 */
+static const float B[] = {
+ 6.055172732649237E-004,
+-1.311620815545743E-003,
+ 2.863437556468661E-003,
+-7.366775108654962E-003,
+ 2.058355474821512E-002,
+-6.735323259371034E-002,
+ 3.224669577325661E-001,
+ 4.227843421859038E-001
+};
+
+/* log gamma(x+1), -.25 < x < .25 */
+static const float C[] = {
+ 1.369488127325832E-001,
+-1.590086327657347E-001,
+ 1.692415923504637E-001,
+-2.067882815621965E-001,
+ 2.705806208275915E-001,
+-4.006931650563372E-001,
+ 8.224670749082976E-001,
+-5.772156501719101E-001
+};
+
+/* log( sqrt( 2*pi ) ) */
+static const float LS2PI  =  0.91893853320467274178;
+#define MAXLGM 2.035093e36
+static const float PIINV =  0.318309886183790671538;
+
+#include "cephes_mconf.h"
+
+/* Reentrant version */ 
+/* Logarithm of gamma function */
+
+float __lgammaf_r( float x, int* sgngamf )
+{
+float p, q, w, z;
+float nx, tx;
+int i, direction;
+
+*sgngamf = 1;
+#ifdef NANS
+if( isnan(x) )
+	return(x);
+#endif
+
+#ifdef INFINITIES
+if( !isfinite(x) )
+	return(x);
+#endif
+
+
+if( x < 0.0 )
+	{
+	q = -x;
+	w = __lgammaf_r(q, sgngamf); /* note this modifies sgngam! */
+	p = floorf(q);
+	if( p == q )
+		{
+lgsing:
+		_SET_ERRNO(EDOM);
+		mtherr( "lgamf", SING );
+#ifdef INFINITIES
+		return (INFINITYF);
+#else
+	return( *sgngamf * MAXNUMF );
+#endif
+		}
+	i = p;
+	if( (i & 1) == 0 )
+		*sgngamf = -1;
+	else
+		*sgngamf = 1;
+	z = q - p;
+	if( z > 0.5 )
+		{
+		p += 1.0;
+		z = p - q;
+		}
+	z = q * sinf( PIF * z );
+	if( z == 0.0 )
+		goto lgsing;
+	z = -logf( PIINV*z ) - w;
+	return( z );
+	}
+
+if( x < 6.5 )
+	{
+	direction = 0;
+	z = 1.0;
+	tx = x;
+	nx = 0.0;
+	if( x >= 1.5 )
+		{
+		while( tx > 2.5 )
+			{
+			nx -= 1.0;
+			tx = x + nx;
+			z *=tx;
+			}
+		x += nx - 2.0;
+iv1r5:
+		p = x * polevlf( x, B, 7 );
+		goto cont;
+		}
+	if( x >= 1.25 )
+		{
+		z *= x;
+		x -= 1.0; /* x + 1 - 2 */
+		direction = 1;
+		goto iv1r5;
+		}
+	if( x >= 0.75 )
+		{
+		x -= 1.0;
+		p = x * polevlf( x, C, 7 );
+		q = 0.0;
+		goto contz;
+		}
+	while( tx < 1.5 )
+		{
+		if( tx == 0.0 )
+			goto lgsing;
+		z *=tx;
+		nx += 1.0;
+		tx = x + nx;
+		}
+	direction = 1;
+	x += nx - 2.0;
+	p = x * polevlf( x, B, 7 );
+
+cont:
+	if( z < 0.0 )
+		{
+		*sgngamf = -1;
+		z = -z;
+		}
+	else
+		{
+		*sgngamf = 1;
+		}
+	q = logf(z);
+	if( direction )
+		q = -q;
+contz:
+	return( p + q );
+	}
+
+if( x > MAXLGM )
+	{
+	_SET_ERRNO(ERANGE);
+	mtherr( "lgamf", OVERFLOW );
+#ifdef INFINITIES
+	return( *sgngamf * INFINITYF );
+#else
+	return( *sgngamf * MAXNUMF );
+#endif
+
+	}
+
+/* Note, though an asymptotic formula could be used for x >= 3,
+ * there is cancellation error in the following if x < 6.5.  */
+q = LS2PI - x;
+q += ( x - 0.5 ) * logf(x);
+
+if( x <= 1.0e4 )
+	{
+	z = 1.0/x;
+	p = z * z;
+	q += ((    6.789774945028216E-004 * p
+		 - 2.769887652139868E-003 ) * p
+		+  8.333316229807355E-002 ) * z;
+	}
+return( q );
+}
+
+/* This is the C99 version */
+
+float lgammaf(float x)
+{
+  int local_sgngamf=0;
+  return (__lgammaf_r(x, &local_sgngamf));
+}
diff --git a/mingw-w64-crt/math/lgammal.c b/mingw-w64-crt/math/lgammal.c
index c72146a..71f8477 100644
--- a/mingw-w64-crt/math/lgammal.c
+++ b/mingw-w64-crt/math/lgammal.c
@@ -1,338 +1,338 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-#if UNK

-static long double S[9] = {

--1.193945051381510095614E-3L,

- 7.220599478036909672331E-3L,

--9.622023360406271645744E-3L,

--4.219773360705915470089E-2L,

- 1.665386113720805206758E-1L,

--4.200263503403344054473E-2L,

--6.558780715202540684668E-1L,

- 5.772156649015328608253E-1L,

- 1.000000000000000000000E0L,

-};

-#endif

-#if IBMPC

-static const unsigned short S[] = {

-0xbaeb,0xd6d3,0x25e5,0x9c7e,0xbff5, XPD

-0xfe9a,0xceb4,0xc74e,0xec9a,0x3ff7, XPD

-0x9225,0xdfef,0xb0e9,0x9da5,0xbff8, XPD

-0x10b0,0xec17,0x87dc,0xacd7,0xbffa, XPD

-0x6b8d,0x7515,0x1905,0xaa89,0x3ffc, XPD

-0xf183,0x126b,0xf47d,0xac0a,0xbffa, XPD

-0x7bf6,0x57d1,0xa013,0xa7e7,0xbffe, XPD

-0xc7a9,0x7db0,0x67e3,0x93c4,0x3ffe, XPD

-0x0000,0x0000,0x0000,0x8000,0x3fff, XPD

-};

-#endif

-#if MIEEE

-static long S[27] = {

-0xbff50000,0x9c7e25e5,0xd6d3baeb,

-0x3ff70000,0xec9ac74e,0xceb4fe9a,

-0xbff80000,0x9da5b0e9,0xdfef9225,

-0xbffa0000,0xacd787dc,0xec1710b0,

-0x3ffc0000,0xaa891905,0x75156b8d,

-0xbffa0000,0xac0af47d,0x126bf183,

-0xbffe0000,0xa7e7a013,0x57d17bf6,

-0x3ffe0000,0x93c467e3,0x7db0c7a9,

-0x3fff0000,0x80000000,0x00000000,

-};

-#endif

-

-#if UNK

-static long double SN[9] = {

- 1.133374167243894382010E-3L,

- 7.220837261893170325704E-3L,

- 9.621911155035976733706E-3L,

--4.219773343731191721664E-2L,

--1.665386113944413519335E-1L,

--4.200263503402112910504E-2L,

- 6.558780715202536547116E-1L,

- 5.772156649015328608727E-1L,

--1.000000000000000000000E0L,

-};

-#endif

-#if IBMPC

-static const unsigned SN[] = {

-0x5dd1,0x02de,0xb9f7,0x948d,0x3ff5, XPD

-0x989b,0xdd68,0xc5f1,0xec9c,0x3ff7, XPD

-0x2ca1,0x18f0,0x386f,0x9da5,0x3ff8, XPD

-0x783f,0x41dd,0x87d1,0xacd7,0xbffa, XPD

-0x7a5b,0xd76d,0x1905,0xaa89,0xbffc, XPD

-0x7f64,0x1234,0xf47d,0xac0a,0xbffa, XPD

-0x5e26,0x57d1,0xa013,0xa7e7,0x3ffe, XPD

-0xc7aa,0x7db0,0x67e3,0x93c4,0x3ffe, XPD

-0x0000,0x0000,0x0000,0x8000,0xbfff, XPD

-};

-#endif

-#if MIEEE

-static long SN[27] = {

-0x3ff50000,0x948db9f7,0x02de5dd1,

-0x3ff70000,0xec9cc5f1,0xdd68989b,

-0x3ff80000,0x9da5386f,0x18f02ca1,

-0xbffa0000,0xacd787d1,0x41dd783f,

-0xbffc0000,0xaa891905,0xd76d7a5b,

-0xbffa0000,0xac0af47d,0x12347f64,

-0x3ffe0000,0xa7e7a013,0x57d15e26,

-0x3ffe0000,0x93c467e3,0x7db0c7aa,

-0xbfff0000,0x80000000,0x00000000,

-};

-#endif

-

-

-/* A[]: Stirling's formula expansion of log gamma

- * B[], C[]: log gamma function between 2 and 3

- */

-

-

-/* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x A(1/x^2)

- * x >= 8

- * Peak relative error 1.51e-21

- * Relative spread of error peaks 5.67e-21

- */

-#if UNK

-static long double A[7] = {

- 4.885026142432270781165E-3L,

--1.880801938119376907179E-3L,

- 8.412723297322498080632E-4L,

--5.952345851765688514613E-4L,

- 7.936507795855070755671E-4L,

--2.777777777750349603440E-3L,

- 8.333333333333331447505E-2L,

-};

-#endif

-#if IBMPC

-static const unsigned short A[] = {

-0xd984,0xcc08,0x91c2,0xa012,0x3ff7, XPD

-0x3d91,0x0304,0x3da1,0xf685,0xbff5, XPD

-0x3bdc,0xaad1,0xd492,0xdc88,0x3ff4, XPD

-0x8b20,0x9fce,0x844e,0x9c09,0xbff4, XPD

-0xf8f2,0x30e5,0x0092,0xd00d,0x3ff4, XPD

-0x4d88,0x03a8,0x60b6,0xb60b,0xbff6, XPD

-0x9fcc,0xaaaa,0xaaaa,0xaaaa,0x3ffb, XPD

-};

-#endif

-#if MIEEE

-static long A[21] = {

-0x3ff70000,0xa01291c2,0xcc08d984,

-0xbff50000,0xf6853da1,0x03043d91,

-0x3ff40000,0xdc88d492,0xaad13bdc,

-0xbff40000,0x9c09844e,0x9fce8b20,

-0x3ff40000,0xd00d0092,0x30e5f8f2,

-0xbff60000,0xb60b60b6,0x03a84d88,

-0x3ffb0000,0xaaaaaaaa,0xaaaa9fcc,

-};

-#endif

-

-/* log gamma(x+2) = x B(x)/C(x)

- * 0 <= x <= 1

- * Peak relative error 7.16e-22

- * Relative spread of error peaks 4.78e-20

- */

-#if UNK

-static long double B[7] = {

--2.163690827643812857640E3L,

--8.723871522843511459790E4L,

--1.104326814691464261197E6L,

--6.111225012005214299996E6L,

--1.625568062543700591014E7L,

--2.003937418103815175475E7L,

--8.875666783650703802159E6L,

-};

-static long double C[7] = {

-/* 1.000000000000000000000E0L,*/

--5.139481484435370143617E2L,

--3.403570840534304670537E4L,

--6.227441164066219501697E5L,

--4.814940379411882186630E6L,

--1.785433287045078156959E7L,

--3.138646407656182662088E7L,

--2.099336717757895876142E7L,

-};

-#endif

-#if IBMPC

-static const unsigned short B[] = {

-0x9557,0x4995,0x0da1,0x873b,0xc00a, XPD

-0xfe44,0x9af8,0x5b8c,0xaa63,0xc00f, XPD

-0x5aa8,0x7cf5,0x3684,0x86ce,0xc013, XPD

-0x259a,0x258c,0xf206,0xba7f,0xc015, XPD

-0xbe18,0x1ca3,0xc0a0,0xf80a,0xc016, XPD

-0x168f,0x2c42,0x6717,0x98e3,0xc017, XPD

-0x2051,0x9d55,0x92c8,0x876e,0xc016, XPD

-};

-static const unsigned short C[] = {

-/*0x0000,0x0000,0x0000,0x8000,0x3fff, XPD*/

-0xaa77,0xcf2f,0xae76,0x807c,0xc008, XPD

-0xb280,0x0d74,0xb55a,0x84f3,0xc00e, XPD

-0xa505,0xcd30,0x81dc,0x9809,0xc012, XPD

-0x3369,0x4246,0xb8c2,0x92f0,0xc015, XPD

-0x63cf,0x6aee,0xbe6f,0x8837,0xc017, XPD

-0x26bb,0xccc7,0xb009,0xef75,0xc017, XPD

-0x462b,0xbae8,0xab96,0xa02a,0xc017, XPD

-};

-#endif

-#if MIEEE

-static long B[21] = {

-0xc00a0000,0x873b0da1,0x49959557,

-0xc00f0000,0xaa635b8c,0x9af8fe44,

-0xc0130000,0x86ce3684,0x7cf55aa8,

-0xc0150000,0xba7ff206,0x258c259a,

-0xc0160000,0xf80ac0a0,0x1ca3be18,

-0xc0170000,0x98e36717,0x2c42168f,

-0xc0160000,0x876e92c8,0x9d552051,

-};

-static long C[21] = {

-/*0x3fff0000,0x80000000,0x00000000,*/

-0xc0080000,0x807cae76,0xcf2faa77,

-0xc00e0000,0x84f3b55a,0x0d74b280,

-0xc0120000,0x980981dc,0xcd30a505,

-0xc0150000,0x92f0b8c2,0x42463369,

-0xc0170000,0x8837be6f,0x6aee63cf,

-0xc0170000,0xef75b009,0xccc726bb,

-0xc0170000,0xa02aab96,0xbae8462b,

-};

-#endif

-

-/* log( sqrt( 2*pi ) ) */

-static const long double LS2PI  =  0.91893853320467274178L;

-#define MAXLGM 1.04848146839019521116e+4928L

-

-

-/* Logarithm of gamma function */

-/* Reentrant version */ 

-

-long double __lgammal_r(long double x, int* sgngaml)

-{

-long double p, q, w, z, f, nx;

-int i;

-

-*sgngaml = 1;

-#ifdef NANS

-if( isnanl(x) )

-	return(NANL);

-#endif

-#ifdef INFINITIES

-if( !isfinitel(x) )

-	return(INFINITYL);

-#endif

-if( x < -34.0L )

-	{

-	q = -x;

-	w = __lgammal_r(q, sgngaml); /* note this modifies sgngam! */

-	p = floorl(q);

-	if( p == q )

-		{

-lgsing:

-		_SET_ERRNO(EDOM);

-		mtherr( "lgammal", SING );

-#ifdef INFINITIES

-		return (INFINITYL);

-#else

-		return (MAXNUML);

-#endif

-		}

-	i = p;

-	if( (i & 1) == 0 )

-		*sgngaml = -1;

-	else

-		*sgngaml = 1;

-	z = q - p;

-	if( z > 0.5L )

-		{

-		p += 1.0L;

-		z = p - q;

-		}

-	z = q * sinl( PIL * z );

-	if( z == 0.0L )

-		goto lgsing;

-/*	z = LOGPI - logl( z ) - w; */

-	z = logl( PIL/z ) - w;

-	return( z );

-	}

-

-if( x < 13.0L )

-	{

-	z = 1.0L;

-	nx = floorl( x +  0.5L );

-	f = x - nx;

-	while( x >= 3.0L )

-		{

-		nx -= 1.0L;

-		x = nx + f;

-		z *= x;

-		}

-	while( x < 2.0L )

-		{

-		if( fabsl(x) <= 0.03125 )

-			goto lsmall;

-		z /= nx +  f;

-		nx += 1.0L;

-		x = nx + f;

-		}

-	if( z < 0.0L )

-		{

-		*sgngaml = -1;

-		z = -z;

-		}

-	else

-		*sgngaml = 1;

-	if( x == 2.0L )

-		return( logl(z) );

-	x = (nx - 2.0L) + f;

-	p = x * polevll( x, B, 6 ) / p1evll( x, C, 7);

-	return( logl(z) + p );

-	}

-

-if( x > MAXLGM )

-	{

-	_SET_ERRNO(ERANGE);

-	mtherr( "lgammal", OVERFLOW );

-#ifdef INFINITIES

-	return( *sgngaml * INFINITYL );

-#else

-	return( *sgngaml * MAXNUML );

-#endif

-	}

-

-q = ( x - 0.5L ) * logl(x) - x + LS2PI;

-if( x > 1.0e10L )

-	return(q);

-p = 1.0L/(x*x);

-q += polevll( p, A, 6 ) / x;

-return( q );

-

-

-lsmall:

-if( x == 0.0L )

-	goto lgsing;

-if( x < 0.0L )

-	{

-	x = -x;

-	q = z / (x * polevll( x, SN, 8 ));

-	}

-else

-	q = z / (x * polevll( x, S, 8 ));

-if( q < 0.0L )

-	{

-	*sgngaml = -1;

-	q = -q;

-	}

-else

-	*sgngaml = 1;

-q = logl( q );

-return(q);

-}

-

-/* This is the C99 version */

-

-long double lgammal(long double x)

-{

-  int local_sgngaml=0;

-  return (__lgammal_r(x, &local_sgngaml));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+#if UNK
+static long double S[9] = {
+-1.193945051381510095614E-3L,
+ 7.220599478036909672331E-3L,
+-9.622023360406271645744E-3L,
+-4.219773360705915470089E-2L,
+ 1.665386113720805206758E-1L,
+-4.200263503403344054473E-2L,
+-6.558780715202540684668E-1L,
+ 5.772156649015328608253E-1L,
+ 1.000000000000000000000E0L,
+};
+#endif
+#if IBMPC
+static const unsigned short S[] = {
+0xbaeb,0xd6d3,0x25e5,0x9c7e,0xbff5, XPD
+0xfe9a,0xceb4,0xc74e,0xec9a,0x3ff7, XPD
+0x9225,0xdfef,0xb0e9,0x9da5,0xbff8, XPD
+0x10b0,0xec17,0x87dc,0xacd7,0xbffa, XPD
+0x6b8d,0x7515,0x1905,0xaa89,0x3ffc, XPD
+0xf183,0x126b,0xf47d,0xac0a,0xbffa, XPD
+0x7bf6,0x57d1,0xa013,0xa7e7,0xbffe, XPD
+0xc7a9,0x7db0,0x67e3,0x93c4,0x3ffe, XPD
+0x0000,0x0000,0x0000,0x8000,0x3fff, XPD
+};
+#endif
+#if MIEEE
+static long S[27] = {
+0xbff50000,0x9c7e25e5,0xd6d3baeb,
+0x3ff70000,0xec9ac74e,0xceb4fe9a,
+0xbff80000,0x9da5b0e9,0xdfef9225,
+0xbffa0000,0xacd787dc,0xec1710b0,
+0x3ffc0000,0xaa891905,0x75156b8d,
+0xbffa0000,0xac0af47d,0x126bf183,
+0xbffe0000,0xa7e7a013,0x57d17bf6,
+0x3ffe0000,0x93c467e3,0x7db0c7a9,
+0x3fff0000,0x80000000,0x00000000,
+};
+#endif
+
+#if UNK
+static long double SN[9] = {
+ 1.133374167243894382010E-3L,
+ 7.220837261893170325704E-3L,
+ 9.621911155035976733706E-3L,
+-4.219773343731191721664E-2L,
+-1.665386113944413519335E-1L,
+-4.200263503402112910504E-2L,
+ 6.558780715202536547116E-1L,
+ 5.772156649015328608727E-1L,
+-1.000000000000000000000E0L,
+};
+#endif
+#if IBMPC
+static const unsigned SN[] = {
+0x5dd1,0x02de,0xb9f7,0x948d,0x3ff5, XPD
+0x989b,0xdd68,0xc5f1,0xec9c,0x3ff7, XPD
+0x2ca1,0x18f0,0x386f,0x9da5,0x3ff8, XPD
+0x783f,0x41dd,0x87d1,0xacd7,0xbffa, XPD
+0x7a5b,0xd76d,0x1905,0xaa89,0xbffc, XPD
+0x7f64,0x1234,0xf47d,0xac0a,0xbffa, XPD
+0x5e26,0x57d1,0xa013,0xa7e7,0x3ffe, XPD
+0xc7aa,0x7db0,0x67e3,0x93c4,0x3ffe, XPD
+0x0000,0x0000,0x0000,0x8000,0xbfff, XPD
+};
+#endif
+#if MIEEE
+static long SN[27] = {
+0x3ff50000,0x948db9f7,0x02de5dd1,
+0x3ff70000,0xec9cc5f1,0xdd68989b,
+0x3ff80000,0x9da5386f,0x18f02ca1,
+0xbffa0000,0xacd787d1,0x41dd783f,
+0xbffc0000,0xaa891905,0xd76d7a5b,
+0xbffa0000,0xac0af47d,0x12347f64,
+0x3ffe0000,0xa7e7a013,0x57d15e26,
+0x3ffe0000,0x93c467e3,0x7db0c7aa,
+0xbfff0000,0x80000000,0x00000000,
+};
+#endif
+
+
+/* A[]: Stirling's formula expansion of log gamma
+ * B[], C[]: log gamma function between 2 and 3
+ */
+
+
+/* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x A(1/x^2)
+ * x >= 8
+ * Peak relative error 1.51e-21
+ * Relative spread of error peaks 5.67e-21
+ */
+#if UNK
+static long double A[7] = {
+ 4.885026142432270781165E-3L,
+-1.880801938119376907179E-3L,
+ 8.412723297322498080632E-4L,
+-5.952345851765688514613E-4L,
+ 7.936507795855070755671E-4L,
+-2.777777777750349603440E-3L,
+ 8.333333333333331447505E-2L,
+};
+#endif
+#if IBMPC
+static const unsigned short A[] = {
+0xd984,0xcc08,0x91c2,0xa012,0x3ff7, XPD
+0x3d91,0x0304,0x3da1,0xf685,0xbff5, XPD
+0x3bdc,0xaad1,0xd492,0xdc88,0x3ff4, XPD
+0x8b20,0x9fce,0x844e,0x9c09,0xbff4, XPD
+0xf8f2,0x30e5,0x0092,0xd00d,0x3ff4, XPD
+0x4d88,0x03a8,0x60b6,0xb60b,0xbff6, XPD
+0x9fcc,0xaaaa,0xaaaa,0xaaaa,0x3ffb, XPD
+};
+#endif
+#if MIEEE
+static long A[21] = {
+0x3ff70000,0xa01291c2,0xcc08d984,
+0xbff50000,0xf6853da1,0x03043d91,
+0x3ff40000,0xdc88d492,0xaad13bdc,
+0xbff40000,0x9c09844e,0x9fce8b20,
+0x3ff40000,0xd00d0092,0x30e5f8f2,
+0xbff60000,0xb60b60b6,0x03a84d88,
+0x3ffb0000,0xaaaaaaaa,0xaaaa9fcc,
+};
+#endif
+
+/* log gamma(x+2) = x B(x)/C(x)
+ * 0 <= x <= 1
+ * Peak relative error 7.16e-22
+ * Relative spread of error peaks 4.78e-20
+ */
+#if UNK
+static long double B[7] = {
+-2.163690827643812857640E3L,
+-8.723871522843511459790E4L,
+-1.104326814691464261197E6L,
+-6.111225012005214299996E6L,
+-1.625568062543700591014E7L,
+-2.003937418103815175475E7L,
+-8.875666783650703802159E6L,
+};
+static long double C[7] = {
+/* 1.000000000000000000000E0L,*/
+-5.139481484435370143617E2L,
+-3.403570840534304670537E4L,
+-6.227441164066219501697E5L,
+-4.814940379411882186630E6L,
+-1.785433287045078156959E7L,
+-3.138646407656182662088E7L,
+-2.099336717757895876142E7L,
+};
+#endif
+#if IBMPC
+static const unsigned short B[] = {
+0x9557,0x4995,0x0da1,0x873b,0xc00a, XPD
+0xfe44,0x9af8,0x5b8c,0xaa63,0xc00f, XPD
+0x5aa8,0x7cf5,0x3684,0x86ce,0xc013, XPD
+0x259a,0x258c,0xf206,0xba7f,0xc015, XPD
+0xbe18,0x1ca3,0xc0a0,0xf80a,0xc016, XPD
+0x168f,0x2c42,0x6717,0x98e3,0xc017, XPD
+0x2051,0x9d55,0x92c8,0x876e,0xc016, XPD
+};
+static const unsigned short C[] = {
+/*0x0000,0x0000,0x0000,0x8000,0x3fff, XPD*/
+0xaa77,0xcf2f,0xae76,0x807c,0xc008, XPD
+0xb280,0x0d74,0xb55a,0x84f3,0xc00e, XPD
+0xa505,0xcd30,0x81dc,0x9809,0xc012, XPD
+0x3369,0x4246,0xb8c2,0x92f0,0xc015, XPD
+0x63cf,0x6aee,0xbe6f,0x8837,0xc017, XPD
+0x26bb,0xccc7,0xb009,0xef75,0xc017, XPD
+0x462b,0xbae8,0xab96,0xa02a,0xc017, XPD
+};
+#endif
+#if MIEEE
+static long B[21] = {
+0xc00a0000,0x873b0da1,0x49959557,
+0xc00f0000,0xaa635b8c,0x9af8fe44,
+0xc0130000,0x86ce3684,0x7cf55aa8,
+0xc0150000,0xba7ff206,0x258c259a,
+0xc0160000,0xf80ac0a0,0x1ca3be18,
+0xc0170000,0x98e36717,0x2c42168f,
+0xc0160000,0x876e92c8,0x9d552051,
+};
+static long C[21] = {
+/*0x3fff0000,0x80000000,0x00000000,*/
+0xc0080000,0x807cae76,0xcf2faa77,
+0xc00e0000,0x84f3b55a,0x0d74b280,
+0xc0120000,0x980981dc,0xcd30a505,
+0xc0150000,0x92f0b8c2,0x42463369,
+0xc0170000,0x8837be6f,0x6aee63cf,
+0xc0170000,0xef75b009,0xccc726bb,
+0xc0170000,0xa02aab96,0xbae8462b,
+};
+#endif
+
+/* log( sqrt( 2*pi ) ) */
+static const long double LS2PI  =  0.91893853320467274178L;
+#define MAXLGM 1.04848146839019521116e+4928L
+
+
+/* Logarithm of gamma function */
+/* Reentrant version */ 
+
+long double __lgammal_r(long double x, int* sgngaml)
+{
+long double p, q, w, z, f, nx;
+int i;
+
+*sgngaml = 1;
+#ifdef NANS
+if( isnanl(x) )
+	return(NANL);
+#endif
+#ifdef INFINITIES
+if( !isfinitel(x) )
+	return(INFINITYL);
+#endif
+if( x < -34.0L )
+	{
+	q = -x;
+	w = __lgammal_r(q, sgngaml); /* note this modifies sgngam! */
+	p = floorl(q);
+	if( p == q )
+		{
+lgsing:
+		_SET_ERRNO(EDOM);
+		mtherr( "lgammal", SING );
+#ifdef INFINITIES
+		return (INFINITYL);
+#else
+		return (MAXNUML);
+#endif
+		}
+	i = p;
+	if( (i & 1) == 0 )
+		*sgngaml = -1;
+	else
+		*sgngaml = 1;
+	z = q - p;
+	if( z > 0.5L )
+		{
+		p += 1.0L;
+		z = p - q;
+		}
+	z = q * sinl( PIL * z );
+	if( z == 0.0L )
+		goto lgsing;
+/*	z = LOGPI - logl( z ) - w; */
+	z = logl( PIL/z ) - w;
+	return( z );
+	}
+
+if( x < 13.0L )
+	{
+	z = 1.0L;
+	nx = floorl( x +  0.5L );
+	f = x - nx;
+	while( x >= 3.0L )
+		{
+		nx -= 1.0L;
+		x = nx + f;
+		z *= x;
+		}
+	while( x < 2.0L )
+		{
+		if( fabsl(x) <= 0.03125 )
+			goto lsmall;
+		z /= nx +  f;
+		nx += 1.0L;
+		x = nx + f;
+		}
+	if( z < 0.0L )
+		{
+		*sgngaml = -1;
+		z = -z;
+		}
+	else
+		*sgngaml = 1;
+	if( x == 2.0L )
+		return( logl(z) );
+	x = (nx - 2.0L) + f;
+	p = x * polevll( x, B, 6 ) / p1evll( x, C, 7);
+	return( logl(z) + p );
+	}
+
+if( x > MAXLGM )
+	{
+	_SET_ERRNO(ERANGE);
+	mtherr( "lgammal", OVERFLOW );
+#ifdef INFINITIES
+	return( *sgngaml * INFINITYL );
+#else
+	return( *sgngaml * MAXNUML );
+#endif
+	}
+
+q = ( x - 0.5L ) * logl(x) - x + LS2PI;
+if( x > 1.0e10L )
+	return(q);
+p = 1.0L/(x*x);
+q += polevll( p, A, 6 ) / x;
+return( q );
+
+
+lsmall:
+if( x == 0.0L )
+	goto lgsing;
+if( x < 0.0L )
+	{
+	x = -x;
+	q = z / (x * polevll( x, SN, 8 ));
+	}
+else
+	q = z / (x * polevll( x, S, 8 ));
+if( q < 0.0L )
+	{
+	*sgngaml = -1;
+	q = -q;
+	}
+else
+	*sgngaml = 1;
+q = logl( q );
+return(q);
+}
+
+/* This is the C99 version */
+
+long double lgammal(long double x)
+{
+  int local_sgngaml=0;
+  return (__lgammal_r(x, &local_sgngaml));
+}
diff --git a/mingw-w64-crt/math/llrint.c b/mingw-w64-crt/math/llrint.c
index 6357618..27dff16 100644
--- a/mingw-w64-crt/math/llrint.c
+++ b/mingw-w64-crt/math/llrint.c
@@ -1,15 +1,15 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long long llrint (double x) 

-{

-  long long retval;

-  __asm__ __volatile__							      \

-    ("fistpll %0"  : "=m" (retval) : "t" (x) : "st");				      \

-  return retval;

-}

-

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long long llrint (double x) 
+{
+  long long retval;
+  __asm__ __volatile__							      \
+    ("fistpll %0"  : "=m" (retval) : "t" (x) : "st");				      \
+  return retval;
+}
+
diff --git a/mingw-w64-crt/math/llrintf.c b/mingw-w64-crt/math/llrintf.c
index a9d2af0..b57a79b 100644
--- a/mingw-w64-crt/math/llrintf.c
+++ b/mingw-w64-crt/math/llrintf.c
@@ -1,14 +1,14 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long long llrintf (float x) 

-{

-  long long retval;

-  __asm__ __volatile__							      \

-    ("fistpll %0"  : "=m" (retval) : "t" (x) : "st");				      \

-  return retval;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long long llrintf (float x) 
+{
+  long long retval;
+  __asm__ __volatile__							      \
+    ("fistpll %0"  : "=m" (retval) : "t" (x) : "st");				      \
+  return retval;
+}
diff --git a/mingw-w64-crt/math/llrintl.c b/mingw-w64-crt/math/llrintl.c
index 830e6f2..dc423a3 100644
--- a/mingw-w64-crt/math/llrintl.c
+++ b/mingw-w64-crt/math/llrintl.c
@@ -1,15 +1,15 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long long llrintl (long double x) 

-{

-  long long retval;

-  __asm__ __volatile__							      \

-    ("fistpll %0"  : "=m" (retval) : "t" (x) : "st");				      \

-  return retval;

-}

-

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long long llrintl (long double x) 
+{
+  long long retval;
+  __asm__ __volatile__							      \
+    ("fistpll %0"  : "=m" (retval) : "t" (x) : "st");				      \
+  return retval;
+}
+
diff --git a/mingw-w64-crt/math/llround.c b/mingw-w64-crt/math/llround.c
index 4e9bed2..769cbb9 100644
--- a/mingw-w64-crt/math/llround.c
+++ b/mingw-w64-crt/math/llround.c
@@ -1,37 +1,37 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <limits.h>

-#include <errno.h>

-

-long long

-llround (double x)

-{

-  double res;

-  

-  if (x >= 0.0)

-    {

-	  res = ceil (x);

-	  if (res - x > 0.5)

- 	    res -= 1.0;

-     }

-   else

-     {

-       res = ceil (-x);

-       if (res + x > 0.5)

- 	     res -= 1.0;

-       res = -res;;

-     }

-   if (!isfinite (res) 

-       || res > (double) LONG_LONG_MAX

-       || res < (double) LONG_LONG_MIN)

-     { 

-       errno = ERANGE;

-       /* Undefined behaviour, so we could return anything.  */

-       /* return res > 0.0 ? LONG_LONG_MAX : LONG_LONG_MIN; */

-     }

-   return (long long) res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <limits.h>
+#include <errno.h>
+
+long long
+llround (double x)
+{
+  double res;
+  
+  if (x >= 0.0)
+    {
+	  res = ceil (x);
+	  if (res - x > 0.5)
+ 	    res -= 1.0;
+     }
+   else
+     {
+       res = ceil (-x);
+       if (res + x > 0.5)
+ 	     res -= 1.0;
+       res = -res;;
+     }
+   if (!isfinite (res) 
+       || res > (double) LONG_LONG_MAX
+       || res < (double) LONG_LONG_MIN)
+     { 
+       errno = ERANGE;
+       /* Undefined behaviour, so we could return anything.  */
+       /* return res > 0.0 ? LONG_LONG_MAX : LONG_LONG_MIN; */
+     }
+   return (long long) res;
+}
diff --git a/mingw-w64-crt/math/llroundf.c b/mingw-w64-crt/math/llroundf.c
index 43767ee..8277c18 100644
--- a/mingw-w64-crt/math/llroundf.c
+++ b/mingw-w64-crt/math/llroundf.c
@@ -1,37 +1,37 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <limits.h>

-#include <errno.h>

-

-long long

-llroundf (float x)

-{

-  float res;

-  

-  if (x >= 0.0F)

-    {

-      res = ceilf (x);

-      if (res - x > 0.5F)

-        res -= 1.0F;

-    }

-  else

-    {

-      res = ceilf (-x);

-      if (res + x > 0.5F)

-        res -= 1.0F;

-      res = -res;

-    }

-  if (!isfinite (res)

-      || res > (float) LONG_LONG_MAX

-      || res < (float) LONG_LONG_MIN)

-    {

-      errno = ERANGE;

-      /* Undefined behaviour, so we could return anything.  */

-      /* return res > 0.0F ? LONG_LONG_MAX : LONG_LONG_MIN; */

-    }

-  return (long long) res;

-}  

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <limits.h>
+#include <errno.h>
+
+long long
+llroundf (float x)
+{
+  float res;
+  
+  if (x >= 0.0F)
+    {
+      res = ceilf (x);
+      if (res - x > 0.5F)
+        res -= 1.0F;
+    }
+  else
+    {
+      res = ceilf (-x);
+      if (res + x > 0.5F)
+        res -= 1.0F;
+      res = -res;
+    }
+  if (!isfinite (res)
+      || res > (float) LONG_LONG_MAX
+      || res < (float) LONG_LONG_MIN)
+    {
+      errno = ERANGE;
+      /* Undefined behaviour, so we could return anything.  */
+      /* return res > 0.0F ? LONG_LONG_MAX : LONG_LONG_MIN; */
+    }
+  return (long long) res;
+}  
diff --git a/mingw-w64-crt/math/llroundl.c b/mingw-w64-crt/math/llroundl.c
index f198408..b39de26 100644
--- a/mingw-w64-crt/math/llroundl.c
+++ b/mingw-w64-crt/math/llroundl.c
@@ -1,37 +1,37 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <limits.h>

-#include <errno.h>

-

-long long

-llroundl (long double x)

-{

-  long double res;

-  

-  if (x >= 0.0L)

-    {

-      res = ceill (x);

-      if (res - x > 0.5L)

-        res -= 1.0L;

-    }

-  else

-    {

-      res = ceill (-x);

-      if (res + x > 0.5L)

-        res -= 1.0L;

-      res = -res;

-    }

-  if (!isfinite (res)

-      || res > (double) LONG_LONG_MAX

-      || res < (double) LONG_LONG_MIN)

-    {

-      errno = ERANGE;

-      /* Undefined behaviour, so we could return anything.  */

-      /* return res > 0.0 ? LONG_LONG_MAX : LONG_LONG_MIN;  */

-    }

-  return (long long) res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <limits.h>
+#include <errno.h>
+
+long long
+llroundl (long double x)
+{
+  long double res;
+  
+  if (x >= 0.0L)
+    {
+      res = ceill (x);
+      if (res - x > 0.5L)
+        res -= 1.0L;
+    }
+  else
+    {
+      res = ceill (-x);
+      if (res + x > 0.5L)
+        res -= 1.0L;
+      res = -res;
+    }
+  if (!isfinite (res)
+      || res > (double) LONG_LONG_MAX
+      || res < (double) LONG_LONG_MIN)
+    {
+      errno = ERANGE;
+      /* Undefined behaviour, so we could return anything.  */
+      /* return res > 0.0 ? LONG_LONG_MAX : LONG_LONG_MIN;  */
+    }
+  return (long long) res;
+}
diff --git a/mingw-w64-crt/math/log10f.c b/mingw-w64-crt/math/log10f.c
index 019d095..c067132 100644
--- a/mingw-w64-crt/math/log10f.c
+++ b/mingw-w64-crt/math/log10f.c
@@ -1,11 +1,11 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float log10f(float _X)

-{

-  return ((float)log10((double)_X));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float log10f(float _X)
+{
+  return ((float)log10((double)_X));
+}
diff --git a/mingw-w64-crt/math/logb.c b/mingw-w64-crt/math/logb.c
index c7eb0a0..5014ef8 100644
--- a/mingw-w64-crt/math/logb.c
+++ b/mingw-w64-crt/math/logb.c
@@ -1,21 +1,21 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written by J.T. Conklin <jtc@netbsd.org>.

- * Changes for long double by Ulrich Drepper <drepper@cygnus.com>

- * Public domain.

- */

-

-#include <math.h>

-

-double

-logb (double x)

-{

-  double res;

-  asm ("fxtract\n\t"

-       "fstp	%%st" : "=t" (res) : "0" (x));

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
+ * Public domain.
+ */
+
+#include <math.h>
+
+double
+logb (double x)
+{
+  double res;
+  asm ("fxtract\n\t"
+       "fstp	%%st" : "=t" (res) : "0" (x));
+  return res;
+}
diff --git a/mingw-w64-crt/math/logbf.c b/mingw-w64-crt/math/logbf.c
index 3d69a39..5478e66 100644
--- a/mingw-w64-crt/math/logbf.c
+++ b/mingw-w64-crt/math/logbf.c
@@ -1,21 +1,21 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written by J.T. Conklin <jtc@netbsd.org>.

- * Changes for long double by Ulrich Drepper <drepper@cygnus.com>

- * Public domain.

- */

-

-#include <math.h>

-

-float

-logbf (float x)

-{

-  float res;

-  asm ("fxtract\n\t"

-       "fstp	%%st" : "=t" (res) : "0" (x));

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
+ * Public domain.
+ */
+
+#include <math.h>
+
+float
+logbf (float x)
+{
+  float res;
+  asm ("fxtract\n\t"
+       "fstp	%%st" : "=t" (res) : "0" (x));
+  return res;
+}
diff --git a/mingw-w64-crt/math/logbl.c b/mingw-w64-crt/math/logbl.c
index b1c1250..b58c552 100644
--- a/mingw-w64-crt/math/logbl.c
+++ b/mingw-w64-crt/math/logbl.c
@@ -1,22 +1,22 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

- * Written by J.T. Conklin <jtc@netbsd.org>.

- * Changes for long double by Ulrich Drepper <drepper@cygnus.com>

- * Public domain.

- */

-

-#include <math.h>

-

-long double

-logbl (long double x)

-{

-  long double res;

-

-  asm ("fxtract\n\t"

-       "fstp	%%st" : "=t" (res) : "0" (x));

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
+ * Public domain.
+ */
+
+#include <math.h>
+
+long double
+logbl (long double x)
+{
+  long double res;
+
+  asm ("fxtract\n\t"
+       "fstp	%%st" : "=t" (res) : "0" (x));
+  return res;
+}
diff --git a/mingw-w64-crt/math/logf.c b/mingw-w64-crt/math/logf.c
index c303dd3..8ef83df 100644
--- a/mingw-w64-crt/math/logf.c
+++ b/mingw-w64-crt/math/logf.c
@@ -1,11 +1,11 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float logf(float _X)

-{

-  return ((float)log((double)_X));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float logf(float _X)
+{
+  return ((float)log((double)_X));
+}
diff --git a/mingw-w64-crt/math/lrint.c b/mingw-w64-crt/math/lrint.c
index b9979e3..a8bfc5a 100644
--- a/mingw-w64-crt/math/lrint.c
+++ b/mingw-w64-crt/math/lrint.c
@@ -1,14 +1,14 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long lrint (double x) 

-{

-  long retval;  

-  __asm__ __volatile__							      \

-    ("fistpl %0"  : "=m" (retval) : "t" (x) : "st");				      \

-  return retval;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long lrint (double x) 
+{
+  long retval;  
+  __asm__ __volatile__							      \
+    ("fistpl %0"  : "=m" (retval) : "t" (x) : "st");				      \
+  return retval;
+}
diff --git a/mingw-w64-crt/math/lrintf.c b/mingw-w64-crt/math/lrintf.c
index 94087e3..de1ebaf 100644
--- a/mingw-w64-crt/math/lrintf.c
+++ b/mingw-w64-crt/math/lrintf.c
@@ -1,14 +1,14 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long lrintf (float x) 

-{

-  long retval;

-  __asm__ __volatile__							      \

-    ("fistpl %0"  : "=m" (retval) : "t" (x) : "st");				      \

-  return retval;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long lrintf (float x) 
+{
+  long retval;
+  __asm__ __volatile__							      \
+    ("fistpl %0"  : "=m" (retval) : "t" (x) : "st");				      \
+  return retval;
+}
diff --git a/mingw-w64-crt/math/lrintl.c b/mingw-w64-crt/math/lrintl.c
index 61a1144..7d507db 100644
--- a/mingw-w64-crt/math/lrintl.c
+++ b/mingw-w64-crt/math/lrintl.c
@@ -1,15 +1,15 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long lrintl (long double x) 

-{

-  long retval;

-  __asm__ __volatile__							      \

-    ("fistpl %0"  : "=m" (retval) : "t" (x) : "st");				      \

-  return retval;

-}

-

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long lrintl (long double x) 
+{
+  long retval;
+  __asm__ __volatile__							      \
+    ("fistpl %0"  : "=m" (retval) : "t" (x) : "st");				      \
+  return retval;
+}
+
diff --git a/mingw-w64-crt/math/lround.c b/mingw-w64-crt/math/lround.c
index f861856..cd8ae05 100644
--- a/mingw-w64-crt/math/lround.c
+++ b/mingw-w64-crt/math/lround.c
@@ -1,37 +1,37 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <limits.h>

-#include <errno.h>

-

-long

-lround (double x)

-{

-  double res;

-

-  if (x >= 0.0)

-    {

-      res = ceil (x);

-      if (res - x > 0.5)

-	res -= 1.0;

-    }

-  else

-    {

-      res = ceil (-x);

-      if (res + x > 0.5)

-	res -= 1.0;

-      res = -res;

-    }

-  if (!isfinite (res)

-      || res > (double) LONG_MAX

-      || res < (double) LONG_MIN)

-    {

-      errno = ERANGE;

-      /* Undefined behaviour, so we could return anything.  */

-      /* return res > 0.0 ? LONG_MAX : LONG_MIN;  */

-    }

-  return (long) res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <limits.h>
+#include <errno.h>
+
+long
+lround (double x)
+{
+  double res;
+
+  if (x >= 0.0)
+    {
+      res = ceil (x);
+      if (res - x > 0.5)
+	res -= 1.0;
+    }
+  else
+    {
+      res = ceil (-x);
+      if (res + x > 0.5)
+	res -= 1.0;
+      res = -res;
+    }
+  if (!isfinite (res)
+      || res > (double) LONG_MAX
+      || res < (double) LONG_MIN)
+    {
+      errno = ERANGE;
+      /* Undefined behaviour, so we could return anything.  */
+      /* return res > 0.0 ? LONG_MAX : LONG_MIN;  */
+    }
+  return (long) res;
+}
diff --git a/mingw-w64-crt/math/lroundf.c b/mingw-w64-crt/math/lroundf.c
index e648095..d6475be 100644
--- a/mingw-w64-crt/math/lroundf.c
+++ b/mingw-w64-crt/math/lroundf.c
@@ -1,37 +1,37 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <limits.h>

-#include <errno.h>

-

-long

-lroundf (float x)

-{

-  float res;

-

-  if (x >= 0.0F)

-    {

-      res = ceilf (x);

-      if (res - x > 0.5F)

-	res -= 1.0F;

-    }

-  else

-    {

-      res = ceilf (-x);

-      if (res + x > 0.5F)

-	res -= 1.0F;

-      res = -res;

-    }

-  if (!isfinite (res)

-      || res > (float) LONG_MAX

-      || res < (float) LONG_MIN)

-    {

-      errno = ERANGE;

-      /* Undefined behaviour, so we could return anything.  */

-      /* return res > 0.0F ? LONG_MAX : LONG_MIN; */

-    }

-  return (long) res;

-}  

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <limits.h>
+#include <errno.h>
+
+long
+lroundf (float x)
+{
+  float res;
+
+  if (x >= 0.0F)
+    {
+      res = ceilf (x);
+      if (res - x > 0.5F)
+	res -= 1.0F;
+    }
+  else
+    {
+      res = ceilf (-x);
+      if (res + x > 0.5F)
+	res -= 1.0F;
+      res = -res;
+    }
+  if (!isfinite (res)
+      || res > (float) LONG_MAX
+      || res < (float) LONG_MIN)
+    {
+      errno = ERANGE;
+      /* Undefined behaviour, so we could return anything.  */
+      /* return res > 0.0F ? LONG_MAX : LONG_MIN; */
+    }
+  return (long) res;
+}  
diff --git a/mingw-w64-crt/math/lroundl.c b/mingw-w64-crt/math/lroundl.c
index 730ea68..64303b1 100644
--- a/mingw-w64-crt/math/lroundl.c
+++ b/mingw-w64-crt/math/lroundl.c
@@ -1,37 +1,37 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <limits.h>

-#include <errno.h>

-

-long

-lroundl (long double x)

-{

-  long double res;

-

-  if (x >= 0.0L)

-    {

-      res = ceill (x);

-      if (res - x > 0.5L)

-	res -= 1.0;

-    }

-  else

-    {

-      res = ceill (-x);

-      if (res + x > 0.5L)

-	res -= 1.0L;

-      res = -res;;

-    }

-  if (!isfinite (res)

-      || res > (long double)LONG_MAX

-      || res < (long double)LONG_MIN)

-    {

-      errno = ERANGE;

-      /* Undefined behaviour, so we could return anything.  */

-      /* return res > 0.0L ? LONG_MAX : LONG_MIN;  */

-    }

-  return (long) res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <limits.h>
+#include <errno.h>
+
+long
+lroundl (long double x)
+{
+  long double res;
+
+  if (x >= 0.0L)
+    {
+      res = ceill (x);
+      if (res - x > 0.5L)
+	res -= 1.0;
+    }
+  else
+    {
+      res = ceill (-x);
+      if (res + x > 0.5L)
+	res -= 1.0L;
+      res = -res;;
+    }
+  if (!isfinite (res)
+      || res > (long double)LONG_MAX
+      || res < (long double)LONG_MIN)
+    {
+      errno = ERANGE;
+      /* Undefined behaviour, so we could return anything.  */
+      /* return res > 0.0L ? LONG_MAX : LONG_MIN;  */
+    }
+  return (long) res;
+}
diff --git a/mingw-w64-crt/math/modff.c b/mingw-w64-crt/math/modff.c
index 6611d64..170563d 100644
--- a/mingw-w64-crt/math/modff.c
+++ b/mingw-w64-crt/math/modff.c
@@ -1,27 +1,27 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <fenv.h>

-#include <math.h>

-#include <errno.h>

-#define FE_ROUNDING_MASK \

-  (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)

-

-float

-modff (float value, float* iptr)

-{

-  float int_part;

-  unsigned short saved_cw;

-  unsigned short tmp_cw;

-  /* truncate */ 

-  asm ("fnstcw %0;" : "=m" (saved_cw)); /* save control word */

-  tmp_cw = (saved_cw & ~FE_ROUNDING_MASK) | FE_TOWARDZERO;

-  asm ("fldcw %0;" : : "m" (tmp_cw));

-  asm ("frndint;" : "=t" (int_part) : "0" (value)); /* round */

-  asm ("fldcw %0;" : : "m" (saved_cw)); /* restore saved cw */

-  if (iptr)

-    *iptr = int_part;

-  return (isinf (value) ?  0.0F : value - int_part);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <fenv.h>
+#include <math.h>
+#include <errno.h>
+#define FE_ROUNDING_MASK \
+  (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)
+
+float
+modff (float value, float* iptr)
+{
+  float int_part;
+  unsigned short saved_cw;
+  unsigned short tmp_cw;
+  /* truncate */ 
+  asm ("fnstcw %0;" : "=m" (saved_cw)); /* save control word */
+  tmp_cw = (saved_cw & ~FE_ROUNDING_MASK) | FE_TOWARDZERO;
+  asm ("fldcw %0;" : : "m" (tmp_cw));
+  asm ("frndint;" : "=t" (int_part) : "0" (value)); /* round */
+  asm ("fldcw %0;" : : "m" (saved_cw)); /* restore saved cw */
+  if (iptr)
+    *iptr = int_part;
+  return (isinf (value) ?  0.0F : value - int_part);
+}
diff --git a/mingw-w64-crt/math/modfl.c b/mingw-w64-crt/math/modfl.c
index c54578b..1ae343e 100644
--- a/mingw-w64-crt/math/modfl.c
+++ b/mingw-w64-crt/math/modfl.c
@@ -1,27 +1,27 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <fenv.h>

-#include <math.h>

-#include <errno.h>

-#define FE_ROUNDING_MASK \

-  (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)

-

-long double

-modfl (long double value, long double* iptr)

-{

-  long double int_part;

-  unsigned short saved_cw;

-  unsigned short tmp_cw;

-  /* truncate */ 

-  asm ("fnstcw %0;" : "=m" (saved_cw)); /* save control word */

-  tmp_cw = (saved_cw & ~FE_ROUNDING_MASK) | FE_TOWARDZERO;

-  asm ("fldcw %0;" : : "m" (tmp_cw));

-  asm ("frndint;" : "=t" (int_part) : "0" (value)); /* round */

-  asm ("fldcw %0;" : : "m" (saved_cw)); /* restore saved cw */

-  if (iptr)

-    *iptr = int_part;

-  return (isinf (value) ?  0.0L : value - int_part);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <fenv.h>
+#include <math.h>
+#include <errno.h>
+#define FE_ROUNDING_MASK \
+  (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)
+
+long double
+modfl (long double value, long double* iptr)
+{
+  long double int_part;
+  unsigned short saved_cw;
+  unsigned short tmp_cw;
+  /* truncate */ 
+  asm ("fnstcw %0;" : "=m" (saved_cw)); /* save control word */
+  tmp_cw = (saved_cw & ~FE_ROUNDING_MASK) | FE_TOWARDZERO;
+  asm ("fldcw %0;" : : "m" (tmp_cw));
+  asm ("frndint;" : "=t" (int_part) : "0" (value)); /* round */
+  asm ("fldcw %0;" : : "m" (saved_cw)); /* restore saved cw */
+  if (iptr)
+    *iptr = int_part;
+  return (isinf (value) ?  0.0L : value - int_part);
+}
diff --git a/mingw-w64-crt/math/nextafterf.c b/mingw-w64-crt/math/nextafterf.c
index b8a66e7..cdf4c71 100644
--- a/mingw-w64-crt/math/nextafterf.c
+++ b/mingw-w64-crt/math/nextafterf.c
@@ -1,32 +1,32 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float

-nextafterf (float x, float y)

-{

-  union

-  {

-    float f;

-    unsigned int i;

-  } u;

-  if (isnan (y) || isnan (x))

-    return x + y;

-  if (x == y )

-     /* nextafter (0.0, -O.0) should return -0.0.  */

-     return y;

-  u.f = x; 

-  if (x == 0.0F)

-    {

-      u.i = 1;

-      return y > 0.0F ? u.f : -u.f;

-    }

-  if (((x > 0.0F) ^ (y > x)) == 0)

-    u.i++;

-  else

-    u.i--;

-  return u.f;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float
+nextafterf (float x, float y)
+{
+  union
+  {
+    float f;
+    unsigned int i;
+  } u;
+  if (isnan (y) || isnan (x))
+    return x + y;
+  if (x == y )
+     /* nextafter (0.0, -O.0) should return -0.0.  */
+     return y;
+  u.f = x; 
+  if (x == 0.0F)
+    {
+      u.i = 1;
+      return y > 0.0F ? u.f : -u.f;
+    }
+  if (((x > 0.0F) ^ (y > x)) == 0)
+    u.i++;
+  else
+    u.i--;
+  return u.f;
+}
diff --git a/mingw-w64-crt/math/nextafterl.c b/mingw-w64-crt/math/nextafterl.c
index f0f2835..29c29a2 100644
--- a/mingw-w64-crt/math/nextafterl.c
+++ b/mingw-w64-crt/math/nextafterl.c
@@ -1,70 +1,70 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

-   nextafterl.c

-   Contributed by Danny Smith <dannysmith@users.sourceforge.net>

-   No copyright claimed, absolutely no warranties.

-

-   2005-05-09

-*/

-

-#include <math.h>

-

-long double

-nextafterl (long double x, long double y)

-{

-  union {

-      long double ld;

-      struct {

-        unsigned long long mantissa;

-        unsigned short expn;

-        unsigned short pad;

-      } __attribute__ ((packed)) parts; 

-  } u;

-

-  /* The normal bit is explicit for long doubles, unlike

-     float and double.  */

-  static const unsigned long long normal_bit = 0x8000000000000000ull;

-

-  if (isnan (y) || isnan (x))

-    return x + y;

-

-  if (x == y )

-     /* nextafter (0.0, -O.0) should return -0.0.  */

-     return y;

-

-  u.ld = x;

-  if (x == 0.0L)

-    {

-      u.parts.mantissa = 1ull;

-      return y > 0.0L ? u.ld : -u.ld;

-    }

-

-  if (((x > 0.0L) ^ (y > x)) == 0)

-    {

-      u.parts.mantissa++;

-      if ((u.parts.mantissa & ~normal_bit) == 0ull)

-	u.parts.expn++;

-    }

-  else

-    {

-      if ((u.parts.mantissa & ~normal_bit) == 0ull)

-	u.parts.expn--;

-      u.parts.mantissa--;

-    }

-

-  /* If we have updated the expn of a normal number,

-     or moved from denormal to normal, [re]set the normal bit.  */ 

-     

-  if (u.parts.expn & 0x7fff)

-    u.parts.mantissa |=  normal_bit;

-

-  return u.ld;

-}

-

-/* nexttowardl is the same function with a different name.  */

-long double

-nexttowardl (long double, long double) __attribute__ ((alias("nextafterl")));

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+   nextafterl.c
+   Contributed by Danny Smith <dannysmith@users.sourceforge.net>
+   No copyright claimed, absolutely no warranties.
+
+   2005-05-09
+*/
+
+#include <math.h>
+
+long double
+nextafterl (long double x, long double y)
+{
+  union {
+      long double ld;
+      struct {
+        unsigned long long mantissa;
+        unsigned short expn;
+        unsigned short pad;
+      } __attribute__ ((packed)) parts; 
+  } u;
+
+  /* The normal bit is explicit for long doubles, unlike
+     float and double.  */
+  static const unsigned long long normal_bit = 0x8000000000000000ull;
+
+  if (isnan (y) || isnan (x))
+    return x + y;
+
+  if (x == y )
+     /* nextafter (0.0, -O.0) should return -0.0.  */
+     return y;
+
+  u.ld = x;
+  if (x == 0.0L)
+    {
+      u.parts.mantissa = 1ull;
+      return y > 0.0L ? u.ld : -u.ld;
+    }
+
+  if (((x > 0.0L) ^ (y > x)) == 0)
+    {
+      u.parts.mantissa++;
+      if ((u.parts.mantissa & ~normal_bit) == 0ull)
+	u.parts.expn++;
+    }
+  else
+    {
+      if ((u.parts.mantissa & ~normal_bit) == 0ull)
+	u.parts.expn--;
+      u.parts.mantissa--;
+    }
+
+  /* If we have updated the expn of a normal number,
+     or moved from denormal to normal, [re]set the normal bit.  */ 
+     
+  if (u.parts.expn & 0x7fff)
+    u.parts.mantissa |=  normal_bit;
+
+  return u.ld;
+}
+
+/* nexttowardl is the same function with a different name.  */
+long double
+nexttowardl (long double, long double) __attribute__ ((alias("nextafterl")));
diff --git a/mingw-w64-crt/math/nexttoward.c b/mingw-w64-crt/math/nexttoward.c
index b9af932..c97e9ad 100644
--- a/mingw-w64-crt/math/nexttoward.c
+++ b/mingw-w64-crt/math/nexttoward.c
@@ -1,47 +1,47 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

-   nexttoward.c

-   Contributed by Danny Smith <dannysmith@users.sourceforge.net>

-   No copyright claimed, absolutely no warranties.

-

-   2005-05-10

-*/

-

-#include <math.h>

-

-double

-nexttoward (double x, long double y)

-{

-  union

-  {

-    double d;

-    unsigned long long ll;

-  } u;

-

-  long double xx = x;

-

-  if (isnan (y) || isnan (x))

-    return x + y;

-

-  if (xx == y)

-     /* nextafter (0.0, -O.0) should return -0.0.  */

-     return y;

-  u.d = x; 

-  if (x == 0.0)

-    {

-      u.ll = 1;

-      return y > 0.0L ? u.d : -u.d;

-    }

-

-  /* Non-extended encodings are lexicographically ordered,

-     with implicit "normal" bit.  */ 

-  if (((x > 0.0) ^ (y > xx)) == 0)

-    u.ll++;

-  else

-    u.ll--;

-  return u.d;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+   nexttoward.c
+   Contributed by Danny Smith <dannysmith@users.sourceforge.net>
+   No copyright claimed, absolutely no warranties.
+
+   2005-05-10
+*/
+
+#include <math.h>
+
+double
+nexttoward (double x, long double y)
+{
+  union
+  {
+    double d;
+    unsigned long long ll;
+  } u;
+
+  long double xx = x;
+
+  if (isnan (y) || isnan (x))
+    return x + y;
+
+  if (xx == y)
+     /* nextafter (0.0, -O.0) should return -0.0.  */
+     return y;
+  u.d = x; 
+  if (x == 0.0)
+    {
+      u.ll = 1;
+      return y > 0.0L ? u.d : -u.d;
+    }
+
+  /* Non-extended encodings are lexicographically ordered,
+     with implicit "normal" bit.  */ 
+  if (((x > 0.0) ^ (y > xx)) == 0)
+    u.ll++;
+  else
+    u.ll--;
+  return u.d;
+}
diff --git a/mingw-w64-crt/math/nexttowardf.c b/mingw-w64-crt/math/nexttowardf.c
index 110266d..ca95ed6 100644
--- a/mingw-w64-crt/math/nexttowardf.c
+++ b/mingw-w64-crt/math/nexttowardf.c
@@ -1,43 +1,43 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/*

-   nexttowardf.c

-   Contributed by Danny Smith <dannysmith@users.sourceforge.net>

-   No copyright claimed, absolutely no warranties.

-

-   2005-05-10

-*/

-

-#include <math.h>

-

-float

-nexttowardf (float x, long double y)

-{

-  union

-  {

-    float f;

-    unsigned int i;

-  } u;

-

-  long double xx = x;

-

-  if (isnan (y) || isnan (x))

-    return x + y;

-  if (xx == y )

-     /* nextafter (0.0, -O.0) should return -0.0.  */

-     return y;

-  u.f = x; 

-  if (x == 0.0F)

-    {

-      u.i = 1;

-      return y > 0.0L ? u.f : -u.f;

-    }

-  if (((x > 0.0F) ^ (y > xx)) == 0)

-    u.i++;

-  else

-    u.i--;

-  return u.f;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/*
+   nexttowardf.c
+   Contributed by Danny Smith <dannysmith@users.sourceforge.net>
+   No copyright claimed, absolutely no warranties.
+
+   2005-05-10
+*/
+
+#include <math.h>
+
+float
+nexttowardf (float x, long double y)
+{
+  union
+  {
+    float f;
+    unsigned int i;
+  } u;
+
+  long double xx = x;
+
+  if (isnan (y) || isnan (x))
+    return x + y;
+  if (xx == y )
+     /* nextafter (0.0, -O.0) should return -0.0.  */
+     return y;
+  u.f = x; 
+  if (x == 0.0F)
+    {
+      u.i = 1;
+      return y > 0.0L ? u.f : -u.f;
+    }
+  if (((x > 0.0F) ^ (y > xx)) == 0)
+    u.i++;
+  else
+    u.i--;
+  return u.f;
+}
diff --git a/mingw-w64-crt/math/powf.c b/mingw-w64-crt/math/powf.c
index f3f0bb2..8e8805f 100644
--- a/mingw-w64-crt/math/powf.c
+++ b/mingw-w64-crt/math/powf.c
@@ -1,10 +1,10 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-float powf (float x, float y)

-{

-  return (float) pow ((double) x, (double) y);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+float powf (float x, float y)
+{
+  return (float) pow ((double) x, (double) y);
+}
diff --git a/mingw-w64-crt/math/powi.c b/mingw-w64-crt/math/powi.c
index 3966e94..63128f1 100644
--- a/mingw-w64-crt/math/powi.c
+++ b/mingw-w64-crt/math/powi.c
@@ -1,142 +1,142 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-#ifndef _SET_ERRNO

-#define _SET_ERRNO(x)

-#endif

-

-double __powi( x, nn )

-double x;

-int nn;

-{

-int n, e, sign, asign, lx;

-double w, y, s;

-

-/* See pow.c for these tests.  */

-if( x == 0.0 )

-	{

-	if( nn == 0 )

-		return( 1.0 );

-	else if( nn < 0 )

-	    return( INFINITY );

-	else

-	  {

-	    if( nn & 1 )

-	      return( x );

-	    else

-	      return( 0.0 );

-	  }

-	}

-

-if( nn == 0 )

-	return( 1.0 );

-

-if( nn == -1 )

-	return( 1.0/x );

-

-if( x < 0.0 )

-	{

-	asign = -1;

-	x = -x;

-	}

-else

-	asign = 0;

-

-

-if( nn < 0 )

-	{

-	sign = -1;

-	n = -nn;

-	}

-else

-	{

-	sign = 1;

-	n = nn;

-	}

-

-/* Even power will be positive. */

-if( (n & 1) == 0 )

-	asign = 0;

-

-/* Overflow detection */

-

-/* Calculate approximate logarithm of answer */

-s = frexp( x, &lx );

-e = (lx - 1)*n;

-if( (e == 0) || (e > 64) || (e < -64) )

-	{

-	s = (s - 7.0710678118654752e-1) / (s +  7.0710678118654752e-1);

-	s = (2.9142135623730950 * s - 0.5 + lx) * nn * LOGE2;

-	}

-else

-	{

-	s = LOGE2 * e;

-	}

-

-if( s > MAXLOG )

-	{

-	mtherr( "powi", OVERFLOW );

-	_SET_ERRNO(ERANGE);

-	y = INFINITY;

-	goto done;

-	}

-

-#if DENORMAL

-if( s < MINLOG )

-	{

-	y = 0.0;

-	goto done;

-	}

-

-/* Handle tiny denormal answer, but with less accuracy

- * since roundoff error in 1.0/x will be amplified.

- * The precise demarcation should be the gradual underflow threshold.

- */

-if( (s < (-MAXLOG+2.0)) && (sign < 0) )

-	{

-	x = 1.0/x;

-	sign = -sign;

-	}

-#else

-/* do not produce denormal answer */

-if( s < -MAXLOG )

-	return(0.0);

-#endif

-

-

-/* First bit of the power */

-if( n & 1 )

-	y = x;

-		

-else

-	y = 1.0;

-

-w = x;

-n >>= 1;

-while( n )

-	{

-	w = w * w;	/* arg to the 2-to-the-kth power */

-	if( n & 1 )	/* if that bit is set, then include in product */

-		y *= w;

-	n >>= 1;

-	}

-

-if( sign < 0 )

-	y = 1.0/y;

-

-done:

-

-if( asign )

-	{

-	/* odd power of negative number */

-	if( y == 0.0 )

-		y = NEGZERO;

-	else

-		y = -y;

-	}

-return(y);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+#ifndef _SET_ERRNO
+#define _SET_ERRNO(x)
+#endif
+
+double __powi( x, nn )
+double x;
+int nn;
+{
+int n, e, sign, asign, lx;
+double w, y, s;
+
+/* See pow.c for these tests.  */
+if( x == 0.0 )
+	{
+	if( nn == 0 )
+		return( 1.0 );
+	else if( nn < 0 )
+	    return( INFINITY );
+	else
+	  {
+	    if( nn & 1 )
+	      return( x );
+	    else
+	      return( 0.0 );
+	  }
+	}
+
+if( nn == 0 )
+	return( 1.0 );
+
+if( nn == -1 )
+	return( 1.0/x );
+
+if( x < 0.0 )
+	{
+	asign = -1;
+	x = -x;
+	}
+else
+	asign = 0;
+
+
+if( nn < 0 )
+	{
+	sign = -1;
+	n = -nn;
+	}
+else
+	{
+	sign = 1;
+	n = nn;
+	}
+
+/* Even power will be positive. */
+if( (n & 1) == 0 )
+	asign = 0;
+
+/* Overflow detection */
+
+/* Calculate approximate logarithm of answer */
+s = frexp( x, &lx );
+e = (lx - 1)*n;
+if( (e == 0) || (e > 64) || (e < -64) )
+	{
+	s = (s - 7.0710678118654752e-1) / (s +  7.0710678118654752e-1);
+	s = (2.9142135623730950 * s - 0.5 + lx) * nn * LOGE2;
+	}
+else
+	{
+	s = LOGE2 * e;
+	}
+
+if( s > MAXLOG )
+	{
+	mtherr( "powi", OVERFLOW );
+	_SET_ERRNO(ERANGE);
+	y = INFINITY;
+	goto done;
+	}
+
+#if DENORMAL
+if( s < MINLOG )
+	{
+	y = 0.0;
+	goto done;
+	}
+
+/* Handle tiny denormal answer, but with less accuracy
+ * since roundoff error in 1.0/x will be amplified.
+ * The precise demarcation should be the gradual underflow threshold.
+ */
+if( (s < (-MAXLOG+2.0)) && (sign < 0) )
+	{
+	x = 1.0/x;
+	sign = -sign;
+	}
+#else
+/* do not produce denormal answer */
+if( s < -MAXLOG )
+	return(0.0);
+#endif
+
+
+/* First bit of the power */
+if( n & 1 )
+	y = x;
+		
+else
+	y = 1.0;
+
+w = x;
+n >>= 1;
+while( n )
+	{
+	w = w * w;	/* arg to the 2-to-the-kth power */
+	if( n & 1 )	/* if that bit is set, then include in product */
+		y *= w;
+	n >>= 1;
+	}
+
+if( sign < 0 )
+	y = 1.0/y;
+
+done:
+
+if( asign )
+	{
+	/* odd power of negative number */
+	if( y == 0.0 )
+		y = NEGZERO;
+	else
+		y = -y;
+	}
+return(y);
+}
diff --git a/mingw-w64-crt/math/powif.c b/mingw-w64-crt/math/powif.c
index b92d737..e886f5e 100644
--- a/mingw-w64-crt/math/powif.c
+++ b/mingw-w64-crt/math/powif.c
@@ -1,140 +1,140 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-#ifndef _SET_ERRNO

-#define _SET_ERRNO(x)

-#endif

-

-float __powif( float x, int nn )

-{

-int n, e, sign, asign, lx;

-float w, y, s;

-

-/* See pow.c for these tests.  */

-if( x == 0.0F )

-	{

-	if( nn == 0 )

-		return( 1.0F );

-	else if( nn < 0 )

-	    return( INFINITYF );

-	else

-	  {

-	    if( nn & 1 )

-	      return( x );

-	    else

-	      return( 0.0 );

-	  }

-	}

-

-if( nn == 0 )

-	return( 1.0 );

-

-if( nn == -1 )

-	return( 1.0/x );

-

-if( x < 0.0 )

-	{

-	asign = -1;

-	x = -x;

-	}

-else

-	asign = 0;

-

-

-if( nn < 0 )

-	{

-	sign = -1;

-	n = -nn;

-	}

-else

-	{

-	sign = 1;

-	n = nn;

-	}

-

-/* Even power will be positive. */

-if( (n & 1) == 0 )

-	asign = 0;

-

-/* Overflow detection */

-

-/* Calculate approximate logarithm of answer */

-s = frexpf( x, &lx );

-e = (lx - 1)*n;

-if( (e == 0) || (e > 64) || (e < -64) )

-	{

-	s = (s - 7.0710678118654752e-1) / (s +  7.0710678118654752e-1);

-	s = (2.9142135623730950 * s - 0.5 + lx) * nn * LOGE2F;

-	}

-else

-	{

-	s = LOGE2F * e;

-	}

-

-if( s > MAXLOGF )

-	{

-	mtherr( "__powif", OVERFLOW );

-	_SET_ERRNO(ERANGE);

-	y = INFINITYF;

-	goto done;

-	}

-

-#if DENORMAL

-if( s < MINLOGF )

-	{

-	y = 0.0;

-	goto done;

-	}

-

-/* Handle tiny denormal answer, but with less accuracy

- * since roundoff error in 1.0/x will be amplified.

- * The precise demarcation should be the gradual underflow threshold.

- */

-if( (s < (-MAXLOGF+2.0)) && (sign < 0) )

-	{

-	x = 1.0/x;

-	sign = -sign;

-	}

-#else

-/* do not produce denormal answer */

-if( s < -MAXLOGF )

-	return(0.0);

-#endif

-

-

-/* First bit of the power */

-if( n & 1 )

-	y = x;

-		

-else

-	y = 1.0;

-

-w = x;

-n >>= 1;

-while( n )

-	{

-	w = w * w;	/* arg to the 2-to-the-kth power */

-	if( n & 1 )	/* if that bit is set, then include in product */

-		y *= w;

-	n >>= 1;

-	}

-

-if( sign < 0 )

-	y = 1.0/y;

-

-done:

-

-if( asign )

-	{

-	/* odd power of negative number */

-	if( y == 0.0 )

-		y = NEGZEROF;

-	else

-		y = -y;

-	}

-return(y);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+#ifndef _SET_ERRNO
+#define _SET_ERRNO(x)
+#endif
+
+float __powif( float x, int nn )
+{
+int n, e, sign, asign, lx;
+float w, y, s;
+
+/* See pow.c for these tests.  */
+if( x == 0.0F )
+	{
+	if( nn == 0 )
+		return( 1.0F );
+	else if( nn < 0 )
+	    return( INFINITYF );
+	else
+	  {
+	    if( nn & 1 )
+	      return( x );
+	    else
+	      return( 0.0 );
+	  }
+	}
+
+if( nn == 0 )
+	return( 1.0 );
+
+if( nn == -1 )
+	return( 1.0/x );
+
+if( x < 0.0 )
+	{
+	asign = -1;
+	x = -x;
+	}
+else
+	asign = 0;
+
+
+if( nn < 0 )
+	{
+	sign = -1;
+	n = -nn;
+	}
+else
+	{
+	sign = 1;
+	n = nn;
+	}
+
+/* Even power will be positive. */
+if( (n & 1) == 0 )
+	asign = 0;
+
+/* Overflow detection */
+
+/* Calculate approximate logarithm of answer */
+s = frexpf( x, &lx );
+e = (lx - 1)*n;
+if( (e == 0) || (e > 64) || (e < -64) )
+	{
+	s = (s - 7.0710678118654752e-1) / (s +  7.0710678118654752e-1);
+	s = (2.9142135623730950 * s - 0.5 + lx) * nn * LOGE2F;
+	}
+else
+	{
+	s = LOGE2F * e;
+	}
+
+if( s > MAXLOGF )
+	{
+	mtherr( "__powif", OVERFLOW );
+	_SET_ERRNO(ERANGE);
+	y = INFINITYF;
+	goto done;
+	}
+
+#if DENORMAL
+if( s < MINLOGF )
+	{
+	y = 0.0;
+	goto done;
+	}
+
+/* Handle tiny denormal answer, but with less accuracy
+ * since roundoff error in 1.0/x will be amplified.
+ * The precise demarcation should be the gradual underflow threshold.
+ */
+if( (s < (-MAXLOGF+2.0)) && (sign < 0) )
+	{
+	x = 1.0/x;
+	sign = -sign;
+	}
+#else
+/* do not produce denormal answer */
+if( s < -MAXLOGF )
+	return(0.0);
+#endif
+
+
+/* First bit of the power */
+if( n & 1 )
+	y = x;
+		
+else
+	y = 1.0;
+
+w = x;
+n >>= 1;
+while( n )
+	{
+	w = w * w;	/* arg to the 2-to-the-kth power */
+	if( n & 1 )	/* if that bit is set, then include in product */
+		y *= w;
+	n >>= 1;
+	}
+
+if( sign < 0 )
+	y = 1.0/y;
+
+done:
+
+if( asign )
+	{
+	/* odd power of negative number */
+	if( y == 0.0 )
+		y = NEGZEROF;
+	else
+		y = -y;
+	}
+return(y);
+}
diff --git a/mingw-w64-crt/math/powil.c b/mingw-w64-crt/math/powil.c
index b677671..f31f09e 100644
--- a/mingw-w64-crt/math/powil.c
+++ b/mingw-w64-crt/math/powil.c
@@ -1,122 +1,122 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-#ifndef _SET_ERRNO

-#define _SET_ERRNO(x)

-#endif

-

-long double __powil( x, nn )

-long double x;

-int nn;

-{

-long double w, y;

-long double s;

-int n, e, sign, asign, lx;

-

-if( x == 0.0L )

-	{

-	if( nn == 0 )

-		return( 1.0L );

-	else if( nn < 0 )

-		return( INFINITYL );

-	else

-		return( 0.0L );

-	}

-

-if( nn == 0 )

-	return( 1.0L );

-

-

-if( x < 0.0L )

-	{

-	asign = -1;

-	x = -x;

-	}

-else

-	asign = 0;

-

-

-if( nn < 0 )

-	{

-	sign = -1;

-	n = -nn;

-	}

-else

-	{

-	sign = 1;

-	n = nn;

-	}

-

-/* Overflow detection */

-

-/* Calculate approximate logarithm of answer */

-s = x;

-s = frexpl( s, &lx );

-e = (lx - 1)*n;

-if( (e == 0) || (e > 64) || (e < -64) )

-	{

-	s = (s - 7.0710678118654752e-1L) / (s +  7.0710678118654752e-1L);

-	s = (2.9142135623730950L * s - 0.5L + lx) * nn * LOGE2L;

-	}

-else

-	{

-	s = LOGE2L * e;

-	}

-

-if( s > MAXLOGL )

-	{

-	mtherr( "__powil", OVERFLOW );

-	_SET_ERRNO(ERANGE);

-	y = INFINITYL;

-	goto done;

-	}

-

-if( s < MINLOGL )

-	{

-	mtherr( "__powil", UNDERFLOW );

-	_SET_ERRNO(ERANGE);

-	return(0.0L);

-	}

-/* Handle tiny denormal answer, but with less accuracy

- * since roundoff error in 1.0/x will be amplified.

- * The precise demarcation should be the gradual underflow threshold.

- */

-if( s < (-MAXLOGL+2.0L) )

-	{

-	x = 1.0L/x;

-	sign = -sign;

-	}

-

-/* First bit of the power */

-if( n & 1 )

-	y = x;

-		

-else

-	{

-	y = 1.0L;

-	asign = 0;

-	}

-

-w = x;

-n >>= 1;

-while( n )

-	{

-	w = w * w;	/* arg to the 2-to-the-kth power */

-	if( n & 1 )	/* if that bit is set, then include in product */

-		y *= w;

-	n >>= 1;

-	}

-

-

-done:

-

-if( asign )

-	y = -y; /* odd power of negative number */

-if( sign < 0 )

-	y = 1.0L/y;

-return(y);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+#ifndef _SET_ERRNO
+#define _SET_ERRNO(x)
+#endif
+
+long double __powil( x, nn )
+long double x;
+int nn;
+{
+long double w, y;
+long double s;
+int n, e, sign, asign, lx;
+
+if( x == 0.0L )
+	{
+	if( nn == 0 )
+		return( 1.0L );
+	else if( nn < 0 )
+		return( INFINITYL );
+	else
+		return( 0.0L );
+	}
+
+if( nn == 0 )
+	return( 1.0L );
+
+
+if( x < 0.0L )
+	{
+	asign = -1;
+	x = -x;
+	}
+else
+	asign = 0;
+
+
+if( nn < 0 )
+	{
+	sign = -1;
+	n = -nn;
+	}
+else
+	{
+	sign = 1;
+	n = nn;
+	}
+
+/* Overflow detection */
+
+/* Calculate approximate logarithm of answer */
+s = x;
+s = frexpl( s, &lx );
+e = (lx - 1)*n;
+if( (e == 0) || (e > 64) || (e < -64) )
+	{
+	s = (s - 7.0710678118654752e-1L) / (s +  7.0710678118654752e-1L);
+	s = (2.9142135623730950L * s - 0.5L + lx) * nn * LOGE2L;
+	}
+else
+	{
+	s = LOGE2L * e;
+	}
+
+if( s > MAXLOGL )
+	{
+	mtherr( "__powil", OVERFLOW );
+	_SET_ERRNO(ERANGE);
+	y = INFINITYL;
+	goto done;
+	}
+
+if( s < MINLOGL )
+	{
+	mtherr( "__powil", UNDERFLOW );
+	_SET_ERRNO(ERANGE);
+	return(0.0L);
+	}
+/* Handle tiny denormal answer, but with less accuracy
+ * since roundoff error in 1.0/x will be amplified.
+ * The precise demarcation should be the gradual underflow threshold.
+ */
+if( s < (-MAXLOGL+2.0L) )
+	{
+	x = 1.0L/x;
+	sign = -sign;
+	}
+
+/* First bit of the power */
+if( n & 1 )
+	y = x;
+		
+else
+	{
+	y = 1.0L;
+	asign = 0;
+	}
+
+w = x;
+n >>= 1;
+while( n )
+	{
+	w = w * w;	/* arg to the 2-to-the-kth power */
+	if( n & 1 )	/* if that bit is set, then include in product */
+		y *= w;
+	n >>= 1;
+	}
+
+
+done:
+
+if( asign )
+	y = -y; /* odd power of negative number */
+if( sign < 0 )
+	y = 1.0L/y;
+return(y);
+}
diff --git a/mingw-w64-crt/math/powl.c b/mingw-w64-crt/math/powl.c
index e002e98..364500c 100644
--- a/mingw-w64-crt/math/powl.c
+++ b/mingw-w64-crt/math/powl.c
@@ -1,692 +1,692 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-#ifndef _SET_ERRNO

-#define _SET_ERRNO(x)

-#endif

-

-

-/* Table size */

-#define NXT 32

-/* log2(Table size) */

-#define LNXT 5

-

-#ifdef UNK

-/* log(1+x) =  x - .5x^2 + x^3 *  P(z)/Q(z)

- * on the domain  2^(-1/32) - 1  <=  x  <=  2^(1/32) - 1

- */

-static long double P[] = {

- 8.3319510773868690346226E-4L,

- 4.9000050881978028599627E-1L,

- 1.7500123722550302671919E0L,

- 1.4000100839971580279335E0L,

-};

-static long double Q[] = {

-/* 1.0000000000000000000000E0L,*/

- 5.2500282295834889175431E0L,

- 8.4000598057587009834666E0L,

- 4.2000302519914740834728E0L,

-};

-/* A[i] = 2^(-i/32), rounded to IEEE long double precision.

- * If i is even, A[i] + B[i/2] gives additional accuracy.

- */

-static long double A[33] = {

- 1.0000000000000000000000E0L,

- 9.7857206208770013448287E-1L,

- 9.5760328069857364691013E-1L,

- 9.3708381705514995065011E-1L,

- 9.1700404320467123175367E-1L,

- 8.9735453750155359320742E-1L,

- 8.7812608018664974155474E-1L,

- 8.5930964906123895780165E-1L,

- 8.4089641525371454301892E-1L,

- 8.2287773907698242225554E-1L,

- 8.0524516597462715409607E-1L,

- 7.8799042255394324325455E-1L,

- 7.7110541270397041179298E-1L,

- 7.5458221379671136985669E-1L,

- 7.3841307296974965571198E-1L,

- 7.2259040348852331001267E-1L,

- 7.0710678118654752438189E-1L,

- 6.9195494098191597746178E-1L,

- 6.7712777346844636413344E-1L,

- 6.6261832157987064729696E-1L,

- 6.4841977732550483296079E-1L,

- 6.3452547859586661129850E-1L,

- 6.2092890603674202431705E-1L,

- 6.0762367999023443907803E-1L,

- 5.9460355750136053334378E-1L,

- 5.8186242938878875689693E-1L,

- 5.6939431737834582684856E-1L,

- 5.5719337129794626814472E-1L,

- 5.4525386633262882960438E-1L,

- 5.3357020033841180906486E-1L,

- 5.2213689121370692017331E-1L,

- 5.1094857432705833910408E-1L,

- 5.0000000000000000000000E-1L,

-};

-static long double B[17] = {

- 0.0000000000000000000000E0L,

- 2.6176170809902549338711E-20L,

--1.0126791927256478897086E-20L,

- 1.3438228172316276937655E-21L,

- 1.2207982955417546912101E-20L,

--6.3084814358060867200133E-21L,

- 1.3164426894366316434230E-20L,

--1.8527916071632873716786E-20L,

- 1.8950325588932570796551E-20L,

- 1.5564775779538780478155E-20L,

- 6.0859793637556860974380E-21L,

--2.0208749253662532228949E-20L,

- 1.4966292219224761844552E-20L,

- 3.3540909728056476875639E-21L,

--8.6987564101742849540743E-22L,

--1.2327176863327626135542E-20L,

- 0.0000000000000000000000E0L,

-};

-

-/* 2^x = 1 + x P(x),

- * on the interval -1/32 <= x <= 0

- */

-static long double R[] = {

- 1.5089970579127659901157E-5L,

- 1.5402715328927013076125E-4L,

- 1.3333556028915671091390E-3L,

- 9.6181291046036762031786E-3L,

- 5.5504108664798463044015E-2L,

- 2.4022650695910062854352E-1L,

- 6.9314718055994530931447E-1L,

-};

-

-#define douba(k) A[k]

-#define doubb(k) B[k]

-#define MEXP (NXT*16384.0L)

-/* The following if denormal numbers are supported, else -MEXP: */

-#ifdef DENORMAL

-#define MNEXP (-NXT*(16384.0L+64.0L))

-#else

-#define MNEXP (-NXT*16384.0L)

-#endif

-/* log2(e) - 1 */

-#define LOG2EA 0.44269504088896340735992L

-#endif

-

-

-#ifdef IBMPC

-static const unsigned short P[] = {

-0xb804,0xa8b7,0xc6f4,0xda6a,0x3ff4, XPD

-0x7de9,0xcf02,0x58c0,0xfae1,0x3ffd, XPD

-0x405a,0x3722,0x67c9,0xe000,0x3fff, XPD

-0xcd99,0x6b43,0x87ca,0xb333,0x3fff, XPD

-};

-static const unsigned short Q[] = {

-/* 0x0000,0x0000,0x0000,0x8000,0x3fff, */

-0x6307,0xa469,0x3b33,0xa800,0x4001, XPD

-0xfec2,0x62d7,0xa51c,0x8666,0x4002, XPD

-0xda32,0xd072,0xa5d7,0x8666,0x4001, XPD

-};

-static const unsigned short A[] = {

-0x0000,0x0000,0x0000,0x8000,0x3fff, XPD

-0x033a,0x722a,0xb2db,0xfa83,0x3ffe, XPD

-0xcc2c,0x2486,0x7d15,0xf525,0x3ffe, XPD

-0xf5cb,0xdcda,0xb99b,0xefe4,0x3ffe, XPD

-0x392f,0xdd24,0xc6e7,0xeac0,0x3ffe, XPD

-0x48a8,0x7c83,0x06e7,0xe5b9,0x3ffe, XPD

-0xe111,0x2a94,0xdeec,0xe0cc,0x3ffe, XPD

-0x3755,0xdaf2,0xb797,0xdbfb,0x3ffe, XPD

-0x6af4,0xd69d,0xfcca,0xd744,0x3ffe, XPD

-0xe45a,0xf12a,0x1d91,0xd2a8,0x3ffe, XPD

-0x80e4,0x1f84,0x8c15,0xce24,0x3ffe, XPD

-0x27a3,0x6e2f,0xbd86,0xc9b9,0x3ffe, XPD

-0xdadd,0x5506,0x2a11,0xc567,0x3ffe, XPD

-0x9456,0x6670,0x4cca,0xc12c,0x3ffe, XPD

-0x36bf,0x580c,0xa39f,0xbd08,0x3ffe, XPD

-0x9ee9,0x62fb,0xaf47,0xb8fb,0x3ffe, XPD

-0x6484,0xf9de,0xf333,0xb504,0x3ffe, XPD

-0x2590,0xd2ac,0xf581,0xb123,0x3ffe, XPD

-0x4ac6,0x42a1,0x3eea,0xad58,0x3ffe, XPD

-0x0ef8,0xea7c,0x5ab4,0xa9a1,0x3ffe, XPD

-0x38ea,0xb151,0xd6a9,0xa5fe,0x3ffe, XPD

-0x6819,0x0c49,0x4303,0xa270,0x3ffe, XPD

-0x11ae,0x91a1,0x3260,0x9ef5,0x3ffe, XPD

-0x5539,0xd54e,0x39b9,0x9b8d,0x3ffe, XPD

-0xa96f,0x8db8,0xf051,0x9837,0x3ffe, XPD

-0x0961,0xfef7,0xefa8,0x94f4,0x3ffe, XPD

-0xc336,0xab11,0xd373,0x91c3,0x3ffe, XPD

-0x53c0,0x45cd,0x398b,0x8ea4,0x3ffe, XPD

-0xd6e7,0xea8b,0xc1e3,0x8b95,0x3ffe, XPD

-0x8527,0x92da,0x0e80,0x8898,0x3ffe, XPD

-0x7b15,0xcc48,0xc367,0x85aa,0x3ffe, XPD

-0xa1d7,0xac2b,0x8698,0x82cd,0x3ffe, XPD

-0x0000,0x0000,0x0000,0x8000,0x3ffe, XPD

-};

-static const unsigned short B[] = {

-0x0000,0x0000,0x0000,0x0000,0x0000, XPD

-0x1f87,0xdb30,0x18f5,0xf73a,0x3fbd, XPD

-0xac15,0x3e46,0x2932,0xbf4a,0xbfbc, XPD

-0x7944,0xba66,0xa091,0xcb12,0x3fb9, XPD

-0xff78,0x40b4,0x2ee6,0xe69a,0x3fbc, XPD

-0xc895,0x5069,0xe383,0xee53,0xbfbb, XPD

-0x7cde,0x9376,0x4325,0xf8ab,0x3fbc, XPD

-0xa10c,0x25e0,0xc093,0xaefd,0xbfbd, XPD

-0x7d3e,0xea95,0x1366,0xb2fb,0x3fbd, XPD

-0x5d89,0xeb34,0x5191,0x9301,0x3fbd, XPD

-0x80d9,0xb883,0xfb10,0xe5eb,0x3fbb, XPD

-0x045d,0x288c,0xc1ec,0xbedd,0xbfbd, XPD

-0xeded,0x5c85,0x4630,0x8d5a,0x3fbd, XPD

-0x9d82,0xe5ac,0x8e0a,0xfd6d,0x3fba, XPD

-0x6dfd,0xeb58,0xaf14,0x8373,0xbfb9, XPD

-0xf938,0x7aac,0x91cf,0xe8da,0xbfbc, XPD

-0x0000,0x0000,0x0000,0x0000,0x0000, XPD

-};

-static const unsigned short R[] = {

-0xa69b,0x530e,0xee1d,0xfd2a,0x3fee, XPD

-0xc746,0x8e7e,0x5960,0xa182,0x3ff2, XPD

-0x63b6,0xadda,0xfd6a,0xaec3,0x3ff5, XPD

-0xc104,0xfd99,0x5b7c,0x9d95,0x3ff8, XPD

-0xe05e,0x249d,0x46b8,0xe358,0x3ffa, XPD

-0x5d1d,0x162c,0xeffc,0xf5fd,0x3ffc, XPD

-0x79aa,0xd1cf,0x17f7,0xb172,0x3ffe, XPD

-};

-

-/* 10 byte sizes versus 12 byte */

-#define douba(k) (*(long double *)(&A[(sizeof( long double )/2)*(k)]))

-#define doubb(k) (*(long double *)(&B[(sizeof( long double )/2)*(k)]))

-#define MEXP (NXT*16384.0L)

-#ifdef DENORMAL

-#define MNEXP (-NXT*(16384.0L+64.0L))

-#else

-#define MNEXP (-NXT*16384.0L)

-#endif

-static const

-union

-{

-  unsigned short L[6];

-  long double ld;

-} log2ea = {{0xc2ef,0x705f,0xeca5,0xe2a8,0x3ffd, XPD}};

-

-#define LOG2EA (log2ea.ld)

-/*

-#define LOG2EA 0.44269504088896340735992L

-*/

-#endif

-

-#ifdef MIEEE

-static long P[] = {

-0x3ff40000,0xda6ac6f4,0xa8b7b804,

-0x3ffd0000,0xfae158c0,0xcf027de9,

-0x3fff0000,0xe00067c9,0x3722405a,

-0x3fff0000,0xb33387ca,0x6b43cd99,

-};

-static long Q[] = {

-/* 0x3fff0000,0x80000000,0x00000000, */

-0x40010000,0xa8003b33,0xa4696307,

-0x40020000,0x8666a51c,0x62d7fec2,

-0x40010000,0x8666a5d7,0xd072da32,

-};

-static long A[] = {

-0x3fff0000,0x80000000,0x00000000,

-0x3ffe0000,0xfa83b2db,0x722a033a,

-0x3ffe0000,0xf5257d15,0x2486cc2c,

-0x3ffe0000,0xefe4b99b,0xdcdaf5cb,

-0x3ffe0000,0xeac0c6e7,0xdd24392f,

-0x3ffe0000,0xe5b906e7,0x7c8348a8,

-0x3ffe0000,0xe0ccdeec,0x2a94e111,

-0x3ffe0000,0xdbfbb797,0xdaf23755,

-0x3ffe0000,0xd744fcca,0xd69d6af4,

-0x3ffe0000,0xd2a81d91,0xf12ae45a,

-0x3ffe0000,0xce248c15,0x1f8480e4,

-0x3ffe0000,0xc9b9bd86,0x6e2f27a3,

-0x3ffe0000,0xc5672a11,0x5506dadd,

-0x3ffe0000,0xc12c4cca,0x66709456,

-0x3ffe0000,0xbd08a39f,0x580c36bf,

-0x3ffe0000,0xb8fbaf47,0x62fb9ee9,

-0x3ffe0000,0xb504f333,0xf9de6484,

-0x3ffe0000,0xb123f581,0xd2ac2590,

-0x3ffe0000,0xad583eea,0x42a14ac6,

-0x3ffe0000,0xa9a15ab4,0xea7c0ef8,

-0x3ffe0000,0xa5fed6a9,0xb15138ea,

-0x3ffe0000,0xa2704303,0x0c496819,

-0x3ffe0000,0x9ef53260,0x91a111ae,

-0x3ffe0000,0x9b8d39b9,0xd54e5539,

-0x3ffe0000,0x9837f051,0x8db8a96f,

-0x3ffe0000,0x94f4efa8,0xfef70961,

-0x3ffe0000,0x91c3d373,0xab11c336,

-0x3ffe0000,0x8ea4398b,0x45cd53c0,

-0x3ffe0000,0x8b95c1e3,0xea8bd6e7,

-0x3ffe0000,0x88980e80,0x92da8527,

-0x3ffe0000,0x85aac367,0xcc487b15,

-0x3ffe0000,0x82cd8698,0xac2ba1d7,

-0x3ffe0000,0x80000000,0x00000000,

-};

-static long B[51] = {

-0x00000000,0x00000000,0x00000000,

-0x3fbd0000,0xf73a18f5,0xdb301f87,

-0xbfbc0000,0xbf4a2932,0x3e46ac15,

-0x3fb90000,0xcb12a091,0xba667944,

-0x3fbc0000,0xe69a2ee6,0x40b4ff78,

-0xbfbb0000,0xee53e383,0x5069c895,

-0x3fbc0000,0xf8ab4325,0x93767cde,

-0xbfbd0000,0xaefdc093,0x25e0a10c,

-0x3fbd0000,0xb2fb1366,0xea957d3e,

-0x3fbd0000,0x93015191,0xeb345d89,

-0x3fbb0000,0xe5ebfb10,0xb88380d9,

-0xbfbd0000,0xbeddc1ec,0x288c045d,

-0x3fbd0000,0x8d5a4630,0x5c85eded,

-0x3fba0000,0xfd6d8e0a,0xe5ac9d82,

-0xbfb90000,0x8373af14,0xeb586dfd,

-0xbfbc0000,0xe8da91cf,0x7aacf938,

-0x00000000,0x00000000,0x00000000,

-};

-static long R[] = {

-0x3fee0000,0xfd2aee1d,0x530ea69b,

-0x3ff20000,0xa1825960,0x8e7ec746,

-0x3ff50000,0xaec3fd6a,0xadda63b6,

-0x3ff80000,0x9d955b7c,0xfd99c104,

-0x3ffa0000,0xe35846b8,0x249de05e,

-0x3ffc0000,0xf5fdeffc,0x162c5d1d,

-0x3ffe0000,0xb17217f7,0xd1cf79aa,

-};

-

-#define douba(k) (*(long double *)&A[3*(k)])

-#define doubb(k) (*(long double *)&B[3*(k)])

-#define MEXP (NXT*16384.0L)

-#ifdef DENORMAL

-#define MNEXP (-NXT*(16384.0L+64.0L))

-#else

-#define MNEXP (-NXT*16382.0L)

-#endif

-static long L[3] = {0x3ffd0000,0xe2a8eca5,0x705fc2ef};

-#define LOG2EA (*(long double *)(&L[0]))

-#endif

-

-

-#define F W

-#define Fa Wa

-#define Fb Wb

-#define G W

-#define Ga Wa

-#define Gb u

-#define H W

-#define Ha Wb

-#define Hb Wb

-

-static VOLATILE long double z;

-static long double w, W, Wa, Wb, ya, yb, u;

-

-static __inline__ long double reducl( long double );

-extern long double __powil ( long double, int );

-extern long double powl ( long double x, long double y);

-

-/* No error checking. We handle Infs and zeros ourselves.  */

-static __inline__ long double

-__fast_ldexpl (long double x, int expn)

-{

-  long double res;

-  __asm__ ("fscale"

-  	    : "=t" (res)

-	    : "0" (x), "u" ((long double) expn));

-  return res;

-}

-

-#define ldexpl  __fast_ldexpl

-

-long double powl( x, y )

-long double x, y;

-{

-/* double F, Fa, Fb, G, Ga, Gb, H, Ha, Hb */

-int i, nflg, iyflg, yoddint;

-long e;

-

-if( y == 0.0L )

-	return( 1.0L );

-

-#ifdef NANS

-if( isnanl(x) )

-	{

-	_SET_ERRNO (EDOM);

-	return( x );

-	}

-if( isnanl(y) )

-	{

-	_SET_ERRNO (EDOM);

-	return( y );

-	}

-#endif

-

-if( y == 1.0L )

-	return( x );

-

-if( isinfl(y) && (x == -1.0L || x == 1.0L) )

-	return( y );

-

-if( x == 1.0L )

-	return( 1.0L );

-

-if( y >= MAXNUML )

-	{

-	_SET_ERRNO (ERANGE);

-#ifdef INFINITIES

-	if( x > 1.0L )

-		return( INFINITYL );

-#else

-	if( x > 1.0L )

-		return( MAXNUML );

-#endif

-	if( x > 0.0L && x < 1.0L )

-		return( 0.0L );

-#ifdef INFINITIES

-	if( x < -1.0L )

-		return( INFINITYL );

-#else

-	if( x < -1.0L )

-		return( MAXNUML );

-#endif

-	if( x > -1.0L && x < 0.0L )

-		return( 0.0L );

-	}

-if( y <= -MAXNUML )

-	{

-	_SET_ERRNO (ERANGE);

-	if( x > 1.0L )

-		return( 0.0L );

-#ifdef INFINITIES

-	if( x > 0.0L && x < 1.0L )

-		return( INFINITYL );

-#else

-	if( x > 0.0L && x < 1.0L )

-		return( MAXNUML );

-#endif

-	if( x < -1.0L )

-		return( 0.0L );

-#ifdef INFINITIES

-	if( x > -1.0L && x < 0.0L )

-		return( INFINITYL );

-#else

-	if( x > -1.0L && x < 0.0L )

-		return( MAXNUML );

-#endif

-	}

-if( x >= MAXNUML )

-	{

-#if INFINITIES

-	if( y > 0.0L )

-		return( INFINITYL );

-#else

-	if( y > 0.0L )

-		return( MAXNUML );

-#endif

-	return( 0.0L );

-	}

-

-w = floorl(y);

-/* Set iyflg to 1 if y is an integer.  */

-iyflg = 0;

-if( w == y )

-	iyflg = 1;

-

-/* Test for odd integer y.  */

-yoddint = 0;

-if( iyflg )

-	{

-	ya = fabsl(y);

-	ya = floorl(0.5L * ya);

-	yb = 0.5L * fabsl(w);

-	if( ya != yb )

-		yoddint = 1;

-	}

-

-if( x <= -MAXNUML )

-	{

-	if( y > 0.0L )

-		{

-#ifdef INFINITIES

-		if( yoddint )

-			return( -INFINITYL );

-		return( INFINITYL );

-#else

-		if( yoddint )

-			return( -MAXNUML );

-		return( MAXNUML );

-#endif

-		}

-	if( y < 0.0L )

-		{

-#ifdef MINUSZERO

-		if( yoddint )

-			return( NEGZEROL );

-#endif

-		return( 0.0 );

-		}

- 	}

-

-

-nflg = 0;	/* flag = 1 if x<0 raised to integer power */

-if( x <= 0.0L )

-	{

-	if( x == 0.0L )

-		{

-		if( y < 0.0 )

-			{

-#ifdef MINUSZERO

-			if( signbitl(x) && yoddint )

-				return( -INFINITYL );

-#endif

-#ifdef INFINITIES

-			return( INFINITYL );

-#else

-			return( MAXNUML );

-#endif

-			}

-		if( y > 0.0 )

-			{

-#ifdef MINUSZERO

-			if( signbitl(x) && yoddint )

-				return( NEGZEROL );

-#endif

-			return( 0.0 );

-			}

-		if( y == 0.0L )

-			return( 1.0L );  /*   0**0   */

-		else  

-			return( 0.0L );  /*   0**y   */

-		}

-	else

-		{

-		if( iyflg == 0 )

-			{ /* noninteger power of negative number */

-			mtherr( fname, DOMAIN );

-			_SET_ERRNO (EDOM);

-#ifdef NANS

-			return(NANL);

-#else

-			return(0.0L);

-#endif

-			}

-		nflg = 1;

-		}

-	}

-

-/* Integer power of an integer.  */

-

-if( iyflg )

-	{

-	i = w;

-	w = floorl(x);

-	if( (w == x) && (fabsl(y) < 32768.0) )

-		{

-		w = __powil( x, (int) y );

-		return( w );

-		}

-	}

-

-

-if( nflg )

-	x = fabsl(x);

-

-/* separate significand from exponent */

-x = frexpl( x, &i );

-e = i;

-

-/* find significand in antilog table A[] */

-i = 1;

-if( x <= douba(17) )

-	i = 17;

-if( x <= douba(i+8) )

-	i += 8;

-if( x <= douba(i+4) )

-	i += 4;

-if( x <= douba(i+2) )

-	i += 2;

-if( x >= douba(1) )

-	i = -1;

-i += 1;

-

-

-/* Find (x - A[i])/A[i]

- * in order to compute log(x/A[i]):

- *

- * log(x) = log( a x/a ) = log(a) + log(x/a)

- *

- * log(x/a) = log(1+v),  v = x/a - 1 = (x-a)/a

- */

-x -= douba(i);

-x -= doubb(i/2);

-x /= douba(i);

-

-

-/* rational approximation for log(1+v):

- *

- * log(1+v)  =  v  -  v**2/2  +  v**3 P(v) / Q(v)

- */

-z = x*x;

-w = x * ( z * polevll( x, P, 3 ) / p1evll( x, Q, 3 ) );

-w = w - ldexpl( z, -1 );   /*  w - 0.5 * z  */

-

-/* Convert to base 2 logarithm:

- * multiply by log2(e) = 1 + LOG2EA

- */

-z = LOG2EA * w;

-z += w;

-z += LOG2EA * x;

-z += x;

-

-/* Compute exponent term of the base 2 logarithm. */

-w = -i;

-w = ldexpl( w, -LNXT );	/* divide by NXT */

-w += e;

-/* Now base 2 log of x is w + z. */

-

-/* Multiply base 2 log by y, in extended precision. */

-

-/* separate y into large part ya

- * and small part yb less than 1/NXT

- */

-ya = reducl(y);

-yb = y - ya;

-

-/* (w+z)(ya+yb)

- * = w*ya + w*yb + z*y

- */

-F = z * y  +  w * yb;

-Fa = reducl(F);

-Fb = F - Fa;

-

-G = Fa + w * ya;

-Ga = reducl(G);

-Gb = G - Ga;

-

-H = Fb + Gb;

-Ha = reducl(H);

-w = ldexpl( Ga + Ha, LNXT );

-

-/* Test the power of 2 for overflow */

-if( w > MEXP )

-	{

-	_SET_ERRNO (ERANGE);

-	mtherr( fname, OVERFLOW );

-	return( MAXNUML );

-	}

-

-if( w < MNEXP )

-	{

-	_SET_ERRNO (ERANGE);

-	mtherr( fname, UNDERFLOW );

-	return( 0.0L );

-	}

-

-e = w;

-Hb = H - Ha;

-

-if( Hb > 0.0L )

-	{

-	e += 1;

-	Hb -= (1.0L/NXT);  /*0.0625L;*/

-	}

-

-/* Now the product y * log2(x)  =  Hb + e/NXT.

- *

- * Compute base 2 exponential of Hb,

- * where -0.0625 <= Hb <= 0.

- */

-z = Hb * polevll( Hb, R, 6 );  /*    z  =  2**Hb - 1    */

-

-/* Express e/NXT as an integer plus a negative number of (1/NXT)ths.

- * Find lookup table entry for the fractional power of 2.

- */

-if( e < 0 )

-	i = 0;

-else

-	i = 1;

-i = e/NXT + i;

-e = NXT*i - e;

-w = douba( e );

-z = w * z;      /*    2**-e * ( 1 + (2**Hb-1) )    */

-z = z + w;

-z = ldexpl( z, i );  /* multiply by integer power of 2 */

-

-if( nflg )

-	{

-/* For negative x,

- * find out if the integer exponent

- * is odd or even.

- */

-	w = ldexpl( y, -1 );

-	w = floorl(w);

-	w = ldexpl( w, 1 );

-	if( w != y )

-		z = -z; /* odd exponent */

-	}

-

-return( z );

-}

-

-static __inline__ long double 

-__convert_inf_to_maxnum(long double x)

-{

-  if (isinf(x))

-    return (x > 0.0L ? MAXNUML : -MAXNUML);

-  else

-    return x;

-}

-

-

-/* Find a multiple of 1/NXT that is within 1/NXT of x. */

-static __inline__ long double reducl(x)

-long double x;

-{

-long double t;

-

-/* If the call to ldexpl overflows, set it to MAXNUML.

-   This avoids Inf - Inf = Nan result when calculating the 'small'

-   part of a reduction.  Instead, the small part becomes Inf,

-   causing under/overflow when adding it to the 'large' part.

-   There must be a cleaner way of doing this. */

-t =  __convert_inf_to_maxnum (ldexpl( x, LNXT ));

-t = floorl( t );

-t = ldexpl( t, -LNXT );

-return(t);

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+#ifndef _SET_ERRNO
+#define _SET_ERRNO(x)
+#endif
+
+
+/* Table size */
+#define NXT 32
+/* log2(Table size) */
+#define LNXT 5
+
+#ifdef UNK
+/* log(1+x) =  x - .5x^2 + x^3 *  P(z)/Q(z)
+ * on the domain  2^(-1/32) - 1  <=  x  <=  2^(1/32) - 1
+ */
+static long double P[] = {
+ 8.3319510773868690346226E-4L,
+ 4.9000050881978028599627E-1L,
+ 1.7500123722550302671919E0L,
+ 1.4000100839971580279335E0L,
+};
+static long double Q[] = {
+/* 1.0000000000000000000000E0L,*/
+ 5.2500282295834889175431E0L,
+ 8.4000598057587009834666E0L,
+ 4.2000302519914740834728E0L,
+};
+/* A[i] = 2^(-i/32), rounded to IEEE long double precision.
+ * If i is even, A[i] + B[i/2] gives additional accuracy.
+ */
+static long double A[33] = {
+ 1.0000000000000000000000E0L,
+ 9.7857206208770013448287E-1L,
+ 9.5760328069857364691013E-1L,
+ 9.3708381705514995065011E-1L,
+ 9.1700404320467123175367E-1L,
+ 8.9735453750155359320742E-1L,
+ 8.7812608018664974155474E-1L,
+ 8.5930964906123895780165E-1L,
+ 8.4089641525371454301892E-1L,
+ 8.2287773907698242225554E-1L,
+ 8.0524516597462715409607E-1L,
+ 7.8799042255394324325455E-1L,
+ 7.7110541270397041179298E-1L,
+ 7.5458221379671136985669E-1L,
+ 7.3841307296974965571198E-1L,
+ 7.2259040348852331001267E-1L,
+ 7.0710678118654752438189E-1L,
+ 6.9195494098191597746178E-1L,
+ 6.7712777346844636413344E-1L,
+ 6.6261832157987064729696E-1L,
+ 6.4841977732550483296079E-1L,
+ 6.3452547859586661129850E-1L,
+ 6.2092890603674202431705E-1L,
+ 6.0762367999023443907803E-1L,
+ 5.9460355750136053334378E-1L,
+ 5.8186242938878875689693E-1L,
+ 5.6939431737834582684856E-1L,
+ 5.5719337129794626814472E-1L,
+ 5.4525386633262882960438E-1L,
+ 5.3357020033841180906486E-1L,
+ 5.2213689121370692017331E-1L,
+ 5.1094857432705833910408E-1L,
+ 5.0000000000000000000000E-1L,
+};
+static long double B[17] = {
+ 0.0000000000000000000000E0L,
+ 2.6176170809902549338711E-20L,
+-1.0126791927256478897086E-20L,
+ 1.3438228172316276937655E-21L,
+ 1.2207982955417546912101E-20L,
+-6.3084814358060867200133E-21L,
+ 1.3164426894366316434230E-20L,
+-1.8527916071632873716786E-20L,
+ 1.8950325588932570796551E-20L,
+ 1.5564775779538780478155E-20L,
+ 6.0859793637556860974380E-21L,
+-2.0208749253662532228949E-20L,
+ 1.4966292219224761844552E-20L,
+ 3.3540909728056476875639E-21L,
+-8.6987564101742849540743E-22L,
+-1.2327176863327626135542E-20L,
+ 0.0000000000000000000000E0L,
+};
+
+/* 2^x = 1 + x P(x),
+ * on the interval -1/32 <= x <= 0
+ */
+static long double R[] = {
+ 1.5089970579127659901157E-5L,
+ 1.5402715328927013076125E-4L,
+ 1.3333556028915671091390E-3L,
+ 9.6181291046036762031786E-3L,
+ 5.5504108664798463044015E-2L,
+ 2.4022650695910062854352E-1L,
+ 6.9314718055994530931447E-1L,
+};
+
+#define douba(k) A[k]
+#define doubb(k) B[k]
+#define MEXP (NXT*16384.0L)
+/* The following if denormal numbers are supported, else -MEXP: */
+#ifdef DENORMAL
+#define MNEXP (-NXT*(16384.0L+64.0L))
+#else
+#define MNEXP (-NXT*16384.0L)
+#endif
+/* log2(e) - 1 */
+#define LOG2EA 0.44269504088896340735992L
+#endif
+
+
+#ifdef IBMPC
+static const unsigned short P[] = {
+0xb804,0xa8b7,0xc6f4,0xda6a,0x3ff4, XPD
+0x7de9,0xcf02,0x58c0,0xfae1,0x3ffd, XPD
+0x405a,0x3722,0x67c9,0xe000,0x3fff, XPD
+0xcd99,0x6b43,0x87ca,0xb333,0x3fff, XPD
+};
+static const unsigned short Q[] = {
+/* 0x0000,0x0000,0x0000,0x8000,0x3fff, */
+0x6307,0xa469,0x3b33,0xa800,0x4001, XPD
+0xfec2,0x62d7,0xa51c,0x8666,0x4002, XPD
+0xda32,0xd072,0xa5d7,0x8666,0x4001, XPD
+};
+static const unsigned short A[] = {
+0x0000,0x0000,0x0000,0x8000,0x3fff, XPD
+0x033a,0x722a,0xb2db,0xfa83,0x3ffe, XPD
+0xcc2c,0x2486,0x7d15,0xf525,0x3ffe, XPD
+0xf5cb,0xdcda,0xb99b,0xefe4,0x3ffe, XPD
+0x392f,0xdd24,0xc6e7,0xeac0,0x3ffe, XPD
+0x48a8,0x7c83,0x06e7,0xe5b9,0x3ffe, XPD
+0xe111,0x2a94,0xdeec,0xe0cc,0x3ffe, XPD
+0x3755,0xdaf2,0xb797,0xdbfb,0x3ffe, XPD
+0x6af4,0xd69d,0xfcca,0xd744,0x3ffe, XPD
+0xe45a,0xf12a,0x1d91,0xd2a8,0x3ffe, XPD
+0x80e4,0x1f84,0x8c15,0xce24,0x3ffe, XPD
+0x27a3,0x6e2f,0xbd86,0xc9b9,0x3ffe, XPD
+0xdadd,0x5506,0x2a11,0xc567,0x3ffe, XPD
+0x9456,0x6670,0x4cca,0xc12c,0x3ffe, XPD
+0x36bf,0x580c,0xa39f,0xbd08,0x3ffe, XPD
+0x9ee9,0x62fb,0xaf47,0xb8fb,0x3ffe, XPD
+0x6484,0xf9de,0xf333,0xb504,0x3ffe, XPD
+0x2590,0xd2ac,0xf581,0xb123,0x3ffe, XPD
+0x4ac6,0x42a1,0x3eea,0xad58,0x3ffe, XPD
+0x0ef8,0xea7c,0x5ab4,0xa9a1,0x3ffe, XPD
+0x38ea,0xb151,0xd6a9,0xa5fe,0x3ffe, XPD
+0x6819,0x0c49,0x4303,0xa270,0x3ffe, XPD
+0x11ae,0x91a1,0x3260,0x9ef5,0x3ffe, XPD
+0x5539,0xd54e,0x39b9,0x9b8d,0x3ffe, XPD
+0xa96f,0x8db8,0xf051,0x9837,0x3ffe, XPD
+0x0961,0xfef7,0xefa8,0x94f4,0x3ffe, XPD
+0xc336,0xab11,0xd373,0x91c3,0x3ffe, XPD
+0x53c0,0x45cd,0x398b,0x8ea4,0x3ffe, XPD
+0xd6e7,0xea8b,0xc1e3,0x8b95,0x3ffe, XPD
+0x8527,0x92da,0x0e80,0x8898,0x3ffe, XPD
+0x7b15,0xcc48,0xc367,0x85aa,0x3ffe, XPD
+0xa1d7,0xac2b,0x8698,0x82cd,0x3ffe, XPD
+0x0000,0x0000,0x0000,0x8000,0x3ffe, XPD
+};
+static const unsigned short B[] = {
+0x0000,0x0000,0x0000,0x0000,0x0000, XPD
+0x1f87,0xdb30,0x18f5,0xf73a,0x3fbd, XPD
+0xac15,0x3e46,0x2932,0xbf4a,0xbfbc, XPD
+0x7944,0xba66,0xa091,0xcb12,0x3fb9, XPD
+0xff78,0x40b4,0x2ee6,0xe69a,0x3fbc, XPD
+0xc895,0x5069,0xe383,0xee53,0xbfbb, XPD
+0x7cde,0x9376,0x4325,0xf8ab,0x3fbc, XPD
+0xa10c,0x25e0,0xc093,0xaefd,0xbfbd, XPD
+0x7d3e,0xea95,0x1366,0xb2fb,0x3fbd, XPD
+0x5d89,0xeb34,0x5191,0x9301,0x3fbd, XPD
+0x80d9,0xb883,0xfb10,0xe5eb,0x3fbb, XPD
+0x045d,0x288c,0xc1ec,0xbedd,0xbfbd, XPD
+0xeded,0x5c85,0x4630,0x8d5a,0x3fbd, XPD
+0x9d82,0xe5ac,0x8e0a,0xfd6d,0x3fba, XPD
+0x6dfd,0xeb58,0xaf14,0x8373,0xbfb9, XPD
+0xf938,0x7aac,0x91cf,0xe8da,0xbfbc, XPD
+0x0000,0x0000,0x0000,0x0000,0x0000, XPD
+};
+static const unsigned short R[] = {
+0xa69b,0x530e,0xee1d,0xfd2a,0x3fee, XPD
+0xc746,0x8e7e,0x5960,0xa182,0x3ff2, XPD
+0x63b6,0xadda,0xfd6a,0xaec3,0x3ff5, XPD
+0xc104,0xfd99,0x5b7c,0x9d95,0x3ff8, XPD
+0xe05e,0x249d,0x46b8,0xe358,0x3ffa, XPD
+0x5d1d,0x162c,0xeffc,0xf5fd,0x3ffc, XPD
+0x79aa,0xd1cf,0x17f7,0xb172,0x3ffe, XPD
+};
+
+/* 10 byte sizes versus 12 byte */
+#define douba(k) (*(long double *)(&A[(sizeof( long double )/2)*(k)]))
+#define doubb(k) (*(long double *)(&B[(sizeof( long double )/2)*(k)]))
+#define MEXP (NXT*16384.0L)
+#ifdef DENORMAL
+#define MNEXP (-NXT*(16384.0L+64.0L))
+#else
+#define MNEXP (-NXT*16384.0L)
+#endif
+static const
+union
+{
+  unsigned short L[6];
+  long double ld;
+} log2ea = {{0xc2ef,0x705f,0xeca5,0xe2a8,0x3ffd, XPD}};
+
+#define LOG2EA (log2ea.ld)
+/*
+#define LOG2EA 0.44269504088896340735992L
+*/
+#endif
+
+#ifdef MIEEE
+static long P[] = {
+0x3ff40000,0xda6ac6f4,0xa8b7b804,
+0x3ffd0000,0xfae158c0,0xcf027de9,
+0x3fff0000,0xe00067c9,0x3722405a,
+0x3fff0000,0xb33387ca,0x6b43cd99,
+};
+static long Q[] = {
+/* 0x3fff0000,0x80000000,0x00000000, */
+0x40010000,0xa8003b33,0xa4696307,
+0x40020000,0x8666a51c,0x62d7fec2,
+0x40010000,0x8666a5d7,0xd072da32,
+};
+static long A[] = {
+0x3fff0000,0x80000000,0x00000000,
+0x3ffe0000,0xfa83b2db,0x722a033a,
+0x3ffe0000,0xf5257d15,0x2486cc2c,
+0x3ffe0000,0xefe4b99b,0xdcdaf5cb,
+0x3ffe0000,0xeac0c6e7,0xdd24392f,
+0x3ffe0000,0xe5b906e7,0x7c8348a8,
+0x3ffe0000,0xe0ccdeec,0x2a94e111,
+0x3ffe0000,0xdbfbb797,0xdaf23755,
+0x3ffe0000,0xd744fcca,0xd69d6af4,
+0x3ffe0000,0xd2a81d91,0xf12ae45a,
+0x3ffe0000,0xce248c15,0x1f8480e4,
+0x3ffe0000,0xc9b9bd86,0x6e2f27a3,
+0x3ffe0000,0xc5672a11,0x5506dadd,
+0x3ffe0000,0xc12c4cca,0x66709456,
+0x3ffe0000,0xbd08a39f,0x580c36bf,
+0x3ffe0000,0xb8fbaf47,0x62fb9ee9,
+0x3ffe0000,0xb504f333,0xf9de6484,
+0x3ffe0000,0xb123f581,0xd2ac2590,
+0x3ffe0000,0xad583eea,0x42a14ac6,
+0x3ffe0000,0xa9a15ab4,0xea7c0ef8,
+0x3ffe0000,0xa5fed6a9,0xb15138ea,
+0x3ffe0000,0xa2704303,0x0c496819,
+0x3ffe0000,0x9ef53260,0x91a111ae,
+0x3ffe0000,0x9b8d39b9,0xd54e5539,
+0x3ffe0000,0x9837f051,0x8db8a96f,
+0x3ffe0000,0x94f4efa8,0xfef70961,
+0x3ffe0000,0x91c3d373,0xab11c336,
+0x3ffe0000,0x8ea4398b,0x45cd53c0,
+0x3ffe0000,0x8b95c1e3,0xea8bd6e7,
+0x3ffe0000,0x88980e80,0x92da8527,
+0x3ffe0000,0x85aac367,0xcc487b15,
+0x3ffe0000,0x82cd8698,0xac2ba1d7,
+0x3ffe0000,0x80000000,0x00000000,
+};
+static long B[51] = {
+0x00000000,0x00000000,0x00000000,
+0x3fbd0000,0xf73a18f5,0xdb301f87,
+0xbfbc0000,0xbf4a2932,0x3e46ac15,
+0x3fb90000,0xcb12a091,0xba667944,
+0x3fbc0000,0xe69a2ee6,0x40b4ff78,
+0xbfbb0000,0xee53e383,0x5069c895,
+0x3fbc0000,0xf8ab4325,0x93767cde,
+0xbfbd0000,0xaefdc093,0x25e0a10c,
+0x3fbd0000,0xb2fb1366,0xea957d3e,
+0x3fbd0000,0x93015191,0xeb345d89,
+0x3fbb0000,0xe5ebfb10,0xb88380d9,
+0xbfbd0000,0xbeddc1ec,0x288c045d,
+0x3fbd0000,0x8d5a4630,0x5c85eded,
+0x3fba0000,0xfd6d8e0a,0xe5ac9d82,
+0xbfb90000,0x8373af14,0xeb586dfd,
+0xbfbc0000,0xe8da91cf,0x7aacf938,
+0x00000000,0x00000000,0x00000000,
+};
+static long R[] = {
+0x3fee0000,0xfd2aee1d,0x530ea69b,
+0x3ff20000,0xa1825960,0x8e7ec746,
+0x3ff50000,0xaec3fd6a,0xadda63b6,
+0x3ff80000,0x9d955b7c,0xfd99c104,
+0x3ffa0000,0xe35846b8,0x249de05e,
+0x3ffc0000,0xf5fdeffc,0x162c5d1d,
+0x3ffe0000,0xb17217f7,0xd1cf79aa,
+};
+
+#define douba(k) (*(long double *)&A[3*(k)])
+#define doubb(k) (*(long double *)&B[3*(k)])
+#define MEXP (NXT*16384.0L)
+#ifdef DENORMAL
+#define MNEXP (-NXT*(16384.0L+64.0L))
+#else
+#define MNEXP (-NXT*16382.0L)
+#endif
+static long L[3] = {0x3ffd0000,0xe2a8eca5,0x705fc2ef};
+#define LOG2EA (*(long double *)(&L[0]))
+#endif
+
+
+#define F W
+#define Fa Wa
+#define Fb Wb
+#define G W
+#define Ga Wa
+#define Gb u
+#define H W
+#define Ha Wb
+#define Hb Wb
+
+static VOLATILE long double z;
+static long double w, W, Wa, Wb, ya, yb, u;
+
+static __inline__ long double reducl( long double );
+extern long double __powil ( long double, int );
+extern long double powl ( long double x, long double y);
+
+/* No error checking. We handle Infs and zeros ourselves.  */
+static __inline__ long double
+__fast_ldexpl (long double x, int expn)
+{
+  long double res;
+  __asm__ ("fscale"
+  	    : "=t" (res)
+	    : "0" (x), "u" ((long double) expn));
+  return res;
+}
+
+#define ldexpl  __fast_ldexpl
+
+long double powl( x, y )
+long double x, y;
+{
+/* double F, Fa, Fb, G, Ga, Gb, H, Ha, Hb */
+int i, nflg, iyflg, yoddint;
+long e;
+
+if( y == 0.0L )
+	return( 1.0L );
+
+#ifdef NANS
+if( isnanl(x) )
+	{
+	_SET_ERRNO (EDOM);
+	return( x );
+	}
+if( isnanl(y) )
+	{
+	_SET_ERRNO (EDOM);
+	return( y );
+	}
+#endif
+
+if( y == 1.0L )
+	return( x );
+
+if( isinfl(y) && (x == -1.0L || x == 1.0L) )
+	return( y );
+
+if( x == 1.0L )
+	return( 1.0L );
+
+if( y >= MAXNUML )
+	{
+	_SET_ERRNO (ERANGE);
+#ifdef INFINITIES
+	if( x > 1.0L )
+		return( INFINITYL );
+#else
+	if( x > 1.0L )
+		return( MAXNUML );
+#endif
+	if( x > 0.0L && x < 1.0L )
+		return( 0.0L );
+#ifdef INFINITIES
+	if( x < -1.0L )
+		return( INFINITYL );
+#else
+	if( x < -1.0L )
+		return( MAXNUML );
+#endif
+	if( x > -1.0L && x < 0.0L )
+		return( 0.0L );
+	}
+if( y <= -MAXNUML )
+	{
+	_SET_ERRNO (ERANGE);
+	if( x > 1.0L )
+		return( 0.0L );
+#ifdef INFINITIES
+	if( x > 0.0L && x < 1.0L )
+		return( INFINITYL );
+#else
+	if( x > 0.0L && x < 1.0L )
+		return( MAXNUML );
+#endif
+	if( x < -1.0L )
+		return( 0.0L );
+#ifdef INFINITIES
+	if( x > -1.0L && x < 0.0L )
+		return( INFINITYL );
+#else
+	if( x > -1.0L && x < 0.0L )
+		return( MAXNUML );
+#endif
+	}
+if( x >= MAXNUML )
+	{
+#if INFINITIES
+	if( y > 0.0L )
+		return( INFINITYL );
+#else
+	if( y > 0.0L )
+		return( MAXNUML );
+#endif
+	return( 0.0L );
+	}
+
+w = floorl(y);
+/* Set iyflg to 1 if y is an integer.  */
+iyflg = 0;
+if( w == y )
+	iyflg = 1;
+
+/* Test for odd integer y.  */
+yoddint = 0;
+if( iyflg )
+	{
+	ya = fabsl(y);
+	ya = floorl(0.5L * ya);
+	yb = 0.5L * fabsl(w);
+	if( ya != yb )
+		yoddint = 1;
+	}
+
+if( x <= -MAXNUML )
+	{
+	if( y > 0.0L )
+		{
+#ifdef INFINITIES
+		if( yoddint )
+			return( -INFINITYL );
+		return( INFINITYL );
+#else
+		if( yoddint )
+			return( -MAXNUML );
+		return( MAXNUML );
+#endif
+		}
+	if( y < 0.0L )
+		{
+#ifdef MINUSZERO
+		if( yoddint )
+			return( NEGZEROL );
+#endif
+		return( 0.0 );
+		}
+ 	}
+
+
+nflg = 0;	/* flag = 1 if x<0 raised to integer power */
+if( x <= 0.0L )
+	{
+	if( x == 0.0L )
+		{
+		if( y < 0.0 )
+			{
+#ifdef MINUSZERO
+			if( signbitl(x) && yoddint )
+				return( -INFINITYL );
+#endif
+#ifdef INFINITIES
+			return( INFINITYL );
+#else
+			return( MAXNUML );
+#endif
+			}
+		if( y > 0.0 )
+			{
+#ifdef MINUSZERO
+			if( signbitl(x) && yoddint )
+				return( NEGZEROL );
+#endif
+			return( 0.0 );
+			}
+		if( y == 0.0L )
+			return( 1.0L );  /*   0**0   */
+		else  
+			return( 0.0L );  /*   0**y   */
+		}
+	else
+		{
+		if( iyflg == 0 )
+			{ /* noninteger power of negative number */
+			mtherr( fname, DOMAIN );
+			_SET_ERRNO (EDOM);
+#ifdef NANS
+			return(NANL);
+#else
+			return(0.0L);
+#endif
+			}
+		nflg = 1;
+		}
+	}
+
+/* Integer power of an integer.  */
+
+if( iyflg )
+	{
+	i = w;
+	w = floorl(x);
+	if( (w == x) && (fabsl(y) < 32768.0) )
+		{
+		w = __powil( x, (int) y );
+		return( w );
+		}
+	}
+
+
+if( nflg )
+	x = fabsl(x);
+
+/* separate significand from exponent */
+x = frexpl( x, &i );
+e = i;
+
+/* find significand in antilog table A[] */
+i = 1;
+if( x <= douba(17) )
+	i = 17;
+if( x <= douba(i+8) )
+	i += 8;
+if( x <= douba(i+4) )
+	i += 4;
+if( x <= douba(i+2) )
+	i += 2;
+if( x >= douba(1) )
+	i = -1;
+i += 1;
+
+
+/* Find (x - A[i])/A[i]
+ * in order to compute log(x/A[i]):
+ *
+ * log(x) = log( a x/a ) = log(a) + log(x/a)
+ *
+ * log(x/a) = log(1+v),  v = x/a - 1 = (x-a)/a
+ */
+x -= douba(i);
+x -= doubb(i/2);
+x /= douba(i);
+
+
+/* rational approximation for log(1+v):
+ *
+ * log(1+v)  =  v  -  v**2/2  +  v**3 P(v) / Q(v)
+ */
+z = x*x;
+w = x * ( z * polevll( x, P, 3 ) / p1evll( x, Q, 3 ) );
+w = w - ldexpl( z, -1 );   /*  w - 0.5 * z  */
+
+/* Convert to base 2 logarithm:
+ * multiply by log2(e) = 1 + LOG2EA
+ */
+z = LOG2EA * w;
+z += w;
+z += LOG2EA * x;
+z += x;
+
+/* Compute exponent term of the base 2 logarithm. */
+w = -i;
+w = ldexpl( w, -LNXT );	/* divide by NXT */
+w += e;
+/* Now base 2 log of x is w + z. */
+
+/* Multiply base 2 log by y, in extended precision. */
+
+/* separate y into large part ya
+ * and small part yb less than 1/NXT
+ */
+ya = reducl(y);
+yb = y - ya;
+
+/* (w+z)(ya+yb)
+ * = w*ya + w*yb + z*y
+ */
+F = z * y  +  w * yb;
+Fa = reducl(F);
+Fb = F - Fa;
+
+G = Fa + w * ya;
+Ga = reducl(G);
+Gb = G - Ga;
+
+H = Fb + Gb;
+Ha = reducl(H);
+w = ldexpl( Ga + Ha, LNXT );
+
+/* Test the power of 2 for overflow */
+if( w > MEXP )
+	{
+	_SET_ERRNO (ERANGE);
+	mtherr( fname, OVERFLOW );
+	return( MAXNUML );
+	}
+
+if( w < MNEXP )
+	{
+	_SET_ERRNO (ERANGE);
+	mtherr( fname, UNDERFLOW );
+	return( 0.0L );
+	}
+
+e = w;
+Hb = H - Ha;
+
+if( Hb > 0.0L )
+	{
+	e += 1;
+	Hb -= (1.0L/NXT);  /*0.0625L;*/
+	}
+
+/* Now the product y * log2(x)  =  Hb + e/NXT.
+ *
+ * Compute base 2 exponential of Hb,
+ * where -0.0625 <= Hb <= 0.
+ */
+z = Hb * polevll( Hb, R, 6 );  /*    z  =  2**Hb - 1    */
+
+/* Express e/NXT as an integer plus a negative number of (1/NXT)ths.
+ * Find lookup table entry for the fractional power of 2.
+ */
+if( e < 0 )
+	i = 0;
+else
+	i = 1;
+i = e/NXT + i;
+e = NXT*i - e;
+w = douba( e );
+z = w * z;      /*    2**-e * ( 1 + (2**Hb-1) )    */
+z = z + w;
+z = ldexpl( z, i );  /* multiply by integer power of 2 */
+
+if( nflg )
+	{
+/* For negative x,
+ * find out if the integer exponent
+ * is odd or even.
+ */
+	w = ldexpl( y, -1 );
+	w = floorl(w);
+	w = ldexpl( w, 1 );
+	if( w != y )
+		z = -z; /* odd exponent */
+	}
+
+return( z );
+}
+
+static __inline__ long double 
+__convert_inf_to_maxnum(long double x)
+{
+  if (isinf(x))
+    return (x > 0.0L ? MAXNUML : -MAXNUML);
+  else
+    return x;
+}
+
+
+/* Find a multiple of 1/NXT that is within 1/NXT of x. */
+static __inline__ long double reducl(x)
+long double x;
+{
+long double t;
+
+/* If the call to ldexpl overflows, set it to MAXNUML.
+   This avoids Inf - Inf = Nan result when calculating the 'small'
+   part of a reduction.  Instead, the small part becomes Inf,
+   causing under/overflow when adding it to the 'large' part.
+   There must be a cleaner way of doing this. */
+t =  __convert_inf_to_maxnum (ldexpl( x, LNXT ));
+t = floorl( t );
+t = ldexpl( t, -LNXT );
+return(t);
+}
diff --git a/mingw-w64-crt/math/rint.c b/mingw-w64-crt/math/rint.c
index 9e68528..9b88010 100644
--- a/mingw-w64-crt/math/rint.c
+++ b/mingw-w64-crt/math/rint.c
@@ -1,11 +1,11 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-double rint (double x){

-  double retval;

-  __asm__ ("frndint;" : "=t" (retval) : "0" (x));

-  return retval;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+double rint (double x){
+  double retval;
+  __asm__ ("frndint;" : "=t" (retval) : "0" (x));
+  return retval;
+}
diff --git a/mingw-w64-crt/math/rintf.c b/mingw-w64-crt/math/rintf.c
index de3ec8f..ad28287 100644
--- a/mingw-w64-crt/math/rintf.c
+++ b/mingw-w64-crt/math/rintf.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float rintf (float x){

-  float retval;

-  __asm__ ("frndint;": "=t" (retval) : "0" (x));

-  return retval;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float rintf (float x){
+  float retval;
+  __asm__ ("frndint;": "=t" (retval) : "0" (x));
+  return retval;
+}
diff --git a/mingw-w64-crt/math/rintl.c b/mingw-w64-crt/math/rintl.c
index f36b22f..becdb0a 100644
--- a/mingw-w64-crt/math/rintl.c
+++ b/mingw-w64-crt/math/rintl.c
@@ -1,12 +1,12 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long double rintl (long double x){

-  long double retval;

-  __asm__ ("frndint;": "=t" (retval) : "0" (x));

-  return retval;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long double rintl (long double x){
+  long double retval;
+  __asm__ ("frndint;": "=t" (retval) : "0" (x));
+  return retval;
+}
diff --git a/mingw-w64-crt/math/round.c b/mingw-w64-crt/math/round.c
index 485b5ec..14134b6 100644
--- a/mingw-w64-crt/math/round.c
+++ b/mingw-w64-crt/math/round.c
@@ -1,26 +1,26 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-double

-round (double x)

-{

-  double res;

-  if (x >= 0.0)

-    {

-      res = ceil (x);

-      if (res - x > 0.5)

-	res -= 1.0;

-    }

-  else

-    {

-      res = ceil (-x);

-      if (res + x > 0.5)

-	res -= 1.0;

-      res = -res;

-    }

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+double
+round (double x)
+{
+  double res;
+  if (x >= 0.0)
+    {
+      res = ceil (x);
+      if (res - x > 0.5)
+	res -= 1.0;
+    }
+  else
+    {
+      res = ceil (-x);
+      if (res + x > 0.5)
+	res -= 1.0;
+      res = -res;
+    }
+  return res;
+}
diff --git a/mingw-w64-crt/math/roundf.c b/mingw-w64-crt/math/roundf.c
index d4ecf53..0eea493 100644
--- a/mingw-w64-crt/math/roundf.c
+++ b/mingw-w64-crt/math/roundf.c
@@ -1,26 +1,26 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float

-roundf (float x)

-{

-  float res;

-  if (x >= 0.0F)

-    {

-      res = ceilf (x);

-      if (res - x > 0.5F)

-	res -= 1.0F;

-    }

-  else

-    {

-      res = ceilf (-x);

-      if (res + x > 0.5F)

-	res -= 1.0F;

-      res = -res;

-    }

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float
+roundf (float x)
+{
+  float res;
+  if (x >= 0.0F)
+    {
+      res = ceilf (x);
+      if (res - x > 0.5F)
+	res -= 1.0F;
+    }
+  else
+    {
+      res = ceilf (-x);
+      if (res + x > 0.5F)
+	res -= 1.0F;
+      res = -res;
+    }
+  return res;
+}
diff --git a/mingw-w64-crt/math/roundl.c b/mingw-w64-crt/math/roundl.c
index 66286a0..787b374 100644
--- a/mingw-w64-crt/math/roundl.c
+++ b/mingw-w64-crt/math/roundl.c
@@ -1,26 +1,26 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-long double

-roundl (long double x)

-{

-  long double res;

-  if (x >= 0.0L)

-    {

-      res = ceill (x);

-      if (res - x > 0.5L)

-	res -= 1.0L;

-    }

-  else

-    {

-      res = ceill (-x);

-      if (res + x > 0.5L)

-	res -= 1.0L;

-      res = -res;;

-    }

-  return res;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+long double
+roundl (long double x)
+{
+  long double res;
+  if (x >= 0.0L)
+    {
+      res = ceill (x);
+      if (res - x > 0.5L)
+	res -= 1.0L;
+    }
+  else
+    {
+      res = ceill (-x);
+      if (res + x > 0.5L)
+	res -= 1.0L;
+      res = -res;;
+    }
+  return res;
+}
diff --git a/mingw-w64-crt/math/s_erf.c b/mingw-w64-crt/math/s_erf.c
index 90cb0c5..e19da83 100644
--- a/mingw-w64-crt/math/s_erf.c
+++ b/mingw-w64-crt/math/s_erf.c
@@ -1,349 +1,349 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/* @(#)s_erf.c 1.3 95/01/18 */

-/*

- * ====================================================

- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.

- *

- * Developed at SunSoft, a Sun Microsystems, Inc. business.

- * Permission to use, copy, modify, and distribute this

- * software is freely granted, provided that this notice 

- * is preserved.

- * ====================================================

- */

-

-/* double erf(double x)

- * double erfc(double x)

- *			     x

- *		      2      |\

- *     erf(x)  =  ---------  | exp(-t*t)dt

- *	 	   sqrt(pi) \| 

- *			     0

- *

- *     erfc(x) =  1-erf(x)

- *  Note that 

- *		erf(-x) = -erf(x)

- *		erfc(-x) = 2 - erfc(x)

- *

- * Method:

- *	1. For |x| in [0, 0.84375]

- *	    erf(x)  = x + x*R(x^2)

- *          erfc(x) = 1 - erf(x)           if x in [-.84375,0.25]

- *                  = 0.5 + ((0.5-x)-x*R)  if x in [0.25,0.84375]

- *	   where R = P/Q where P is an odd poly of degree 8 and

- *	   Q is an odd poly of degree 10.

- *						 -57.90

- *			| R - (erf(x)-x)/x | <= 2

- *	

- *

- *	   Remark. The formula is derived by noting

- *          erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....)

- *	   and that

- *          2/sqrt(pi) = 1.128379167095512573896158903121545171688

- *	   is close to one. The interval is chosen because the fix

- *	   point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is

- *	   near 0.6174), and by some experiment, 0.84375 is chosen to

- * 	   guarantee the error is less than one ulp for erf.

- *

- *      2. For |x| in [0.84375,1.25], let s = |x| - 1, and

- *         c = 0.84506291151 rounded to single (24 bits)

- *         	erf(x)  = sign(x) * (c  + P1(s)/Q1(s))

- *         	erfc(x) = (1-c)  - P1(s)/Q1(s) if x > 0

- *			  1+(c+P1(s)/Q1(s))    if x < 0

- *         	|P1/Q1 - (erf(|x|)-c)| <= 2**-59.06

- *	   Remark: here we use the taylor series expansion at x=1.

- *		erf(1+s) = erf(1) + s*Poly(s)

- *			 = 0.845.. + P1(s)/Q1(s)

- *	   That is, we use rational approximation to approximate

- *			erf(1+s) - (c = (single)0.84506291151)

- *	   Note that |P1/Q1|< 0.078 for x in [0.84375,1.25]

- *	   where 

- *		P1(s) = degree 6 poly in s

- *		Q1(s) = degree 6 poly in s

- *

- *      3. For x in [1.25,1/0.35(~2.857143)], 

- *         	erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1)

- *         	erf(x)  = 1 - erfc(x)

- *	   where 

- *		R1(z) = degree 7 poly in z, (z=1/x^2)

- *		S1(z) = degree 8 poly in z

- *

- *      4. For x in [1/0.35,28]

- *         	erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0

- *			= 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6<x<0

- *			= 2.0 - tiny		(if x <= -6)

- *         	erf(x)  = sign(x)*(1.0 - erfc(x)) if x < 6, else

- *         	erf(x)  = sign(x)*(1.0 - tiny)

- *	   where

- *		R2(z) = degree 6 poly in z, (z=1/x^2)

- *		S2(z) = degree 7 poly in z

- *

- *      Note1:

- *	   To compute exp(-x*x-0.5625+R/S), let s be a single

- *	   precision number and s := x; then

- *		-x*x = -s*s + (s-x)*(s+x)

- *	        exp(-x*x-0.5626+R/S) = 

- *			exp(-s*s-0.5625)*exp((s-x)*(s+x)+R/S);

- *      Note2:

- *	   Here 4 and 5 make use of the asymptotic series

- *			  exp(-x*x)

- *		erfc(x) ~ ---------- * ( 1 + Poly(1/x^2) )

- *			  x*sqrt(pi)

- *	   We use rational approximation to approximate

- *      	g(s)=f(1/x^2) = log(erfc(x)*x) - x*x + 0.5625

- *	   Here is the error bound for R1/S1 and R2/S2

- *      	|R1/S1 - f(x)|  < 2**(-62.57)

- *      	|R2/S2 - f(x)|  < 2**(-61.52)

- *

- *      5. For inf > x >= 28

- *         	erf(x)  = sign(x) *(1 - tiny)  (raise inexact)

- *         	erfc(x) = tiny*tiny (raise underflow) if x > 0

- *			= 2 - tiny if x<0

- *

- *      7. Special case:

- *         	erf(0)  = 0, erf(inf)  = 1, erf(-inf) = -1,

- *         	erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2, 

- *	   	erfc/erf(NaN) is NaN

- */

-

-

-/* #include "fdlibm.h" */

-

-#include <math.h>

-#include <stdint.h>

-#include <errno.h>

-

-#define __ieee754_exp exp

-

-typedef union 

-{

-  double value;

-  struct 

-  {

-    uint32_t lsw;

-    uint32_t msw;

-  } parts;

-} ieee_double_shape_type;

-

-

-static inline int __get_hi_word(const double x)

-{

-  ieee_double_shape_type u;

-  u.value = x;

-  return u.parts.msw;

-}

-

-static inline void __trunc_lo_word(double *x)

-{

-  ieee_double_shape_type u;

-  u.value = *x;

-  u.parts.lsw = 0;

-  *x = u.value;

-}

-

-

-#ifdef __STDC__

-static const double

-#else

-static double

-#endif

-tiny	    = 1e-300,

-half=  5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */

-one =  1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */

-two =  2.00000000000000000000e+00, /* 0x40000000, 0x00000000 */

-	/* c = (float)0.84506291151 */

-erx =  8.45062911510467529297e-01, /* 0x3FEB0AC1, 0x60000000 */

-/*

- * Coefficients for approximation to  erf on [0,0.84375]

- */

-efx =  1.28379167095512586316e-01, /* 0x3FC06EBA, 0x8214DB69 */

-efx8=  1.02703333676410069053e+00, /* 0x3FF06EBA, 0x8214DB69 */

-pp0  =  1.28379167095512558561e-01, /* 0x3FC06EBA, 0x8214DB68 */

-pp1  = -3.25042107247001499370e-01, /* 0xBFD4CD7D, 0x691CB913 */

-pp2  = -2.84817495755985104766e-02, /* 0xBF9D2A51, 0xDBD7194F */

-pp3  = -5.77027029648944159157e-03, /* 0xBF77A291, 0x236668E4 */

-pp4  = -2.37630166566501626084e-05, /* 0xBEF8EAD6, 0x120016AC */

-qq1  =  3.97917223959155352819e-01, /* 0x3FD97779, 0xCDDADC09 */

-qq2  =  6.50222499887672944485e-02, /* 0x3FB0A54C, 0x5536CEBA */

-qq3  =  5.08130628187576562776e-03, /* 0x3F74D022, 0xC4D36B0F */

-qq4  =  1.32494738004321644526e-04, /* 0x3F215DC9, 0x221C1A10 */

-qq5  = -3.96022827877536812320e-06, /* 0xBED09C43, 0x42A26120 */

-/*

- * Coefficients for approximation to  erf  in [0.84375,1.25] 

- */

-pa0  = -2.36211856075265944077e-03, /* 0xBF6359B8, 0xBEF77538 */

-pa1  =  4.14856118683748331666e-01, /* 0x3FDA8D00, 0xAD92B34D */

-pa2  = -3.72207876035701323847e-01, /* 0xBFD7D240, 0xFBB8C3F1 */

-pa3  =  3.18346619901161753674e-01, /* 0x3FD45FCA, 0x805120E4 */

-pa4  = -1.10894694282396677476e-01, /* 0xBFBC6398, 0x3D3E28EC */

-pa5  =  3.54783043256182359371e-02, /* 0x3FA22A36, 0x599795EB */

-pa6  = -2.16637559486879084300e-03, /* 0xBF61BF38, 0x0A96073F */

-qa1  =  1.06420880400844228286e-01, /* 0x3FBB3E66, 0x18EEE323 */

-qa2  =  5.40397917702171048937e-01, /* 0x3FE14AF0, 0x92EB6F33 */

-qa3  =  7.18286544141962662868e-02, /* 0x3FB2635C, 0xD99FE9A7 */

-qa4  =  1.26171219808761642112e-01, /* 0x3FC02660, 0xE763351F */

-qa5  =  1.36370839120290507362e-02, /* 0x3F8BEDC2, 0x6B51DD1C */

-qa6  =  1.19844998467991074170e-02, /* 0x3F888B54, 0x5735151D */

-/*

- * Coefficients for approximation to  erfc in [1.25,1/0.35]

- */

-ra0  = -9.86494403484714822705e-03, /* 0xBF843412, 0x600D6435 */

-ra1  = -6.93858572707181764372e-01, /* 0xBFE63416, 0xE4BA7360 */

-ra2  = -1.05586262253232909814e+01, /* 0xC0251E04, 0x41B0E726 */

-ra3  = -6.23753324503260060396e+01, /* 0xC04F300A, 0xE4CBA38D */

-ra4  = -1.62396669462573470355e+02, /* 0xC0644CB1, 0x84282266 */

-ra5  = -1.84605092906711035994e+02, /* 0xC067135C, 0xEBCCABB2 */

-ra6  = -8.12874355063065934246e+01, /* 0xC0545265, 0x57E4D2F2 */

-ra7  = -9.81432934416914548592e+00, /* 0xC023A0EF, 0xC69AC25C */

-sa1  =  1.96512716674392571292e+01, /* 0x4033A6B9, 0xBD707687 */

-sa2  =  1.37657754143519042600e+02, /* 0x4061350C, 0x526AE721 */

-sa3  =  4.34565877475229228821e+02, /* 0x407B290D, 0xD58A1A71 */

-sa4  =  6.45387271733267880336e+02, /* 0x40842B19, 0x21EC2868 */

-sa5  =  4.29008140027567833386e+02, /* 0x407AD021, 0x57700314 */

-sa6  =  1.08635005541779435134e+02, /* 0x405B28A3, 0xEE48AE2C */

-sa7  =  6.57024977031928170135e+00, /* 0x401A47EF, 0x8E484A93 */

-sa8  = -6.04244152148580987438e-02, /* 0xBFAEEFF2, 0xEE749A62 */

-/*

- * Coefficients for approximation to  erfc in [1/.35,28]

- */

-rb0  = -9.86494292470009928597e-03, /* 0xBF843412, 0x39E86F4A */

-rb1  = -7.99283237680523006574e-01, /* 0xBFE993BA, 0x70C285DE */

-rb2  = -1.77579549177547519889e+01, /* 0xC031C209, 0x555F995A */

-rb3  = -1.60636384855821916062e+02, /* 0xC064145D, 0x43C5ED98 */

-rb4  = -6.37566443368389627722e+02, /* 0xC083EC88, 0x1375F228 */

-rb5  = -1.02509513161107724954e+03, /* 0xC0900461, 0x6A2E5992 */

-rb6  = -4.83519191608651397019e+02, /* 0xC07E384E, 0x9BDC383F */

-sb1  =  3.03380607434824582924e+01, /* 0x403E568B, 0x261D5190 */

-sb2  =  3.25792512996573918826e+02, /* 0x40745CAE, 0x221B9F0A */

-sb3  =  1.53672958608443695994e+03, /* 0x409802EB, 0x189D5118 */

-sb4  =  3.19985821950859553908e+03, /* 0x40A8FFB7, 0x688C246A */

-sb5  =  2.55305040643316442583e+03, /* 0x40A3F219, 0xCEDF3BE6 */

-sb6  =  4.74528541206955367215e+02, /* 0x407DA874, 0xE79FE763 */

-sb7  = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */

-

-#ifdef __STDC__

-	double erf(double x) 

-#else

-	double erf(x) 

-	double x;

-#endif

-{

-	int hx,ix,i;

-	double R,S,P,Q,s,y,z,r;

-	hx = __get_hi_word(x);

-	ix = hx&0x7fffffff;

-	if(ix>=0x7ff00000) {		/* erf(nan)=nan */

-	    i = ((unsigned)hx>>31)<<1;

-	    return (double)(1-i)+one/x;	/* erf(+-inf)=+-1 */

-	}

-

-	if(ix < 0x3feb0000) {		/* |x|<0.84375 */

-	    if(ix < 0x3e300000) { 	/* |x|<2**-28 */

-	        if (ix < 0x00800000) 

-		    return 0.125*(8.0*x+efx8*x);  /*avoid underflow */

-		return x + efx*x;

-	    }

-	    z = x*x;

-	    r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));

-	    s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));

-	    y = r/s;

-	    return x + x*y;

-	}

-	if(ix < 0x3ff40000) {		/* 0.84375 <= |x| < 1.25 */

-	    s = fabs(x)-one;

-	    P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));

-	    Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));

-	    if(hx>=0) return erx + P/Q; else return -erx - P/Q;

-	}

-	if (ix >= 0x40180000) {		/* inf>|x|>=6 */

-	    if(hx>=0) return one-tiny; else return tiny-one;

-	}

-	x = fabs(x);

- 	s = one/(x*x);

-	if(ix< 0x4006DB6E) {	/* |x| < 1/0.35 */

-	    R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(

-				ra5+s*(ra6+s*ra7))))));

-	    S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(

-				sa5+s*(sa6+s*(sa7+s*sa8)))))));

-	} else {	/* |x| >= 1/0.35 */

-	    R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(

-				rb5+s*rb6)))));

-	    S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(

-				sb5+s*(sb6+s*sb7))))));

-	}

-	z  = x;  

-	__trunc_lo_word(&z);

-	r  =  __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);

-	if(hx>=0) return one-r/x; else return  r/x-one;

-}

-

-#ifdef __STDC__

-	double erfc(double x) 

-#else

-	double erfc(x) 

-	double x;

-#endif

-{

-	int hx,ix;

-	double R,S,P,Q,s,y,z,r;

-	hx = __get_hi_word(x);

-	ix = hx&0x7fffffff;

-	if(ix>=0x7ff00000) {			/* erfc(nan)=nan */

-						/* erfc(+-inf)=0,2 */

-	    return (double)(((unsigned)hx>>31)<<1)+one/x;

-	}

-

-	if(ix < 0x3feb0000) {		/* |x|<0.84375 */

-	    if(ix < 0x3c700000)  	/* |x|<2**-56 */

-		return one-x;

-	    z = x*x;

-	    r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));

-	    s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));

-	    y = r/s;

-	    if(hx < 0x3fd00000) {  	/* x<1/4 */

-		return one-(x+x*y);

-	    } else {

-		r = x*y;

-		r += (x-half);

-	        return half - r ;

-	    }

-	}

-	if(ix < 0x3ff40000) {		/* 0.84375 <= |x| < 1.25 */

-	    s = fabs(x)-one;

-	    P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));

-	    Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));

-	    if(hx>=0) {

-	        z  = one-erx; return z - P/Q; 

-	    } else {

-		z = erx+P/Q; return one+z;

-	    }

-	}

-	if (ix < 0x403c0000) {		/* |x|<28 */

-	    x = fabs(x);

- 	    s = one/(x*x);

-	    if(ix< 0x4006DB6D) {	/* |x| < 1/.35 ~ 2.857143*/

-	        R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(

-				ra5+s*(ra6+s*ra7))))));

-	        S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(

-				sa5+s*(sa6+s*(sa7+s*sa8)))))));

-	    } else {			/* |x| >= 1/.35 ~ 2.857143 */

-		if(hx<0&&ix>=0x40180000) return two-tiny;/* x < -6 */

-	        R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(

-				rb5+s*rb6)))));

-	        S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(

-				sb5+s*(sb6+s*sb7))))));

-	    }

-	    z  = x;

-	    __trunc_lo_word(&z);

-	    r  =  __ieee754_exp(-z*z-0.5625)*

-			__ieee754_exp((z-x)*(z+x)+R/S);

-	    if(hx>0) return r/x; else return two-r/x;

-	} else {

-	    /* set range error */

-            errno = ERANGE;

-	    if(hx>0) return tiny*tiny; else return two-tiny;

-	}

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/* @(#)s_erf.c 1.3 95/01/18 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice 
+ * is preserved.
+ * ====================================================
+ */
+
+/* double erf(double x)
+ * double erfc(double x)
+ *			     x
+ *		      2      |\
+ *     erf(x)  =  ---------  | exp(-t*t)dt
+ *	 	   sqrt(pi) \| 
+ *			     0
+ *
+ *     erfc(x) =  1-erf(x)
+ *  Note that 
+ *		erf(-x) = -erf(x)
+ *		erfc(-x) = 2 - erfc(x)
+ *
+ * Method:
+ *	1. For |x| in [0, 0.84375]
+ *	    erf(x)  = x + x*R(x^2)
+ *          erfc(x) = 1 - erf(x)           if x in [-.84375,0.25]
+ *                  = 0.5 + ((0.5-x)-x*R)  if x in [0.25,0.84375]
+ *	   where R = P/Q where P is an odd poly of degree 8 and
+ *	   Q is an odd poly of degree 10.
+ *						 -57.90
+ *			| R - (erf(x)-x)/x | <= 2
+ *	
+ *
+ *	   Remark. The formula is derived by noting
+ *          erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....)
+ *	   and that
+ *          2/sqrt(pi) = 1.128379167095512573896158903121545171688
+ *	   is close to one. The interval is chosen because the fix
+ *	   point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is
+ *	   near 0.6174), and by some experiment, 0.84375 is chosen to
+ * 	   guarantee the error is less than one ulp for erf.
+ *
+ *      2. For |x| in [0.84375,1.25], let s = |x| - 1, and
+ *         c = 0.84506291151 rounded to single (24 bits)
+ *         	erf(x)  = sign(x) * (c  + P1(s)/Q1(s))
+ *         	erfc(x) = (1-c)  - P1(s)/Q1(s) if x > 0
+ *			  1+(c+P1(s)/Q1(s))    if x < 0
+ *         	|P1/Q1 - (erf(|x|)-c)| <= 2**-59.06
+ *	   Remark: here we use the taylor series expansion at x=1.
+ *		erf(1+s) = erf(1) + s*Poly(s)
+ *			 = 0.845.. + P1(s)/Q1(s)
+ *	   That is, we use rational approximation to approximate
+ *			erf(1+s) - (c = (single)0.84506291151)
+ *	   Note that |P1/Q1|< 0.078 for x in [0.84375,1.25]
+ *	   where 
+ *		P1(s) = degree 6 poly in s
+ *		Q1(s) = degree 6 poly in s
+ *
+ *      3. For x in [1.25,1/0.35(~2.857143)], 
+ *         	erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1)
+ *         	erf(x)  = 1 - erfc(x)
+ *	   where 
+ *		R1(z) = degree 7 poly in z, (z=1/x^2)
+ *		S1(z) = degree 8 poly in z
+ *
+ *      4. For x in [1/0.35,28]
+ *         	erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0
+ *			= 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6<x<0
+ *			= 2.0 - tiny		(if x <= -6)
+ *         	erf(x)  = sign(x)*(1.0 - erfc(x)) if x < 6, else
+ *         	erf(x)  = sign(x)*(1.0 - tiny)
+ *	   where
+ *		R2(z) = degree 6 poly in z, (z=1/x^2)
+ *		S2(z) = degree 7 poly in z
+ *
+ *      Note1:
+ *	   To compute exp(-x*x-0.5625+R/S), let s be a single
+ *	   precision number and s := x; then
+ *		-x*x = -s*s + (s-x)*(s+x)
+ *	        exp(-x*x-0.5626+R/S) = 
+ *			exp(-s*s-0.5625)*exp((s-x)*(s+x)+R/S);
+ *      Note2:
+ *	   Here 4 and 5 make use of the asymptotic series
+ *			  exp(-x*x)
+ *		erfc(x) ~ ---------- * ( 1 + Poly(1/x^2) )
+ *			  x*sqrt(pi)
+ *	   We use rational approximation to approximate
+ *      	g(s)=f(1/x^2) = log(erfc(x)*x) - x*x + 0.5625
+ *	   Here is the error bound for R1/S1 and R2/S2
+ *      	|R1/S1 - f(x)|  < 2**(-62.57)
+ *      	|R2/S2 - f(x)|  < 2**(-61.52)
+ *
+ *      5. For inf > x >= 28
+ *         	erf(x)  = sign(x) *(1 - tiny)  (raise inexact)
+ *         	erfc(x) = tiny*tiny (raise underflow) if x > 0
+ *			= 2 - tiny if x<0
+ *
+ *      7. Special case:
+ *         	erf(0)  = 0, erf(inf)  = 1, erf(-inf) = -1,
+ *         	erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2, 
+ *	   	erfc/erf(NaN) is NaN
+ */
+
+
+/* #include "fdlibm.h" */
+
+#include <math.h>
+#include <stdint.h>
+#include <errno.h>
+
+#define __ieee754_exp exp
+
+typedef union 
+{
+  double value;
+  struct 
+  {
+    uint32_t lsw;
+    uint32_t msw;
+  } parts;
+} ieee_double_shape_type;
+
+
+static inline int __get_hi_word(const double x)
+{
+  ieee_double_shape_type u;
+  u.value = x;
+  return u.parts.msw;
+}
+
+static inline void __trunc_lo_word(double *x)
+{
+  ieee_double_shape_type u;
+  u.value = *x;
+  u.parts.lsw = 0;
+  *x = u.value;
+}
+
+
+#ifdef __STDC__
+static const double
+#else
+static double
+#endif
+tiny	    = 1e-300,
+half=  5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
+one =  1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
+two =  2.00000000000000000000e+00, /* 0x40000000, 0x00000000 */
+	/* c = (float)0.84506291151 */
+erx =  8.45062911510467529297e-01, /* 0x3FEB0AC1, 0x60000000 */
+/*
+ * Coefficients for approximation to  erf on [0,0.84375]
+ */
+efx =  1.28379167095512586316e-01, /* 0x3FC06EBA, 0x8214DB69 */
+efx8=  1.02703333676410069053e+00, /* 0x3FF06EBA, 0x8214DB69 */
+pp0  =  1.28379167095512558561e-01, /* 0x3FC06EBA, 0x8214DB68 */
+pp1  = -3.25042107247001499370e-01, /* 0xBFD4CD7D, 0x691CB913 */
+pp2  = -2.84817495755985104766e-02, /* 0xBF9D2A51, 0xDBD7194F */
+pp3  = -5.77027029648944159157e-03, /* 0xBF77A291, 0x236668E4 */
+pp4  = -2.37630166566501626084e-05, /* 0xBEF8EAD6, 0x120016AC */
+qq1  =  3.97917223959155352819e-01, /* 0x3FD97779, 0xCDDADC09 */
+qq2  =  6.50222499887672944485e-02, /* 0x3FB0A54C, 0x5536CEBA */
+qq3  =  5.08130628187576562776e-03, /* 0x3F74D022, 0xC4D36B0F */
+qq4  =  1.32494738004321644526e-04, /* 0x3F215DC9, 0x221C1A10 */
+qq5  = -3.96022827877536812320e-06, /* 0xBED09C43, 0x42A26120 */
+/*
+ * Coefficients for approximation to  erf  in [0.84375,1.25] 
+ */
+pa0  = -2.36211856075265944077e-03, /* 0xBF6359B8, 0xBEF77538 */
+pa1  =  4.14856118683748331666e-01, /* 0x3FDA8D00, 0xAD92B34D */
+pa2  = -3.72207876035701323847e-01, /* 0xBFD7D240, 0xFBB8C3F1 */
+pa3  =  3.18346619901161753674e-01, /* 0x3FD45FCA, 0x805120E4 */
+pa4  = -1.10894694282396677476e-01, /* 0xBFBC6398, 0x3D3E28EC */
+pa5  =  3.54783043256182359371e-02, /* 0x3FA22A36, 0x599795EB */
+pa6  = -2.16637559486879084300e-03, /* 0xBF61BF38, 0x0A96073F */
+qa1  =  1.06420880400844228286e-01, /* 0x3FBB3E66, 0x18EEE323 */
+qa2  =  5.40397917702171048937e-01, /* 0x3FE14AF0, 0x92EB6F33 */
+qa3  =  7.18286544141962662868e-02, /* 0x3FB2635C, 0xD99FE9A7 */
+qa4  =  1.26171219808761642112e-01, /* 0x3FC02660, 0xE763351F */
+qa5  =  1.36370839120290507362e-02, /* 0x3F8BEDC2, 0x6B51DD1C */
+qa6  =  1.19844998467991074170e-02, /* 0x3F888B54, 0x5735151D */
+/*
+ * Coefficients for approximation to  erfc in [1.25,1/0.35]
+ */
+ra0  = -9.86494403484714822705e-03, /* 0xBF843412, 0x600D6435 */
+ra1  = -6.93858572707181764372e-01, /* 0xBFE63416, 0xE4BA7360 */
+ra2  = -1.05586262253232909814e+01, /* 0xC0251E04, 0x41B0E726 */
+ra3  = -6.23753324503260060396e+01, /* 0xC04F300A, 0xE4CBA38D */
+ra4  = -1.62396669462573470355e+02, /* 0xC0644CB1, 0x84282266 */
+ra5  = -1.84605092906711035994e+02, /* 0xC067135C, 0xEBCCABB2 */
+ra6  = -8.12874355063065934246e+01, /* 0xC0545265, 0x57E4D2F2 */
+ra7  = -9.81432934416914548592e+00, /* 0xC023A0EF, 0xC69AC25C */
+sa1  =  1.96512716674392571292e+01, /* 0x4033A6B9, 0xBD707687 */
+sa2  =  1.37657754143519042600e+02, /* 0x4061350C, 0x526AE721 */
+sa3  =  4.34565877475229228821e+02, /* 0x407B290D, 0xD58A1A71 */
+sa4  =  6.45387271733267880336e+02, /* 0x40842B19, 0x21EC2868 */
+sa5  =  4.29008140027567833386e+02, /* 0x407AD021, 0x57700314 */
+sa6  =  1.08635005541779435134e+02, /* 0x405B28A3, 0xEE48AE2C */
+sa7  =  6.57024977031928170135e+00, /* 0x401A47EF, 0x8E484A93 */
+sa8  = -6.04244152148580987438e-02, /* 0xBFAEEFF2, 0xEE749A62 */
+/*
+ * Coefficients for approximation to  erfc in [1/.35,28]
+ */
+rb0  = -9.86494292470009928597e-03, /* 0xBF843412, 0x39E86F4A */
+rb1  = -7.99283237680523006574e-01, /* 0xBFE993BA, 0x70C285DE */
+rb2  = -1.77579549177547519889e+01, /* 0xC031C209, 0x555F995A */
+rb3  = -1.60636384855821916062e+02, /* 0xC064145D, 0x43C5ED98 */
+rb4  = -6.37566443368389627722e+02, /* 0xC083EC88, 0x1375F228 */
+rb5  = -1.02509513161107724954e+03, /* 0xC0900461, 0x6A2E5992 */
+rb6  = -4.83519191608651397019e+02, /* 0xC07E384E, 0x9BDC383F */
+sb1  =  3.03380607434824582924e+01, /* 0x403E568B, 0x261D5190 */
+sb2  =  3.25792512996573918826e+02, /* 0x40745CAE, 0x221B9F0A */
+sb3  =  1.53672958608443695994e+03, /* 0x409802EB, 0x189D5118 */
+sb4  =  3.19985821950859553908e+03, /* 0x40A8FFB7, 0x688C246A */
+sb5  =  2.55305040643316442583e+03, /* 0x40A3F219, 0xCEDF3BE6 */
+sb6  =  4.74528541206955367215e+02, /* 0x407DA874, 0xE79FE763 */
+sb7  = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */
+
+#ifdef __STDC__
+	double erf(double x) 
+#else
+	double erf(x) 
+	double x;
+#endif
+{
+	int hx,ix,i;
+	double R,S,P,Q,s,y,z,r;
+	hx = __get_hi_word(x);
+	ix = hx&0x7fffffff;
+	if(ix>=0x7ff00000) {		/* erf(nan)=nan */
+	    i = ((unsigned)hx>>31)<<1;
+	    return (double)(1-i)+one/x;	/* erf(+-inf)=+-1 */
+	}
+
+	if(ix < 0x3feb0000) {		/* |x|<0.84375 */
+	    if(ix < 0x3e300000) { 	/* |x|<2**-28 */
+	        if (ix < 0x00800000) 
+		    return 0.125*(8.0*x+efx8*x);  /*avoid underflow */
+		return x + efx*x;
+	    }
+	    z = x*x;
+	    r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
+	    s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
+	    y = r/s;
+	    return x + x*y;
+	}
+	if(ix < 0x3ff40000) {		/* 0.84375 <= |x| < 1.25 */
+	    s = fabs(x)-one;
+	    P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
+	    Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
+	    if(hx>=0) return erx + P/Q; else return -erx - P/Q;
+	}
+	if (ix >= 0x40180000) {		/* inf>|x|>=6 */
+	    if(hx>=0) return one-tiny; else return tiny-one;
+	}
+	x = fabs(x);
+ 	s = one/(x*x);
+	if(ix< 0x4006DB6E) {	/* |x| < 1/0.35 */
+	    R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
+				ra5+s*(ra6+s*ra7))))));
+	    S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
+				sa5+s*(sa6+s*(sa7+s*sa8)))))));
+	} else {	/* |x| >= 1/0.35 */
+	    R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
+				rb5+s*rb6)))));
+	    S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
+				sb5+s*(sb6+s*sb7))))));
+	}
+	z  = x;  
+	__trunc_lo_word(&z);
+	r  =  __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
+	if(hx>=0) return one-r/x; else return  r/x-one;
+}
+
+#ifdef __STDC__
+	double erfc(double x) 
+#else
+	double erfc(x) 
+	double x;
+#endif
+{
+	int hx,ix;
+	double R,S,P,Q,s,y,z,r;
+	hx = __get_hi_word(x);
+	ix = hx&0x7fffffff;
+	if(ix>=0x7ff00000) {			/* erfc(nan)=nan */
+						/* erfc(+-inf)=0,2 */
+	    return (double)(((unsigned)hx>>31)<<1)+one/x;
+	}
+
+	if(ix < 0x3feb0000) {		/* |x|<0.84375 */
+	    if(ix < 0x3c700000)  	/* |x|<2**-56 */
+		return one-x;
+	    z = x*x;
+	    r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
+	    s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
+	    y = r/s;
+	    if(hx < 0x3fd00000) {  	/* x<1/4 */
+		return one-(x+x*y);
+	    } else {
+		r = x*y;
+		r += (x-half);
+	        return half - r ;
+	    }
+	}
+	if(ix < 0x3ff40000) {		/* 0.84375 <= |x| < 1.25 */
+	    s = fabs(x)-one;
+	    P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
+	    Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
+	    if(hx>=0) {
+	        z  = one-erx; return z - P/Q; 
+	    } else {
+		z = erx+P/Q; return one+z;
+	    }
+	}
+	if (ix < 0x403c0000) {		/* |x|<28 */
+	    x = fabs(x);
+ 	    s = one/(x*x);
+	    if(ix< 0x4006DB6D) {	/* |x| < 1/.35 ~ 2.857143*/
+	        R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
+				ra5+s*(ra6+s*ra7))))));
+	        S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
+				sa5+s*(sa6+s*(sa7+s*sa8)))))));
+	    } else {			/* |x| >= 1/.35 ~ 2.857143 */
+		if(hx<0&&ix>=0x40180000) return two-tiny;/* x < -6 */
+	        R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
+				rb5+s*rb6)))));
+	        S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
+				sb5+s*(sb6+s*sb7))))));
+	    }
+	    z  = x;
+	    __trunc_lo_word(&z);
+	    r  =  __ieee754_exp(-z*z-0.5625)*
+			__ieee754_exp((z-x)*(z+x)+R/S);
+	    if(hx>0) return r/x; else return two-r/x;
+	} else {
+	    /* set range error */
+            errno = ERANGE;
+	    if(hx>0) return tiny*tiny; else return two-tiny;
+	}
+}
diff --git a/mingw-w64-crt/math/sf_erf.c b/mingw-w64-crt/math/sf_erf.c
index 9102f5a..5b3ff40 100644
--- a/mingw-w64-crt/math/sf_erf.c
+++ b/mingw-w64-crt/math/sf_erf.c
@@ -1,273 +1,273 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-/* sf_erf.c -- float version of s_erf.c.

- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.

- */

-

-/*

- * ====================================================

- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.

- *

- * Developed at SunPro, a Sun Microsystems, Inc. business.

- * Permission to use, copy, modify, and distribute this

- * software is freely granted, provided that this notice 

- * is preserved.

- * ====================================================

- */

-

-/*

-#include "fdlibm.h"

-*/

-#include <math.h>

-#include <stdint.h>

-#include <errno.h>

-

-#define __ieee754_expf expf

-

-

-

-typedef union

-{

-  float value;

-  uint32_t word;

-} ieee_float_shape_type;

-

-/* Get a 32 bit int from a float.  */

-

-static inline int

-__get_float_word(float d)

-{

-  ieee_float_shape_type u;

-  u.value = d;

-  return u.word;

-}

-

-/* Set a float from a 32 bit int.  */

-

-#define SET_FLOAT_WORD(d,i)					\

-do {								\

-  ieee_float_shape_type sf_u;					\

-  sf_u.word = (i);						\

-  (d) = sf_u.value;						\

-} while (0)

-

-static inline void __trunc_float_word(float * x)

-{

-  ieee_float_shape_type u;

-  u.value = * x;	  

-  u.word &= 0xfffff000;

-}

-

-#ifdef __v810__

-#define const

-#endif

-

-#ifdef __STDC__

-static const float

-#else

-static float

-#endif

-tiny	    = 1e-30,

-half=  5.0000000000e-01, /* 0x3F000000 */

-one =  1.0000000000e+00, /* 0x3F800000 */

-two =  2.0000000000e+00, /* 0x40000000 */

-	/* c = (subfloat)0.84506291151 */

-erx =  8.4506291151e-01, /* 0x3f58560b */

-/*

- * Coefficients for approximation to  erf on [0,0.84375]

- */

-efx =  1.2837916613e-01, /* 0x3e0375d4 */

-efx8=  1.0270333290e+00, /* 0x3f8375d4 */

-pp0  =  1.2837916613e-01, /* 0x3e0375d4 */

-pp1  = -3.2504209876e-01, /* 0xbea66beb */

-pp2  = -2.8481749818e-02, /* 0xbce9528f */

-pp3  = -5.7702702470e-03, /* 0xbbbd1489 */

-pp4  = -2.3763017452e-05, /* 0xb7c756b1 */

-qq1  =  3.9791721106e-01, /* 0x3ecbbbce */

-qq2  =  6.5022252500e-02, /* 0x3d852a63 */

-qq3  =  5.0813062117e-03, /* 0x3ba68116 */

-qq4  =  1.3249473704e-04, /* 0x390aee49 */

-qq5  = -3.9602282413e-06, /* 0xb684e21a */

-/*

- * Coefficients for approximation to  erf  in [0.84375,1.25] 

- */

-pa0  = -2.3621185683e-03, /* 0xbb1acdc6 */

-pa1  =  4.1485610604e-01, /* 0x3ed46805 */

-pa2  = -3.7220788002e-01, /* 0xbebe9208 */

-pa3  =  3.1834661961e-01, /* 0x3ea2fe54 */

-pa4  = -1.1089469492e-01, /* 0xbde31cc2 */

-pa5  =  3.5478305072e-02, /* 0x3d1151b3 */

-pa6  = -2.1663755178e-03, /* 0xbb0df9c0 */

-qa1  =  1.0642088205e-01, /* 0x3dd9f331 */

-qa2  =  5.4039794207e-01, /* 0x3f0a5785 */

-qa3  =  7.1828655899e-02, /* 0x3d931ae7 */

-qa4  =  1.2617121637e-01, /* 0x3e013307 */

-qa5  =  1.3637083583e-02, /* 0x3c5f6e13 */

-qa6  =  1.1984500103e-02, /* 0x3c445aa3 */

-/*

- * Coefficients for approximation to  erfc in [1.25,1/0.35]

- */

-ra0  = -9.8649440333e-03, /* 0xbc21a093 */

-ra1  = -6.9385856390e-01, /* 0xbf31a0b7 */

-ra2  = -1.0558626175e+01, /* 0xc128f022 */

-ra3  = -6.2375331879e+01, /* 0xc2798057 */

-ra4  = -1.6239666748e+02, /* 0xc322658c */

-ra5  = -1.8460508728e+02, /* 0xc3389ae7 */

-ra6  = -8.1287437439e+01, /* 0xc2a2932b */

-ra7  = -9.8143291473e+00, /* 0xc11d077e */

-sa1  =  1.9651271820e+01, /* 0x419d35ce */

-sa2  =  1.3765776062e+02, /* 0x4309a863 */

-sa3  =  4.3456588745e+02, /* 0x43d9486f */

-sa4  =  6.4538726807e+02, /* 0x442158c9 */

-sa5  =  4.2900814819e+02, /* 0x43d6810b */

-sa6  =  1.0863500214e+02, /* 0x42d9451f */

-sa7  =  6.5702495575e+00, /* 0x40d23f7c */

-sa8  = -6.0424413532e-02, /* 0xbd777f97 */

-/*

- * Coefficients for approximation to  erfc in [1/.35,28]

- */

-rb0  = -9.8649431020e-03, /* 0xbc21a092 */

-rb1  = -7.9928326607e-01, /* 0xbf4c9dd4 */

-rb2  = -1.7757955551e+01, /* 0xc18e104b */

-rb3  = -1.6063638306e+02, /* 0xc320a2ea */

-rb4  = -6.3756646729e+02, /* 0xc41f6441 */

-rb5  = -1.0250950928e+03, /* 0xc480230b */

-rb6  = -4.8351919556e+02, /* 0xc3f1c275 */

-sb1  =  3.0338060379e+01, /* 0x41f2b459 */

-sb2  =  3.2579251099e+02, /* 0x43a2e571 */

-sb3  =  1.5367296143e+03, /* 0x44c01759 */

-sb4  =  3.1998581543e+03, /* 0x4547fdbb */

-sb5  =  2.5530502930e+03, /* 0x451f90ce */

-sb6  =  4.7452853394e+02, /* 0x43ed43a7 */

-sb7  = -2.2440952301e+01; /* 0xc1b38712 */

-

-#ifdef __STDC__

-	float erff(float x) 

-#else

-	float erff(x) 

-	float x;

-#endif

-{

-	int32_t hx,ix,i;

-	float R,S,P,Q,s,y,z,r;

-	hx = __get_float_word(x);

-	ix = hx&0x7fffffff;

-	if(!(ix<0x7f800000L)) {		/* erf(nan)=nan */

-	    i = ((uint32_t)hx>>31)<<1;

-	    return (float)(1-i)+one/x;	/* erf(+-inf)=+-1 */

-	}

-

-	if(ix < 0x3f580000) {		/* |x|<0.84375 */

-	    if(ix < 0x31800000) { 	/* |x|<2**-28 */

-	        if (ix < 0x04000000) 

-		    /*avoid underflow */

-		    return (float)0.125*((float)8.0*x+efx8*x);

-		return x + efx*x;

-	    }

-	    z = x*x;

-	    r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));

-	    s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));

-	    y = r/s;

-	    return x + x*y;

-	}

-	if(ix < 0x3fa00000) {		/* 0.84375 <= |x| < 1.25 */

-	    s = fabsf(x)-one;

-	    P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));

-	    Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));

-	    if(hx>=0) return erx + P/Q; else return -erx - P/Q;

-	}

-	if (ix >= 0x40c00000) {		/* inf>|x|>=6 */

-	    if(hx>=0) return one-tiny; else return tiny-one;

-	}

-	x = fabsf(x);

- 	s = one/(x*x);

-	if(ix< 0x4036DB6E) {	/* |x| < 1/0.35 */

-	    R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(

-				ra5+s*(ra6+s*ra7))))));

-	    S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(

-				sa5+s*(sa6+s*(sa7+s*sa8)))))));

-	} else {	/* |x| >= 1/0.35 */

-	    R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(

-				rb5+s*rb6)))));

-	    S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(

-				sb5+s*(sb6+s*sb7))))));

-	}

-

-	z = x;

-	__trunc_float_word (&z);

-	r  =  __ieee754_expf(-z*z-(float)0.5625)*__ieee754_expf((z-x)*(z+x)+R/S);

-	if(hx>=0) return one-r/x; else return  r/x-one;

-}

-

-#ifdef __STDC__

-	float erfcf(float x) 

-#else

-	float erfcf(x) 

-	float x;

-#endif

-{

-	int32_t hx,ix;

-	float R,S,P,Q,s,y,z,r;

-	hx = __get_float_word(x);

-	ix = hx&0x7fffffff;

-	if(!(ix<0x7f800000L)) {			/* erfc(nan)=nan */

-						/* erfc(+-inf)=0,2 */

-	    return (float)(((uint32_t)hx>>31)<<1)+one/x;

-	}

-

-	if(ix < 0x3f580000) {		/* |x|<0.84375 */

-	    if(ix < 0x23800000)  	/* |x|<2**-56 */

-		return one-x;

-	    z = x*x;

-	    r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));

-	    s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));

-	    y = r/s;

-	    if(hx < 0x3e800000) {  	/* x<1/4 */

-		return one-(x+x*y);

-	    } else {

-		r = x*y;

-		r += (x-half);

-	        return half - r ;

-	    }

-	}

-	if(ix < 0x3fa00000) {		/* 0.84375 <= |x| < 1.25 */

-	    s = fabsf(x)-one;

-	    P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));

-	    Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));

-	    if(hx>=0) {

-	        z  = one-erx; return z - P/Q; 

-	    } else {

-		z = erx+P/Q; return one+z;

-	    }

-	}

-

-	if (ix < 0x41e00000) {		/* |x|<28 */

-	    x = fabsf(x);

- 	    s = one/(x*x);

-	    if(ix< 0x4036DB6D) {	/* |x| < 1/.35 ~ 2.857143*/

-	        R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(

-				ra5+s*(ra6+s*ra7))))));

-	        S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(

-				sa5+s*(sa6+s*(sa7+s*sa8)))))));

-	    } else {			/* |x| >= 1/.35 ~ 2.857143 */

-		if(hx<0&&ix>=0x40c00000) return two-tiny;/* x < -6 */

-	        R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(

-				rb5+s*rb6)))));

-	        S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(

-				sb5+s*(sb6+s*sb7))))));

-	    }

-

-	    z = x;

-	    __trunc_float_word (&z);

-	    r  =  __ieee754_expf(-z*z-(float)0.5625)*

-			__ieee754_expf((z-x)*(z+x)+R/S);

-	    if(hx>0) return r/x; else return two-r/x;

-	} else {

-	    /* set range error */

-            errno = ERANGE;

-	    if(hx>0) return tiny*tiny; else return two-tiny;

-	}

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+/* sf_erf.c -- float version of s_erf.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice 
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+#include "fdlibm.h"
+*/
+#include <math.h>
+#include <stdint.h>
+#include <errno.h>
+
+#define __ieee754_expf expf
+
+
+
+typedef union
+{
+  float value;
+  uint32_t word;
+} ieee_float_shape_type;
+
+/* Get a 32 bit int from a float.  */
+
+static inline int
+__get_float_word(float d)
+{
+  ieee_float_shape_type u;
+  u.value = d;
+  return u.word;
+}
+
+/* Set a float from a 32 bit int.  */
+
+#define SET_FLOAT_WORD(d,i)					\
+do {								\
+  ieee_float_shape_type sf_u;					\
+  sf_u.word = (i);						\
+  (d) = sf_u.value;						\
+} while (0)
+
+static inline void __trunc_float_word(float * x)
+{
+  ieee_float_shape_type u;
+  u.value = * x;	  
+  u.word &= 0xfffff000;
+}
+
+#ifdef __v810__
+#define const
+#endif
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+tiny	    = 1e-30,
+half=  5.0000000000e-01, /* 0x3F000000 */
+one =  1.0000000000e+00, /* 0x3F800000 */
+two =  2.0000000000e+00, /* 0x40000000 */
+	/* c = (subfloat)0.84506291151 */
+erx =  8.4506291151e-01, /* 0x3f58560b */
+/*
+ * Coefficients for approximation to  erf on [0,0.84375]
+ */
+efx =  1.2837916613e-01, /* 0x3e0375d4 */
+efx8=  1.0270333290e+00, /* 0x3f8375d4 */
+pp0  =  1.2837916613e-01, /* 0x3e0375d4 */
+pp1  = -3.2504209876e-01, /* 0xbea66beb */
+pp2  = -2.8481749818e-02, /* 0xbce9528f */
+pp3  = -5.7702702470e-03, /* 0xbbbd1489 */
+pp4  = -2.3763017452e-05, /* 0xb7c756b1 */
+qq1  =  3.9791721106e-01, /* 0x3ecbbbce */
+qq2  =  6.5022252500e-02, /* 0x3d852a63 */
+qq3  =  5.0813062117e-03, /* 0x3ba68116 */
+qq4  =  1.3249473704e-04, /* 0x390aee49 */
+qq5  = -3.9602282413e-06, /* 0xb684e21a */
+/*
+ * Coefficients for approximation to  erf  in [0.84375,1.25] 
+ */
+pa0  = -2.3621185683e-03, /* 0xbb1acdc6 */
+pa1  =  4.1485610604e-01, /* 0x3ed46805 */
+pa2  = -3.7220788002e-01, /* 0xbebe9208 */
+pa3  =  3.1834661961e-01, /* 0x3ea2fe54 */
+pa4  = -1.1089469492e-01, /* 0xbde31cc2 */
+pa5  =  3.5478305072e-02, /* 0x3d1151b3 */
+pa6  = -2.1663755178e-03, /* 0xbb0df9c0 */
+qa1  =  1.0642088205e-01, /* 0x3dd9f331 */
+qa2  =  5.4039794207e-01, /* 0x3f0a5785 */
+qa3  =  7.1828655899e-02, /* 0x3d931ae7 */
+qa4  =  1.2617121637e-01, /* 0x3e013307 */
+qa5  =  1.3637083583e-02, /* 0x3c5f6e13 */
+qa6  =  1.1984500103e-02, /* 0x3c445aa3 */
+/*
+ * Coefficients for approximation to  erfc in [1.25,1/0.35]
+ */
+ra0  = -9.8649440333e-03, /* 0xbc21a093 */
+ra1  = -6.9385856390e-01, /* 0xbf31a0b7 */
+ra2  = -1.0558626175e+01, /* 0xc128f022 */
+ra3  = -6.2375331879e+01, /* 0xc2798057 */
+ra4  = -1.6239666748e+02, /* 0xc322658c */
+ra5  = -1.8460508728e+02, /* 0xc3389ae7 */
+ra6  = -8.1287437439e+01, /* 0xc2a2932b */
+ra7  = -9.8143291473e+00, /* 0xc11d077e */
+sa1  =  1.9651271820e+01, /* 0x419d35ce */
+sa2  =  1.3765776062e+02, /* 0x4309a863 */
+sa3  =  4.3456588745e+02, /* 0x43d9486f */
+sa4  =  6.4538726807e+02, /* 0x442158c9 */
+sa5  =  4.2900814819e+02, /* 0x43d6810b */
+sa6  =  1.0863500214e+02, /* 0x42d9451f */
+sa7  =  6.5702495575e+00, /* 0x40d23f7c */
+sa8  = -6.0424413532e-02, /* 0xbd777f97 */
+/*
+ * Coefficients for approximation to  erfc in [1/.35,28]
+ */
+rb0  = -9.8649431020e-03, /* 0xbc21a092 */
+rb1  = -7.9928326607e-01, /* 0xbf4c9dd4 */
+rb2  = -1.7757955551e+01, /* 0xc18e104b */
+rb3  = -1.6063638306e+02, /* 0xc320a2ea */
+rb4  = -6.3756646729e+02, /* 0xc41f6441 */
+rb5  = -1.0250950928e+03, /* 0xc480230b */
+rb6  = -4.8351919556e+02, /* 0xc3f1c275 */
+sb1  =  3.0338060379e+01, /* 0x41f2b459 */
+sb2  =  3.2579251099e+02, /* 0x43a2e571 */
+sb3  =  1.5367296143e+03, /* 0x44c01759 */
+sb4  =  3.1998581543e+03, /* 0x4547fdbb */
+sb5  =  2.5530502930e+03, /* 0x451f90ce */
+sb6  =  4.7452853394e+02, /* 0x43ed43a7 */
+sb7  = -2.2440952301e+01; /* 0xc1b38712 */
+
+#ifdef __STDC__
+	float erff(float x) 
+#else
+	float erff(x) 
+	float x;
+#endif
+{
+	int32_t hx,ix,i;
+	float R,S,P,Q,s,y,z,r;
+	hx = __get_float_word(x);
+	ix = hx&0x7fffffff;
+	if(!(ix<0x7f800000L)) {		/* erf(nan)=nan */
+	    i = ((uint32_t)hx>>31)<<1;
+	    return (float)(1-i)+one/x;	/* erf(+-inf)=+-1 */
+	}
+
+	if(ix < 0x3f580000) {		/* |x|<0.84375 */
+	    if(ix < 0x31800000) { 	/* |x|<2**-28 */
+	        if (ix < 0x04000000) 
+		    /*avoid underflow */
+		    return (float)0.125*((float)8.0*x+efx8*x);
+		return x + efx*x;
+	    }
+	    z = x*x;
+	    r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
+	    s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
+	    y = r/s;
+	    return x + x*y;
+	}
+	if(ix < 0x3fa00000) {		/* 0.84375 <= |x| < 1.25 */
+	    s = fabsf(x)-one;
+	    P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
+	    Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
+	    if(hx>=0) return erx + P/Q; else return -erx - P/Q;
+	}
+	if (ix >= 0x40c00000) {		/* inf>|x|>=6 */
+	    if(hx>=0) return one-tiny; else return tiny-one;
+	}
+	x = fabsf(x);
+ 	s = one/(x*x);
+	if(ix< 0x4036DB6E) {	/* |x| < 1/0.35 */
+	    R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
+				ra5+s*(ra6+s*ra7))))));
+	    S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
+				sa5+s*(sa6+s*(sa7+s*sa8)))))));
+	} else {	/* |x| >= 1/0.35 */
+	    R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
+				rb5+s*rb6)))));
+	    S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
+				sb5+s*(sb6+s*sb7))))));
+	}
+
+	z = x;
+	__trunc_float_word (&z);
+	r  =  __ieee754_expf(-z*z-(float)0.5625)*__ieee754_expf((z-x)*(z+x)+R/S);
+	if(hx>=0) return one-r/x; else return  r/x-one;
+}
+
+#ifdef __STDC__
+	float erfcf(float x) 
+#else
+	float erfcf(x) 
+	float x;
+#endif
+{
+	int32_t hx,ix;
+	float R,S,P,Q,s,y,z,r;
+	hx = __get_float_word(x);
+	ix = hx&0x7fffffff;
+	if(!(ix<0x7f800000L)) {			/* erfc(nan)=nan */
+						/* erfc(+-inf)=0,2 */
+	    return (float)(((uint32_t)hx>>31)<<1)+one/x;
+	}
+
+	if(ix < 0x3f580000) {		/* |x|<0.84375 */
+	    if(ix < 0x23800000)  	/* |x|<2**-56 */
+		return one-x;
+	    z = x*x;
+	    r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
+	    s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
+	    y = r/s;
+	    if(hx < 0x3e800000) {  	/* x<1/4 */
+		return one-(x+x*y);
+	    } else {
+		r = x*y;
+		r += (x-half);
+	        return half - r ;
+	    }
+	}
+	if(ix < 0x3fa00000) {		/* 0.84375 <= |x| < 1.25 */
+	    s = fabsf(x)-one;
+	    P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
+	    Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
+	    if(hx>=0) {
+	        z  = one-erx; return z - P/Q; 
+	    } else {
+		z = erx+P/Q; return one+z;
+	    }
+	}
+
+	if (ix < 0x41e00000) {		/* |x|<28 */
+	    x = fabsf(x);
+ 	    s = one/(x*x);
+	    if(ix< 0x4036DB6D) {	/* |x| < 1/.35 ~ 2.857143*/
+	        R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
+				ra5+s*(ra6+s*ra7))))));
+	        S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
+				sa5+s*(sa6+s*(sa7+s*sa8)))))));
+	    } else {			/* |x| >= 1/.35 ~ 2.857143 */
+		if(hx<0&&ix>=0x40c00000) return two-tiny;/* x < -6 */
+	        R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
+				rb5+s*rb6)))));
+	        S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
+				sb5+s*(sb6+s*sb7))))));
+	    }
+
+	    z = x;
+	    __trunc_float_word (&z);
+	    r  =  __ieee754_expf(-z*z-(float)0.5625)*
+			__ieee754_expf((z-x)*(z+x)+R/S);
+	    if(hx>0) return r/x; else return two-r/x;
+	} else {
+	    /* set range error */
+            errno = ERANGE;
+	    if(hx>0) return tiny*tiny; else return two-tiny;
+	}
+}
diff --git a/mingw-w64-crt/math/signbit.c b/mingw-w64-crt/math/signbit.c
index 57cf9f5..b55a6e6 100644
--- a/mingw-w64-crt/math/signbit.c
+++ b/mingw-w64-crt/math/signbit.c
@@ -1,18 +1,18 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#define __FP_SIGNBIT  0x0200

-

-int __signbit (double x) {

-  unsigned short sw;

-  __asm__ ("fxam; fstsw %%ax;"

-	   : "=a" (sw)

-	   : "t" (x) );

-  return (sw & __FP_SIGNBIT) != 0;

-}

-

-#undef signbit

-int __attribute__ ((alias ("__signbit"))) signbit (double);

-

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#define __FP_SIGNBIT  0x0200
+
+int __signbit (double x) {
+  unsigned short sw;
+  __asm__ ("fxam; fstsw %%ax;"
+	   : "=a" (sw)
+	   : "t" (x) );
+  return (sw & __FP_SIGNBIT) != 0;
+}
+
+#undef signbit
+int __attribute__ ((alias ("__signbit"))) signbit (double);
+
diff --git a/mingw-w64-crt/math/signbitf.c b/mingw-w64-crt/math/signbitf.c
index 98fc753..04ccaec 100644
--- a/mingw-w64-crt/math/signbitf.c
+++ b/mingw-w64-crt/math/signbitf.c
@@ -1,15 +1,15 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#define __FP_SIGNBIT  0x0200

-

-int __signbitf (float x) {

-  unsigned short sw;

-  __asm__ ("fxam; fstsw %%ax;"

-	   : "=a" (sw)

-	   : "t" (x) );

-  return (sw & __FP_SIGNBIT) != 0;

-}

-int __attribute__ ((alias ("__signbitf"))) signbitf (float);

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#define __FP_SIGNBIT  0x0200
+
+int __signbitf (float x) {
+  unsigned short sw;
+  __asm__ ("fxam; fstsw %%ax;"
+	   : "=a" (sw)
+	   : "t" (x) );
+  return (sw & __FP_SIGNBIT) != 0;
+}
+int __attribute__ ((alias ("__signbitf"))) signbitf (float);
diff --git a/mingw-w64-crt/math/signbitl.c b/mingw-w64-crt/math/signbitl.c
index 2d9c4d5..5e3596c 100644
--- a/mingw-w64-crt/math/signbitl.c
+++ b/mingw-w64-crt/math/signbitl.c
@@ -1,16 +1,16 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#define __FP_SIGNBIT  0x0200

-

-int __signbitl (long double x) {

-  unsigned short sw;

-  __asm__ ("fxam; fstsw %%ax;"

-	   : "=a" (sw)

-	   : "t" (x) );

-  return (sw & __FP_SIGNBIT) != 0;

-}

-

-int __attribute__ ((alias ("__signbitl"))) signbitl (long double);

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#define __FP_SIGNBIT  0x0200
+
+int __signbitl (long double x) {
+  unsigned short sw;
+  __asm__ ("fxam; fstsw %%ax;"
+	   : "=a" (sw)
+	   : "t" (x) );
+  return (sw & __FP_SIGNBIT) != 0;
+}
+
+int __attribute__ ((alias ("__signbitl"))) signbitl (long double);
diff --git a/mingw-w64-crt/math/sinf.c b/mingw-w64-crt/math/sinf.c
index 5efb7be..f874660 100644
--- a/mingw-w64-crt/math/sinf.c
+++ b/mingw-w64-crt/math/sinf.c
@@ -1,11 +1,11 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float sinf(float _X)

-{

-  return ((float) sin ((double) _X));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float sinf(float _X)
+{
+  return ((float) sin ((double) _X));
+}
diff --git a/mingw-w64-crt/math/sinhf.c b/mingw-w64-crt/math/sinhf.c
index e79e0eb..4fde4e6 100644
--- a/mingw-w64-crt/math/sinhf.c
+++ b/mingw-w64-crt/math/sinhf.c
@@ -1,8 +1,8 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-float sinhf (float x)

-  {return (float) sinh (x);}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+float sinhf (float x)
+  {return (float) sinh (x);}
diff --git a/mingw-w64-crt/math/sinhl.c b/mingw-w64-crt/math/sinhl.c
index b780897..4abf918 100644
--- a/mingw-w64-crt/math/sinhl.c
+++ b/mingw-w64-crt/math/sinhl.c
@@ -1,111 +1,111 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-#ifndef _SET_ERRNO

-#define _SET_ERRNO(x)

-#endif

-

-#ifdef UNK

-static long double P[] = {

- 1.7550769032975377032681E-6L,

- 4.1680702175874268714539E-4L,

- 3.0993532520425419002409E-2L,

- 9.9999999999999999998002E-1L,

-};

-static long double Q[] = {

- 1.7453965448620151484660E-8L,

--5.9116673682651952419571E-6L,

- 1.0599252315677389339530E-3L,

--1.1403880487744749056675E-1L,

- 6.0000000000000000000200E0L,

-};

-#endif

-

-#ifdef IBMPC

-static const unsigned short P[] = {

-0xec6a,0xd942,0xfbb3,0xeb8f,0x3feb, XPD

-0x365e,0xb30a,0xe437,0xda86,0x3ff3, XPD

-0x8890,0x01f6,0x2612,0xfde6,0x3ff9, XPD

-0x0000,0x0000,0x0000,0x8000,0x3fff, XPD

-};

-static const unsigned short Q[] = {

-0x4edd,0x4c21,0xad09,0x95ed,0x3fe5, XPD

-0x4376,0x9b70,0xd605,0xc65c,0xbfed, XPD

-0xc8ad,0x5d21,0x3069,0x8aed,0x3ff5, XPD

-0x9c32,0x6374,0x2d4b,0xe98d,0xbffb, XPD

-0x0000,0x0000,0x0000,0xc000,0x4001, XPD

-};

-#endif

-

-#ifdef MIEEE

-static long P[] = {

-0x3feb0000,0xeb8ffbb3,0xd942ec6a,

-0x3ff30000,0xda86e437,0xb30a365e,

-0x3ff90000,0xfde62612,0x01f68890,

-0x3fff0000,0x80000000,0x00000000,

-};

-static long Q[] = {

-0x3fe50000,0x95edad09,0x4c214edd,

-0xbfed0000,0xc65cd605,0x9b704376,

-0x3ff50000,0x8aed3069,0x5d21c8ad,

-0xbffb0000,0xe98d2d4b,0x63749c32,

-0x40010000,0xc0000000,0x00000000,

-};

-#endif

-

-long double sinhl(x)

-long double x;

-{

-long double a;

-

-#ifdef MINUSZERO

-if( x == 0.0 )

-	return(x);

-#endif

-#ifdef NANS

-if (isnanl(x))

-	{

-	_SET_ERRNO(EDOM);

-	}

-#endif

-a = fabsl(x);

-if( (x > (MAXLOGL + LOGE2L)) || (x > -(MINLOGL-LOGE2L) ) )

-	{

-	mtherr( "sinhl", DOMAIN );

-	_SET_ERRNO(ERANGE);

-#ifdef INFINITIES

-	if( x > 0.0L )

-		return( INFINITYL );

-	else

-		return( -INFINITYL );

-#else

-	if( x > 0.0L )

-		return( MAXNUML );

-	else

-		return( -MAXNUML );

-#endif

-	}

-if( a > 1.0L )

-	{

-	if( a >= (MAXLOGL - LOGE2L) )

-		{

-		a = expl(0.5L*a);

-		a = (0.5L * a) * a;

-		if( x < 0.0L )

-			a = -a;

-		return(a);

-		}

-	a = expl(a);

-	a = 0.5L*a - (0.5L/a);

-	if( x < 0.0L )

-		a = -a;

-	return(a);

-	}

-

-a *= a;

-return( x + x * a * (polevll(a,P,3)/polevll(a,Q,4)) );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+#ifndef _SET_ERRNO
+#define _SET_ERRNO(x)
+#endif
+
+#ifdef UNK
+static long double P[] = {
+ 1.7550769032975377032681E-6L,
+ 4.1680702175874268714539E-4L,
+ 3.0993532520425419002409E-2L,
+ 9.9999999999999999998002E-1L,
+};
+static long double Q[] = {
+ 1.7453965448620151484660E-8L,
+-5.9116673682651952419571E-6L,
+ 1.0599252315677389339530E-3L,
+-1.1403880487744749056675E-1L,
+ 6.0000000000000000000200E0L,
+};
+#endif
+
+#ifdef IBMPC
+static const unsigned short P[] = {
+0xec6a,0xd942,0xfbb3,0xeb8f,0x3feb, XPD
+0x365e,0xb30a,0xe437,0xda86,0x3ff3, XPD
+0x8890,0x01f6,0x2612,0xfde6,0x3ff9, XPD
+0x0000,0x0000,0x0000,0x8000,0x3fff, XPD
+};
+static const unsigned short Q[] = {
+0x4edd,0x4c21,0xad09,0x95ed,0x3fe5, XPD
+0x4376,0x9b70,0xd605,0xc65c,0xbfed, XPD
+0xc8ad,0x5d21,0x3069,0x8aed,0x3ff5, XPD
+0x9c32,0x6374,0x2d4b,0xe98d,0xbffb, XPD
+0x0000,0x0000,0x0000,0xc000,0x4001, XPD
+};
+#endif
+
+#ifdef MIEEE
+static long P[] = {
+0x3feb0000,0xeb8ffbb3,0xd942ec6a,
+0x3ff30000,0xda86e437,0xb30a365e,
+0x3ff90000,0xfde62612,0x01f68890,
+0x3fff0000,0x80000000,0x00000000,
+};
+static long Q[] = {
+0x3fe50000,0x95edad09,0x4c214edd,
+0xbfed0000,0xc65cd605,0x9b704376,
+0x3ff50000,0x8aed3069,0x5d21c8ad,
+0xbffb0000,0xe98d2d4b,0x63749c32,
+0x40010000,0xc0000000,0x00000000,
+};
+#endif
+
+long double sinhl(x)
+long double x;
+{
+long double a;
+
+#ifdef MINUSZERO
+if( x == 0.0 )
+	return(x);
+#endif
+#ifdef NANS
+if (isnanl(x))
+	{
+	_SET_ERRNO(EDOM);
+	}
+#endif
+a = fabsl(x);
+if( (x > (MAXLOGL + LOGE2L)) || (x > -(MINLOGL-LOGE2L) ) )
+	{
+	mtherr( "sinhl", DOMAIN );
+	_SET_ERRNO(ERANGE);
+#ifdef INFINITIES
+	if( x > 0.0L )
+		return( INFINITYL );
+	else
+		return( -INFINITYL );
+#else
+	if( x > 0.0L )
+		return( MAXNUML );
+	else
+		return( -MAXNUML );
+#endif
+	}
+if( a > 1.0L )
+	{
+	if( a >= (MAXLOGL - LOGE2L) )
+		{
+		a = expl(0.5L*a);
+		a = (0.5L * a) * a;
+		if( x < 0.0L )
+			a = -a;
+		return(a);
+		}
+	a = expl(a);
+	a = 0.5L*a - (0.5L/a);
+	if( x < 0.0L )
+		a = -a;
+	return(a);
+	}
+
+a *= a;
+return( x + x * a * (polevll(a,P,3)/polevll(a,Q,4)) );
+}
diff --git a/mingw-w64-crt/math/sqrtf.c b/mingw-w64-crt/math/sqrtf.c
index f68921c..3671df1 100644
--- a/mingw-w64-crt/math/sqrtf.c
+++ b/mingw-w64-crt/math/sqrtf.c
@@ -1,25 +1,25 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-

-extern float  __QNANF;

-

-float

-sqrtf (float x)

-{

-  if (x < 0.0F )

-    {

-      errno = EDOM;

-      return __QNANF;

-    }

-  else

-    {

-      float res;

-      asm ("fsqrt" : "=t" (res) : "0" (x));

-      return res;

-    }

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+
+extern float  __QNANF;
+
+float
+sqrtf (float x)
+{
+  if (x < 0.0F )
+    {
+      errno = EDOM;
+      return __QNANF;
+    }
+  else
+    {
+      float res;
+      asm ("fsqrt" : "=t" (res) : "0" (x));
+      return res;
+    }
+}
diff --git a/mingw-w64-crt/math/sqrtl.c b/mingw-w64-crt/math/sqrtl.c
index 1810e2f..a4436b6 100644
--- a/mingw-w64-crt/math/sqrtl.c
+++ b/mingw-w64-crt/math/sqrtl.c
@@ -1,25 +1,25 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-#include <errno.h>

-

-extern long double  __QNANL;

-

-long double

-sqrtl (long double x)

-{

-  if (x < 0.0L )

-    {

-      errno = EDOM;

-      return __QNANL;

-    }

-  else

-    {

-      long double res;

-      asm ("fsqrt" : "=t" (res) : "0" (x));

-      return res;

-    }

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+#include <errno.h>
+
+extern long double  __QNANL;
+
+long double
+sqrtl (long double x)
+{
+  if (x < 0.0L )
+    {
+      errno = EDOM;
+      return __QNANL;
+    }
+  else
+    {
+      long double res;
+      asm ("fsqrt" : "=t" (res) : "0" (x));
+      return res;
+    }
+}
diff --git a/mingw-w64-crt/math/tanf.c b/mingw-w64-crt/math/tanf.c
index ac1f022..25e4ba9 100644
--- a/mingw-w64-crt/math/tanf.c
+++ b/mingw-w64-crt/math/tanf.c
@@ -1,11 +1,11 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-

-float tanf(float _X)

-{

-  return ((float)tan((double)_X));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+
+float tanf(float _X)
+{
+  return ((float)tan((double)_X));
+}
diff --git a/mingw-w64-crt/math/tanhf.c b/mingw-w64-crt/math/tanhf.c
index e21f5fc..738ed12 100644
--- a/mingw-w64-crt/math/tanhf.c
+++ b/mingw-w64-crt/math/tanhf.c
@@ -1,8 +1,8 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <math.h>

-float tanhf (float x)

-  {return (float) tanh (x);}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <math.h>
+float tanhf (float x)
+  {return (float) tanh (x);}
diff --git a/mingw-w64-crt/math/tanhl.c b/mingw-w64-crt/math/tanhl.c
index 8df3888..600862a 100644
--- a/mingw-w64-crt/math/tanhl.c
+++ b/mingw-w64-crt/math/tanhl.c
@@ -1,95 +1,95 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-#ifndef _SET_ERRNO

-#define _SET_ERRNO(x)

-#endif

-

-#ifdef UNK

-static long double P[] = {

--6.8473739392677100872869E-5L,

--9.5658283111794641589011E-1L,

--8.4053568599672284488465E1L,

--1.3080425704712825945553E3L,

-};

-static long double Q[] = {

-/* 1.0000000000000000000000E0L,*/

- 9.6259501838840336946872E1L,

- 1.8218117903645559060232E3L,

- 3.9241277114138477845780E3L,

-};

-#endif

-

-#ifdef IBMPC

-static unsigned short P[] = {

-0xd2a4,0x1b0c,0x8f15,0x8f99,0xbff1, XPD

-0x5959,0x9111,0x9cc7,0xf4e2,0xbffe, XPD

-0xb576,0xef5e,0x6d57,0xa81b,0xc005, XPD

-0xe3be,0xbfbd,0x5cbc,0xa381,0xc009, XPD

-};

-static unsigned short Q[] = {

-/*0x0000,0x0000,0x0000,0x8000,0x3fff,*/

-0x687f,0xce24,0xdd6c,0xc084,0x4005, XPD

-0x3793,0xc95f,0xfa2f,0xe3b9,0x4009, XPD

-0xd5a2,0x1f9c,0x0b1b,0xf542,0x400a, XPD

-};

-#endif

-

-#ifdef MIEEE

-static long P[] = {

-0xbff10000,0x8f998f15,0x1b0cd2a4,

-0xbffe0000,0xf4e29cc7,0x91115959,

-0xc0050000,0xa81b6d57,0xef5eb576,

-0xc0090000,0xa3815cbc,0xbfbde3be,

-};

-static long Q[] = {

-/*0x3fff0000,0x80000000,0x00000000,*/

-0x40050000,0xc084dd6c,0xce24687f,

-0x40090000,0xe3b9fa2f,0xc95f3793,

-0x400a0000,0xf5420b1b,0x1f9cd5a2,

-};

-#endif

-

-long double tanhl(x)

-long double x;

-{

-long double s, z;

-

-#ifdef MINUSZERO

-if( x == 0.0L )

-	return(x);

-#endif

-if (isnanl(x))

-	{

-	_SET_ERRNO (EDOM);

-	return x;

-	}

-

-z = fabsl(x);

-if( z > 0.5L * MAXLOGL )

-	{

-	_SET_ERRNO (ERANGE);

-	if( x > 0 )

-		return( 1.0L );

-	else

-		return( -1.0L );

-	}

-if( z >= 0.625L )

-	{

-	s = expl(2.0*z);

-	z =  1.0L  - 2.0/(s + 1.0L);

-	if( x < 0 )

-		z = -z;

-	}

-else

-	{

-	s = x * x;

-	z = polevll( s, P, 3 )/p1evll(s, Q, 3);

-	z = x * s * z;

-	z = x + z;

-	}

-return( z );

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+#ifndef _SET_ERRNO
+#define _SET_ERRNO(x)
+#endif
+
+#ifdef UNK
+static long double P[] = {
+-6.8473739392677100872869E-5L,
+-9.5658283111794641589011E-1L,
+-8.4053568599672284488465E1L,
+-1.3080425704712825945553E3L,
+};
+static long double Q[] = {
+/* 1.0000000000000000000000E0L,*/
+ 9.6259501838840336946872E1L,
+ 1.8218117903645559060232E3L,
+ 3.9241277114138477845780E3L,
+};
+#endif
+
+#ifdef IBMPC
+static unsigned short P[] = {
+0xd2a4,0x1b0c,0x8f15,0x8f99,0xbff1, XPD
+0x5959,0x9111,0x9cc7,0xf4e2,0xbffe, XPD
+0xb576,0xef5e,0x6d57,0xa81b,0xc005, XPD
+0xe3be,0xbfbd,0x5cbc,0xa381,0xc009, XPD
+};
+static unsigned short Q[] = {
+/*0x0000,0x0000,0x0000,0x8000,0x3fff,*/
+0x687f,0xce24,0xdd6c,0xc084,0x4005, XPD
+0x3793,0xc95f,0xfa2f,0xe3b9,0x4009, XPD
+0xd5a2,0x1f9c,0x0b1b,0xf542,0x400a, XPD
+};
+#endif
+
+#ifdef MIEEE
+static long P[] = {
+0xbff10000,0x8f998f15,0x1b0cd2a4,
+0xbffe0000,0xf4e29cc7,0x91115959,
+0xc0050000,0xa81b6d57,0xef5eb576,
+0xc0090000,0xa3815cbc,0xbfbde3be,
+};
+static long Q[] = {
+/*0x3fff0000,0x80000000,0x00000000,*/
+0x40050000,0xc084dd6c,0xce24687f,
+0x40090000,0xe3b9fa2f,0xc95f3793,
+0x400a0000,0xf5420b1b,0x1f9cd5a2,
+};
+#endif
+
+long double tanhl(x)
+long double x;
+{
+long double s, z;
+
+#ifdef MINUSZERO
+if( x == 0.0L )
+	return(x);
+#endif
+if (isnanl(x))
+	{
+	_SET_ERRNO (EDOM);
+	return x;
+	}
+
+z = fabsl(x);
+if( z > 0.5L * MAXLOGL )
+	{
+	_SET_ERRNO (ERANGE);
+	if( x > 0 )
+		return( 1.0L );
+	else
+		return( -1.0L );
+	}
+if( z >= 0.625L )
+	{
+	s = expl(2.0*z);
+	z =  1.0L  - 2.0/(s + 1.0L);
+	if( x < 0 )
+		z = -z;
+	}
+else
+	{
+	s = x * x;
+	z = polevll( s, P, 3 )/p1evll(s, Q, 3);
+	z = x * s * z;
+	z = x + z;
+	}
+return( z );
+}
diff --git a/mingw-w64-crt/math/tgamma.c b/mingw-w64-crt/math/tgamma.c
index 12a0138..c742a78 100644
--- a/mingw-w64-crt/math/tgamma.c
+++ b/mingw-w64-crt/math/tgamma.c
@@ -1,302 +1,302 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-#ifdef UNK

-static const double P[] = {

-  1.60119522476751861407E-4,

-  1.19135147006586384913E-3,

-  1.04213797561761569935E-2,

-  4.76367800457137231464E-2,

-  2.07448227648435975150E-1,

-  4.94214826801497100753E-1,

-  9.99999999999999996796E-1

-};

-static const double Q[] = {

--2.31581873324120129819E-5,

- 5.39605580493303397842E-4,

--4.45641913851797240494E-3,

- 1.18139785222060435552E-2,

- 3.58236398605498653373E-2,

--2.34591795718243348568E-1,

- 7.14304917030273074085E-2,

- 1.00000000000000000320E0

-};

-#define MAXGAM 171.624376956302725

-static const double LOGPI = 1.14472988584940017414;

-#endif

-

-#ifdef DEC

-static const unsigned short P[] = {

-0035047,0162701,0146301,0005234,

-0035634,0023437,0032065,0176530,

-0036452,0137157,0047330,0122574,

-0037103,0017310,0143041,0017232,

-0037524,0066516,0162563,0164605,

-0037775,0004671,0146237,0014222,

-0040200,0000000,0000000,0000000

-};

-static const unsigned short Q[] = {

-0134302,0041724,0020006,0116565,

-0035415,0072121,0044251,0025634,

-0136222,0003447,0035205,0121114,

-0036501,0107552,0154335,0104271,

-0037022,0135717,0014776,0171471,

-0137560,0034324,0165024,0037021,

-0037222,0045046,0047151,0161213,

-0040200,0000000,0000000,0000000

-};

-#define MAXGAM 34.84425627277176174

-#endif

-

-#ifdef IBMPC

-static const unsigned short P[] = {

-0x2153,0x3998,0xfcb8,0x3f24,

-0xbfab,0xe686,0x84e3,0x3f53,

-0x14b0,0xe9db,0x57cd,0x3f85,

-0x23d3,0x18c4,0x63d9,0x3fa8,

-0x7d31,0xdcae,0x8da9,0x3fca,

-0xe312,0x3993,0xa137,0x3fdf,

-0x0000,0x0000,0x0000,0x3ff0

-};

-static const unsigned short Q[] = {

-0xd3af,0x8400,0x487a,0xbef8,

-0x2573,0x2915,0xae8a,0x3f41,

-0xb44a,0xe750,0x40e4,0xbf72,

-0xb117,0x5b1b,0x31ed,0x3f88,

-0xde67,0xe33f,0x5779,0x3fa2,

-0x87c2,0x9d42,0x071a,0xbfce,

-0x3c51,0xc9cd,0x4944,0x3fb2,

-0x0000,0x0000,0x0000,0x3ff0

-};

-#define MAXGAM 171.624376956302725

-#endif 

-

-#ifdef MIEEE

-static const unsigned short P[] = {

-0x3f24,0xfcb8,0x3998,0x2153,

-0x3f53,0x84e3,0xe686,0xbfab,

-0x3f85,0x57cd,0xe9db,0x14b0,

-0x3fa8,0x63d9,0x18c4,0x23d3,

-0x3fca,0x8da9,0xdcae,0x7d31,

-0x3fdf,0xa137,0x3993,0xe312,

-0x3ff0,0x0000,0x0000,0x0000

-};

-static const unsigned short Q[] = {

-0xbef8,0x487a,0x8400,0xd3af,

-0x3f41,0xae8a,0x2915,0x2573,

-0xbf72,0x40e4,0xe750,0xb44a,

-0x3f88,0x31ed,0x5b1b,0xb117,

-0x3fa2,0x5779,0xe33f,0xde67,

-0xbfce,0x071a,0x9d42,0x87c2,

-0x3fb2,0x4944,0xc9cd,0x3c51,

-0x3ff0,0x0000,0x0000,0x0000

-};

-#define MAXGAM 171.624376956302725

-#endif 

-

-/* Stirling's formula for the gamma function */

-#if UNK

-static const double STIR[5] = {

- 7.87311395793093628397E-4,

--2.29549961613378126380E-4,

--2.68132617805781232825E-3,

- 3.47222221605458667310E-3,

- 8.33333333333482257126E-2,

-};

-#define MAXSTIR 143.01608

-static const double SQTPI = 2.50662827463100050242E0;

-#endif

-#if DEC

-static const unsigned short STIR[20] = {

-0035516,0061622,0144553,0112224,

-0135160,0131531,0037460,0165740,

-0136057,0134460,0037242,0077270,

-0036143,0107070,0156306,0027751,

-0037252,0125252,0125252,0146064,

-};

-#define MAXSTIR 26.77

-static const unsigned short SQT[4] = {

-0040440,0066230,0177661,0034055,

-};

-#define SQTPI *(double *)SQT

-#endif

-#if IBMPC

-static const unsigned short STIR[20] = {

-0x7293,0x592d,0xcc72,0x3f49,

-0x1d7c,0x27e6,0x166b,0xbf2e,

-0x4fd7,0x07d4,0xf726,0xbf65,

-0xc5fd,0x1b98,0x71c7,0x3f6c,

-0x5986,0x5555,0x5555,0x3fb5,

-};

-#define MAXSTIR 143.01608

-

-static const union

-{

-  unsigned short s[4];

-  double d;

-} sqt = {{0x2706,0x1ff6,0x0d93,0x4004}};

-#define SQTPI (sqt.d)

-#endif

-#if MIEEE

-static const unsigned short STIR[20] = {

-0x3f49,0xcc72,0x592d,0x7293,

-0xbf2e,0x166b,0x27e6,0x1d7c,

-0xbf65,0xf726,0x07d4,0x4fd7,

-0x3f6c,0x71c7,0x1b98,0xc5fd,

-0x3fb5,0x5555,0x5555,0x5986,

-};

-#define MAXSTIR 143.01608

-static const unsigned short SQT[4] = {

-0x4004,0x0d93,0x1ff6,0x2706,

-};

-#define SQTPI *(double *)SQT

-#endif

-

-static double stirf ( double );

-

-/* Gamma function computed by Stirling's formula.

- * The polynomial STIR is valid for 33 <= x <= 172.

- */

-static double stirf(x)

-double x;

-{

-double y, w, v;

-

-w = 1.0/x;

-w = 1.0 + w * polevl( w, STIR, 4 );

-y = exp(x);

-if( x > MAXSTIR )

-	{ /* Avoid overflow in pow() */

-	v = pow( x, 0.5 * x - 0.25 );

-	y = v * (v / y);

-	}

-else

-	{

-	y = pow( x, x - 0.5 ) / y;

-	}

-y = SQTPI * y * w;

-return( y );

-}

-

-

-

-double __tgamma_r(double x, int* sgngam)

-{

-double p, q, z;

-int i;

-

-*sgngam = 1;

-#ifdef NANS

-if( isnan(x) )

-	return(x);

-#endif

-#ifdef INFINITIES

-#ifdef NANS

-if( x == INFINITY )

-	return(x);

-if( x == -INFINITY )

-	return(NAN);

-#else

-if( !isfinite(x) )

-	return(x);

-#endif

-#endif

-q = fabs(x);

-

-if( q > 33.0 )

-	{

-	if( x < 0.0 )

-		{

-		p = floor(q);

-		if( p == q )

-			{

-gsing:

-			_SET_ERRNO(EDOM);

-			mtherr( "tgamma", SING );

-#ifdef INFINITIES

-			return (INFINITY);

-#else

-			return (MAXNUM);

-#endif

-			}

-		i = p;

-		if( (i & 1) == 0 )

-			*sgngam = -1;

-		z = q - p;

-		if( z > 0.5 )

-			{

-			p += 1.0;

-			z = q - p;

-			}

-		z = q * sin( PI * z );

-		if( z == 0.0 )

-			{

-			_SET_ERRNO(ERANGE);

-			mtherr( "tgamma", OVERFLOW );

-#ifdef INFINITIES

-			return( *sgngam * INFINITY);

-#else

-			return( *sgngam * MAXNUM);

-#endif

-			}

-		z = fabs(z);

-		z = PI/(z * stirf(q) );

-		}

-	else

-		{

-		z = stirf(x);

-		}

-	return( *sgngam * z );

-	}

-

-z = 1.0;

-while( x >= 3.0 )

-	{

-	x -= 1.0;

-	z *= x;

-	}

-

-while( x < 0.0 )

-	{

-	if( x > -1.E-9 )

-		goto Small;

-	z /= x;

-	x += 1.0;

-	}

-

-while( x < 2.0 )

-	{

-	if( x < 1.e-9 )

-		goto Small;

-	z /= x;

-	x += 1.0;

-	}

-

-if( x == 2.0 )

-	return(z);

-

-x -= 2.0;

-p = polevl( x, P, 6 );

-q = polevl( x, Q, 7 );

-return( z * p / q );

-

-Small:

-if( x == 0.0 )

-	{

-	goto gsing;

-	}

-else

-	return( z/((1.0 + 0.5772156649015329 * x) * x) );

-}

-

-/* This is the C99 version */

-

-double tgamma(double x)

-{

-  int local_sgngam=0;

-  return (__tgamma_r(x, &local_sgngam));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+#ifdef UNK
+static const double P[] = {
+  1.60119522476751861407E-4,
+  1.19135147006586384913E-3,
+  1.04213797561761569935E-2,
+  4.76367800457137231464E-2,
+  2.07448227648435975150E-1,
+  4.94214826801497100753E-1,
+  9.99999999999999996796E-1
+};
+static const double Q[] = {
+-2.31581873324120129819E-5,
+ 5.39605580493303397842E-4,
+-4.45641913851797240494E-3,
+ 1.18139785222060435552E-2,
+ 3.58236398605498653373E-2,
+-2.34591795718243348568E-1,
+ 7.14304917030273074085E-2,
+ 1.00000000000000000320E0
+};
+#define MAXGAM 171.624376956302725
+static const double LOGPI = 1.14472988584940017414;
+#endif
+
+#ifdef DEC
+static const unsigned short P[] = {
+0035047,0162701,0146301,0005234,
+0035634,0023437,0032065,0176530,
+0036452,0137157,0047330,0122574,
+0037103,0017310,0143041,0017232,
+0037524,0066516,0162563,0164605,
+0037775,0004671,0146237,0014222,
+0040200,0000000,0000000,0000000
+};
+static const unsigned short Q[] = {
+0134302,0041724,0020006,0116565,
+0035415,0072121,0044251,0025634,
+0136222,0003447,0035205,0121114,
+0036501,0107552,0154335,0104271,
+0037022,0135717,0014776,0171471,
+0137560,0034324,0165024,0037021,
+0037222,0045046,0047151,0161213,
+0040200,0000000,0000000,0000000
+};
+#define MAXGAM 34.84425627277176174
+#endif
+
+#ifdef IBMPC
+static const unsigned short P[] = {
+0x2153,0x3998,0xfcb8,0x3f24,
+0xbfab,0xe686,0x84e3,0x3f53,
+0x14b0,0xe9db,0x57cd,0x3f85,
+0x23d3,0x18c4,0x63d9,0x3fa8,
+0x7d31,0xdcae,0x8da9,0x3fca,
+0xe312,0x3993,0xa137,0x3fdf,
+0x0000,0x0000,0x0000,0x3ff0
+};
+static const unsigned short Q[] = {
+0xd3af,0x8400,0x487a,0xbef8,
+0x2573,0x2915,0xae8a,0x3f41,
+0xb44a,0xe750,0x40e4,0xbf72,
+0xb117,0x5b1b,0x31ed,0x3f88,
+0xde67,0xe33f,0x5779,0x3fa2,
+0x87c2,0x9d42,0x071a,0xbfce,
+0x3c51,0xc9cd,0x4944,0x3fb2,
+0x0000,0x0000,0x0000,0x3ff0
+};
+#define MAXGAM 171.624376956302725
+#endif 
+
+#ifdef MIEEE
+static const unsigned short P[] = {
+0x3f24,0xfcb8,0x3998,0x2153,
+0x3f53,0x84e3,0xe686,0xbfab,
+0x3f85,0x57cd,0xe9db,0x14b0,
+0x3fa8,0x63d9,0x18c4,0x23d3,
+0x3fca,0x8da9,0xdcae,0x7d31,
+0x3fdf,0xa137,0x3993,0xe312,
+0x3ff0,0x0000,0x0000,0x0000
+};
+static const unsigned short Q[] = {
+0xbef8,0x487a,0x8400,0xd3af,
+0x3f41,0xae8a,0x2915,0x2573,
+0xbf72,0x40e4,0xe750,0xb44a,
+0x3f88,0x31ed,0x5b1b,0xb117,
+0x3fa2,0x5779,0xe33f,0xde67,
+0xbfce,0x071a,0x9d42,0x87c2,
+0x3fb2,0x4944,0xc9cd,0x3c51,
+0x3ff0,0x0000,0x0000,0x0000
+};
+#define MAXGAM 171.624376956302725
+#endif 
+
+/* Stirling's formula for the gamma function */
+#if UNK
+static const double STIR[5] = {
+ 7.87311395793093628397E-4,
+-2.29549961613378126380E-4,
+-2.68132617805781232825E-3,
+ 3.47222221605458667310E-3,
+ 8.33333333333482257126E-2,
+};
+#define MAXSTIR 143.01608
+static const double SQTPI = 2.50662827463100050242E0;
+#endif
+#if DEC
+static const unsigned short STIR[20] = {
+0035516,0061622,0144553,0112224,
+0135160,0131531,0037460,0165740,
+0136057,0134460,0037242,0077270,
+0036143,0107070,0156306,0027751,
+0037252,0125252,0125252,0146064,
+};
+#define MAXSTIR 26.77
+static const unsigned short SQT[4] = {
+0040440,0066230,0177661,0034055,
+};
+#define SQTPI *(double *)SQT
+#endif
+#if IBMPC
+static const unsigned short STIR[20] = {
+0x7293,0x592d,0xcc72,0x3f49,
+0x1d7c,0x27e6,0x166b,0xbf2e,
+0x4fd7,0x07d4,0xf726,0xbf65,
+0xc5fd,0x1b98,0x71c7,0x3f6c,
+0x5986,0x5555,0x5555,0x3fb5,
+};
+#define MAXSTIR 143.01608
+
+static const union
+{
+  unsigned short s[4];
+  double d;
+} sqt = {{0x2706,0x1ff6,0x0d93,0x4004}};
+#define SQTPI (sqt.d)
+#endif
+#if MIEEE
+static const unsigned short STIR[20] = {
+0x3f49,0xcc72,0x592d,0x7293,
+0xbf2e,0x166b,0x27e6,0x1d7c,
+0xbf65,0xf726,0x07d4,0x4fd7,
+0x3f6c,0x71c7,0x1b98,0xc5fd,
+0x3fb5,0x5555,0x5555,0x5986,
+};
+#define MAXSTIR 143.01608
+static const unsigned short SQT[4] = {
+0x4004,0x0d93,0x1ff6,0x2706,
+};
+#define SQTPI *(double *)SQT
+#endif
+
+static double stirf ( double );
+
+/* Gamma function computed by Stirling's formula.
+ * The polynomial STIR is valid for 33 <= x <= 172.
+ */
+static double stirf(x)
+double x;
+{
+double y, w, v;
+
+w = 1.0/x;
+w = 1.0 + w * polevl( w, STIR, 4 );
+y = exp(x);
+if( x > MAXSTIR )
+	{ /* Avoid overflow in pow() */
+	v = pow( x, 0.5 * x - 0.25 );
+	y = v * (v / y);
+	}
+else
+	{
+	y = pow( x, x - 0.5 ) / y;
+	}
+y = SQTPI * y * w;
+return( y );
+}
+
+
+
+double __tgamma_r(double x, int* sgngam)
+{
+double p, q, z;
+int i;
+
+*sgngam = 1;
+#ifdef NANS
+if( isnan(x) )
+	return(x);
+#endif
+#ifdef INFINITIES
+#ifdef NANS
+if( x == INFINITY )
+	return(x);
+if( x == -INFINITY )
+	return(NAN);
+#else
+if( !isfinite(x) )
+	return(x);
+#endif
+#endif
+q = fabs(x);
+
+if( q > 33.0 )
+	{
+	if( x < 0.0 )
+		{
+		p = floor(q);
+		if( p == q )
+			{
+gsing:
+			_SET_ERRNO(EDOM);
+			mtherr( "tgamma", SING );
+#ifdef INFINITIES
+			return (INFINITY);
+#else
+			return (MAXNUM);
+#endif
+			}
+		i = p;
+		if( (i & 1) == 0 )
+			*sgngam = -1;
+		z = q - p;
+		if( z > 0.5 )
+			{
+			p += 1.0;
+			z = q - p;
+			}
+		z = q * sin( PI * z );
+		if( z == 0.0 )
+			{
+			_SET_ERRNO(ERANGE);
+			mtherr( "tgamma", OVERFLOW );
+#ifdef INFINITIES
+			return( *sgngam * INFINITY);
+#else
+			return( *sgngam * MAXNUM);
+#endif
+			}
+		z = fabs(z);
+		z = PI/(z * stirf(q) );
+		}
+	else
+		{
+		z = stirf(x);
+		}
+	return( *sgngam * z );
+	}
+
+z = 1.0;
+while( x >= 3.0 )
+	{
+	x -= 1.0;
+	z *= x;
+	}
+
+while( x < 0.0 )
+	{
+	if( x > -1.E-9 )
+		goto Small;
+	z /= x;
+	x += 1.0;
+	}
+
+while( x < 2.0 )
+	{
+	if( x < 1.e-9 )
+		goto Small;
+	z /= x;
+	x += 1.0;
+	}
+
+if( x == 2.0 )
+	return(z);
+
+x -= 2.0;
+p = polevl( x, P, 6 );
+q = polevl( x, Q, 7 );
+return( z * p / q );
+
+Small:
+if( x == 0.0 )
+	{
+	goto gsing;
+	}
+else
+	return( z/((1.0 + 0.5772156649015329 * x) * x) );
+}
+
+/* This is the C99 version */
+
+double tgamma(double x)
+{
+  int local_sgngam=0;
+  return (__tgamma_r(x, &local_sgngam));
+}
diff --git a/mingw-w64-crt/math/tgammaf.c b/mingw-w64-crt/math/tgammaf.c
index a2d584f..abbe4f1 100644
--- a/mingw-w64-crt/math/tgammaf.c
+++ b/mingw-w64-crt/math/tgammaf.c
@@ -1,193 +1,193 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-/* define MAXGAM 34.84425627277176174 */

-

-/* Stirling's formula for the gamma function

- * gamma(x) = sqrt(2 pi) x^(x-.5) exp(-x) ( 1 + 1/x P(1/x) )

- * .028 < 1/x < .1

- * relative error < 1.9e-11

- */

-static const float STIR[] = {

--2.705194986674176E-003,

- 3.473255786154910E-003,

- 8.333331788340907E-002,

-};

-static const float MAXSTIR = 26.77;

-static const float SQTPIF = 2.50662827463100050242; /* sqrt( 2 pi ) */

-

-static float stirf(float);

-

-/* Gamma function computed by Stirling's formula,

- * sqrt(2 pi) x^(x-.5) exp(-x) (1 + 1/x P(1/x))

- * The polynomial STIR is valid for 33 <= x <= 172.

- */

-static float stirf( float x )

-{

-float  y, w, v;

-

-w = 1.0/x;

-w = 1.0 + w * polevlf( w, STIR, 2 );

-y = expf( -x );

-if( x > MAXSTIR )

-	{ /* Avoid overflow in pow() */

-	v = powf( x, 0.5 * x - 0.25 );

-	y *= v;

-	y *= v;

-	}

-else

-	{

-	y = powf( x, x - 0.5 ) * y;

-	}

-y = SQTPIF * y * w;

-return( y );

-}

-

-

-/* gamma(x+2), 0 < x < 1 */

-static const float P[] = {

- 1.536830450601906E-003,

- 5.397581592950993E-003,

- 4.130370201859976E-003,

- 7.232307985516519E-002,

- 8.203960091619193E-002,

- 4.117857447645796E-001,

- 4.227867745131584E-001,

- 9.999999822945073E-001,

-};

-

-float __tgammaf_r( float x, int* sgngamf)

-{

-float p, q, z, nz;

-int i, direction, negative;

-

-#ifdef NANS

-if( isnan(x) )

-	return(x);

-#endif

-#ifdef INFINITIES

-#ifdef NANS

-if( x == INFINITYF )

-	return(x);

-if( x == -INFINITYF )

-	return(NANF);

-#else

-if( !isfinite(x) )

-	return(x);

-#endif

-#endif

-

-*sgngamf = 1;

-negative = 0;

-nz = 0.0;

-if( x < 0.0 )

-	{

-	negative = 1;

-	q = -x;

-	p = floorf(q);

-	if( p == q )

-		{

-gsing:

-		_SET_ERRNO(EDOM);

-		mtherr( "tgammaf", SING );

-#ifdef INFINITIES

-		return (INFINITYF);

-#else

-		return (MAXNUMF);

-#endif

-			}

-	i = p;

-	if( (i & 1) == 0 )

-		*sgngamf = -1;

-	nz = q - p;

-	if( nz > 0.5 )

-		{

-		p += 1.0;

-		nz = q - p;

-		}

-	nz = q * sinf( PIF * nz );

-	if( nz == 0.0 )

-		{

-		_SET_ERRNO(ERANGE);

-		mtherr( "tgamma", OVERFLOW );

-#ifdef INFINITIES

-		return( *sgngamf * INFINITYF);

-#else

-		return( *sgngamf * MAXNUMF);

-#endif

-		}

-	if( nz < 0 )

-		nz = -nz;

-	x = q;

-	}

-if( x >= 10.0 )

-	{

-	z = stirf(x);

-	}

-if( x < 2.0 )

-	direction = 1;

-else

-	direction = 0;

-z = 1.0;

-while( x >= 3.0 )

-	{

-	x -= 1.0;

-	z *= x;

-	}

-/*

-while( x < 0.0 )

-	{

-	if( x > -1.E-4 )

-		goto Small;

-	z *=x;

-	x += 1.0;

-	}

-*/

-while( x < 2.0 )

-	{

-	if( x < 1.e-4 )

-		goto Small;

-	z *=x;

-	x += 1.0;

-	}

-

-if( direction )

-	z = 1.0/z;

-

-if( x == 2.0 )

-	return(z);

-

-x -= 2.0;

-p = z * polevlf( x, P, 7 );

-

-gdone:

-

-if( negative )

-	{

-	p = *sgngamf * PIF/(nz * p );

-	}

-return(p);

-

-Small:

-if( x == 0.0 )

-	{

-	goto gsing;

-	}

-else

-	{

-	p = z / ((1.0 + 0.5772156649015329 * x) * x);

-	goto gdone;

-	}

-}

-

-/* This is the C99 version */

-

-float tgammaf(float x)

-{

-  int local_sgngamf=0;

-  return (__tgammaf_r(x, &local_sgngamf));

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+/* define MAXGAM 34.84425627277176174 */
+
+/* Stirling's formula for the gamma function
+ * gamma(x) = sqrt(2 pi) x^(x-.5) exp(-x) ( 1 + 1/x P(1/x) )
+ * .028 < 1/x < .1
+ * relative error < 1.9e-11
+ */
+static const float STIR[] = {
+-2.705194986674176E-003,
+ 3.473255786154910E-003,
+ 8.333331788340907E-002,
+};
+static const float MAXSTIR = 26.77;
+static const float SQTPIF = 2.50662827463100050242; /* sqrt( 2 pi ) */
+
+static float stirf(float);
+
+/* Gamma function computed by Stirling's formula,
+ * sqrt(2 pi) x^(x-.5) exp(-x) (1 + 1/x P(1/x))
+ * The polynomial STIR is valid for 33 <= x <= 172.
+ */
+static float stirf( float x )
+{
+float  y, w, v;
+
+w = 1.0/x;
+w = 1.0 + w * polevlf( w, STIR, 2 );
+y = expf( -x );
+if( x > MAXSTIR )
+	{ /* Avoid overflow in pow() */
+	v = powf( x, 0.5 * x - 0.25 );
+	y *= v;
+	y *= v;
+	}
+else
+	{
+	y = powf( x, x - 0.5 ) * y;
+	}
+y = SQTPIF * y * w;
+return( y );
+}
+
+
+/* gamma(x+2), 0 < x < 1 */
+static const float P[] = {
+ 1.536830450601906E-003,
+ 5.397581592950993E-003,
+ 4.130370201859976E-003,
+ 7.232307985516519E-002,
+ 8.203960091619193E-002,
+ 4.117857447645796E-001,
+ 4.227867745131584E-001,
+ 9.999999822945073E-001,
+};
+
+float __tgammaf_r( float x, int* sgngamf)
+{
+float p, q, z, nz;
+int i, direction, negative;
+
+#ifdef NANS
+if( isnan(x) )
+	return(x);
+#endif
+#ifdef INFINITIES
+#ifdef NANS
+if( x == INFINITYF )
+	return(x);
+if( x == -INFINITYF )
+	return(NANF);
+#else
+if( !isfinite(x) )
+	return(x);
+#endif
+#endif
+
+*sgngamf = 1;
+negative = 0;
+nz = 0.0;
+if( x < 0.0 )
+	{
+	negative = 1;
+	q = -x;
+	p = floorf(q);
+	if( p == q )
+		{
+gsing:
+		_SET_ERRNO(EDOM);
+		mtherr( "tgammaf", SING );
+#ifdef INFINITIES
+		return (INFINITYF);
+#else
+		return (MAXNUMF);
+#endif
+			}
+	i = p;
+	if( (i & 1) == 0 )
+		*sgngamf = -1;
+	nz = q - p;
+	if( nz > 0.5 )
+		{
+		p += 1.0;
+		nz = q - p;
+		}
+	nz = q * sinf( PIF * nz );
+	if( nz == 0.0 )
+		{
+		_SET_ERRNO(ERANGE);
+		mtherr( "tgamma", OVERFLOW );
+#ifdef INFINITIES
+		return( *sgngamf * INFINITYF);
+#else
+		return( *sgngamf * MAXNUMF);
+#endif
+		}
+	if( nz < 0 )
+		nz = -nz;
+	x = q;
+	}
+if( x >= 10.0 )
+	{
+	z = stirf(x);
+	}
+if( x < 2.0 )
+	direction = 1;
+else
+	direction = 0;
+z = 1.0;
+while( x >= 3.0 )
+	{
+	x -= 1.0;
+	z *= x;
+	}
+/*
+while( x < 0.0 )
+	{
+	if( x > -1.E-4 )
+		goto Small;
+	z *=x;
+	x += 1.0;
+	}
+*/
+while( x < 2.0 )
+	{
+	if( x < 1.e-4 )
+		goto Small;
+	z *=x;
+	x += 1.0;
+	}
+
+if( direction )
+	z = 1.0/z;
+
+if( x == 2.0 )
+	return(z);
+
+x -= 2.0;
+p = z * polevlf( x, P, 7 );
+
+gdone:
+
+if( negative )
+	{
+	p = *sgngamf * PIF/(nz * p );
+	}
+return(p);
+
+Small:
+if( x == 0.0 )
+	{
+	goto gsing;
+	}
+else
+	{
+	p = z / ((1.0 + 0.5772156649015329 * x) * x);
+	goto gdone;
+	}
+}
+
+/* This is the C99 version */
+
+float tgammaf(float x)
+{
+  int local_sgngamf=0;
+  return (__tgammaf_r(x, &local_sgngamf));
+}
diff --git a/mingw-w64-crt/math/tgammal.c b/mingw-w64-crt/math/tgammal.c
index aec208f..24cfdd0 100644
--- a/mingw-w64-crt/math/tgammal.c
+++ b/mingw-w64-crt/math/tgammal.c
@@ -1,417 +1,417 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include "cephes_mconf.h"

-

-/*

-gamma(x+2)  = gamma(x+2) P(x)/Q(x)

-0 <= x <= 1

-Relative error

-n=7, d=8

-Peak error =  1.83e-20

-Relative error spread =  8.4e-23

-*/

-

-#if UNK

-static const long double P[8] = {

- 4.212760487471622013093E-5L,

- 4.542931960608009155600E-4L,

- 4.092666828394035500949E-3L,

- 2.385363243461108252554E-2L,

- 1.113062816019361559013E-1L,

- 3.629515436640239168939E-1L,

- 8.378004301573126728826E-1L,

- 1.000000000000000000009E0L,

-};

-static const long double Q[9] = {

--1.397148517476170440917E-5L,

- 2.346584059160635244282E-4L,

--1.237799246653152231188E-3L,

--7.955933682494738320586E-4L,

- 2.773706565840072979165E-2L,

--4.633887671244534213831E-2L,

--2.243510905670329164562E-1L,

- 4.150160950588455434583E-1L,

- 9.999999999999999999908E-1L,

-};

-#endif

-#if IBMPC

-static const unsigned short P[] = {

-0x434a,0x3f22,0x2bda,0xb0b2,0x3ff0, XPD

-0xf5aa,0xe82f,0x335b,0xee2e,0x3ff3, XPD

-0xbe6c,0x3757,0xc717,0x861b,0x3ff7, XPD

-0x7f43,0x5196,0xb166,0xc368,0x3ff9, XPD

-0x9549,0x8eb5,0x8c3a,0xe3f4,0x3ffb, XPD

-0x8d75,0x23af,0xc8e4,0xb9d4,0x3ffd, XPD

-0x29cf,0x19b3,0x16c8,0xd67a,0x3ffe, XPD

-0x0000,0x0000,0x0000,0x8000,0x3fff, XPD

-};

-static const unsigned short Q[] = {

-0x5473,0x2de8,0x1268,0xea67,0xbfee, XPD

-0x334b,0xc2f0,0xa2dd,0xf60e,0x3ff2, XPD

-0xbeed,0x1853,0xa691,0xa23d,0xbff5, XPD

-0x296e,0x7cb1,0x5dfd,0xd08f,0xbff4, XPD

-0x0417,0x7989,0xd7bc,0xe338,0x3ff9, XPD

-0x3295,0x3698,0xd580,0xbdcd,0xbffa, XPD

-0x75ef,0x3ab7,0x4ad3,0xe5bc,0xbffc, XPD

-0xe458,0x2ec7,0xfd57,0xd47c,0x3ffd, XPD

-0x0000,0x0000,0x0000,0x8000,0x3fff, XPD

-};

-#endif

-#if MIEEE

-static const long P[24] = {

-0x3ff00000,0xb0b22bda,0x3f22434a,

-0x3ff30000,0xee2e335b,0xe82ff5aa,

-0x3ff70000,0x861bc717,0x3757be6c,

-0x3ff90000,0xc368b166,0x51967f43,

-0x3ffb0000,0xe3f48c3a,0x8eb59549,

-0x3ffd0000,0xb9d4c8e4,0x23af8d75,

-0x3ffe0000,0xd67a16c8,0x19b329cf,

-0x3fff0000,0x80000000,0x00000000,

-};

-static const long Q[27] = {

-0xbfee0000,0xea671268,0x2de85473,

-0x3ff20000,0xf60ea2dd,0xc2f0334b,

-0xbff50000,0xa23da691,0x1853beed,

-0xbff40000,0xd08f5dfd,0x7cb1296e,

-0x3ff90000,0xe338d7bc,0x79890417,

-0xbffa0000,0xbdcdd580,0x36983295,

-0xbffc0000,0xe5bc4ad3,0x3ab775ef,

-0x3ffd0000,0xd47cfd57,0x2ec7e458,

-0x3fff0000,0x80000000,0x00000000,

-};

-#endif

-/*

-static const long double P[] = {

--3.01525602666895735709e0L,

--3.25157411956062339893e1L,

--2.92929976820724030353e2L,

--1.70730828800510297666e3L,

--7.96667499622741999770e3L,

--2.59780216007146401957e4L,

--5.99650230220855581642e4L,

--7.15743521530849602425e4L

-};

-static const long double Q[] = {

- 1.00000000000000000000e0L,

--1.67955233807178858919e1L,

- 8.85946791747759881659e1L,

- 5.69440799097468430177e1L,

--1.98526250512761318471e3L,

- 3.31667508019495079814e3L,

- 1.60577839621734713377e4L,

--2.97045081369399940529e4L,

--7.15743521530849602412e4L

-};

-*/

-#define MAXGAML 1755.455L

-/*static const long double LOGPI = 1.14472988584940017414L;*/

-

-/* Stirling's formula for the gamma function

-gamma(x) = sqrt(2 pi) x^(x-.5) exp(-x) (1 + 1/x P(1/x))

-z(x) = x

-13 <= x <= 1024

-Relative error

-n=8, d=0

-Peak error =  9.44e-21

-Relative error spread =  8.8e-4

-*/

-#if UNK

-static const long double STIR[9] = {

- 7.147391378143610789273E-4L,

--2.363848809501759061727E-5L,

--5.950237554056330156018E-4L,

- 6.989332260623193171870E-5L,

- 7.840334842744753003862E-4L,

--2.294719747873185405699E-4L,

--2.681327161876304418288E-3L,

- 3.472222222230075327854E-3L,

- 8.333333333333331800504E-2L,

-};

-#endif

-#if IBMPC

-static const unsigned short STIR[] = {

-0x6ede,0x69f7,0x54e3,0xbb5d,0x3ff4, XPD

-0xc395,0x0295,0x4443,0xc64b,0xbfef, XPD

-0xba6f,0x7c59,0x5e47,0x9bfb,0xbff4, XPD

-0x5704,0x1a39,0xb11d,0x9293,0x3ff1, XPD

-0x30b7,0x1a21,0x98b2,0xcd87,0x3ff4, XPD

-0xbef3,0x7023,0x6a08,0xf09e,0xbff2, XPD

-0x3a1c,0x5ac8,0x3478,0xafb9,0xbff6, XPD

-0xc3c9,0x906e,0x38e3,0xe38e,0x3ff6, XPD

-0xa1d5,0xaaaa,0xaaaa,0xaaaa,0x3ffb, XPD

-};

-#endif

-#if MIEEE

-static const long STIR[27] = {

-0x3ff40000,0xbb5d54e3,0x69f76ede,

-0xbfef0000,0xc64b4443,0x0295c395,

-0xbff40000,0x9bfb5e47,0x7c59ba6f,

-0x3ff10000,0x9293b11d,0x1a395704,

-0x3ff40000,0xcd8798b2,0x1a2130b7,

-0xbff20000,0xf09e6a08,0x7023bef3,

-0xbff60000,0xafb93478,0x5ac83a1c,

-0x3ff60000,0xe38e38e3,0x906ec3c9,

-0x3ffb0000,0xaaaaaaaa,0xaaaaa1d5,

-};

-#endif

-#define MAXSTIR 1024.0L

-static const long double SQTPI = 2.50662827463100050242E0L;

-

-/* 1/gamma(x) = z P(z)

- * z(x) = 1/x

- * 0 < x < 0.03125

- * Peak relative error 4.2e-23

- */

-#if UNK

-static const long double S[9] = {

--1.193945051381510095614E-3L,

- 7.220599478036909672331E-3L,

--9.622023360406271645744E-3L,

--4.219773360705915470089E-2L,

- 1.665386113720805206758E-1L,

--4.200263503403344054473E-2L,

--6.558780715202540684668E-1L,

- 5.772156649015328608253E-1L,

- 1.000000000000000000000E0L,

-};

-#endif

-#if IBMPC

-static const unsigned short S[] = {

-0xbaeb,0xd6d3,0x25e5,0x9c7e,0xbff5, XPD

-0xfe9a,0xceb4,0xc74e,0xec9a,0x3ff7, XPD

-0x9225,0xdfef,0xb0e9,0x9da5,0xbff8, XPD

-0x10b0,0xec17,0x87dc,0xacd7,0xbffa, XPD

-0x6b8d,0x7515,0x1905,0xaa89,0x3ffc, XPD

-0xf183,0x126b,0xf47d,0xac0a,0xbffa, XPD

-0x7bf6,0x57d1,0xa013,0xa7e7,0xbffe, XPD

-0xc7a9,0x7db0,0x67e3,0x93c4,0x3ffe, XPD

-0x0000,0x0000,0x0000,0x8000,0x3fff, XPD

-};

-#endif

-#if MIEEE

-static const long S[27] = {

-0xbff50000,0x9c7e25e5,0xd6d3baeb,

-0x3ff70000,0xec9ac74e,0xceb4fe9a,

-0xbff80000,0x9da5b0e9,0xdfef9225,

-0xbffa0000,0xacd787dc,0xec1710b0,

-0x3ffc0000,0xaa891905,0x75156b8d,

-0xbffa0000,0xac0af47d,0x126bf183,

-0xbffe0000,0xa7e7a013,0x57d17bf6,

-0x3ffe0000,0x93c467e3,0x7db0c7a9,

-0x3fff0000,0x80000000,0x00000000,

-};

-#endif

-/* 1/gamma(-x) = z P(z)

- * z(x) = 1/x

- * 0 < x < 0.03125

- * Peak relative error 5.16e-23

- * Relative error spread =  2.5e-24

- */

-#if UNK

-static const long double SN[9] = {

- 1.133374167243894382010E-3L,

- 7.220837261893170325704E-3L,

- 9.621911155035976733706E-3L,

--4.219773343731191721664E-2L,

--1.665386113944413519335E-1L,

--4.200263503402112910504E-2L,

- 6.558780715202536547116E-1L,

- 5.772156649015328608727E-1L,

--1.000000000000000000000E0L,

-};

-#endif

-#if IBMPC

-static const unsigned short SN[] = {

-0x5dd1,0x02de,0xb9f7,0x948d,0x3ff5, XPD

-0x989b,0xdd68,0xc5f1,0xec9c,0x3ff7, XPD

-0x2ca1,0x18f0,0x386f,0x9da5,0x3ff8, XPD

-0x783f,0x41dd,0x87d1,0xacd7,0xbffa, XPD

-0x7a5b,0xd76d,0x1905,0xaa89,0xbffc, XPD

-0x7f64,0x1234,0xf47d,0xac0a,0xbffa, XPD

-0x5e26,0x57d1,0xa013,0xa7e7,0x3ffe, XPD

-0xc7aa,0x7db0,0x67e3,0x93c4,0x3ffe, XPD

-0x0000,0x0000,0x0000,0x8000,0xbfff, XPD

-};

-#endif

-#if MIEEE

-static const long SN[27] = {

-0x3ff50000,0x948db9f7,0x02de5dd1,

-0x3ff70000,0xec9cc5f1,0xdd68989b,

-0x3ff80000,0x9da5386f,0x18f02ca1,

-0xbffa0000,0xacd787d1,0x41dd783f,

-0xbffc0000,0xaa891905,0xd76d7a5b,

-0xbffa0000,0xac0af47d,0x12347f64,

-0x3ffe0000,0xa7e7a013,0x57d15e26,

-0x3ffe0000,0x93c467e3,0x7db0c7aa,

-0xbfff0000,0x80000000,0x00000000,

-};

-#endif

-

-static long double stirf ( long double );

-

-/* Gamma function computed by Stirling's formula.  */

-

-static long double stirf(x)

-long double x;

-{

-long double y, w, v;

-

-w = 1.0L/x;

-/* For large x, use rational coefficients from the analytical expansion.  */

-if( x > 1024.0L )

-	w = (((((6.97281375836585777429E-5L * w

-		+ 7.84039221720066627474E-4L) * w

-		- 2.29472093621399176955E-4L) * w

-		- 2.68132716049382716049E-3L) * w

-		+ 3.47222222222222222222E-3L) * w

-		+ 8.33333333333333333333E-2L) * w

-		+ 1.0L;

-else

-	w = 1.0L + w * polevll( w, STIR, 8 );

-y = expl(x);

-if( x > MAXSTIR )

-	{ /* Avoid overflow in pow() */

-	v = powl( x, 0.5L * x - 0.25L );

-	y = v * (v / y);

-	}

-else

-	{

-	y = powl( x, x - 0.5L ) / y;

-	}

-y = SQTPI * y * w;

-return( y );

-}

-

-

-long double __tgammal_r(long double x, int* sgngaml)

-{

-long double p, q, z;

-int i;

-

-*sgngaml = 1;

-#ifdef NANS

-if( isnanl(x) )

-	return(NANL);

-#endif

-#ifdef INFINITIES

-#ifdef NANS

-if( x == INFINITYL )

-	return(x);

-if( x == -INFINITYL )

-	return(NANL);

-#else

-if( !isfinite(x) )

-	return(x);

-#endif

-#endif

-q = fabsl(x);

-

-if( q > 13.0L )

-	{

-	if( q > MAXGAML )

-		goto goverf;

-	if( x < 0.0L )

-		{

-		p = floorl(q);

-		if( p == q )

-			{

-gsing:

-			_SET_ERRNO(EDOM);

-			mtherr( "tgammal", SING );

-#ifdef INFINITIES

-			return (INFINITYL);

-#else

-			return( *sgngaml * MAXNUML);

-#endif

-			}

-		i = p;

-		if( (i & 1) == 0 )

-			*sgngaml = -1;

-		z = q - p;

-		if( z > 0.5L )

-			{

-			p += 1.0L;

-			z = q - p;

-			}

-		z = q * sinl( PIL * z );

-		z = fabsl(z) * stirf(q);

-		if( z <= PIL/MAXNUML )

-			{

-goverf:

-			_SET_ERRNO(ERANGE);

-			mtherr( "tgammal", OVERFLOW );

-#ifdef INFINITIES

-			return( *sgngaml * INFINITYL);

-#else

-			return( *sgngaml * MAXNUML);

-#endif

-			}

-		z = PIL/z;

-		}

-	else

-		{

-		z = stirf(x);

-		}

-	return( *sgngaml * z );

-	}

-

-z = 1.0L;

-while( x >= 3.0L )

-	{

-	x -= 1.0L;

-	z *= x;

-	}

-

-while( x < -0.03125L )

-	{

-	z /= x;

-	x += 1.0L;

-	}

-

-if( x <= 0.03125L )

-	goto Small;

-

-while( x < 2.0L )

-	{

-	z /= x;

-	x += 1.0L;

-	}

-

-if( x == 2.0L )

-	return(z);

-

-x -= 2.0L;

-p = polevll( x, P, 7 );

-q = polevll( x, Q, 8 );

-return( z * p / q );

-

-Small:

-if( x == 0.0L )

-	{

-	goto gsing;

-	}

-else

-	{

-	if( x < 0.0L )

-		{

-		x = -x;

-		q = z / (x * polevll( x, SN, 8 ));

-		}

-	else

-		q = z / (x * polevll( x, S, 8 ));

-	}

-return q;

-}

-

-

-/* This is the C99 version. */

-

-long double tgammal(long double x)

-{

-  int local_sgngaml=0;

-  return (__tgammal_r(x, &local_sgngaml));

-}

-

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include "cephes_mconf.h"
+
+/*
+gamma(x+2)  = gamma(x+2) P(x)/Q(x)
+0 <= x <= 1
+Relative error
+n=7, d=8
+Peak error =  1.83e-20
+Relative error spread =  8.4e-23
+*/
+
+#if UNK
+static const long double P[8] = {
+ 4.212760487471622013093E-5L,
+ 4.542931960608009155600E-4L,
+ 4.092666828394035500949E-3L,
+ 2.385363243461108252554E-2L,
+ 1.113062816019361559013E-1L,
+ 3.629515436640239168939E-1L,
+ 8.378004301573126728826E-1L,
+ 1.000000000000000000009E0L,
+};
+static const long double Q[9] = {
+-1.397148517476170440917E-5L,
+ 2.346584059160635244282E-4L,
+-1.237799246653152231188E-3L,
+-7.955933682494738320586E-4L,
+ 2.773706565840072979165E-2L,
+-4.633887671244534213831E-2L,
+-2.243510905670329164562E-1L,
+ 4.150160950588455434583E-1L,
+ 9.999999999999999999908E-1L,
+};
+#endif
+#if IBMPC
+static const unsigned short P[] = {
+0x434a,0x3f22,0x2bda,0xb0b2,0x3ff0, XPD
+0xf5aa,0xe82f,0x335b,0xee2e,0x3ff3, XPD
+0xbe6c,0x3757,0xc717,0x861b,0x3ff7, XPD
+0x7f43,0x5196,0xb166,0xc368,0x3ff9, XPD
+0x9549,0x8eb5,0x8c3a,0xe3f4,0x3ffb, XPD
+0x8d75,0x23af,0xc8e4,0xb9d4,0x3ffd, XPD
+0x29cf,0x19b3,0x16c8,0xd67a,0x3ffe, XPD
+0x0000,0x0000,0x0000,0x8000,0x3fff, XPD
+};
+static const unsigned short Q[] = {
+0x5473,0x2de8,0x1268,0xea67,0xbfee, XPD
+0x334b,0xc2f0,0xa2dd,0xf60e,0x3ff2, XPD
+0xbeed,0x1853,0xa691,0xa23d,0xbff5, XPD
+0x296e,0x7cb1,0x5dfd,0xd08f,0xbff4, XPD
+0x0417,0x7989,0xd7bc,0xe338,0x3ff9, XPD
+0x3295,0x3698,0xd580,0xbdcd,0xbffa, XPD
+0x75ef,0x3ab7,0x4ad3,0xe5bc,0xbffc, XPD
+0xe458,0x2ec7,0xfd57,0xd47c,0x3ffd, XPD
+0x0000,0x0000,0x0000,0x8000,0x3fff, XPD
+};
+#endif
+#if MIEEE
+static const long P[24] = {
+0x3ff00000,0xb0b22bda,0x3f22434a,
+0x3ff30000,0xee2e335b,0xe82ff5aa,
+0x3ff70000,0x861bc717,0x3757be6c,
+0x3ff90000,0xc368b166,0x51967f43,
+0x3ffb0000,0xe3f48c3a,0x8eb59549,
+0x3ffd0000,0xb9d4c8e4,0x23af8d75,
+0x3ffe0000,0xd67a16c8,0x19b329cf,
+0x3fff0000,0x80000000,0x00000000,
+};
+static const long Q[27] = {
+0xbfee0000,0xea671268,0x2de85473,
+0x3ff20000,0xf60ea2dd,0xc2f0334b,
+0xbff50000,0xa23da691,0x1853beed,
+0xbff40000,0xd08f5dfd,0x7cb1296e,
+0x3ff90000,0xe338d7bc,0x79890417,
+0xbffa0000,0xbdcdd580,0x36983295,
+0xbffc0000,0xe5bc4ad3,0x3ab775ef,
+0x3ffd0000,0xd47cfd57,0x2ec7e458,
+0x3fff0000,0x80000000,0x00000000,
+};
+#endif
+/*
+static const long double P[] = {
+-3.01525602666895735709e0L,
+-3.25157411956062339893e1L,
+-2.92929976820724030353e2L,
+-1.70730828800510297666e3L,
+-7.96667499622741999770e3L,
+-2.59780216007146401957e4L,
+-5.99650230220855581642e4L,
+-7.15743521530849602425e4L
+};
+static const long double Q[] = {
+ 1.00000000000000000000e0L,
+-1.67955233807178858919e1L,
+ 8.85946791747759881659e1L,
+ 5.69440799097468430177e1L,
+-1.98526250512761318471e3L,
+ 3.31667508019495079814e3L,
+ 1.60577839621734713377e4L,
+-2.97045081369399940529e4L,
+-7.15743521530849602412e4L
+};
+*/
+#define MAXGAML 1755.455L
+/*static const long double LOGPI = 1.14472988584940017414L;*/
+
+/* Stirling's formula for the gamma function
+gamma(x) = sqrt(2 pi) x^(x-.5) exp(-x) (1 + 1/x P(1/x))
+z(x) = x
+13 <= x <= 1024
+Relative error
+n=8, d=0
+Peak error =  9.44e-21
+Relative error spread =  8.8e-4
+*/
+#if UNK
+static const long double STIR[9] = {
+ 7.147391378143610789273E-4L,
+-2.363848809501759061727E-5L,
+-5.950237554056330156018E-4L,
+ 6.989332260623193171870E-5L,
+ 7.840334842744753003862E-4L,
+-2.294719747873185405699E-4L,
+-2.681327161876304418288E-3L,
+ 3.472222222230075327854E-3L,
+ 8.333333333333331800504E-2L,
+};
+#endif
+#if IBMPC
+static const unsigned short STIR[] = {
+0x6ede,0x69f7,0x54e3,0xbb5d,0x3ff4, XPD
+0xc395,0x0295,0x4443,0xc64b,0xbfef, XPD
+0xba6f,0x7c59,0x5e47,0x9bfb,0xbff4, XPD
+0x5704,0x1a39,0xb11d,0x9293,0x3ff1, XPD
+0x30b7,0x1a21,0x98b2,0xcd87,0x3ff4, XPD
+0xbef3,0x7023,0x6a08,0xf09e,0xbff2, XPD
+0x3a1c,0x5ac8,0x3478,0xafb9,0xbff6, XPD
+0xc3c9,0x906e,0x38e3,0xe38e,0x3ff6, XPD
+0xa1d5,0xaaaa,0xaaaa,0xaaaa,0x3ffb, XPD
+};
+#endif
+#if MIEEE
+static const long STIR[27] = {
+0x3ff40000,0xbb5d54e3,0x69f76ede,
+0xbfef0000,0xc64b4443,0x0295c395,
+0xbff40000,0x9bfb5e47,0x7c59ba6f,
+0x3ff10000,0x9293b11d,0x1a395704,
+0x3ff40000,0xcd8798b2,0x1a2130b7,
+0xbff20000,0xf09e6a08,0x7023bef3,
+0xbff60000,0xafb93478,0x5ac83a1c,
+0x3ff60000,0xe38e38e3,0x906ec3c9,
+0x3ffb0000,0xaaaaaaaa,0xaaaaa1d5,
+};
+#endif
+#define MAXSTIR 1024.0L
+static const long double SQTPI = 2.50662827463100050242E0L;
+
+/* 1/gamma(x) = z P(z)
+ * z(x) = 1/x
+ * 0 < x < 0.03125
+ * Peak relative error 4.2e-23
+ */
+#if UNK
+static const long double S[9] = {
+-1.193945051381510095614E-3L,
+ 7.220599478036909672331E-3L,
+-9.622023360406271645744E-3L,
+-4.219773360705915470089E-2L,
+ 1.665386113720805206758E-1L,
+-4.200263503403344054473E-2L,
+-6.558780715202540684668E-1L,
+ 5.772156649015328608253E-1L,
+ 1.000000000000000000000E0L,
+};
+#endif
+#if IBMPC
+static const unsigned short S[] = {
+0xbaeb,0xd6d3,0x25e5,0x9c7e,0xbff5, XPD
+0xfe9a,0xceb4,0xc74e,0xec9a,0x3ff7, XPD
+0x9225,0xdfef,0xb0e9,0x9da5,0xbff8, XPD
+0x10b0,0xec17,0x87dc,0xacd7,0xbffa, XPD
+0x6b8d,0x7515,0x1905,0xaa89,0x3ffc, XPD
+0xf183,0x126b,0xf47d,0xac0a,0xbffa, XPD
+0x7bf6,0x57d1,0xa013,0xa7e7,0xbffe, XPD
+0xc7a9,0x7db0,0x67e3,0x93c4,0x3ffe, XPD
+0x0000,0x0000,0x0000,0x8000,0x3fff, XPD
+};
+#endif
+#if MIEEE
+static const long S[27] = {
+0xbff50000,0x9c7e25e5,0xd6d3baeb,
+0x3ff70000,0xec9ac74e,0xceb4fe9a,
+0xbff80000,0x9da5b0e9,0xdfef9225,
+0xbffa0000,0xacd787dc,0xec1710b0,
+0x3ffc0000,0xaa891905,0x75156b8d,
+0xbffa0000,0xac0af47d,0x126bf183,
+0xbffe0000,0xa7e7a013,0x57d17bf6,
+0x3ffe0000,0x93c467e3,0x7db0c7a9,
+0x3fff0000,0x80000000,0x00000000,
+};
+#endif
+/* 1/gamma(-x) = z P(z)
+ * z(x) = 1/x
+ * 0 < x < 0.03125
+ * Peak relative error 5.16e-23
+ * Relative error spread =  2.5e-24
+ */
+#if UNK
+static const long double SN[9] = {
+ 1.133374167243894382010E-3L,
+ 7.220837261893170325704E-3L,
+ 9.621911155035976733706E-3L,
+-4.219773343731191721664E-2L,
+-1.665386113944413519335E-1L,
+-4.200263503402112910504E-2L,
+ 6.558780715202536547116E-1L,
+ 5.772156649015328608727E-1L,
+-1.000000000000000000000E0L,
+};
+#endif
+#if IBMPC
+static const unsigned short SN[] = {
+0x5dd1,0x02de,0xb9f7,0x948d,0x3ff5, XPD
+0x989b,0xdd68,0xc5f1,0xec9c,0x3ff7, XPD
+0x2ca1,0x18f0,0x386f,0x9da5,0x3ff8, XPD
+0x783f,0x41dd,0x87d1,0xacd7,0xbffa, XPD
+0x7a5b,0xd76d,0x1905,0xaa89,0xbffc, XPD
+0x7f64,0x1234,0xf47d,0xac0a,0xbffa, XPD
+0x5e26,0x57d1,0xa013,0xa7e7,0x3ffe, XPD
+0xc7aa,0x7db0,0x67e3,0x93c4,0x3ffe, XPD
+0x0000,0x0000,0x0000,0x8000,0xbfff, XPD
+};
+#endif
+#if MIEEE
+static const long SN[27] = {
+0x3ff50000,0x948db9f7,0x02de5dd1,
+0x3ff70000,0xec9cc5f1,0xdd68989b,
+0x3ff80000,0x9da5386f,0x18f02ca1,
+0xbffa0000,0xacd787d1,0x41dd783f,
+0xbffc0000,0xaa891905,0xd76d7a5b,
+0xbffa0000,0xac0af47d,0x12347f64,
+0x3ffe0000,0xa7e7a013,0x57d15e26,
+0x3ffe0000,0x93c467e3,0x7db0c7aa,
+0xbfff0000,0x80000000,0x00000000,
+};
+#endif
+
+static long double stirf ( long double );
+
+/* Gamma function computed by Stirling's formula.  */
+
+static long double stirf(x)
+long double x;
+{
+long double y, w, v;
+
+w = 1.0L/x;
+/* For large x, use rational coefficients from the analytical expansion.  */
+if( x > 1024.0L )
+	w = (((((6.97281375836585777429E-5L * w
+		+ 7.84039221720066627474E-4L) * w
+		- 2.29472093621399176955E-4L) * w
+		- 2.68132716049382716049E-3L) * w
+		+ 3.47222222222222222222E-3L) * w
+		+ 8.33333333333333333333E-2L) * w
+		+ 1.0L;
+else
+	w = 1.0L + w * polevll( w, STIR, 8 );
+y = expl(x);
+if( x > MAXSTIR )
+	{ /* Avoid overflow in pow() */
+	v = powl( x, 0.5L * x - 0.25L );
+	y = v * (v / y);
+	}
+else
+	{
+	y = powl( x, x - 0.5L ) / y;
+	}
+y = SQTPI * y * w;
+return( y );
+}
+
+
+long double __tgammal_r(long double x, int* sgngaml)
+{
+long double p, q, z;
+int i;
+
+*sgngaml = 1;
+#ifdef NANS
+if( isnanl(x) )
+	return(NANL);
+#endif
+#ifdef INFINITIES
+#ifdef NANS
+if( x == INFINITYL )
+	return(x);
+if( x == -INFINITYL )
+	return(NANL);
+#else
+if( !isfinite(x) )
+	return(x);
+#endif
+#endif
+q = fabsl(x);
+
+if( q > 13.0L )
+	{
+	if( q > MAXGAML )
+		goto goverf;
+	if( x < 0.0L )
+		{
+		p = floorl(q);
+		if( p == q )
+			{
+gsing:
+			_SET_ERRNO(EDOM);
+			mtherr( "tgammal", SING );
+#ifdef INFINITIES
+			return (INFINITYL);
+#else
+			return( *sgngaml * MAXNUML);
+#endif
+			}
+		i = p;
+		if( (i & 1) == 0 )
+			*sgngaml = -1;
+		z = q - p;
+		if( z > 0.5L )
+			{
+			p += 1.0L;
+			z = q - p;
+			}
+		z = q * sinl( PIL * z );
+		z = fabsl(z) * stirf(q);
+		if( z <= PIL/MAXNUML )
+			{
+goverf:
+			_SET_ERRNO(ERANGE);
+			mtherr( "tgammal", OVERFLOW );
+#ifdef INFINITIES
+			return( *sgngaml * INFINITYL);
+#else
+			return( *sgngaml * MAXNUML);
+#endif
+			}
+		z = PIL/z;
+		}
+	else
+		{
+		z = stirf(x);
+		}
+	return( *sgngaml * z );
+	}
+
+z = 1.0L;
+while( x >= 3.0L )
+	{
+	x -= 1.0L;
+	z *= x;
+	}
+
+while( x < -0.03125L )
+	{
+	z /= x;
+	x += 1.0L;
+	}
+
+if( x <= 0.03125L )
+	goto Small;
+
+while( x < 2.0L )
+	{
+	z /= x;
+	x += 1.0L;
+	}
+
+if( x == 2.0L )
+	return(z);
+
+x -= 2.0L;
+p = polevll( x, P, 7 );
+q = polevll( x, Q, 8 );
+return( z * p / q );
+
+Small:
+if( x == 0.0L )
+	{
+	goto gsing;
+	}
+else
+	{
+	if( x < 0.0L )
+		{
+		x = -x;
+		q = z / (x * polevll( x, SN, 8 ));
+		}
+	else
+		q = z / (x * polevll( x, S, 8 ));
+	}
+return q;
+}
+
+
+/* This is the C99 version. */
+
+long double tgammal(long double x)
+{
+  int local_sgngaml=0;
+  return (__tgammal_r(x, &local_sgngaml));
+}
+
diff --git a/mingw-w64-crt/math/trunc.c b/mingw-w64-crt/math/trunc.c
index d1cd6ed..993f257 100644
--- a/mingw-w64-crt/math/trunc.c
+++ b/mingw-w64-crt/math/trunc.c
@@ -1,21 +1,21 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <fenv.h>

-#include <math.h>

-

-double

-trunc (double _x){

-  double retval;

-  unsigned short saved_cw;

-  unsigned short tmp_cw;

-  __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */

-  tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO))

-	    | FE_TOWARDZERO;

-  __asm__ ("fldcw %0;" : : "m" (tmp_cw));

-  __asm__ ("frndint;" : "=t" (retval)  : "0" (_x)); /* round towards zero */

-  __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */

-  return retval;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <fenv.h>
+#include <math.h>
+
+double
+trunc (double _x){
+  double retval;
+  unsigned short saved_cw;
+  unsigned short tmp_cw;
+  __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */
+  tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO))
+	    | FE_TOWARDZERO;
+  __asm__ ("fldcw %0;" : : "m" (tmp_cw));
+  __asm__ ("frndint;" : "=t" (retval)  : "0" (_x)); /* round towards zero */
+  __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */
+  return retval;
+}
diff --git a/mingw-w64-crt/math/truncf.c b/mingw-w64-crt/math/truncf.c
index df3f17d..fab04a1 100644
--- a/mingw-w64-crt/math/truncf.c
+++ b/mingw-w64-crt/math/truncf.c
@@ -1,22 +1,22 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <fenv.h>

-#include <math.h>

-

-float

-truncf (float _x)

-{

-  float retval;

-  unsigned short saved_cw;

-  unsigned short tmp_cw;

-  __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */

-  tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO))

-	    | FE_TOWARDZERO;

-  __asm__ ("fldcw %0;" : : "m" (tmp_cw));

-  __asm__ ("frndint;" : "=t" (retval)  : "0" (_x)); /* round towards zero */

-  __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */

-  return retval;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <fenv.h>
+#include <math.h>
+
+float
+truncf (float _x)
+{
+  float retval;
+  unsigned short saved_cw;
+  unsigned short tmp_cw;
+  __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */
+  tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO))
+	    | FE_TOWARDZERO;
+  __asm__ ("fldcw %0;" : : "m" (tmp_cw));
+  __asm__ ("frndint;" : "=t" (retval)  : "0" (_x)); /* round towards zero */
+  __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */
+  return retval;
+}
diff --git a/mingw-w64-crt/math/truncl.c b/mingw-w64-crt/math/truncl.c
index 7758635..601c0ab 100644
--- a/mingw-w64-crt/math/truncl.c
+++ b/mingw-w64-crt/math/truncl.c
@@ -1,21 +1,21 @@
-/**

- * This file has no copyright assigned and is placed in the Public Domain.

- * This file is part of the w64 mingw-runtime package.

- * No warranty is given; refer to the file DISCLAIMER within this package.

- */

-#include <fenv.h>

-#include <math.h>

-

-long double

-truncl (long double _x){

-  long double retval;

-  unsigned short saved_cw;

-  unsigned short tmp_cw;

-  __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */

-  tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO))

-	    | FE_TOWARDZERO;

-  __asm__ ("fldcw %0;" : : "m" (tmp_cw));

-  __asm__ ("frndint;" : "=t" (retval)  : "0" (_x)); /* round towards zero */

-  __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */

-  return retval;

-}

+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+#include <fenv.h>
+#include <math.h>
+
+long double
+truncl (long double _x){
+  long double retval;
+  unsigned short saved_cw;
+  unsigned short tmp_cw;
+  __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */
+  tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO))
+	    | FE_TOWARDZERO;
+  __asm__ ("fldcw %0;" : : "m" (tmp_cw));
+  __asm__ ("frndint;" : "=t" (retval)  : "0" (_x)); /* round towards zero */
+  __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */
+  return retval;
+}