[prev in list] [next in list] [prev in thread] [next in thread]
List: mingw-cvs
Subject: MinGW-cvs digest, Vol 1 #425 - 4 msgs
From: mingw-cvs-request () lists ! sourceforge ! net
Date: 2005-01-03 4:21:55
Message-ID: 20050103042218.9921EFB99 () sc8-sf-spam2 ! sourceforge ! net
[Download RAW message or body]
Send MinGW-cvs mailing list submissions to
mingw-cvs@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/mingw-cvs
or, via email, send a message with subject or body 'help' to
mingw-cvs-request@lists.sourceforge.net
You can reach the person managing the list at
mingw-cvs-admin@lists.sourceforge.net
When replying, please edit your Subject line so it is more specific
than "Re: Contents of MinGW-cvs digest..."
This list will notify you of updates to the code stored in CVS. Typically only \
developers with access to update the CVS are interested in this list. However, this \
list can be beneficial to see what is happening with your changes. If you wish to \
unsubscribe please do so at https://lists.sourceforge.net/lists/listinfo/mingw-cvs.
Today's Topics:
1. runtime/mingwex/math acosh.c,NONE,1.1 acoshf.c,NONE,1.1 acoshl.c,NONE,1.1 \
asinh.c,NONE,1.1 asinhf.c,NONE,1.1 asinhl.c,NONE,1.1 atanh.c,NONE,1.1 \
atanhf.c,NONE,1.1 atanhl.c,NONE,1.1 fastmath.h,NONE,1.1 (Earnie Boyd) 2. runtime \
Makefile.in,1.32,1.33 (Earnie Boyd) 3. runtime/include _mingw.h,1.21,1.22 (Earnie \
Boyd) 4. runtime ChangeLog,1.68,1.69 (Earnie Boyd)
--__--__--
Message: 1
From: Earnie Boyd <earnie@users.sourceforge.net>
To: mingw-cvs@lists.sourceforge.net
Date: Sun, 02 Jan 2005 16:09:05 +0000
Subject: [MinGW-cvs] runtime/mingwex/math acosh.c,NONE,1.1 acoshf.c,NONE,1.1 \
acoshl.c,NONE,1.1 asinh.c,NONE,1.1 asinhf.c,NONE,1.1 asinhl.c,NONE,1.1 \
atanh.c,NONE,1.1 atanhf.c,NONE,1.1 atanhl.c,NONE,1.1 fastmath.h,NONE,1.1
Update of /cvsroot/mingw/runtime/mingwex/math
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3140/mingwex/math
Added Files:
acosh.c acoshf.c acoshl.c asinh.c asinhf.c asinhl.c atanh.c
atanhf.c atanhl.c fastmath.h
Log Message:
Merge winsup changes
--- NEW FILE: asinh.c ---
#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);
}
--- NEW FILE: asinhl.c ---
#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);
}
--- NEW FILE: atanhf.c ---
#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;
}
--- NEW FILE: acoshf.c ---
#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)));
}
--- NEW FILE: atanh.c ---
#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;
}
--- NEW FILE: acosh.c ---
#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)));
}
--- NEW FILE: acoshl.c ---
#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)));
}
--- NEW FILE: fastmath.h ---
#ifndef _MINGWEX_FASTMATH_H_
#define _MINGWEX_FASTMATH_H_
/* Fast math inlines
No range or domain checks. No setting of errno. No tweaks to
protect precision near range limits. */
/* For now this is an internal header with just the functions that
are currently used in building libmingwex.a math components */
/* FIXME: We really should get rid of the code duplication using euther
C++ templates or tgmath-type macros. */
static __inline__ double __fast_sqrt (double x)
{
double res;
asm __volatile__ ("fsqrt" : "=t" (res) : "0" (x));
return res;
}
static __inline__ long double __fast_sqrtl (long double x)
{
long double res;
asm __volatile__ ("fsqrt" : "=t" (res) : "0" (x));
return res;
}
static __inline__ float __fast_sqrtf (float x)
{
float res;
asm __volatile__ ("fsqrt" : "=t" (res) : "0" (x));
return res;
}
static __inline__ double __fast_log (double x)
{
double res;
asm __volatile__
("fldln2\n\t"
"fxch\n\t"
"fyl2x"
: "=t" (res) : "0" (x) : "st(1)");
return res;
}
static __inline__ long double __fast_logl (long double x)
{
long double res;
asm __volatile__
("fldln2\n\t"
"fxch\n\t"
"fyl2x"
: "=t" (res) : "0" (x) : "st(1)");
return res;
}
static __inline__ float __fast_logf (float x)
{
float res;
asm __volatile__
("fldln2\n\t"
"fxch\n\t"
"fyl2x"
: "=t" (res) : "0" (x) : "st(1)");
return res;
}
static __inline__ double __fast_log1p (double x)
{
double res;
/* fyl2xp1 accurate only for |x| <= 1.0 - 0.5 * sqrt (2.0) */
if (fabs (x) >= 1.0 - 0.5 * 1.41421356237309504880)
res = __fast_log (1.0 + x);
else
asm __volatile__
("fldln2\n\t"
"fxch\n\t"
"fyl2xp1"
: "=t" (res) : "0" (x) : "st(1)");
return res;
}
static __inline__ long double __fast_log1pl (long double x)
{
long double res;
/* fyl2xp1 accurate only for |x| <= 1.0 - 0.5 * sqrt (2.0) */
if (fabsl (x) >= 1.0L - 0.5L * 1.41421356237309504880L)
res = __fast_logl (1.0L + x);
else
asm __volatile__
("fldln2\n\t"
"fxch\n\t"
"fyl2xp1"
: "=t" (res) : "0" (x) : "st(1)");
return res;
}
static __inline__ float __fast_log1pf (float x)
{
float res;
/* fyl2xp1 accurate only for |x| <= 1.0 - 0.5 * sqrt (2.0) */
if (fabsf (x) >= 1.0 - 0.5 * 1.41421356237309504880)
res = __fast_logf (1.0 + x);
else
asm __volatile__
("fldln2\n\t"
"fxch\n\t"
"fyl2xp1"
: "=t" (res) : "0" (x) : "st(1)");
return res;
}
#endif
--- NEW FILE: asinhf.c ---
#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);
}
--- NEW FILE: atanhl.c ---
#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;
}
--__--__--
Message: 2
From: Earnie Boyd <earnie@users.sourceforge.net>
To: mingw-cvs@lists.sourceforge.net
Date: Sun, 02 Jan 2005 16:18:48 +0000
Subject: [MinGW-cvs] runtime Makefile.in,1.32,1.33
Update of /cvsroot/mingw/runtime
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4971
Modified Files:
Makefile.in
Log Message:
Merge winsup changes
Index: Makefile.in
===================================================================
RCS file: /cvsroot/mingw/runtime/Makefile.in,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** Makefile.in 5 Sep 2004 13:52:44 -0000 1.32
--- Makefile.in 2 Jan 2005 16:18:45 -0000 1.33
***************
*** 19,23 ****
PACKAGE = mingw-runtime
! VERSION = 3.5
CYGRELEASE = 1
--- 19,23 ----
PACKAGE = mingw-runtime
! VERSION = 3.6
CYGRELEASE = 1
--__--__--
Message: 3
From: Earnie Boyd <earnie@users.sourceforge.net>
To: mingw-cvs@lists.sourceforge.net
Date: Sun, 02 Jan 2005 16:18:48 +0000
Subject: [MinGW-cvs] runtime/include _mingw.h,1.21,1.22
Update of /cvsroot/mingw/runtime/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4971/include
Modified Files:
_mingw.h
Log Message:
Merge winsup changes
Index: _mingw.h
===================================================================
RCS file: /cvsroot/mingw/runtime/include/_mingw.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** _mingw.h 5 Sep 2004 13:52:44 -0000 1.21
--- _mingw.h 2 Jan 2005 16:18:46 -0000 1.22
***************
*** 142,148 ****
#endif
! #define __MINGW32_VERSION 3.5
#define __MINGW32_MAJOR_VERSION 3
! #define __MINGW32_MINOR_VERSION 5
#endif /* __MINGW_H */
--- 142,148 ----
#endif
! #define __MINGW32_VERSION 3.6
#define __MINGW32_MAJOR_VERSION 3
! #define __MINGW32_MINOR_VERSION 6
#endif /* __MINGW_H */
--__--__--
Message: 4
From: Earnie Boyd <earnie@users.sourceforge.net>
To: mingw-cvs@lists.sourceforge.net
Date: Sun, 02 Jan 2005 17:18:12 +0000
Subject: [MinGW-cvs] runtime ChangeLog,1.68,1.69
Update of /cvsroot/mingw/runtime
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15611
Modified Files:
ChangeLog
Log Message:
Merge winsup changes
Index: ChangeLog
===================================================================
RCS file: /cvsroot/mingw/runtime/ChangeLog,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** ChangeLog 2 Jan 2005 16:00:39 -0000 1.68
--- ChangeLog 2 Jan 2005 17:18:10 -0000 1.69
***************
*** 1,2 ****
--- 1,7 ----
+ 2005-01-02 Earnie Boyd <earnie@users.sf.net>
+
+ * include/_mingw.h: Increment version to 3.6
+ * Makefile.in: Ditto
+
2004-12-26 Danny Smith <dannysmith@users.sourceforge.net>
--__--__--
_______________________________________________
MinGW-cvs mailing list
MinGW-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-cvs
End of MinGW-cvs Digest
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic