suggestion about math.h

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Aug 8 10:46:00 GMT 2014


On Aug  7 14:10, Tim Prince wrote:
> 
> On 8/7/2014 1:41 PM, Denis Excoffier wrote:
> >Hello,
> >
> >Perhaps the values of some constants are not as accurate as they should be? See also M_LN2LO and M_LN2HI.
> >
> >diff -uNr cygwin-snapshot-20140807-1-original/newlib/libc/include/math.h cygwin-snapshot-20140807-1-patched/newlib/libc/include/math.h
> >--- cygwin-snapshot-20140807-1-original/newlib/libc/include/math.h	2014-08-07 18:26:21.000000000 +0200
> >+++ cygwin-snapshot-20140807-1-patched/newlib/libc/include/math.h	2014-08-07 19:31:51.000000000 +0200
> >@@ -569,14 +569,14 @@
> >  #ifndef __STRICT_ANSI__
> >  #define M_TWOPI         (M_PI * 2.0)
> >-#define M_3PI_4		2.3561944901923448370E0
> >-#define M_SQRTPI        1.77245385090551602792981
> >+#define M_3PI_4		2.3561944901923449288E0
> >+#define M_SQRTPI        1.77245385090551602729817
> >  #define M_LN2LO         1.9082149292705877000E-10
> >  #define M_LN2HI         6.9314718036912381649E-1
> >-#define M_SQRT3	1.73205080756887719000
> >+#define M_SQRT3	1.73205080756887729353
> >  #define M_IVLN10        0.43429448190325182765 /* 1 / log(10) */
> >  #define M_LOG2_E        _M_LN2
> >-#define M_INVLN2        1.4426950408889633870E0  /* 1 / log(2) */
> >+#define M_INVLN2        1.4426950408889634074E0  /* 1 / log(2) */
> >  /* Global control over fdlibm error handling.  */
> >
> >
> >
> Without the L suffix, it doesn't look like it matters.
> I just noticed this week the M_LN2LO and HI.  They should add up to a long
> double accurate constant.  I've been using a similar pair in implementation
> of exp() for 20 years.

Uhm, I'm not exactly a math expert so I won't try to contribute.

However, given that this file is from newlib, it would be more helpful
to discuss this on the newlib AT sourceware DOT org mailing list.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140808/59499692/attachment.sig>


More information about the Cygwin mailing list