-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 26.07.2014 um 01:54 schrieb JonY: > On 7/26/2014 06:20, André Hentschel wrote: >> +double log2(double x) +{ + return softmath_log(x) / softmath_log(2); +} > > Any reason not to expand softmath_log(2) into a constant? Otherwise, it looks > OK. > >
Like this? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQGcBAEBAgAGBQJT1R+iAAoJEGm5GZTakYssU5wL/ixIN3v3SRGCY3dlGld2wTOq V7n2sz1eppJKuds3bPjHWPHgaR4gI+Z1b8clnGcMsnl+uYPzQW+RHPNxeXyDM6g7 /Dn8TK3eQ2tv/MUVBH1XFfZHyZXLvB+OEBmxnpMvjbvKPYp/Eha015bM9RLqYvEC RbGp1An/qk1jT3ThpZbyWmjm2ufyUNAZCyAxdBKzUFoa+M9qmgpJ85Z/F1gbmPBA scM6RzoD0xI5QC3xDflAR2wLxTtvbt4znr7GLxcelvWU5JQzO5KHrIzOg2gSgPEG xiWjJGbq6x8fj1cuwZFTf811LEj6pT5njDvHQ9R0faW+aNYejwU03/O1MZrRKGbp yegdTtDe5SxX2maOD+CMrUEe1URgkn6EEhwBWSmI7y77Dmi1lYx0oYcCsTSFveKq 1Q/AMgqgBLsHKl9FMiZRyV7o9Twv/ImDl+p2LR6YXDXmca+6N7hFK5Oci7zHcZat VsT2nzxUd2vXpKRFXvA7fDC7WEJhkrxxBWHZ75wtGw== =9S19 -----END PGP SIGNATURE-----
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index 175ecdd..5d4e469 100644 --- a/mingw-w64-crt/Makefile.am +++ b/mingw-w64-crt/Makefile.am @@ -220,18 +220,18 @@ src_libmingwex=\ gdtoa/strtopx.c gdtoa/sum.c gdtoa/ulp.c \ \ math/_chgsignl.S math/ceil.S math/ceilf.S math/ceill.S math/copysignl.S math/cosl_internal.S \ - math/exp2.S math/exp2l.S math/floor.S math/floorf.S math/floorl.S \ - math/fma.S math/fmaf.S math/frexpl.S math/ilogb.S math/ilogbl.S \ - math/internal_logl.S math/log10l.S math/log1p.S math/log1pl.S math/log2.S \ + 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/scalbn.S \ math/scalbnl.S math/sinl_internal.S math/tanl.S math/trunc.S math/truncf.S \ math/acoshl.c math/acosl.c \ - math/asinh.c math/asinhl.c math/asinl.c math/atan2l.c \ - math/atanh.c math/atanhl.c math/atanl.c math/cbrt.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/exp.c math/expf.c math/expl.c math/expm1.c math/expm1l.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 \ math/fminl.c math/fmod.c math/fmodl.c math/fp_consts.c math/fp_constsf.c \ @@ -295,25 +295,31 @@ src_libmingwex=\ # these only go into the 64 bit version: src_libmingwex64=\ - math/acosf.c math/acosh.c math/acoshf.c math/asinf.c math/asinhf.c \ - math/atan2f.c math/atanf.c math/atanhf.c math/cosf.c math/exp2f.S \ - math/expm1f.c math/fmodf.c math/ilogbf.S math/log1pf.S math/log2f.S \ - math/logbf.c math/scalbnf.S math/sinf.c math/tanf.c + 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/fmodf.c math/ilogb.S math/ilogbf.S math/log1p.S \ + math/log1pf.S math/log2.S math/log2f.S math/logbf.c math/scalbnf.S \ + 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/asinhf.c \ - math/atan2f.c math/atanf.c math/atanhf.c math/cosf.c math/exp2f.S \ - math/expm1f.c math/fmodf.c math/ilogbf.S math/log1pf.S math/log2f.S \ - math/logbf.c math/scalbnf.S math/sinf.c math/tanf.c + 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/fmodf.c math/ilogb.S math/ilogbf.S math/log1p.S \ + math/log1pf.S math/log2.S math/log2f.S math/logbf.c math/scalbnf.S \ + math/sinf.c math/tanf.c # these only go into the ARM32 version: src_libmingwexarm32=\ 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/asinhf.c \ - math/softmath/atan2f.c math/softmath/atanf.c math/softmath/atanhf.c math/softmath/cosf.c math/softmath/exp2f.c \ - math/softmath/expm1f.c math/softmath/fmodf.c math/softmath/ilogbf.c math/softmath/log1pf.c math/softmath/log2f.c \ - math/softmath/logbf.c math/softmath/scalbnf.c math/softmath/sinf.c math/softmath/tanf.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/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/logbf.c math/softmath/scalbnf.c \ + math/softmath/sinf.c math/softmath/tanf.c # These intrinsics are target independent: diff --git a/mingw-w64-crt/math/softmath/asinh.c b/mingw-w64-crt/math/softmath/asinh.c new file mode 100644 index 0000000..10601c5 --- /dev/null +++ b/mingw-w64-crt/math/softmath/asinh.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 asinh(double x) +{ + return softmath_log(x + sqrt(x * x * 2 + 1)); +} diff --git a/mingw-w64-crt/math/softmath/atanh.c b/mingw-w64-crt/math/softmath/atanh.c new file mode 100644 index 0000000..d05f0b8 --- /dev/null +++ b/mingw-w64-crt/math/softmath/atanh.c @@ -0,0 +1,52 @@ +/* + 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 atanh(double x) +{ + if (x > 1) return NAN; + else if (x < -1) return -NAN; + return softmath_log((1 + x) / (1 - x)) / 2; +} diff --git a/mingw-w64-crt/math/softmath/exp.c b/mingw-w64-crt/math/softmath/exp.c new file mode 100644 index 0000000..b5216c8 --- /dev/null +++ b/mingw-w64-crt/math/softmath/exp.c @@ -0,0 +1,60 @@ +/* + 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 exp(double x) +{ + double result = 0.0; + int n; + + for(n = 0; n < 64; n++) + { + result += (bsd__ieee754_pow(x, n) / softmath_fact(n)); + if (isnan(result) || isinf(result)) + break; + } + + return result; +} diff --git a/mingw-w64-crt/math/softmath/exp2.c b/mingw-w64-crt/math/softmath/exp2.c new file mode 100644 index 0000000..61e5955 --- /dev/null +++ b/mingw-w64-crt/math/softmath/exp2.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 exp2(double x) +{ + return bsd__ieee754_pow(2, x); +} diff --git a/mingw-w64-crt/math/softmath/expm1.c b/mingw-w64-crt/math/softmath/expm1.c new file mode 100644 index 0000000..a76f9c8 --- /dev/null +++ b/mingw-w64-crt/math/softmath/expm1.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 expm1(double x) +{ + return exp(x) - 1; +} diff --git a/mingw-w64-crt/math/softmath/ilogb.c b/mingw-w64-crt/math/softmath/ilogb.c new file mode 100644 index 0000000..641561e --- /dev/null +++ b/mingw-w64-crt/math/softmath/ilogb.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" + +int ilogb(double x) +{ + return floor(log2(x)); +} diff --git a/mingw-w64-crt/math/softmath/log1p.c b/mingw-w64-crt/math/softmath/log1p.c new file mode 100644 index 0000000..fa2169c --- /dev/null +++ b/mingw-w64-crt/math/softmath/log1p.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 log1p(double x) +{ + return softmath_log(x + 1); +} diff --git a/mingw-w64-crt/math/softmath/log2.c b/mingw-w64-crt/math/softmath/log2.c new file mode 100644 index 0000000..e94d38b --- /dev/null +++ b/mingw-w64-crt/math/softmath/log2.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 log2(double x) +{ + return softmath_log(x) / 0.69314718246459960938d; +} diff --git a/mingw-w64-crt/math/softmath/log2f.c b/mingw-w64-crt/math/softmath/log2f.c index 443c43c..73d9659 100644 --- a/mingw-w64-crt/math/softmath/log2f.c +++ b/mingw-w64-crt/math/softmath/log2f.c @@ -46,5 +46,5 @@ float log2f(float x) { - return softmath_logf(x) / softmath_logf(2); + return softmath_logf(x) / 0.69314718246459960938f; }
softmath.patch.sig
Description: PGP signature
------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public