Please review, i'll commit it, just need an OK.
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index c2b5ff6..90567df 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -224,14 +224,14 @@ src_libmingwex=\
math/exp2l.S math/floor.S math/floorf.S math/floorl.S \
math/fma.S math/fmaf.S math/frexpl.S math/ilogbl.S \
math/internal_logl.S math/log10l.S math/log1pl.S \
- math/log2l.S math/nearbyint.S math/nearbyintf.S math/nearbyintl.S math/remainder.S \
- math/remainderf.S math/remainderl.S math/remquo.S math/remquof.S math/remquol.S \
+ math/log2l.S math/nearbyint.S math/nearbyintf.S math/nearbyintl.S \
+ math/remainderl.S math/remquo.S math/remquof.S math/remquol.S \
math/scalbnl.S math/sinl_internal.S math/tanl.S math/trunc.S math/truncf.S \
math/acoshl.c math/acosl.c \
math/asinhl.c math/asinl.c math/atan2l.c \
math/atanhl.c math/atanl.c math/cbrt.c \
- math/cbrtf.c math/cbrtl.c math/cephes_emath.c math/copysign.c math/copysignf.c math/cos.c \
- math/coshf.c math/coshl.c math/cosl.c math/cossin.c math/erfl.c \
+ math/cbrtf.c math/cbrtl.c math/cephes_emath.c math/copysign.c math/copysignf.c \
+ math/coshf.c math/coshl.c math/cosl.c math/erfl.c \
math/expf.c math/expl.c math/expm1l.c \
math/fabs.c math/fabsf.c math/fabsl.c math/fdim.c math/fdimf.c math/fdiml.c \
math/fmal.c math/fmax.c math/fmaxf.c math/fmaxl.c math/fmin.c math/fminf.c \
@@ -247,7 +247,7 @@ src_libmingwex=\
math/nexttowardf.c math/pow.c math/powf.c math/powi.c math/powif.c math/powil.c \
math/powl.c math/rint.c math/rintf.c math/rintl.c math/round.c math/roundf.c \
math/roundl.c math/s_erf.c math/sf_erf.c math/signbit.c math/signbitf.c math/signbitl.c \
- math/sin.c math/sinhf.c math/sinhl.c math/sinl.c math/sqrt.c \
+ math/sinhf.c math/sinhl.c math/sinl.c math/sqrt.c \
math/sqrtf.c math/sqrtl.c math/tanhf.c math/tanhl.c math/tgamma.c \
math/tgammaf.c math/tgammal.c math/truncl.c \
math/acosh.def.h math/cos.def.h math/exp.def.h math/expm1.def.h math/log.def.h math/pow.def.h \
@@ -298,29 +298,33 @@ src_libmingwex=\
src_libmingwex64=\
math/acosf.c math/acosh.c math/acoshf.c math/asinf.c math/asinh.c \
math/asinhf.c math/atan2f.c math/atanf.c math/atanh.c math/atanhf.c \
- math/cosf.c math/exp.c math/exp2.S math/exp2f.S math/expm1.c \
- math/expm1f.c math/fmod.c math/fmodf.c math/ilogb.S math/ilogbf.S \
- math/log1p.S math/log1pf.S math/log2.S math/log2f.S math/logb.c \
- math/logbf.c math/scalbn.S math/scalbnf.S math/sinf.c math/tanf.c
+ math/cos.c math/cosf.c math/cossin.c math/exp.c math/exp2.S \
+ math/exp2f.S math/expm1.c math/expm1f.c math/fmod.c math/fmodf.c \
+ math/ilogb.S math/ilogbf.S math/log1p.S math/log1pf.S math/log2.S \
+ math/log2f.S math/logb.c math/logbf.c math/remainder.S math/remainderf.S \
+ math/scalbn.S math/scalbnf.S math/sin.c math/sinf.c math/tanf.c
# these only go into the 32 bit version:
src_libmingwex32=\
math/acosf.c math/acosh.c math/acoshf.c math/asinf.c math/asinh.c \
math/asinhf.c math/atan2f.c math/atanf.c math/atanh.c math/atanhf.c \
- math/cosf.c math/exp.c math/exp2.S math/exp2f.S math/expm1.c \
- math/expm1f.c math/fmod.c math/fmodf.c math/ilogb.S math/ilogbf.S \
- math/log1p.S math/log1pf.S math/log2.S math/log2f.S math/logb.c \
- math/logbf.c math/scalbn.S math/scalbnf.S math/sinf.c math/tanf.c
+ math/cos.c math/cosf.c math/cossin.c math/exp.c math/exp2.S \
+ math/exp2f.S math/expm1.c math/expm1f.c math/fmod.c math/fmodf.c \
+ math/ilogb.S math/ilogbf.S math/log1p.S math/log1pf.S math/log2.S \
+ math/log2f.S math/logb.c math/logbf.c math/remainder.S math/remainderf.S \
+ math/scalbn.S math/scalbnf.S math/sin.c math/sinf.c math/tanf.c
# these only go into the ARM32 version:
src_libmingwexarm32=\
math/softmath/e_fmod.c math/softmath/e_fmodf.c math/softmath/e_powf.c \
math/softmath/acosf.c math/softmath/acosh.c math/softmath/acoshf.c math/softmath/asinf.c math/softmath/asinh.c \
math/softmath/asinhf.c math/softmath/atan2f.c math/softmath/atanf.c math/softmath/atanh.c math/softmath/atanhf.c \
- math/softmath/cosf.c math/softmath/exp.c math/softmath/exp2.c math/softmath/exp2f.c math/softmath/expm1.c \
- math/softmath/expm1f.c math/softmath/fmod.c math/softmath/fmodf.c math/softmath/ilogb.c math/softmath/ilogbf.c \
- math/softmath/log1p.c math/softmath/log1pf.c math/softmath/log2.c math/softmath/log2f.c math/softmath/logb.c \
- math/softmath/logbf.c math/softmath/scalbn.c math/softmath/scalbnf.c math/softmath/sinf.c math/softmath/tanf.c
+ math/softmath/cos.c math/softmath/cosf.c math/softmath/exp.c math/softmath/exp2.c math/softmath/exp2f.c \
+ math/softmath/expm1.c math/softmath/expm1f.c math/softmath/fmod.c math/softmath/fmodf.c math/softmath/ilogb.c \
+ math/softmath/ilogbf.c math/softmath/log1p.c math/softmath/log1pf.c math/softmath/log2.c math/softmath/log2f.c \
+ math/softmath/logb.c math/softmath/logbf.c math/softmath/remainder.c math/softmath/remainderf.c math/softmath/scalbn.c \
+ math/softmath/scalbnf.c math/softmath/sin.c math/softmath/sincos.c math/softmath/sincosf.c math/softmath/sinf.c \
+ math/softmath/tanf.c
# These intrinsics are target independent:
diff --git a/mingw-w64-crt/math/softmath/bsd_private.h b/mingw-w64-crt/math/softmath/bsd_private.h
index af01999..690214a 100644
--- a/mingw-w64-crt/math/softmath/bsd_private.h
+++ b/mingw-w64-crt/math/softmath/bsd_private.h
@@ -9,7 +9,7 @@
* ====================================================
*/
-#include <math.h>
+#include "softmath_private.h"
#include <inttypes.h>
static const double
diff --git a/mingw-w64-crt/math/softmath/bsd_privatef.h b/mingw-w64-crt/math/softmath/bsd_privatef.h
index 66bb415..08ef588 100644
--- a/mingw-w64-crt/math/softmath/bsd_privatef.h
+++ b/mingw-w64-crt/math/softmath/bsd_privatef.h
@@ -9,7 +9,7 @@
* ====================================================
*/
-#include <math.h>
+#include "softmath_private.h"
#include <inttypes.h>
static const float
diff --git a/mingw-w64-crt/math/softmath/cos.c b/mingw-w64-crt/math/softmath/cos.c
new file mode 100644
index 0000000..d9b0303
--- /dev/null
+++ b/mingw-w64-crt/math/softmath/cos.c
@@ -0,0 +1,69 @@
+/*
+ This Software is provided under the Zope Public License (ZPL) Version 2.1.
+
+ Copyright (c) 2014 by the mingw-w64 project
+
+ See the AUTHORS file for the list of contributors to the mingw-w64 project.
+
+ This license has been certified as open source. It has also been designated
+ as GPL compatible by the Free Software Foundation (FSF).
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions in source code must retain the accompanying copyright
+ notice, this list of conditions, and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the accompanying
+ copyright notice, this list of conditions, and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ 3. Names of the copyright holders must not be used to endorse or promote
+ products derived from this software without prior written permission
+ from the copyright holders.
+ 4. The right to distribute this software or to use it for any purpose does
+ not give you the right to use Servicemarks (sm) or Trademarks (tm) of
+ the copyright holders. Use of them is covered by separate agreement
+ with the copyright holders.
+ 5. If any files are modified, you must cause the modified files to carry
+ prominent notices stating that you changed the files and the date of
+ any change.
+
+ Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "softmath_private.h"
+
+double cos(double x)
+{
+ double result = 0.0, neg = (x < 0) ? -1 : 1;
+ int n, quadrant;
+
+ x *= neg;
+ quadrant = (int)(x / M_PI_2) % 4;
+
+ x = bsd__ieee754_fmod(x, M_PI_2);
+ if (quadrant == 1 || quadrant == 3)
+ x = M_PI_2 - x;
+
+ for(n = 0; n < 6; n++)
+ {
+ double sign = (n % 2 == 0) ? 1 : -1;
+ result += sign * (bsd__ieee754_pow(x, (2 * n)) / softmath_fact(2 * n));
+ }
+
+ if (quadrant == 1 || quadrant == 2)
+ result *= -1;
+
+ return result;
+}
diff --git a/mingw-w64-crt/math/softmath/e_fmod.c b/mingw-w64-crt/math/softmath/e_fmod.c
index 4b5c350..da0db6f 100644
--- a/mingw-w64-crt/math/softmath/e_fmod.c
+++ b/mingw-w64-crt/math/softmath/e_fmod.c
@@ -15,7 +15,6 @@
* Method: shift and subtract
*/
-#include "math.h"
#include "bsd_private.h"
double bsd__ieee754_fmod(double x, double y)
diff --git a/mingw-w64-crt/math/softmath/e_fmodf.c b/mingw-w64-crt/math/softmath/e_fmodf.c
index 6a4eaf3..a08fb04 100644
--- a/mingw-w64-crt/math/softmath/e_fmodf.c
+++ b/mingw-w64-crt/math/softmath/e_fmodf.c
@@ -15,7 +15,6 @@
* Method: shift and subtract
*/
-#include "math.h"
#include "bsd_privatef.h"
float bsd__ieee754_fmodf(float x, float y)
diff --git a/mingw-w64-crt/math/softmath/e_pow.c b/mingw-w64-crt/math/softmath/e_pow.c
index 97fb44a..4e56eeb 100644
--- a/mingw-w64-crt/math/softmath/e_pow.c
+++ b/mingw-w64-crt/math/softmath/e_pow.c
@@ -8,7 +8,6 @@
* ====================================================
*/
-#include "math.h"
#include "bsd_private.h"
double bsd__ieee754_pow(double x, double y)
diff --git a/mingw-w64-crt/math/softmath/e_powf.c b/mingw-w64-crt/math/softmath/e_powf.c
index 01ee105..1ab8d6f 100644
--- a/mingw-w64-crt/math/softmath/e_powf.c
+++ b/mingw-w64-crt/math/softmath/e_powf.c
@@ -9,7 +9,6 @@
* ====================================================
*/
-#include "math.h"
#include "bsd_privatef.h"
float bsd__ieee754_powf(float x, float y)
diff --git a/mingw-w64-crt/math/softmath/e_remainder.c b/mingw-w64-crt/math/softmath/e_remainder.c
new file mode 100644
index 0000000..6e90af6
--- /dev/null
+++ b/mingw-w64-crt/math/softmath/e_remainder.c
@@ -0,0 +1,54 @@
+/*
+ * ====================================================
+ * 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.
+ * ====================================================
+ */
+
+#include "bsd_private.h"
+
+double bsd__ieee754_remainder(double x, double p)
+{
+ int32_t hx,hp;
+ u_int32_t sx,lx,lp;
+ double p_half;
+
+ EXTRACT_WORDS(hx,lx,x);
+ EXTRACT_WORDS(hp,lp,p);
+ sx = hx&0x80000000;
+ hp &= 0x7fffffff;
+ hx &= 0x7fffffff;
+
+ /* purge off exception values */
+ if((hp|lp)==0) return (x*p)/(x*p); /* p = 0 */
+ if((hx>=0x7ff00000)|| /* x not finite */
+ ((hp>=0x7ff00000)&& /* p is NaN */
+ (((hp-0x7ff00000)|lp)!=0)))
+ return ((long double)x*p)/((long double)x*p);
+
+
+ if (hp<=0x7fdfffff) x = bsd__ieee754_fmod(x,p+p); /* now x < 2p */
+ if (((hx-hp)|(lx-lp))==0) return zero*x;
+ x = fabs(x);
+ p = fabs(p);
+ if (hp<0x00200000) {
+ if(x+x>p) {
+ x-=p;
+ if(x+x>=p) x -= p;
+ }
+ } else {
+ p_half = 0.5*p;
+ if(x>p_half) {
+ x-=p;
+ if(x>=p_half) x -= p;
+ }
+ }
+ GET_HIGH_WORD(hx,x);
+ if ((hx&0x7fffffff)==0) hx = 0;
+ SET_HIGH_WORD(x,hx^sx);
+ return x;
+}
diff --git a/mingw-w64-crt/math/softmath/e_remainderf.c b/mingw-w64-crt/math/softmath/e_remainderf.c
new file mode 100644
index 0000000..a4feb36
--- /dev/null
+++ b/mingw-w64-crt/math/softmath/e_remainderf.c
@@ -0,0 +1,53 @@
+/*
+ * ====================================================
+ * 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 "bsd_privatef.h"
+
+float bsd__ieee754_remainderf(float x, float p)
+{
+ int32_t hx,hp;
+ u_int32_t sx;
+ float p_half;
+
+ GET_FLOAT_WORD(hx,x);
+ GET_FLOAT_WORD(hp,p);
+ sx = hx&0x80000000;
+ hp &= 0x7fffffff;
+ hx &= 0x7fffffff;
+
+ /* purge off exception values */
+ if(hp==0) return (x*p)/(x*p); /* p = 0 */
+ if((hx>=0x7f800000)|| /* x not finite */
+ ((hp>0x7f800000))) /* p is NaN */
+ return ((long double)x*p)/((long double)x*p);
+
+
+ if (hp<=0x7effffff) x = bsd__ieee754_fmodf(x,p+p); /* now x < 2p */
+ if ((hx-hp)==0) return zero*x;
+ x = fabsf(x);
+ p = fabsf(p);
+ if (hp<0x01000000) {
+ if(x+x>p) {
+ x-=p;
+ if(x+x>=p) x -= p;
+ }
+ } else {
+ p_half = (float)0.5*p;
+ if(x>p_half) {
+ x-=p;
+ if(x>=p_half) x -= p;
+ }
+ }
+ GET_FLOAT_WORD(hx,x);
+ if ((hx&0x7fffffff)==0) hx = 0;
+ SET_FLOAT_WORD(x,hx^sx);
+ return x;
+}
diff --git a/mingw-w64-crt/math/softmath/remainder.c b/mingw-w64-crt/math/softmath/remainder.c
new file mode 100644
index 0000000..c655b27
--- /dev/null
+++ b/mingw-w64-crt/math/softmath/remainder.c
@@ -0,0 +1,50 @@
+/*
+ This Software is provided under the Zope Public License (ZPL) Version 2.1.
+
+ Copyright (c) 2014 by the mingw-w64 project
+
+ See the AUTHORS file for the list of contributors to the mingw-w64 project.
+
+ This license has been certified as open source. It has also been designated
+ as GPL compatible by the Free Software Foundation (FSF).
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions in source code must retain the accompanying copyright
+ notice, this list of conditions, and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the accompanying
+ copyright notice, this list of conditions, and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ 3. Names of the copyright holders must not be used to endorse or promote
+ products derived from this software without prior written permission
+ from the copyright holders.
+ 4. The right to distribute this software or to use it for any purpose does
+ not give you the right to use Servicemarks (sm) or Trademarks (tm) of
+ the copyright holders. Use of them is covered by separate agreement
+ with the copyright holders.
+ 5. If any files are modified, you must cause the modified files to carry
+ prominent notices stating that you changed the files and the date of
+ any change.
+
+ Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "softmath_private.h"
+
+double remainder(double x, double y)
+{
+ return bsd__ieee754_remainder(x, y);
+}
diff --git a/mingw-w64-crt/math/softmath/remainderf.c b/mingw-w64-crt/math/softmath/remainderf.c
new file mode 100644
index 0000000..1198fa8
--- /dev/null
+++ b/mingw-w64-crt/math/softmath/remainderf.c
@@ -0,0 +1,50 @@
+/*
+ This Software is provided under the Zope Public License (ZPL) Version 2.1.
+
+ Copyright (c) 2014 by the mingw-w64 project
+
+ See the AUTHORS file for the list of contributors to the mingw-w64 project.
+
+ This license has been certified as open source. It has also been designated
+ as GPL compatible by the Free Software Foundation (FSF).
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions in source code must retain the accompanying copyright
+ notice, this list of conditions, and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the accompanying
+ copyright notice, this list of conditions, and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ 3. Names of the copyright holders must not be used to endorse or promote
+ products derived from this software without prior written permission
+ from the copyright holders.
+ 4. The right to distribute this software or to use it for any purpose does
+ not give you the right to use Servicemarks (sm) or Trademarks (tm) of
+ the copyright holders. Use of them is covered by separate agreement
+ with the copyright holders.
+ 5. If any files are modified, you must cause the modified files to carry
+ prominent notices stating that you changed the files and the date of
+ any change.
+
+ Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "softmath_private.h"
+
+float remainderf(float x, float y)
+{
+ return bsd__ieee754_remainderf(x, y);
+}
diff --git a/mingw-w64-crt/math/softmath/sin.c b/mingw-w64-crt/math/softmath/sin.c
new file mode 100644
index 0000000..e561060
--- /dev/null
+++ b/mingw-w64-crt/math/softmath/sin.c
@@ -0,0 +1,69 @@
+/*
+ This Software is provided under the Zope Public License (ZPL) Version 2.1.
+
+ Copyright (c) 2014 by the mingw-w64 project
+
+ See the AUTHORS file for the list of contributors to the mingw-w64 project.
+
+ This license has been certified as open source. It has also been designated
+ as GPL compatible by the Free Software Foundation (FSF).
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions in source code must retain the accompanying copyright
+ notice, this list of conditions, and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the accompanying
+ copyright notice, this list of conditions, and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ 3. Names of the copyright holders must not be used to endorse or promote
+ products derived from this software without prior written permission
+ from the copyright holders.
+ 4. The right to distribute this software or to use it for any purpose does
+ not give you the right to use Servicemarks (sm) or Trademarks (tm) of
+ the copyright holders. Use of them is covered by separate agreement
+ with the copyright holders.
+ 5. If any files are modified, you must cause the modified files to carry
+ prominent notices stating that you changed the files and the date of
+ any change.
+
+ Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "softmath_private.h"
+
+double sin(double x)
+{
+ double result = 0.0, neg = (x < 0) ? -1 : 1;
+ int n, quadrant;
+
+ x *= neg;
+ quadrant = (int)(x / M_PI_2) % 4;
+
+ x = bsd__ieee754_fmod(x, M_PI_2);
+ if (quadrant == 1 || quadrant == 3)
+ x = M_PI_2 - x;
+
+ for(n = 0; n < 6; n++)
+ {
+ double sign = (n % 2 == 0) ? 1 : -1;
+ result += sign * (bsd__ieee754_pow(x, ((2 * n) + 1)) / softmath_fact((2 * n) + 1));
+ }
+
+ if (quadrant == 2 || quadrant == 3)
+ result *= -1;
+
+ return neg * result;
+}
diff --git a/mingw-w64-crt/math/softmath/sincos.c b/mingw-w64-crt/math/softmath/sincos.c
new file mode 100644
index 0000000..4c86233
--- /dev/null
+++ b/mingw-w64-crt/math/softmath/sincos.c
@@ -0,0 +1,51 @@
+/*
+ This Software is provided under the Zope Public License (ZPL) Version 2.1.
+
+ Copyright (c) 2014 by the mingw-w64 project
+
+ See the AUTHORS file for the list of contributors to the mingw-w64 project.
+
+ This license has been certified as open source. It has also been designated
+ as GPL compatible by the Free Software Foundation (FSF).
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions in source code must retain the accompanying copyright
+ notice, this list of conditions, and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the accompanying
+ copyright notice, this list of conditions, and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ 3. Names of the copyright holders must not be used to endorse or promote
+ products derived from this software without prior written permission
+ from the copyright holders.
+ 4. The right to distribute this software or to use it for any purpose does
+ not give you the right to use Servicemarks (sm) or Trademarks (tm) of
+ the copyright holders. Use of them is covered by separate agreement
+ with the copyright holders.
+ 5. If any files are modified, you must cause the modified files to carry
+ prominent notices stating that you changed the files and the date of
+ any change.
+
+ Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "softmath_private.h"
+
+void sincos(double x, double *s, double *c)
+{
+ if (s) *s = sin(x);
+ if (c) *c = cos(x);
+}
diff --git a/mingw-w64-crt/math/softmath/sincosf.c b/mingw-w64-crt/math/softmath/sincosf.c
new file mode 100644
index 0000000..b1e2b8a
--- /dev/null
+++ b/mingw-w64-crt/math/softmath/sincosf.c
@@ -0,0 +1,51 @@
+/*
+ This Software is provided under the Zope Public License (ZPL) Version 2.1.
+
+ Copyright (c) 2014 by the mingw-w64 project
+
+ See the AUTHORS file for the list of contributors to the mingw-w64 project.
+
+ This license has been certified as open source. It has also been designated
+ as GPL compatible by the Free Software Foundation (FSF).
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions in source code must retain the accompanying copyright
+ notice, this list of conditions, and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the accompanying
+ copyright notice, this list of conditions, and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ 3. Names of the copyright holders must not be used to endorse or promote
+ products derived from this software without prior written permission
+ from the copyright holders.
+ 4. The right to distribute this software or to use it for any purpose does
+ not give you the right to use Servicemarks (sm) or Trademarks (tm) of
+ the copyright holders. Use of them is covered by separate agreement
+ with the copyright holders.
+ 5. If any files are modified, you must cause the modified files to carry
+ prominent notices stating that you changed the files and the date of
+ any change.
+
+ Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "softmath_private.h"
+
+void sincosf(float x, float *s, float *c)
+{
+ if (s) *s = sinf(x);
+ if (c) *c = cosf(x);
+}
diff --git a/mingw-w64-crt/math/softmath/softmath_private.h b/mingw-w64-crt/math/softmath/softmath_private.h
index 105ea91..0ce9db2 100644
--- a/mingw-w64-crt/math/softmath/softmath_private.h
+++ b/mingw-w64-crt/math/softmath/softmath_private.h
@@ -16,6 +16,8 @@ extern double bsd__ieee754_fmod(double, double);
extern float bsd__ieee754_fmodf(float, float);
extern double bsd__ieee754_pow(double, double);
extern float bsd__ieee754_powf(float, float);
+extern double bsd__ieee754_remainder(double, double);
+extern float bsd__ieee754_remainderf(float, float);
static inline double softmath_fact(double number)
{
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public