diff options
Diffstat (limited to 'libc/sysdeps/ieee754/dbl-64')
86 files changed, 354 insertions, 622 deletions
diff --git a/libc/sysdeps/ieee754/dbl-64/MathLib.h b/libc/sysdeps/ieee754/dbl-64/MathLib.h index 74febcaf7..23f71980b 100644 --- a/libc/sysdeps/ieee754/dbl-64/MathLib.h +++ b/libc/sysdeps/ieee754/dbl-64/MathLib.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/asincos.tbl b/libc/sysdeps/ieee754/dbl-64/asincos.tbl index 829ef2683..b50a366d8 100644 --- a/libc/sysdeps/ieee754/dbl-64/asincos.tbl +++ b/libc/sysdeps/ieee754/dbl-64/asincos.tbl @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/atnat.h b/libc/sysdeps/ieee754/dbl-64/atnat.h index 6b8e17821..2beb33b05 100644 --- a/libc/sysdeps/ieee754/dbl-64/atnat.h +++ b/libc/sysdeps/ieee754/dbl-64/atnat.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -52,8 +52,6 @@ /**/ f17 = {{0x3fae1e1e, 0x1e1e1e1e} }, /* 1/17 */ /**/ f19 = {{0xbfaaf286, 0xbca1af28} }, /* -1/19 */ /* constants */ -/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ one = {{0x3ff00000, 0x00000000} }, /* 1 */ /**/ a = {{0x3e4bb67a, 0x00000000} }, /* 1.290e-8 */ /**/ b = {{0x3fb00000, 0x00000000} }, /* 1/16 */ /**/ c = {{0x3ff00000, 0x00000000} }, /* 1 */ @@ -77,9 +75,7 @@ /**/ u9[M] ={{{0x38c1aa5b, 0x00000000} }, /* 2.658e-35 */ /**/ {{0x35c1aa4d, 0x00000000} }, /* 9.443e-50 */ /**/ {{0x32c1aa88, 0x00000000} }, /* 3.355e-64 */ -/**/ {{0x11c1aa56, 0x00000000} }},/* 3.818e-223 */ -/**/ two8 = {{0x40700000, 0x00000000} }, /* 2**8=256 */ -/**/ two52 = {{0x43300000, 0x00000000} }; /* 2**52 */ +/**/ {{0x11c1aa56, 0x00000000} }};/* 3.818e-223 */ #else #ifdef LITTLE_ENDI @@ -106,8 +102,6 @@ /**/ f17 = {{0x1e1e1e1e, 0x3fae1e1e} }, /* 1/17 */ /**/ f19 = {{0xbca1af28, 0xbfaaf286} }, /* -1/19 */ /* constants */ -/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ one = {{0x00000000, 0x3ff00000} }, /* 1 */ /**/ a = {{0x00000000, 0x3e4bb67a} }, /* 1.290e-8 */ /**/ b = {{0x00000000, 0x3fb00000} }, /* 1/16 */ /**/ c = {{0x00000000, 0x3ff00000} }, /* 1 */ @@ -131,15 +125,13 @@ /**/ u9[M] ={{{0x00000000, 0x38c1aa5b} }, /* 2.658e-35 */ /**/ {{0x00000000, 0x35c1aa4d} }, /* 9.443e-50 */ /**/ {{0x00000000, 0x32c1aa88} }, /* 3.355e-64 */ -/**/ {{0x00000000, 0x11c1aa56} }},/* 3.818e-223 */ -/**/ two8 = {{0x00000000, 0x40700000} }, /* 2**8=256 */ -/**/ two52 = {{0x00000000, 0x43300000} }; /* 2**52 */ +/**/ {{0x00000000, 0x11c1aa56} }};/* 3.818e-223 */ #endif #endif -#define ZERO zero.d -#define ONE one.d +#define ZERO 0.0 +#define ONE 1.0 #define A a.d #define B b.d #define C c.d @@ -160,7 +152,7 @@ #define U6 u6.d #define U7 u7.d #define U8 u8.d -#define TWO8 two8.d -#define TWO52 two52.d +#define TWO8 0x1.0p8 /* 2^8 */ +#define TWO52 0x1.0p52 /* 2^52 */ #endif diff --git a/libc/sysdeps/ieee754/dbl-64/atnat2.h b/libc/sysdeps/ieee754/dbl-64/atnat2.h index fa6aa0d49..10b32535b 100644 --- a/libc/sysdeps/ieee754/dbl-64/atnat2.h +++ b/libc/sysdeps/ieee754/dbl-64/atnat2.h @@ -2,7 +2,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -57,9 +57,6 @@ /**/ f17 = {{0x3fae1e1e, 0x1e1e1e1e} }, /* 1/17 */ /**/ f19 = {{0xbfaaf286, 0xbca1af28} }, /* -1/19 */ /* constants */ -/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ mzero = {{0x80000000, 0x00000000} }, /* -0 */ -/**/ one = {{0x3ff00000, 0x00000000} }, /* 1 */ /**/ inv16 = {{0x3fb00000, 0x00000000} }, /* 1/16 */ /**/ opi = {{0x400921fb, 0x54442d18} }, /* pi */ /**/ opi1 = {{0x3ca1a626, 0x33145c07} }, /* pi-opi */ @@ -95,11 +92,8 @@ /**/ {{0x23c6eee8, 0x00000000} }, /* 2.465e-136 */ /**/ {{0x11c6ed16, 0x00000000} }},/* 4.955e-223 */ /**/ ue = {{0x38900e9d, 0x00000000} }, /* 3.02e-36 */ -/**/ two8 = {{0x40700000, 0x00000000} }, /* 2**8=256 */ -/**/ two52 = {{0x43300000, 0x00000000} }, /* 2**52 */ /**/ two500 = {{0x5f300000, 0x00000000} }, /* 2**500 */ -/**/ twom500 = {{0x20b00000, 0x00000000} }, /* 2**(-500) */ -/**/ twom1022 = {{0x00100000, 0x00000000} }; /* 2**(-1022) */ +/**/ twom500 = {{0x20b00000, 0x00000000} }; /* 2**(-500) */ #else #ifdef LITTLE_ENDI @@ -127,9 +121,6 @@ /**/ f17 = {{0x1e1e1e1e, 0x3fae1e1e} }, /* 1/17 */ /**/ f19 = {{0xbca1af28, 0xbfaaf286} }, /* -1/19 */ /* constants */ -/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ mzero = {{0x00000000, 0x80000000} }, /* -0 */ -/**/ one = {{0x00000000, 0x3ff00000} }, /* 1 */ /**/ inv16 = {{0x00000000, 0x3fb00000} }, /* 1/16 */ /**/ opi = {{0x54442d18, 0x400921fb} }, /* pi */ /**/ opi1 = {{0x33145c07, 0x3ca1a626} }, /* pi-opi */ @@ -165,20 +156,17 @@ /**/ {{0x00000000, 0x23c6eee8} }, /* 2.465e-136 */ /**/ {{0x00000000, 0x11c6ed16} }},/* 4.955e-223 */ /**/ ue = {{0x00000000, 0x38900e9d} }, /* 3.02e-36 */ -/**/ two8 = {{0x00000000, 0x40700000} }, /* 2**8=256 */ -/**/ two52 = {{0x00000000, 0x43300000} }, /* 2**52 */ /**/ two500 = {{0x00000000, 0x5f300000} }, /* 2**500 */ -/**/ twom500 = {{0x00000000, 0x20b00000} }, /* 2**(-500) */ -/**/ twom1022 = {{0x00000000, 0x00100000} }; /* 2**(-1022) */ +/**/ twom500 = {{0x00000000, 0x20b00000} }; /* 2**(-500) */ #endif #endif -#define ZERO zero.d -#define MZERO mzero.d -#define ONE one.d -#define TWO8 two8.d -#define TWO52 two52.d -#define TWOM1022 twom1022.d +#define ZERO 0.0 /* 0 */ +#define MZERO -0.0 /* 0 with the sign bit set */ +#define ONE 1.0 /* 1 */ +#define TWO8 0x1.0p8 /* 2^8 */ +#define TWO52 0x1.0p52 /* 2^52 */ +#define TWOM1022 0x1.0p-1022 /* 2^-1022 */ #endif diff --git a/libc/sysdeps/ieee754/dbl-64/branred.c b/libc/sysdeps/ieee754/dbl-64/branred.c index a32daa990..ecceeca63 100644 --- a/libc/sysdeps/ieee754/dbl-64/branred.c +++ b/libc/sysdeps/ieee754/dbl-64/branred.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/branred.h b/libc/sysdeps/ieee754/dbl-64/branred.h index c1e73543e..4e27c37b8 100644 --- a/libc/sysdeps/ieee754/dbl-64/branred.h +++ b/libc/sysdeps/ieee754/dbl-64/branred.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -26,6 +26,7 @@ #ifndef BRANRED_H #define BRANRED_H +#include <dla.h> #ifdef BIG_ENDI static const mynumber @@ -74,6 +75,6 @@ static const double toverp[75] = { /* 2/ PI base 24*/ 12618859.0, 4703257.0, 12806093.0, 14477321.0, 2786137.0, 12875403.0, 9837734.0, 14528324.0, 13719321.0, 343717.0 }; -static const double split = 134217729.0; +static const double split = CN; /* 2^27 + 1 */ #endif diff --git a/libc/sysdeps/ieee754/dbl-64/dbl2mpn.c b/libc/sysdeps/ieee754/dbl-64/dbl2mpn.c index 2b437a901..f2294de5a 100644 --- a/libc/sysdeps/ieee754/dbl-64/dbl2mpn.c +++ b/libc/sysdeps/ieee754/dbl-64/dbl2mpn.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1994,1995,1996,1997,2003 Free Software Foundation, Inc. +/* Copyright (C) 1993-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libc/sysdeps/ieee754/dbl-64/dla.h b/libc/sysdeps/ieee754/dbl-64/dla.h index c92fcfe34..b09f00ec7 100644 --- a/libc/sysdeps/ieee754/dbl-64/dla.h +++ b/libc/sysdeps/ieee754/dbl-64/dla.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -34,7 +34,8 @@ /* IEEE double. */ /***********************************************************************/ -/* CN = 1+2**27 = '41a0000002000000' IEEE double format */ +/* CN = 1+2**27 = '41a0000002000000' IEEE double format. Use it to split a + double for better accuracy. */ #define CN 134217729.0 diff --git a/libc/sysdeps/ieee754/dbl-64/doasin.c b/libc/sysdeps/ieee754/dbl-64/doasin.c index c041612b6..ff444d5ca 100644 --- a/libc/sysdeps/ieee754/dbl-64/doasin.c +++ b/libc/sysdeps/ieee754/dbl-64/doasin.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/doasin.h b/libc/sysdeps/ieee754/dbl-64/doasin.h index ed27e27f2..554821078 100644 --- a/libc/sysdeps/ieee754/dbl-64/doasin.h +++ b/libc/sysdeps/ieee754/dbl-64/doasin.h @@ -2,7 +2,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/dosincos.c b/libc/sysdeps/ieee754/dbl-64/dosincos.c index e472438a9..bbef186ad 100644 --- a/libc/sysdeps/ieee754/dbl-64/dosincos.c +++ b/libc/sysdeps/ieee754/dbl-64/dosincos.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/dosincos.h b/libc/sysdeps/ieee754/dbl-64/dosincos.h index 94f134c5e..49a22c8d7 100644 --- a/libc/sysdeps/ieee754/dbl-64/dosincos.h +++ b/libc/sysdeps/ieee754/dbl-64/dosincos.h @@ -2,7 +2,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/e_asin.c b/libc/sysdeps/ieee754/dbl-64/e_asin.c index a9b1bc216..5585ad1d0 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_asin.c +++ b/libc/sysdeps/ieee754/dbl-64/e_asin.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/e_atan2.c b/libc/sysdeps/ieee754/dbl-64/e_atan2.c index 497afcab1..ee3215ed3 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_atan2.c +++ b/libc/sysdeps/ieee754/dbl-64/e_atan2.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001-2012 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/e_atanh.c b/libc/sysdeps/ieee754/dbl-64/e_atanh.c index 6cec1093c..958e9375c 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_atanh.c +++ b/libc/sysdeps/ieee754/dbl-64/e_atanh.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011, 2012 Free Software Foundation, Inc. +/* Copyright (C) 2011-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gmail.com>, 2011. diff --git a/libc/sysdeps/ieee754/dbl-64/e_exp.c b/libc/sysdeps/ieee754/dbl-64/e_exp.c index 5deba5e44..0f9d87ba5 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_exp.c +++ b/libc/sysdeps/ieee754/dbl-64/e_exp.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001-2012 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/e_exp10.c b/libc/sysdeps/ieee754/dbl-64/e_exp10.c index eeb63a698..50b97f17a 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_exp10.c +++ b/libc/sysdeps/ieee754/dbl-64/e_exp10.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Free Software Foundation, Inc. +/* Copyright (C) 2012-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libc/sysdeps/ieee754/dbl-64/e_exp2.c b/libc/sysdeps/ieee754/dbl-64/e_exp2.c index e57ec9211..96ec735e3 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_exp2.c +++ b/libc/sysdeps/ieee754/dbl-64/e_exp2.c @@ -1,6 +1,5 @@ /* Double-precision floating point 2^x. - Copyright (C) 1997,1998,2000,2001,2005,2006,2011 - Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Geoffrey Keating <geoffk@ozemail.com.au> diff --git a/libc/sysdeps/ieee754/dbl-64/e_gamma_r.c b/libc/sysdeps/ieee754/dbl-64/e_gamma_r.c index 62b5db9b2..987355175 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_gamma_r.c +++ b/libc/sysdeps/ieee754/dbl-64/e_gamma_r.c @@ -1,5 +1,5 @@ /* Implementation of gamma function according to ISO C. - Copyright (C) 1997, 1999, 2001, 2004, 2011 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/e_log.c b/libc/sysdeps/ieee754/dbl-64/e_log.c index 15f3dccce..762639bcd 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_log.c +++ b/libc/sysdeps/ieee754/dbl-64/e_log.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/e_pow.c b/libc/sysdeps/ieee754/dbl-64/e_pow.c index 513171891..ee2711322 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_pow.c +++ b/libc/sysdeps/ieee754/dbl-64/e_pow.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001-2012 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -95,10 +95,10 @@ __ieee754_pow(double x, double y) { if (ABS (y) < 0x1p-64) y = y < 0 ? -0x1p-64 : 0x1p-64; z = log1(x,&aa,&error); /* x^y =e^(y log (X)) */ - t = y*134217729.0; + t = y*CN; y1 = t - (t-y); y2 = y - y1; - t = z*134217729.0; + t = z*CN; a1 = t - (t-z); a2 = (z - a1)+aa; a = y1*a1; @@ -182,10 +182,10 @@ SECTION power1(double x, double y) { double z,a,aa,error, t,a1,a2,y1,y2; z = my_log2(x,&aa,&error); - t = y*134217729.0; + t = y*CN; y1 = t - (t-y); y2 = y - y1; - t = z*134217729.0; + t = z*CN; a1 = t - (t-z); a2 = z - a1; a = y*z; diff --git a/libc/sysdeps/ieee754/dbl-64/e_remainder.c b/libc/sysdeps/ieee754/dbl-64/e_remainder.c index 304b45d95..ac4b55f9d 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_remainder.c +++ b/libc/sysdeps/ieee754/dbl-64/e_remainder.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/e_sqrt.c b/libc/sysdeps/ieee754/dbl-64/e_sqrt.c index 3dc64c7d5..f90ea0c07 100644 --- a/libc/sysdeps/ieee754/dbl-64/e_sqrt.c +++ b/libc/sysdeps/ieee754/dbl-64/e_sqrt.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/halfulp.c b/libc/sysdeps/ieee754/dbl-64/halfulp.c index 33c14e1aa..8c5a9312a 100644 --- a/libc/sysdeps/ieee754/dbl-64/halfulp.c +++ b/libc/sysdeps/ieee754/dbl-64/halfulp.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2005, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/mpa.c b/libc/sysdeps/ieee754/dbl-64/mpa.c index 7e0ee445c..7abad6782 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpa.c +++ b/libc/sysdeps/ieee754/dbl-64/mpa.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -45,17 +45,20 @@ #include "endian.h" #include "mpa.h" #include "mpa2.h" -#include <sys/param.h> /* For MIN() */ +#include <sys/param.h> #ifndef SECTION # define SECTION #endif +#ifndef NO__CONST +const mp_no mpone = {1, {1.0, 1.0}}; +const mp_no mptwo = {1, {1.0, 2.0}}; +#endif + #ifndef NO___ACR -/* mcr() compares the sizes of the mantissas of two multiple precision */ -/* numbers. Mantissas are compared regardless of the signs of the */ -/* numbers, even if x->d[0] or y->d[0] are zero. Exponents are also */ -/* disregarded. */ +/* Compare mantissa of two multiple precision numbers regardless of the sign + and exponent of the numbers. */ static int mcr(const mp_no *x, const mp_no *y, int p) { int i; @@ -66,8 +69,7 @@ mcr(const mp_no *x, const mp_no *y, int p) { return 0; } - -/* acr() compares the absolute values of two multiple precision numbers */ +/* Compare the absolute values of two multiple precision numbers. */ int __acr(const mp_no *x, const mp_no *y, int p) { int i; @@ -87,59 +89,22 @@ __acr(const mp_no *x, const mp_no *y, int p) { } #endif - -#if 0 -/* cr() compares the values of two multiple precision numbers */ -static int __cr(const mp_no *x, const mp_no *y, int p) { - int i; - - if (X[0] > Y[0]) i= 1; - else if (X[0] < Y[0]) i=-1; - else if (X[0] < ZERO ) i= __acr(y,x,p); - else i= __acr(x,y,p); - - return i; -} -#endif - - #ifndef NO___CPY -/* Copy a multiple precision number. Set *y=*x. x=y is permissible. */ +/* Copy multiple precision number X into Y. They could be the same + number. */ void __cpy(const mp_no *x, mp_no *y, int p) { EY = EX; for (int i=0; i <= p; i++) Y[i] = X[i]; } #endif - -#if 0 -/* Copy a multiple precision number x of precision m into a */ -/* multiple precision number y of precision n. In case n>m, */ -/* the digits of y beyond the m'th are set to zero. In case */ -/* n<m, the digits of x beyond the n'th are ignored. */ -/* x=y is permissible. */ - -static void __cpymn(const mp_no *x, int m, mp_no *y, int n) { - - int i,k; - - EY = EX; k=MIN(m,n); - for (i=0; i <= k; i++) Y[i] = X[i]; - for ( ; i <= n; i++) Y[i] = ZERO; -} -#endif - - #ifndef NO___MP_DBL -/* Convert a multiple precision number *x into a double precision */ -/* number *y, normalized case (|x| >= 2**(-1022))) */ +/* Convert a multiple precision number *X into a double precision + number *Y, normalized case (|x| >= 2**(-1022))). */ static void norm(const mp_no *x, double *y, int p) { - #define R radixi.d + #define R RADIXI int i; -#if 0 - int k; -#endif double a,c,u,v,z[5]; if (p<5) { if (p==1) c = X[1]; @@ -185,17 +150,14 @@ static void norm(const mp_no *x, double *y, int p) #undef R } -/* Convert a multiple precision number *x into a double precision */ -/* number *y, denormalized case (|x| < 2**(-1022))) */ +/* Convert a multiple precision number *X into a double precision + number *Y, Denormal case (|x| < 2**(-1022))). */ static void denorm(const mp_no *x, double *y, int p) { int i,k; double c,u,z[5]; -#if 0 - double a,v; -#endif -#define R radixi.d +#define R RADIXI if (EX<-44 || (EX==-44 && X[1]<TWO5)) { *y=ZERO; return; } @@ -232,28 +194,21 @@ static void denorm(const mp_no *x, double *y, int p) #undef R } -/* Convert a multiple precision number *x into a double precision number *y. */ -/* The result is correctly rounded to the nearest/even. *x is left unchanged */ - +/* Convert multiple precision number *X into double precision number *Y. The + result is correctly rounded to the nearest/even. */ void __mp_dbl(const mp_no *x, double *y, int p) { -#if 0 - int i,k; - double a,c,u,v,z[5]; -#endif if (X[0] == ZERO) {*y = ZERO; return; } - if (EX> -42) norm(x,y,p); - else if (EX==-42 && X[1]>=TWO10) norm(x,y,p); - else denorm(x,y,p); + if (__glibc_likely (EX > -42 || (EX == -42 && X[1] >= TWO10))) + norm(x,y,p); + else + denorm(x,y,p); } #endif - -/* dbl_mp() converts a double precision number x into a multiple precision */ -/* number *y. If the precision p is too small the result is truncated. x is */ -/* left unchanged. */ - +/* Get the multiple precision equivalent of X into *Y. If the precision is too + small, the result is truncated. */ void SECTION __dbl_mp(double x, mp_no *y, int p) { @@ -261,16 +216,16 @@ __dbl_mp(double x, mp_no *y, int p) { int i,n; double u; - /* Sign */ + /* Sign. */ if (x == ZERO) {Y[0] = ZERO; return; } else if (x > ZERO) Y[0] = ONE; else {Y[0] = MONE; x=-x; } - /* Exponent */ + /* Exponent. */ for (EY=ONE; x >= RADIX; EY += ONE) x *= RADIXI; for ( ; x < ONE; EY -= ONE) x *= RADIX; - /* Digits */ + /* Digits. */ n=MIN(p,4); for (i=1; i<=n; i++) { u = (x + TWO52) - TWO52; @@ -279,13 +234,10 @@ __dbl_mp(double x, mp_no *y, int p) { for ( ; i<=p; i++) Y[i] = ZERO; } - -/* add_magnitudes() adds the magnitudes of *x & *y assuming that */ -/* abs(*x) >= abs(*y) > 0. */ -/* The sign of the sum *z is undefined. x&y may overlap but not x&z or y&z. */ -/* No guard digit is used. The result equals the exact sum, truncated. */ -/* *x & *y are left unchanged. */ - +/* Add magnitudes of *X and *Y assuming that abs (*X) >= abs (*Y) > 0. The + sign of the sum *Z is not changed. X and Y may overlap but not X and Z or + Y and Z. No guard digit is used. The result equals the exact sum, + truncated. */ static void SECTION add_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) { @@ -323,13 +275,10 @@ add_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) { else EZ += ONE; } - -/* sub_magnitudes() subtracts the magnitudes of *x & *y assuming that */ -/* abs(*x) > abs(*y) > 0. */ -/* The sign of the difference *z is undefined. x&y may overlap but not x&z */ -/* or y&z. One guard digit is used. The error is less than one ulp. */ -/* *x & *y are left unchanged. */ - +/* Subtract the magnitudes of *X and *Y assuming that abs (*x) > abs (*y) > 0. + The sign of the difference *Z is not changed. X and Y may overlap but not X + and Z or Y and Z. One guard digit is used. The error is less than one + ULP. */ static void SECTION sub_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) { @@ -381,11 +330,9 @@ sub_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) { Z[k++] = ZERO; } - -/* Add two multiple precision numbers. Set *z = *x + *y. x&y may overlap */ -/* but not x&z or y&z. One guard digit is used. The error is less than */ -/* one ulp. *x & *y are left unchanged. */ - +/* Add *X and *Y and store the result in *Z. X and Y may overlap, but not X + and Z or Y and Z. One guard digit is used. The error is less than one + ULP. */ void SECTION __add(const mp_no *x, const mp_no *y, mp_no *z, int p) { @@ -406,11 +353,9 @@ __add(const mp_no *x, const mp_no *y, mp_no *z, int p) { } } - -/* Subtract two multiple precision numbers. *z is set to *x - *y. x&y may */ -/* overlap but not x&z or y&z. One guard digit is used. The error is */ -/* less than one ulp. *x & *y are left unchanged. */ - +/* Subtract *Y from *X and return the result in *Z. X and Y may overlap but + not X and Z or Y and Z. One guard digit is used. The error is less than + one ULP. */ void SECTION __sub(const mp_no *x, const mp_no *y, mp_no *z, int p) { @@ -431,68 +376,77 @@ __sub(const mp_no *x, const mp_no *y, mp_no *z, int p) { } } - -/* Multiply two multiple precision numbers. *z is set to *x * *y. x&y */ -/* may overlap but not x&z or y&z. In case p=1,2,3 the exact result is */ -/* truncated to p digits. In case p>3 the error is bounded by 1.001 ulp. */ -/* *x & *y are left unchanged. */ - +/* Multiply *X and *Y and store result in *Z. X and Y may overlap but not X + and Z or Y and Z. For P in [1, 2, 3], the exact result is truncated to P + digits. In case P > 3 the error is bounded by 1.001 ULP. */ void SECTION __mul(const mp_no *x, const mp_no *y, mp_no *z, int p) { - int i, i1, i2, j, k, k2; + int i, j, k, k2; double u; - /* Is z=0? */ - if (X[0]*Y[0]==ZERO) - { Z[0]=ZERO; return; } - - /* Multiply, add and carry */ - k2 = (p<3) ? p+p : p+3; - Z[k2]=ZERO; - for (k=k2; k>1; ) { - if (k > p) {i1=k-p; i2=p+1; } - else {i1=1; i2=k; } - for (i=i1,j=i2-1; i<i2; i++,j--) Z[k] += X[i]*Y[j]; - - u = (Z[k] + CUTTER)-CUTTER; - if (u > Z[k]) u -= RADIX; - Z[k] -= u; - Z[--k] = u*RADIXI; - } + /* Is z=0? */ + if (__glibc_unlikely (X[0] * Y[0] == ZERO)) + { + Z[0]=ZERO; + return; + } - /* Is there a carry beyond the most significant digit? */ - if (Z[1] == ZERO) { - for (i=1; i<=p; i++) Z[i]=Z[i+1]; - EZ = EX + EY - 1; } - else - EZ = EX + EY; + /* Multiply, add and carry. */ + k2 = (__glibc_unlikely (p < 3)) ? p + p : p + 3; + Z[k2] = ZERO; + + for (k = k2; k > p; ) + { + for (i = k - p, j = p; i < p + 1; i++, j--) + Z[k] += X[i] * Y[j]; + + u = (Z[k] + CUTTER) - CUTTER; + if (u > Z[k]) + u -= RADIX; + Z[k] -= u; + Z[--k] = u * RADIXI; + } + + while (k > 1) + { + for (i = 1,j = k - 1; i < k; i++, j--) + Z[k] += X[i] * Y[j]; + + u = (Z[k] + CUTTER) - CUTTER; + if (u > Z[k]) + u -= RADIX; + Z[k] -= u; + Z[--k] = u * RADIXI; + } + + EZ = EX + EY; + /* Is there a carry beyond the most significant digit? */ + if (__glibc_unlikely (Z[1] == ZERO)) + { + for (i = 1; i <= p; i++) + Z[i] = Z[i+1]; + EZ--; + } Z[0] = X[0] * Y[0]; } +/* Invert *X and store in *Y. Relative error bound: + - For P = 2: 1.001 * R ^ (1 - P) + - For P = 3: 1.063 * R ^ (1 - P) + - For P > 3: 2.001 * R ^ (1 - P) -/* Invert a multiple precision number. Set *y = 1 / *x. */ -/* Relative error bound = 1.001*r**(1-p) for p=2, 1.063*r**(1-p) for p=3, */ -/* 2.001*r**(1-p) for p>3. */ -/* *x=0 is not permissible. *x is left unchanged. */ - + *X = 0 is not permissible. */ static SECTION void __inv(const mp_no *x, mp_no *y, int p) { int i; -#if 0 - int l; -#endif double t; mp_no z,w; static const int np1[] = {0,0,0,0,1,2,2,2,2,3,3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4}; - const mp_no mptwo = {1,{1.0,2.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}; __cpy(x,&z,p); z.e=0; __mp_dbl(&z,&t,p); t=ONE/t; __dbl_mp(t,y,p); EY -= EX; @@ -505,12 +459,13 @@ void __inv(const mp_no *x, mp_no *y, int p) { } } +/* Divide *X by *Y and store result in *Z. X and Y may overlap but not X and Z + or Y and Z. Relative error bound: + - For P = 2: 2.001 * R ^ (1 - P) + - For P = 3: 2.063 * R ^ (1 - P) + - For P > 3: 3.001 * R ^ (1 - P) -/* Divide one multiple precision number by another.Set *z = *x / *y. *x & *y */ -/* are left unchanged. x&y may overlap but not x&z or y&z. */ -/* Relative error bound = 2.001*r**(1-p) for p=2, 2.063*r**(1-p) for p=3 */ -/* and 3.001*r**(1-p) for p>3. *y=0 is not permissible. */ - + *X = 0 is not permissible. */ void SECTION __dvd(const mp_no *x, const mp_no *y, mp_no *z, int p) { diff --git a/libc/sysdeps/ieee754/dbl-64/mpa.h b/libc/sysdeps/ieee754/dbl-64/mpa.h index 26ae2ac9d..77715fc05 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpa.h +++ b/libc/sysdeps/ieee754/dbl-64/mpa.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -23,15 +23,12 @@ /* FUNCTIONS: */ /* mcr */ /* acr */ -/* cr */ /* cpy */ -/* cpymn */ /* mp_dbl */ /* dbl_mp */ /* add */ /* sub */ /* mul */ -/* inv */ /* dvd */ /* */ /* Arithmetic functions for multiple precision numbers. */ @@ -39,20 +36,42 @@ /************************************************************************/ -typedef struct {/* This structure holds the details of a multi-precision */ - int e; /* floating point number, x: d[0] holds its sign (-1,0 or 1) */ - double d[40]; /* e holds its exponent (...,-2,-1,0,1,2,...) and */ -} mp_no; /* d[1]...d[p] hold its mantissa digits. The value of x is, */ - /* x = d[1]*r**(e-1) + d[2]*r**(e-2) + ... + d[p]*r**(e-p). */ - /* Here r = 2**24, 0 <= d[i] < r and 1 <= p <= 32. */ - /* p is a global variable. A multi-precision number is */ - /* always normalized. Namely, d[1] > 0. An exception is */ - /* a zero which is characterized by d[0] = 0. The terms */ - /* d[p+1], d[p+2], ... of a none zero number have no */ - /* significance and so are the terms e, d[1],d[2],... */ - /* of a zero. */ +/* The mp_no structure holds the details of a multi-precision floating point + number. -typedef union { int i[2]; double d; } number; + - The radix of the number (R) is 2 ^ 24. + + - E: The exponent of the number. + + - D[0]: The sign (-1, 1) or 0 if the value is 0. In the latter case, the + values of the remaining members of the structure are ignored. + + - D[1] - D[p]: The mantissa of the number where: + + 0 <= D[i] < R and + P is the precision of the number and 1 <= p <= 32 + + D[p+1] ... D[39] have no significance. + + - The value of the number is: + + D[1] * R ^ (E - 1) + D[2] * R ^ (E - 2) ... D[p] * R ^ (E - p) + + */ +typedef struct +{ + int e; + double d[40]; +} mp_no; + +typedef union +{ + int i[2]; + double d; +} number; + +extern const mp_no mpone; +extern const mp_no mptwo; #define X x->d #define Y y->d @@ -63,21 +82,18 @@ typedef union { int i[2]; double d; } number; #define ABS(x) ((x) < 0 ? -(x) : (x)) -int __acr(const mp_no *, const mp_no *, int); -// int __cr(const mp_no *, const mp_no *, int); -void __cpy(const mp_no *, mp_no *, int); -// void __cpymn(const mp_no *, int, mp_no *, int); -void __mp_dbl(const mp_no *, double *, int); -void __dbl_mp(double, mp_no *, int); -void __add(const mp_no *, const mp_no *, mp_no *, int); -void __sub(const mp_no *, const mp_no *, mp_no *, int); -void __mul(const mp_no *, const mp_no *, mp_no *, int); -// void __inv(const mp_no *, mp_no *, int); -void __dvd(const mp_no *, const mp_no *, mp_no *, int); +int __acr (const mp_no *, const mp_no *, int); +void __cpy (const mp_no *, mp_no *, int); +void __mp_dbl (const mp_no *, double *, int); +void __dbl_mp (double, mp_no *, int); +void __add (const mp_no *, const mp_no *, mp_no *, int); +void __sub (const mp_no *, const mp_no *, mp_no *, int); +void __mul (const mp_no *, const mp_no *, mp_no *, int); +void __dvd (const mp_no *, const mp_no *, mp_no *, int); extern void __mpatan (mp_no *, mp_no *, int); extern void __mpatan2 (mp_no *, mp_no *, mp_no *, int); extern void __mpsqrt (mp_no *, mp_no *, int); -extern void __mpexp (mp_no *, mp_no *__y, int); +extern void __mpexp (mp_no *, mp_no *, int); extern void __c32 (mp_no *, mp_no *, mp_no *, int); extern int __mpranred (double, mp_no *, int); diff --git a/libc/sysdeps/ieee754/dbl-64/mpa2.h b/libc/sysdeps/ieee754/dbl-64/mpa2.h index cfe22b883..b80bf412e 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpa2.h +++ b/libc/sysdeps/ieee754/dbl-64/mpa2.h @@ -2,7 +2,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -30,65 +30,21 @@ #ifndef MPA2_H #define MPA2_H - -#ifdef BIG_ENDI -static const number -/**/ radix = {{0x41700000, 0x00000000} }, /* 2**24 */ -/**/ radixi = {{0x3e700000, 0x00000000} }, /* 2**-24 */ -/**/ cutter = {{0x44b00000, 0x00000000} }, /* 2**76 */ -/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ one = {{0x3ff00000, 0x00000000} }, /* 1 */ -/**/ mone = {{0xbff00000, 0x00000000} }, /* -1 */ -/**/ two = {{0x40000000, 0x00000000} }, /* 2 */ -/**/ two5 = {{0x40400000, 0x00000000} }, /* 2**5 */ -/**/ two10 = {{0x40900000, 0x00000000} }, /* 2**10 */ -/**/ two18 = {{0x41100000, 0x00000000} }, /* 2**18 */ -/**/ two19 = {{0x41200000, 0x00000000} }, /* 2**19 */ -/**/ two23 = {{0x41600000, 0x00000000} }, /* 2**23 */ -/**/ two52 = {{0x43300000, 0x00000000} }, /* 2**52 */ -/**/ two57 = {{0x43800000, 0x00000000} }, /* 2**57 */ -/**/ two71 = {{0x44600000, 0x00000000} }, /* 2**71 */ -/**/ twom1032 = {{0x00000400, 0x00000000} }; /* 2**-1032 */ - -#else -#ifdef LITTLE_ENDI -static const number -/**/ radix = {{0x00000000, 0x41700000} }, /* 2**24 */ -/**/ radixi = {{0x00000000, 0x3e700000} }, /* 2**-24 */ -/**/ cutter = {{0x00000000, 0x44b00000} }, /* 2**76 */ -/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ one = {{0x00000000, 0x3ff00000} }, /* 1 */ -/**/ mone = {{0x00000000, 0xbff00000} }, /* -1 */ -/**/ two = {{0x00000000, 0x40000000} }, /* 2 */ -/**/ two5 = {{0x00000000, 0x40400000} }, /* 2**5 */ -/**/ two10 = {{0x00000000, 0x40900000} }, /* 2**10 */ -/**/ two18 = {{0x00000000, 0x41100000} }, /* 2**18 */ -/**/ two19 = {{0x00000000, 0x41200000} }, /* 2**19 */ -/**/ two23 = {{0x00000000, 0x41600000} }, /* 2**23 */ -/**/ two52 = {{0x00000000, 0x43300000} }, /* 2**52 */ -/**/ two57 = {{0x00000000, 0x43800000} }, /* 2**57 */ -/**/ two71 = {{0x00000000, 0x44600000} }, /* 2**71 */ -/**/ twom1032 = {{0x00000000, 0x00000400} }; /* 2**-1032 */ - -#endif -#endif - -#define RADIX radix.d -#define RADIXI radixi.d -#define CUTTER cutter.d -#define ZERO zero.d -#define ONE one.d -#define MONE mone.d -#define TWO two.d -#define TWO5 two5.d -#define TWO10 two10.d -#define TWO18 two18.d -#define TWO19 two19.d -#define TWO23 two23.d -#define TWO52 two52.d -#define TWO57 two57.d -#define TWO71 two71.d -#define TWOM1032 twom1032.d - +#define RADIX 0x1.0p24 /* 2^24 */ +#define RADIXI 0x1.0p-24 /* 2^-24 */ +#define CUTTER 0x1.0p76 /* 2^76 */ +#define ZERO 0.0 /* 0 */ +#define ONE 1.0 /* 1 */ +#define MONE -1.0 /* -1 */ +#define TWO -2.0 /* -2 */ +#define TWO5 0x1.0p5 /* 2^5 */ +#define TWO10 0x1.0p10 /* 2^10 */ +#define TWO18 0x1.0p18 /* 2^18 */ +#define TWO19 0x1.0p19 /* 2^19 */ +#define TWO23 0x1.0p23 /* 2^23 */ +#define TWO52 0x1.0p52 /* 2^52 */ +#define TWO57 0x1.0p57 /* 2^57 */ +#define TWO71 0x1.0p71 /* 2^71 */ +#define TWOM1032 0x1.0p-1032 /* 2^-1032 */ #endif diff --git a/libc/sysdeps/ieee754/dbl-64/mpatan.c b/libc/sysdeps/ieee754/dbl-64/mpatan.c index 80637e502..db5868092 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpatan.c +++ b/libc/sysdeps/ieee754/dbl-64/mpatan.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -48,19 +48,13 @@ __mpatan(mp_no *x, mp_no *y, int p) { int i,m,n; double dx; mp_no - mpone = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}, - mptwo = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}, mptwoim1 = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}; mp_no mps,mpsm,mpt,mpt1,mpt2,mpt3; - /* Choose m and initiate mpone, mptwo & mptwoim1 */ + /* Choose m and initiate mptwoim1 */ if (EX>0) m=7; else if (EX<0) m=0; else { @@ -68,9 +62,8 @@ __mpatan(mp_no *x, mp_no *y, int p) { for (m=6; m>0; m--) {if (dx>__atan_xm[m].d) break;} } - mpone.e = mptwo.e = mptwoim1.e = 1; - mpone.d[0] = mpone.d[1] = mptwo.d[0] = mptwoim1.d[0] = ONE; - mptwo.d[1] = TWO; + mptwoim1.e = 1; + mptwoim1.d[0] = ONE; /* Reduce x m times */ __mul(x,x,&mpsm,p); @@ -101,7 +94,7 @@ __mpatan(mp_no *x, mp_no *y, int p) { __sub(&mps,&mpt1,&mpt,p); /* Compute Atan(x) */ - mptwoim1.d[1] = __atan_twom[m].d; + mptwoim1.d[1] = 1 << m; __mul(&mptwoim1,&mpt,y,p); return; diff --git a/libc/sysdeps/ieee754/dbl-64/mpatan.h b/libc/sysdeps/ieee754/dbl-64/mpatan.h index c56b9b5fc..d8e758916 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpatan.h +++ b/libc/sysdeps/ieee754/dbl-64/mpatan.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -30,8 +30,6 @@ extern const number __atan_xm[8] attribute_hidden; extern const number __atan_twonm1[33] attribute_hidden; extern const number __atan_twom[8] attribute_hidden; -extern const number __atan_one attribute_hidden; -extern const number __atan_two attribute_hidden; extern const int __atan_np[33] attribute_hidden; @@ -85,22 +83,6 @@ extern const int __atan_np[33] attribute_hidden; /**/ {{0x405d4000, 0x00000000} }, /* 117 */ }; - const number - __atan_twom[8] = { /* 2**m */ -/**/ {{0x3ff00000, 0x00000000} }, /* 1.0 */ -/**/ {{0x40000000, 0x00000000} }, /* 2.0 */ -/**/ {{0x40100000, 0x00000000} }, /* 4.0 */ -/**/ {{0x40200000, 0x00000000} }, /* 8.0 */ -/**/ {{0x40300000, 0x00000000} }, /* 16.0 */ -/**/ {{0x40400000, 0x00000000} }, /* 32.0 */ -/**/ {{0x40500000, 0x00000000} }, /* 64.0 */ -/**/ {{0x40600000, 0x00000000} }, /* 128.0 */ - }; - - const number -/**/ __atan_one = {{0x3ff00000, 0x00000000} }, /* 1 */ -/**/ __atan_two = {{0x40000000, 0x00000000} }; /* 2 */ - #else #ifdef LITTLE_ENDI @@ -152,22 +134,6 @@ __atan_twonm1[33] = { /* 2n-1 */ /**/ {{0x00000000, 0x405d4000} }, /* 117 */ }; - const number - __atan_twom[8] = { /* 2**m */ -/**/ {{0x00000000, 0x3ff00000} }, /* 1.0 */ -/**/ {{0x00000000, 0x40000000} }, /* 2.0 */ -/**/ {{0x00000000, 0x40100000} }, /* 4.0 */ -/**/ {{0x00000000, 0x40200000} }, /* 8.0 */ -/**/ {{0x00000000, 0x40300000} }, /* 16.0 */ -/**/ {{0x00000000, 0x40400000} }, /* 32.0 */ -/**/ {{0x00000000, 0x40500000} }, /* 64.0 */ -/**/ {{0x00000000, 0x40600000} }, /* 128.0 */ - }; - - const number -/**/ __atan_one = {{0x00000000, 0x3ff00000} }, /* 1 */ -/**/ __atan_two = {{0x00000000, 0x40000000} }; /* 2 */ - #endif #endif @@ -178,5 +144,5 @@ __atan_twonm1[33] = { /* 2n-1 */ #endif #endif -#define ONE __atan_one.d -#define TWO __atan_two.d +#define ONE 1.0 +#define TWO 2.0 diff --git a/libc/sysdeps/ieee754/dbl-64/mpatan2.c b/libc/sysdeps/ieee754/dbl-64/mpatan2.c index e9c974526..9084d98d6 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpatan2.c +++ b/libc/sysdeps/ieee754/dbl-64/mpatan2.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -51,14 +51,10 @@ __mpatan2(mp_no *y, mp_no *x, mp_no *z, int p) { static const double ZERO = 0.0, ONE = 1.0; - mp_no mpone = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}; mp_no mpt1,mpt2,mpt3; if (X[0] <= ZERO) { - mpone.e = 1; mpone.d[0] = mpone.d[1] = ONE; __dvd(x,y,&mpt1,p); __mul(&mpt1,&mpt1,&mpt2,p); if (mpt1.d[0] != ZERO) mpt1.d[0] = ONE; __add(&mpt2,&mpone,&mpt3,p); __mpsqrt(&mpt3,&mpt2,p); diff --git a/libc/sysdeps/ieee754/dbl-64/mpexp.c b/libc/sysdeps/ieee754/dbl-64/mpexp.c index 6b1fcf255..c4048207e 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpexp.c +++ b/libc/sysdeps/ieee754/dbl-64/mpexp.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -31,6 +31,7 @@ #include "endian.h" #include "mpa.h" #include "mpexp.h" +#include <assert.h> #ifndef SECTION # define SECTION @@ -56,9 +57,6 @@ __mpexp(mp_no *x, mp_no *y, int p) { { 0, 0, 0, 0, 0, 0,23,28,33,38,42,47,52,57,62,66, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0,27, 0, 0,39,43,47,51,55,59,63}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,43,47,50,54}}; - mp_no mpone = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}; mp_no mpk = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}; @@ -74,23 +72,34 @@ __mpexp(mp_no *x, mp_no *y, int p) { for (i=2; i<=p; i++) { if (X[i]!=ZERO) break; } if (i==p+1) { m2--; a *= TWO; } } - if ((m=m1+m2) <= 0) { - m=0; a=ONE; - for (i=n-1; i>0; i--,n--) { if (m1np[i][p]+m2>0) break; } - } + + m = m1 + m2; + if (__glibc_unlikely (m <= 0)) + { + /* The m1np array which is used to determine if we can reduce the + polynomial expansion iterations, has only 18 elements. Besides, + numbers smaller than those required by p >= 18 should not come here + at all since the fast phase of exp returns 1.0 for anything less + than 2^-55. */ + assert (p < 18); + m = 0; + a = ONE; + for (i = n - 1; i > 0; i--, n--) + if (m1np[i][p] + m2 > 0) + break; + } /* Compute s=x*2**(-m). Put result in mps */ __dbl_mp(a,&mpt1,p); __mul(x,&mpt1,&mps,p); /* Evaluate the polynomial. Put result in mpt2 */ - mpone.e=1; mpone.d[0]=ONE; mpone.d[1]=ONE; - mpk.e = 1; mpk.d[0] = ONE; mpk.d[1]=__mpexp_nn[n].d; + mpk.e = 1; mpk.d[0] = ONE; mpk.d[1]=n; __dvd(&mps,&mpk,&mpt1,p); __add(&mpone,&mpt1,&mpak,p); for (k=n-1; k>1; k--) { __mul(&mps,&mpak,&mpt1,p); - mpk.d[1]=__mpexp_nn[k].d; + mpk.d[1] = k; __dvd(&mpt1,&mpk,&mpt2,p); __add(&mpone,&mpt2,&mpak,p); } diff --git a/libc/sysdeps/ieee754/dbl-64/mpexp.h b/libc/sysdeps/ieee754/dbl-64/mpexp.h index 390e2720b..2b2638607 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpexp.h +++ b/libc/sysdeps/ieee754/dbl-64/mpexp.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -28,23 +28,15 @@ #define MPEXP_H extern const number __mpexp_twomm1[33] attribute_hidden; -extern const number __mpexp_nn[9] attribute_hidden; -extern const number __mpexp_radix attribute_hidden; -extern const number __mpexp_radixi attribute_hidden; -extern const number __mpexp_zero attribute_hidden; -extern const number __mpexp_one attribute_hidden; -extern const number __mpexp_two attribute_hidden; -extern const number __mpexp_half attribute_hidden; - #ifndef AVOID_MPEXP_H #ifdef BIG_ENDI const number __mpexp_twomm1[33] = { /* 2**-m1 */ -/**/ {{0x00000000, 0x00000000} }, /* 0 */ -/**/ {{0x00000000, 0x00000000} }, /* 0 */ -/**/ {{0x00000000, 0x00000000} }, /* 0 */ -/**/ {{0x00000000, 0x00000000} }, /* 0 */ +/**/ {{0x3ff00000, 0x00000000} }, /* 1 */ +/**/ {{0x3ff00000, 0x00000000} }, /* 1 */ +/**/ {{0x3ff00000, 0x00000000} }, /* 1 */ +/**/ {{0x3ff00000, 0x00000000} }, /* 1 */ /**/ {{0x3ee00000, 0x00000000} }, /* 2**-17 */ /**/ {{0x3e800000, 0x00000000} }, /* 2**-23 */ /**/ {{0x3e800000, 0x00000000} }, /* 2**-23 */ @@ -75,35 +67,15 @@ extern const number __mpexp_half attribute_hidden; /**/ {{0x3b100000, 0x00000000} }, /* 2**-78 */ /**/ {{0x3ae00000, 0x00000000} }, /* 2**-81 */ }; - const number - __mpexp_nn[9]={ /* n */ -/**/ {{0x00000000, 0x00000000} }, /* 0 */ -/**/ {{0x3ff00000, 0x00000000} }, /* 1 */ -/**/ {{0x40000000, 0x00000000} }, /* 2 */ -/**/ {{0x40080000, 0x00000000} }, /* 3 */ -/**/ {{0x40100000, 0x00000000} }, /* 4 */ -/**/ {{0x40140000, 0x00000000} }, /* 5 */ -/**/ {{0x40180000, 0x00000000} }, /* 6 */ -/**/ {{0x401c0000, 0x00000000} }, /* 7 */ -/**/ {{0x40200000, 0x00000000} }, /* 8 */ - }; - - const number -/**/ __mpexp_radix = {{0x41700000, 0x00000000} }, /* 2**24 */ -/**/ __mpexp_radixi = {{0x3e700000, 0x00000000} }, /* 2**-24 */ -/**/ __mpexp_zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ __mpexp_one = {{0x3ff00000, 0x00000000} }, /* 1 */ -/**/ __mpexp_two = {{0x40000000, 0x00000000} }, /* 2 */ -/**/ __mpexp_half = {{0x3fe00000, 0x00000000} }; /* 1/2 */ #else #ifdef LITTLE_ENDI const number __mpexp_twomm1[33] = { /* 2**-m1 */ -/**/ {{0x00000000, 0x00000000} }, /* 0 */ -/**/ {{0x00000000, 0x00000000} }, /* 0 */ -/**/ {{0x00000000, 0x00000000} }, /* 0 */ -/**/ {{0x00000000, 0x00000000} }, /* 0 */ +/**/ {{0x00000000, 0x3ff00000} }, /* 1 */ +/**/ {{0x00000000, 0x3ff00000} }, /* 1 */ +/**/ {{0x00000000, 0x3ff00000} }, /* 1 */ +/**/ {{0x00000000, 0x3ff00000} }, /* 1 */ /**/ {{0x00000000, 0x3ee00000} }, /* 2**-17 */ /**/ {{0x00000000, 0x3e800000} }, /* 2**-23 */ /**/ {{0x00000000, 0x3e800000} }, /* 2**-23 */ @@ -134,36 +106,16 @@ extern const number __mpexp_half attribute_hidden; /**/ {{0x00000000, 0x3b100000} }, /* 2**-78 */ /**/ {{0x00000000, 0x3ae00000} }, /* 2**-81 */ }; - const number - __mpexp_nn[9]={ /* n */ -/**/ {{0x00000000, 0x00000000} }, /* 0 */ -/**/ {{0x00000000, 0x3ff00000} }, /* 1 */ -/**/ {{0x00000000, 0x40000000} }, /* 2 */ -/**/ {{0x00000000, 0x40080000} }, /* 3 */ -/**/ {{0x00000000, 0x40100000} }, /* 4 */ -/**/ {{0x00000000, 0x40140000} }, /* 5 */ -/**/ {{0x00000000, 0x40180000} }, /* 6 */ -/**/ {{0x00000000, 0x401c0000} }, /* 7 */ -/**/ {{0x00000000, 0x40200000} }, /* 8 */ - }; - - const number -/**/ __mpexp_radix = {{0x00000000, 0x41700000} }, /* 2**24 */ -/**/ __mpexp_radixi = {{0x00000000, 0x3e700000} }, /* 2**-24 */ -/**/ __mpexp_zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ __mpexp_one = {{0x00000000, 0x3ff00000} }, /* 1 */ -/**/ __mpexp_two = {{0x00000000, 0x40000000} }, /* 2 */ -/**/ __mpexp_half = {{0x00000000, 0x3fe00000} }; /* 1/2 */ #endif #endif #endif -#define RADIX __mpexp_radix.d -#define RADIXI __mpexp_radixi.d -#define ZERO __mpexp_zero.d -#define ONE __mpexp_one.d -#define TWO __mpexp_two.d -#define HALF __mpexp_half.d +#define RADIX 0x1.0p24 /* 2^24 */ +#define RADIXI 0x1.0p-24 /* 2^-24 */ +#define ZERO 0.0 /* 0 */ +#define ONE 1.0 /* 1 */ +#define TWO 2.0 /* 2 */ +#define HALF 0x1.0p-1 /* 1/2 */ #endif diff --git a/libc/sysdeps/ieee754/dbl-64/mplog.c b/libc/sysdeps/ieee754/dbl-64/mplog.c index 8255e2a10..e3d10846e 100644 --- a/libc/sysdeps/ieee754/dbl-64/mplog.c +++ b/libc/sysdeps/ieee754/dbl-64/mplog.c @@ -2,7 +2,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -40,21 +40,13 @@ void __mpexp(mp_no *, mp_no *, int); void __mplog(mp_no *x, mp_no *y, int p) { -#include "mplog.h" int i,m; -#if 0 - int j,k,m1,m2,n; - double a,b; -#endif static const int mp[33] = {0,0,0,0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4,4,4,4,4,4,4}; - mp_no mpone = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}; mp_no mpt1,mpt2; - /* Choose m and initiate mpone */ - m = mp[p]; mpone.e = 1; mpone.d[0]=mpone.d[1]=ONE; + /* Choose m */ + m = mp[p]; /* Perform m newton iterations to solve for y: exp(y)-x=0. */ /* The iterations formula is: y(n+1)=y(n)+(x*exp(-y(n))-1). */ diff --git a/libc/sysdeps/ieee754/dbl-64/mplog.h b/libc/sysdeps/ieee754/dbl-64/mplog.h deleted file mode 100644 index b967f5242..000000000 --- a/libc/sysdeps/ieee754/dbl-64/mplog.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * IBM Accurate Mathematical Library - * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, see <http://www.gnu.org/licenses/>. - */ - -/******************************************************************/ -/* */ -/* MODULE_NAME:mplog.h */ -/* */ -/* common data and variables prototype and definition */ -/******************************************************************/ - -#ifndef MPLOG_H -#define MPLOG_H - -#ifdef BIG_ENDI - static const number -/**/ one = {{0x3ff00000, 0x00000000} }; /* 1 */ - -#else -#ifdef LITTLE_ENDI - static const number -/**/ one = {{0x00000000, 0x3ff00000} }; /* 1 */ - -#endif -#endif - -#define ONE one.d - -#endif diff --git a/libc/sysdeps/ieee754/dbl-64/mpn2dbl.c b/libc/sysdeps/ieee754/dbl-64/mpn2dbl.c index 3df05ce2d..8a2f45b9d 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpn2dbl.c +++ b/libc/sysdeps/ieee754/dbl-64/mpn2dbl.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,2002,2003 Free Software Foundation, Inc. +/* Copyright (C) 1995-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libc/sysdeps/ieee754/dbl-64/mpsqrt.c b/libc/sysdeps/ieee754/dbl-64/mpsqrt.c index 92bf5ef87..65df9fd06 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpsqrt.c +++ b/libc/sysdeps/ieee754/dbl-64/mpsqrt.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -52,19 +52,11 @@ SECTION __mpsqrt(mp_no *x, mp_no *y, int p) { int i,m,ey; double dx,dy; - mp_no - mphalf = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}, - mp3halfs = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}; + static const mp_no + mphalf = {0,{1.0,8388608.0 /* 2^23 */}}, + mp3halfs = {1,{1.0,1.0,8388608.0 /* 2^23 */}}; mp_no mpxn,mpz,mpu,mpt1,mpt2; - /* Prepare multi-precision 1/2 and 3/2 */ - mphalf.e =0; mphalf.d[0] =ONE; mphalf.d[1] =HALFRAD; - mp3halfs.e=1; mp3halfs.d[0]=ONE; mp3halfs.d[1]=ONE; mp3halfs.d[2]=HALFRAD; - ey=EX/2; __cpy(x,&mpxn,p); mpxn.e -= (ey+ey); __mp_dbl(&mpxn,&dx,p); dy=fastiroot(dx); __dbl_mp(dy,&mpu,p); __mul(&mpxn,&mphalf,&mpz,p); diff --git a/libc/sysdeps/ieee754/dbl-64/mpsqrt.h b/libc/sysdeps/ieee754/dbl-64/mpsqrt.h index 7cf5b691b..c7354970a 100644 --- a/libc/sysdeps/ieee754/dbl-64/mpsqrt.h +++ b/libc/sysdeps/ieee754/dbl-64/mpsqrt.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -27,31 +27,15 @@ #ifndef MPSQRT_H #define MPSQRT_H -extern const number __mpsqrt_one attribute_hidden; -extern const number __mpsqrt_halfrad attribute_hidden; extern const int __mpsqrt_mp[33] attribute_hidden; #ifndef AVOID_MPSQRT_H -#ifdef BIG_ENDI - const number -/**/ __mpsqrt_one = {{0x3ff00000, 0x00000000} }, /* 1 */ -/**/ __mpsqrt_halfrad = {{0x41600000, 0x00000000} }; /* 2**23 */ - -#else -#ifdef LITTLE_ENDI - const number -/**/ __mpsqrt_one = {{0x00000000, 0x3ff00000} }, /* 1 */ -/**/ __mpsqrt_halfrad = {{0x00000000, 0x41600000} }; /* 2**23 */ - -#endif -#endif - const int __mpsqrt_mp[33] = {0,0,0,0,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4}; #endif -#define ONE __mpsqrt_one.d -#define HALFRAD __mpsqrt_halfrad.d +#define ONE 1.0 /* 1 */ +#define HALFRAD 0x1.0p23 /* 2^23 */ #endif diff --git a/libc/sysdeps/ieee754/dbl-64/mptan.c b/libc/sysdeps/ieee754/dbl-64/mptan.c index e75b2dabf..6e08b0dc8 100644 --- a/libc/sysdeps/ieee754/dbl-64/mptan.c +++ b/libc/sysdeps/ieee754/dbl-64/mptan.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/mydefs.h b/libc/sysdeps/ieee754/dbl-64/mydefs.h index adf8d1753..89ca965c6 100644 --- a/libc/sysdeps/ieee754/dbl-64/mydefs.h +++ b/libc/sysdeps/ieee754/dbl-64/mydefs.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/powtwo.tbl b/libc/sysdeps/ieee754/dbl-64/powtwo.tbl index 6cc868a18..4d0aa7af0 100644 --- a/libc/sysdeps/ieee754/dbl-64/powtwo.tbl +++ b/libc/sysdeps/ieee754/dbl-64/powtwo.tbl @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/root.tbl b/libc/sysdeps/ieee754/dbl-64/root.tbl index 5cb29f1a4..6ceddee39 100644 --- a/libc/sysdeps/ieee754/dbl-64/root.tbl +++ b/libc/sysdeps/ieee754/dbl-64/root.tbl @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/s_atan.c b/libc/sysdeps/ieee754/dbl-64/s_atan.c index 4e125deb4..37442b72e 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_atan.c +++ b/libc/sysdeps/ieee754/dbl-64/s_atan.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/s_cbrt.c b/libc/sysdeps/ieee754/dbl-64/s_cbrt.c index 30bd3a630..a7120e1e1 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_cbrt.c +++ b/libc/sysdeps/ieee754/dbl-64/s_cbrt.c @@ -1,5 +1,5 @@ /* Compute cubic root of double value. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Dirk Alboth <dirka@uni-paderborn.de> and Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/s_fma.c b/libc/sysdeps/ieee754/dbl-64/s_fma.c index 8c69b987e..06c0d2ae6 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_fma.c +++ b/libc/sysdeps/ieee754/dbl-64/s_fma.c @@ -1,5 +1,5 @@ /* Compute x * y + z as ternary operation. - Copyright (C) 2010-2012 Free Software Foundation, Inc. + Copyright (C) 2010-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2010. diff --git a/libc/sysdeps/ieee754/dbl-64/s_fmaf.c b/libc/sysdeps/ieee754/dbl-64/s_fmaf.c index a4f12d9f7..e92145054 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_fmaf.c +++ b/libc/sysdeps/ieee754/dbl-64/s_fmaf.c @@ -1,5 +1,5 @@ /* Compute x * y + z as ternary operation. - Copyright (C) 2010-2012 Free Software Foundation, Inc. + Copyright (C) 2010-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2010. diff --git a/libc/sysdeps/ieee754/dbl-64/s_fpclassify.c b/libc/sysdeps/ieee754/dbl-64/s_fpclassify.c index 4884b377f..0f72454f1 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_fpclassify.c +++ b/libc/sysdeps/ieee754/dbl-64/s_fpclassify.c @@ -1,5 +1,5 @@ /* Return classification value corresponding to argument. - Copyright (C) 1997, 2002 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/s_llrint.c b/libc/sysdeps/ieee754/dbl-64/s_llrint.c index 5bb50090c..0cbc39a55 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_llrint.c +++ b/libc/sysdeps/ieee754/dbl-64/s_llrint.c @@ -1,6 +1,6 @@ /* Round argument to nearest integral value according to current rounding direction. - Copyright (C) 1997, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/s_llround.c b/libc/sysdeps/ieee754/dbl-64/s_llround.c index 89516bae5..e8c2232e9 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_llround.c +++ b/libc/sysdeps/ieee754/dbl-64/s_llround.c @@ -1,5 +1,5 @@ /* Round double value to long long int. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/s_lrint.c b/libc/sysdeps/ieee754/dbl-64/s_lrint.c index d1561bfd2..a68c97e59 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_lrint.c +++ b/libc/sysdeps/ieee754/dbl-64/s_lrint.c @@ -1,6 +1,6 @@ /* Round argument to nearest integral value according to current rounding direction. - Copyright (C) 1997, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/s_lround.c b/libc/sysdeps/ieee754/dbl-64/s_lround.c index 4cb9ca42f..e9dfcbaab 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_lround.c +++ b/libc/sysdeps/ieee754/dbl-64/s_lround.c @@ -1,5 +1,5 @@ /* Round double value to long int. - Copyright (C) 1997, 2004 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/s_remquo.c b/libc/sysdeps/ieee754/dbl-64/s_remquo.c index 174dde40f..642581ede 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_remquo.c +++ b/libc/sysdeps/ieee754/dbl-64/s_remquo.c @@ -1,5 +1,5 @@ /* Compute remainder and a congruent to the quotient. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/s_round.c b/libc/sysdeps/ieee754/dbl-64/s_round.c index 046d5863a..7913ac061 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_round.c +++ b/libc/sysdeps/ieee754/dbl-64/s_round.c @@ -1,5 +1,5 @@ /* Round double to integer away from zero. - Copyright (C) 1997, 2011 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/s_signbit.c b/libc/sysdeps/ieee754/dbl-64/s_signbit.c index 3e576f7a3..bc1edac48 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_signbit.c +++ b/libc/sysdeps/ieee754/dbl-64/s_signbit.c @@ -1,5 +1,5 @@ /* Return nonzero value if number is negative. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/s_sin.c b/libc/sysdeps/ieee754/dbl-64/s_sin.c index 7b9252f81..496f1e191 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_sin.c +++ b/libc/sysdeps/ieee754/dbl-64/s_sin.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001-2012 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/s_sincos.c b/libc/sysdeps/ieee754/dbl-64/s_sincos.c index 4d55c71da..b6d5432f4 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_sincos.c +++ b/libc/sysdeps/ieee754/dbl-64/s_sincos.c @@ -1,5 +1,5 @@ /* Compute sine and cosine of argument. - Copyright (C) 1997, 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/s_tan.c b/libc/sysdeps/ieee754/dbl-64/s_tan.c index f8507eaa4..c5446a6e5 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_tan.c +++ b/libc/sysdeps/ieee754/dbl-64/s_tan.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2009, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -84,7 +84,7 @@ tan(double x) { goto ret; } - w=(x<ZERO) ? -x : x; + w=(x<0.0) ? -x : x; /* (I) The case abs(x) <= 1.259e-8 */ if (w<=g1.d) { retval = x; goto ret; } @@ -101,7 +101,7 @@ tan(double x) { c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+ x2*a27.d)))))); EMULV(x,x,x2,xx2,t1,t2,t3,t4,t5) - ADD2(a13.d,aa13.d,c1,zero.d,c2,cc2,t1,t2) + ADD2(a13.d,aa13.d,c1,0.0,c2,cc2,t1,t2) MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) ADD2(a11.d,aa11.d,c1,cc1,c2,cc2,t1,t2) MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) @@ -113,8 +113,8 @@ tan(double x) { MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) ADD2(a3.d ,aa3.d ,c1,cc1,c2,cc2,t1,t2) MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) - MUL2(x ,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8) - ADD2(x ,zero.d,c2,cc2,c1,cc1,t1,t2) + MUL2(x ,0.0,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8) + ADD2(x ,0.0,c2,cc2,c1,cc1,t1,t2) if ((y=c1+(cc1-u2.d*c1)) == c1+(cc1+u2.d*c1)) { retval = y; goto ret; } retval = tanMp(x); goto ret; @@ -125,11 +125,11 @@ tan(double x) { /* First stage */ i = ((int) (mfftnhf.d+TWO8*w)); - z = w-xfg[i][0].d; z2 = z*z; s = (x<ZERO) ? MONE : ONE; + z = w-xfg[i][0].d; z2 = z*z; s = (x<0.0) ? MONE : ONE; pz = z+z*z2*(e0.d+z2*e1.d); fi = xfg[i][1].d; gi = xfg[i][2].d; t2 = pz*(gi+fi)/(gi-pz); if ((y=fi+(t2-fi*u3.d))==fi+(t2+fi*u3.d)) { retval = (s*y); goto ret; } - t3 = (t2<ZERO) ? -t2 : t2; + t3 = (t2<0.0) ? -t2 : t2; t4 = fi*ua3.d+t3*ub3.d; if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (s*y); goto ret; } @@ -137,16 +137,16 @@ tan(double x) { ffi = xfg[i][3].d; c1 = z2*(a7.d+z2*(a9.d+z2*a11.d)); EMULV(z,z,z2,zz2,t1,t2,t3,t4,t5) - ADD2(a5.d,aa5.d,c1,zero.d,c2,cc2,t1,t2) + ADD2(a5.d,aa5.d,c1,0.0,c2,cc2,t1,t2) MUL2(z2,zz2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) ADD2(a3.d,aa3.d,c1,cc1,c2,cc2,t1,t2) MUL2(z2,zz2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) - MUL2(z ,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8) - ADD2(z ,zero.d,c2,cc2,c1,cc1,t1,t2) + MUL2(z ,0.0,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8) + ADD2(z ,0.0,c2,cc2,c1,cc1,t1,t2) ADD2(fi ,ffi,c1,cc1,c2,cc2,t1,t2) MUL2(fi ,ffi,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8) - SUB2(one.d,zero.d,c3,cc3,c1,cc1,t1,t2) + SUB2(1.0,0.0,c3,cc3,c1,cc1,t1,t2) DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) if ((y=c3+(cc3-u4.d*c3))==c3+(cc3+u4.d*c3)) { retval = (s*y); goto ret; } @@ -165,7 +165,7 @@ tan(double x) { da = xn*mp3.d; a=t1-da; da = (t1-a)-da; - if (a<ZERO) {ya=-a; yya=-da; sy=MONE;} + if (a<0.0) {ya=-a; yya=-da; sy=MONE;} else {ya= a; yya= da; sy= ONE;} /* (IV),(V) The case 0.787 < abs(x) <= 25, abs(y) <= 1e-7 */ @@ -178,7 +178,7 @@ tan(double x) { if (n) { /* First stage -cot */ EADD(a,t2,b,db) - DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) + DIV2(1.0,0.0,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) if ((y=c+(dc-u6.d*c))==c+(dc+u6.d*c)) { retval = (-y); goto ret; } } else { /* First stage tan */ @@ -202,7 +202,7 @@ tan(double x) { MUL2(a,da,a,da,x2,xx2,t1,t2,t3,t4,t5,t6,t7,t8) c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+ x2*a27.d)))))); - ADD2(a13.d,aa13.d,c1,zero.d,c2,cc2,t1,t2) + ADD2(a13.d,aa13.d,c1,0.0,c2,cc2,t1,t2) MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) ADD2(a11.d,aa11.d,c1,cc1,c2,cc2,t1,t2) MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) @@ -219,7 +219,7 @@ tan(double x) { if (n) { /* Second stage -cot */ - DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) + DIV2(1.0,0.0,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) if ((y=c2+(cc2-u8.d*c2)) == c2+(cc2+u8.d*c2)) { retval = (-y); goto ret; } } else { /* Second stage tan */ @@ -240,14 +240,14 @@ tan(double x) { /* -cot */ t2 = pz*(fi+gi)/(fi+pz); if ((y=gi-(t2-gi*u10.d))==gi-(t2+gi*u10.d)) { retval = (-sy*y); goto ret; } - t3 = (t2<ZERO) ? -t2 : t2; + t3 = (t2<0.0) ? -t2 : t2; t4 = gi*ua10.d+t3*ub10.d; if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } } else { /* tan */ t2 = pz*(gi+fi)/(gi-pz); if ((y=fi+(t2-fi*u9.d))==fi+(t2+fi*u9.d)) { retval = (sy*y); goto ret; } - t3 = (t2<ZERO) ? -t2 : t2; + t3 = (t2<0.0) ? -t2 : t2; t4 = fi*ua9.d+t3*ub9.d; if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } } @@ -256,7 +256,7 @@ tan(double x) { EADD(z0,yya,z,zz) MUL2(z,zz,z,zz,z2,zz2,t1,t2,t3,t4,t5,t6,t7,t8) c1 = z2*(a7.d+z2*(a9.d+z2*a11.d)); - ADD2(a5.d,aa5.d,c1,zero.d,c2,cc2,t1,t2) + ADD2(a5.d,aa5.d,c1,0.0,c2,cc2,t1,t2) MUL2(z2,zz2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) ADD2(a3.d,aa3.d,c1,cc1,c2,cc2,t1,t2) MUL2(z2,zz2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) @@ -265,7 +265,7 @@ tan(double x) { ADD2(fi ,ffi,c1,cc1,c2,cc2,t1,t2) MUL2(fi ,ffi,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8) - SUB2(one.d,zero.d,c3,cc3,c1,cc1,t1,t2) + SUB2(1.0,0.0,c3,cc3,c1,cc1,t1,t2) if (n) { /* -cot */ @@ -295,7 +295,7 @@ tan(double x) { a = t - t1; da = ((t-a)-t1)+da; EADD(a,da,t1,t2) a=t1; da=t2; - if (a<ZERO) {ya=-a; yya=-da; sy=MONE;} + if (a<0.0) {ya=-a; yya=-da; sy=MONE;} else {ya= a; yya= da; sy= ONE;} /* (+++) The case 25 < abs(x) <= 1e8, abs(y) <= 1e-7 */ @@ -308,7 +308,7 @@ tan(double x) { if (n) { /* First stage -cot */ EADD(a,t2,b,db) - DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) + DIV2(1.0,0.0,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) if ((y=c+(dc-u14.d*c))==c+(dc+u14.d*c)) { retval = (-y); goto ret; } } else { /* First stage tan */ @@ -318,7 +318,7 @@ tan(double x) { MUL2(a,da,a,da,x2,xx2,t1,t2,t3,t4,t5,t6,t7,t8) c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+ x2*a27.d)))))); - ADD2(a13.d,aa13.d,c1,zero.d,c2,cc2,t1,t2) + ADD2(a13.d,aa13.d,c1,0.0,c2,cc2,t1,t2) MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) ADD2(a11.d,aa11.d,c1,cc1,c2,cc2,t1,t2) MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) @@ -335,7 +335,7 @@ tan(double x) { if (n) { /* Second stage -cot */ - DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) + DIV2(1.0,0.0,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) if ((y=c2+(cc2-u16.d*c2)) == c2+(cc2+u16.d*c2)) { retval = (-y); goto ret; } } else { /* Second stage tan */ @@ -355,14 +355,14 @@ tan(double x) { /* -cot */ t2 = pz*(fi+gi)/(fi+pz); if ((y=gi-(t2-gi*u18.d))==gi-(t2+gi*u18.d)) { retval = (-sy*y); goto ret; } - t3 = (t2<ZERO) ? -t2 : t2; + t3 = (t2<0.0) ? -t2 : t2; t4 = gi*ua18.d+t3*ub18.d; if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } } else { /* tan */ t2 = pz*(gi+fi)/(gi-pz); if ((y=fi+(t2-fi*u17.d))==fi+(t2+fi*u17.d)) { retval = (sy*y); goto ret; } - t3 = (t2<ZERO) ? -t2 : t2; + t3 = (t2<0.0) ? -t2 : t2; t4 = fi*ua17.d+t3*ub17.d; if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } } @@ -371,7 +371,7 @@ tan(double x) { EADD(z0,yya,z,zz) MUL2(z,zz,z,zz,z2,zz2,t1,t2,t3,t4,t5,t6,t7,t8) c1 = z2*(a7.d+z2*(a9.d+z2*a11.d)); - ADD2(a5.d,aa5.d,c1,zero.d,c2,cc2,t1,t2) + ADD2(a5.d,aa5.d,c1,0.0,c2,cc2,t1,t2) MUL2(z2,zz2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) ADD2(a3.d,aa3.d,c1,cc1,c2,cc2,t1,t2) MUL2(z2,zz2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) @@ -380,7 +380,7 @@ tan(double x) { ADD2(fi ,ffi,c1,cc1,c2,cc2,t1,t2) MUL2(fi ,ffi,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8) - SUB2(one.d,zero.d,c3,cc3,c1,cc1,t1,t2) + SUB2(1.0,0.0,c3,cc3,c1,cc1,t1,t2) if (n) { /* -cot */ @@ -398,7 +398,7 @@ tan(double x) { /* Range reduction by algorithm iii */ n = (__branred(x,&a,&da)) & 0x00000001; EADD(a,da,t1,t2) a=t1; da=t2; - if (a<ZERO) {ya=-a; yya=-da; sy=MONE;} + if (a<0.0) {ya=-a; yya=-da; sy=MONE;} else {ya= a; yya= da; sy= ONE;} /* (+++) The case 1e8 < abs(x) < 2**1024, abs(y) <= 1e-7 */ @@ -411,7 +411,7 @@ tan(double x) { if (n) { /* First stage -cot */ EADD(a,t2,b,db) - DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) + DIV2(1.0,0.0,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) if ((y=c+(dc-u22.d*c))==c+(dc+u22.d*c)) { retval = (-y); goto ret; } } else { /* First stage tan */ @@ -426,7 +426,7 @@ tan(double x) { MUL2(a,da,a,da,x2,xx2,t1,t2,t3,t4,t5,t6,t7,t8) c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+ x2*a27.d)))))); - ADD2(a13.d,aa13.d,c1,zero.d,c2,cc2,t1,t2) + ADD2(a13.d,aa13.d,c1,0.0,c2,cc2,t1,t2) MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) ADD2(a11.d,aa11.d,c1,cc1,c2,cc2,t1,t2) MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) @@ -443,7 +443,7 @@ tan(double x) { if (n) { /* Second stage -cot */ - DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) + DIV2(1.0,0.0,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) if ((y=c2+(cc2-u24.d*c2)) == c2+(cc2+u24.d*c2)) { retval = (-y); goto ret; } } else { /* Second stage tan */ @@ -463,14 +463,14 @@ tan(double x) { /* -cot */ t2 = pz*(fi+gi)/(fi+pz); if ((y=gi-(t2-gi*u26.d))==gi-(t2+gi*u26.d)) { retval = (-sy*y); goto ret; } - t3 = (t2<ZERO) ? -t2 : t2; + t3 = (t2<0.0) ? -t2 : t2; t4 = gi*ua26.d+t3*ub26.d; if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } } else { /* tan */ t2 = pz*(gi+fi)/(gi-pz); if ((y=fi+(t2-fi*u25.d))==fi+(t2+fi*u25.d)) { retval = (sy*y); goto ret; } - t3 = (t2<ZERO) ? -t2 : t2; + t3 = (t2<0.0) ? -t2 : t2; t4 = fi*ua25.d+t3*ub25.d; if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } } @@ -479,7 +479,7 @@ tan(double x) { EADD(z0,yya,z,zz) MUL2(z,zz,z,zz,z2,zz2,t1,t2,t3,t4,t5,t6,t7,t8) c1 = z2*(a7.d+z2*(a9.d+z2*a11.d)); - ADD2(a5.d,aa5.d,c1,zero.d,c2,cc2,t1,t2) + ADD2(a5.d,aa5.d,c1,0.0,c2,cc2,t1,t2) MUL2(z2,zz2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) ADD2(a3.d,aa3.d,c1,cc1,c2,cc2,t1,t2) MUL2(z2,zz2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8) @@ -488,7 +488,7 @@ tan(double x) { ADD2(fi ,ffi,c1,cc1,c2,cc2,t1,t2) MUL2(fi ,ffi,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8) - SUB2(one.d,zero.d,c3,cc3,c1,cc1,t1,t2) + SUB2(1.0,0.0,c3,cc3,c1,cc1,t1,t2) if (n) { /* -cot */ diff --git a/libc/sysdeps/ieee754/dbl-64/s_trunc.c b/libc/sysdeps/ieee754/dbl-64/s_trunc.c index cf43482f2..e23447721 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_trunc.c +++ b/libc/sysdeps/ieee754/dbl-64/s_trunc.c @@ -1,5 +1,5 @@ /* Truncate argument to nearest integral value not larger than the argument. - Copyright (C) 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/sincos32.c b/libc/sysdeps/ieee754/dbl-64/sincos32.c index 038d1bdf2..6c5ffded5 100644 --- a/libc/sysdeps/ieee754/dbl-64/sincos32.c +++ b/libc/sysdeps/ieee754/dbl-64/sincos32.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/sincos32.h b/libc/sysdeps/ieee754/dbl-64/sincos32.h index 6efe4d488..1e5ac8bcf 100644 --- a/libc/sysdeps/ieee754/dbl-64/sincos32.h +++ b/libc/sysdeps/ieee754/dbl-64/sincos32.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/sincostab.c b/libc/sysdeps/ieee754/dbl-64/sincostab.c index 7df668e4a..43833f0b5 100644 --- a/libc/sysdeps/ieee754/dbl-64/sincostab.c +++ b/libc/sysdeps/ieee754/dbl-64/sincostab.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001, 2007, 2011 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/slowexp.c b/libc/sysdeps/ieee754/dbl-64/slowexp.c index 887a06b2d..34ca3275e 100644 --- a/libc/sysdeps/ieee754/dbl-64/slowexp.c +++ b/libc/sysdeps/ieee754/dbl-64/slowexp.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/slowpow.c b/libc/sysdeps/ieee754/dbl-64/slowpow.c index 7c829c74f..c303eaa5a 100644 --- a/libc/sysdeps/ieee754/dbl-64/slowpow.c +++ b/libc/sysdeps/ieee754/dbl-64/slowpow.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2011 Free Software Foundation + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/t_exp.c b/libc/sysdeps/ieee754/dbl-64/t_exp.c index b18b26f15..7466e2997 100644 --- a/libc/sysdeps/ieee754/dbl-64/t_exp.c +++ b/libc/sysdeps/ieee754/dbl-64/t_exp.c @@ -1,5 +1,5 @@ /* Accurate tables for exp(). - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Geoffrey Keating <geoffk@ozemail.com.au> diff --git a/libc/sysdeps/ieee754/dbl-64/uasncs.h b/libc/sysdeps/ieee754/dbl-64/uasncs.h index eb20289d0..66030d1c6 100644 --- a/libc/sysdeps/ieee754/dbl-64/uasncs.h +++ b/libc/sysdeps/ieee754/dbl-64/uasncs.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/uatan.tbl b/libc/sysdeps/ieee754/dbl-64/uatan.tbl index 734b1e1c3..d259587b7 100644 --- a/libc/sysdeps/ieee754/dbl-64/uatan.tbl +++ b/libc/sysdeps/ieee754/dbl-64/uatan.tbl @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/uexp.h b/libc/sysdeps/ieee754/dbl-64/uexp.h index 8ba95cf54..073c0ee42 100644 --- a/libc/sysdeps/ieee754/dbl-64/uexp.h +++ b/libc/sysdeps/ieee754/dbl-64/uexp.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/uexp.tbl b/libc/sysdeps/ieee754/dbl-64/uexp.tbl index 019f1e141..68396b79d 100644 --- a/libc/sysdeps/ieee754/dbl-64/uexp.tbl +++ b/libc/sysdeps/ieee754/dbl-64/uexp.tbl @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/ulog.h b/libc/sysdeps/ieee754/dbl-64/ulog.h index 0b7d3c25d..5afda3cda 100644 --- a/libc/sysdeps/ieee754/dbl-64/ulog.h +++ b/libc/sysdeps/ieee754/dbl-64/ulog.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -80,10 +80,6 @@ /**/ d19 = {{0x3faaf286, 0xbca1af28} }, /* 1/19 */ /**/ d20 = {{0xbfa99999, 0x9999999a} }, /* -1/20 */ /* constants */ -/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ one = {{0x3ff00000, 0x00000000} }, /* 1 */ -/**/ half = {{0x3fe00000, 0x00000000} }, /* 1/2 */ -/**/ mhalf = {{0xbfe00000, 0x00000000} }, /* -1/2 */ /**/ sqrt_2 = {{0x3ff6a09e, 0x667f3bcc} }, /* sqrt(2) */ /**/ h1 = {{0x3fd2e000, 0x00000000} }, /* 151/2**9 */ /**/ h2 = {{0x3f669000, 0x00000000} }, /* 361/2**17 */ @@ -156,10 +152,6 @@ /**/ d19 = {{0xbca1af28, 0x3faaf286} }, /* 1/19 */ /**/ d20 = {{0x9999999a, 0xbfa99999} }, /* -1/20 */ /* constants */ -/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ one = {{0x00000000, 0x3ff00000} }, /* 1 */ -/**/ half = {{0x00000000, 0x3fe00000} }, /* 1/2 */ -/**/ mhalf = {{0x00000000, 0xbfe00000} }, /* -1/2 */ /**/ sqrt_2 = {{0x667f3bcc, 0x3ff6a09e} }, /* sqrt(2) */ /**/ h1 = {{0x00000000, 0x3fd2e000} }, /* 151/2**9 */ /**/ h2 = {{0x00000000, 0x3f669000} }, /* 361/2**17 */ @@ -181,10 +173,10 @@ #endif #endif -#define ZERO zero.d -#define ONE one.d -#define HALF half.d -#define MHALF mhalf.d +#define ZERO 0.0 /* 0 */ +#define ONE 1.0 /* 1 */ +#define HALF 0x1.0p-1 /* 1/2 */ +#define MHALF -0x1.0p-1 /* -1/2 */ #define SQRT_2 sqrt_2.d #define DEL_U delu.d #define DEL_V delv.d diff --git a/libc/sysdeps/ieee754/dbl-64/ulog.tbl b/libc/sysdeps/ieee754/dbl-64/ulog.tbl index 1dead02cf..32f384635 100644 --- a/libc/sysdeps/ieee754/dbl-64/ulog.tbl +++ b/libc/sysdeps/ieee754/dbl-64/ulog.tbl @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/upow.h b/libc/sysdeps/ieee754/dbl-64/upow.h index ec307b5b4..67bae1aef 100644 --- a/libc/sysdeps/ieee754/dbl-64/upow.h +++ b/libc/sysdeps/ieee754/dbl-64/upow.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001, 2002 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/upow.tbl b/libc/sysdeps/ieee754/dbl-64/upow.tbl index b5ba3966c..f836b9b7b 100644 --- a/libc/sysdeps/ieee754/dbl-64/upow.tbl +++ b/libc/sysdeps/ieee754/dbl-64/upow.tbl @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/urem.h b/libc/sysdeps/ieee754/dbl-64/urem.h index 77776cff0..c4daa5d1a 100644 --- a/libc/sysdeps/ieee754/dbl-64/urem.h +++ b/libc/sysdeps/ieee754/dbl-64/urem.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/uroot.h b/libc/sysdeps/ieee754/dbl-64/uroot.h index ca1c730ac..f2484994c 100644 --- a/libc/sysdeps/ieee754/dbl-64/uroot.h +++ b/libc/sysdeps/ieee754/dbl-64/uroot.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/usncs.h b/libc/sysdeps/ieee754/dbl-64/usncs.h index b84924ac7..92a632144 100644 --- a/libc/sysdeps/ieee754/dbl-64/usncs.h +++ b/libc/sysdeps/ieee754/dbl-64/usncs.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/utan.h b/libc/sysdeps/ieee754/dbl-64/utan.h index 2fbe58b16..5ab573ea2 100644 --- a/libc/sysdeps/ieee754/dbl-64/utan.h +++ b/libc/sysdeps/ieee754/dbl-64/utan.h @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -81,11 +81,7 @@ /**/ e1 = {{0x3FC11112, 0xE0A6B45F} }, /* . */ /* constants */ -/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ one = {{0x3ff00000, 0x00000000} }, /* 1 */ -/**/ mone = {{0xbff00000, 0x00000000} }, /*-1 */ /**/ mfftnhf = {{0xc02f0000, 0x00000000} }, /*-15.5 */ -/**/ two8 = {{0x40700000, 0x00000000} }, /* 256 */ /**/ g1 = {{0x3e4b096c, 0x00000000} }, /* 1.259e-8 */ /**/ g2 = {{0x3faf212d, 0x00000000} }, /* 0.0608 */ @@ -202,11 +198,7 @@ /**/ e1 = {{0xE0A6B45F, 0x3FC11112} }, /* . */ /* constants */ -/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */ -/**/ one = {{0x00000000, 0x3ff00000} }, /* 1 */ -/**/ mone = {{0x00000000, 0xbff00000} }, /*-1 */ /**/ mfftnhf = {{0x00000000, 0xc02f0000} }, /*-15.5 */ -/**/ two8 = {{0x00000000, 0x40700000} }, /* 256 */ /**/ g1 = {{0x00000000, 0x3e4b096c} }, /* 1.259e-8 */ /**/ g2 = {{0x00000000, 0x3faf212d} }, /* 0.0608 */ @@ -271,9 +263,9 @@ #endif -#define ZERO zero.d -#define ONE one.d -#define MONE mone.d -#define TWO8 two8.d +#define ZERO 0.0 +#define ONE 1.0 +#define MONE -1.0 +#define TWO8 0x1.0p8 /* 2^8 */ #endif diff --git a/libc/sysdeps/ieee754/dbl-64/utan.tbl b/libc/sysdeps/ieee754/dbl-64/utan.tbl index 8a5f917a5..271f6fbeb 100644 --- a/libc/sysdeps/ieee754/dbl-64/utan.tbl +++ b/libc/sysdeps/ieee754/dbl-64/utan.tbl @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001-2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/libc/sysdeps/ieee754/dbl-64/w_exp.c b/libc/sysdeps/ieee754/dbl-64/w_exp.c index 14328a7b4..4f6da6c15 100644 --- a/libc/sysdeps/ieee754/dbl-64/w_exp.c +++ b/libc/sysdeps/ieee754/dbl-64/w_exp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011, 2012 Free Software Foundation, Inc. +/* Copyright (C) 2011-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gmail.com>, 2011. diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c index 34fa6dad5..5beccb0ac 100644 --- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c +++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c @@ -1,5 +1,5 @@ /* Round double to integer away from zero. - Copyright (C) 2011 Free Software Foundation, Inc. + Copyright (C) 2011-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 2011. diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c index 5ca6b0f97..59dafe8e1 100644 --- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c +++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Free Software Foundation, Inc. +/* Copyright (C) 2011-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gmail.com>, 2011. diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c index 4a72005d0..d9214298a 100644 --- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c +++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c @@ -1,5 +1,5 @@ /* Round double value to long long int. - Copyright (C) 1997-2012 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c index 40b888813..42349bd90 100644 --- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c +++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c @@ -1,5 +1,5 @@ /* Compute radix independent exponent. - Copyright (C) 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 2011-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gmail.com>, 2011. diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c index d634d67f4..e9ae82bdb 100644 --- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c +++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c @@ -1,5 +1,5 @@ /* Compute remainder and a congruent to the quotient. - Copyright (C) 1997, 2011 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c index 4d2012ae2..df674670e 100644 --- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c +++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c @@ -1,5 +1,5 @@ /* Round double to integer away from zero. - Copyright (C) 1997, 2009, 2011 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c index bfb773d3a..dcdf569d6 100644 --- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c +++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c @@ -1,5 +1,5 @@ /* Truncate argument to nearest integral value not larger than the argument. - Copyright (C) 1997, 1998, 2009 Free Software Foundation, Inc. + Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. diff --git a/libc/sysdeps/ieee754/dbl-64/x2y2m1.c b/libc/sysdeps/ieee754/dbl-64/x2y2m1.c index 4badde3be..0b73f0a2e 100644 --- a/libc/sysdeps/ieee754/dbl-64/x2y2m1.c +++ b/libc/sysdeps/ieee754/dbl-64/x2y2m1.c @@ -1,5 +1,5 @@ /* Compute x^2 + y^2 - 1, without large cancellation error. - Copyright (C) 2012 Free Software Foundation, Inc. + Copyright (C) 2012-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libc/sysdeps/ieee754/dbl-64/x2y2m1f.c b/libc/sysdeps/ieee754/dbl-64/x2y2m1f.c index fcaa70851..bd1444dad 100644 --- a/libc/sysdeps/ieee754/dbl-64/x2y2m1f.c +++ b/libc/sysdeps/ieee754/dbl-64/x2y2m1f.c @@ -1,5 +1,5 @@ /* Compute x^2 + y^2 - 1, without large cancellation error. - Copyright (C) 2012 Free Software Foundation, Inc. + Copyright (C) 2012-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or |