long double __tanl(long double, long double, int);
/* polynomial evaluation */
-long double __polevll(long double, long double *, int);
-long double __p1evll(long double, long double *, int);
+long double __polevll(long double, const long double *, int);
+long double __p1evll(long double, const long double *, int);
// FIXME: not needed when -fexcess-precision=standard is supported (>=gcc4.5)
/*
* Polynomial evaluator:
* P[0] x^n + P[1] x^(n-1) + ... + P[n]
*/
-long double __polevll(long double x, long double *P, int n)
+long double __polevll(long double x, const long double *P, int n)
{
long double y;
* Polynomial evaluator:
* x^n + P[0] x^(n-1) + P[1] x^(n-2) + ... + P[n]
*/
-long double __p1evll(long double x, long double *P, int n)
+long double __p1evll(long double x, const long double *P, int n)
{
long double y;
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */
pio2_hi = 1.57079632679489655800e+00; /* 0x3FF921FB, 0x54442D18 */
-static volatile double
+static const volatile double
pio2_lo = 6.12323399573676603587e-17; /* 0x3C91A626, 0x33145C07 */
static const double
pS0 = 1.66666666666666657415e-01, /* 0x3FC55555, 0x55555555 */
one = 1.0000000000e+00, /* 0x3F800000 */
pi = 3.1415925026e+00, /* 0x40490fda */
pio2_hi = 1.5707962513e+00; /* 0x3fc90fda */
-static volatile float
+static const volatile float
pio2_lo = 7.5497894159e-08; /* 0x33a22168 */
static const float
pS0 = 1.6666586697e-01,
// FIXME
//#ifdef __i386__
/* XXX Work around the fact that gcc truncates long double constants on i386 */
-static volatile double
+static const volatile double
pi1 = 3.14159265358979311600e+00, /* 0x1.921fb54442d18p+1 */
pi2 = 1.22514845490862001043e-16; /* 0x1.1a80000000000p-53 */
#define pi ((long double)pi1 + pi2)
#include "libm.h"
-static volatile double
+static const volatile double
tiny = 1.0e-300;
static const double
zero = 0.0,
pi_o_4 = 7.8539816339744827900E-01, /* 0x3FE921FB, 0x54442D18 */
pi_o_2 = 1.5707963267948965580E+00, /* 0x3FF921FB, 0x54442D18 */
pi = 3.1415926535897931160E+00; /* 0x400921FB, 0x54442D18 */
-static volatile double
+static const volatile double
pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
double atan2(double y, double x)
#include "libm.h"
-static volatile float
+static const volatile float
tiny = 1.0e-30;
static const float
zero = 0.0,
pi_o_4 = 7.8539818525e-01, /* 0x3f490fdb */
pi_o_2 = 1.5707963705e+00, /* 0x3fc90fdb */
pi = 3.1415927410e+00; /* 0x40490fdb */
-static volatile float
+static const volatile float
pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */
float atan2f(float y, float x)
}
#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
#include "__invtrigl.h"
-static volatile long double
+static const volatile long double
tiny = 1.0e-300;
static const long double
zero = 0.0;
/* XXX Work around the fact that gcc truncates long double constants on i386 */
-static volatile double
+static const volatile double
pi1 = 3.14159265358979311600e+00, /* 0x1.921fb54442d18p+1 */
pi2 = 1.22514845490862001043e-16; /* 0x1.1a80000000000p-53 */
#define pi ((long double)pi1 + pi2)
P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
-static volatile double
+static const volatile double
twom1000 = 9.33263618503218878990e-302; /* 2**-1000=0x01700000,0 */
double exp(double x)
P4 = 0x1.3b2ab88f70400p-7,
P5 = 0x1.5d88003875c74p-10;
-static volatile double twom1000 = 0x1p-1000;
+static const volatile double twom1000 = 0x1p-1000;
static const double tbl[TBLSIZE * 2] = {
/* exp2(z + eps) eps */
P3 = 0x1.c6b348p-5f,
P4 = 0x1.3b2c9cp-7f;
-static volatile float twom100 = 0x1p-100f;
+static const volatile float twom100 = 0x1p-100f;
static const double exp2ft[TBLSIZE] = {
0x1.6a09e667f3bcdp-1,
static const long double huge = 0x1p10000L;
/* XXX Prevent gcc from erroneously constant folding this. */
-static volatile long double twom10000 = 0x1p-10000L;
+static const volatile long double twom10000 = 0x1p-10000L;
static const double
redux = 0x1.8p63 / TBLSIZE,
P1 = 1.6666625440e-1, /* 0xaaaa8f.0p-26 */
P2 = -2.7667332906e-3; /* -0xb55215.0p-32 */
-static volatile float twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */
+static const volatile float twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */
float expf(float x)
{
}
#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
-static long double P[3] = {
+static const long double P[3] = {
1.2617719307481059087798E-4L,
3.0299440770744196129956E-2L,
9.9999999999999999991025E-1L,
};
-static long double Q[4] = {
+static const long double Q[4] = {
3.0019850513866445504159E-6L,
2.5244834034968410419224E-3L,
2.2726554820815502876593E-1L,
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 6.2e-22
*/
-static long double P[] = {
+static const long double P[] = {
4.9962495940332550844739E-1L,
1.0767376367209449010438E1L,
7.7671073698359539859595E1L,
3.4258224542413922935104E2L,
1.0747524399916215149070E2L,
};
-static long double Q[] = {
+static const long double Q[] = {
/* 1.0000000000000000000000E0,*/
2.3479774160285863271658E1L,
1.9444210022760132894510E2L,
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 6.16e-22
*/
-static long double R[4] = {
+static const long double R[4] = {
1.9757429581415468984296E-3L,
-7.1990767473014147232598E-1L,
1.0777257190312272158094E1L,
-3.5717684488096787370998E1L,
};
-static long double S[4] = {
+static const long double S[4] = {
/* 1.00000000000000000000E0L,*/
-2.6201045551331104417768E1L,
1.9361891836232102174846E2L,
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 2.32e-20
*/
-static long double P[] = {
+static const long double P[] = {
4.5270000862445199635215E-5L,
4.9854102823193375972212E-1L,
6.5787325942061044846969E0L,
5.7112963590585538103336E1L,
2.0039553499201281259648E1L,
};
-static long double Q[] = {
+static const long double Q[] = {
/* 1.0000000000000000000000E0,*/
1.5062909083469192043167E1L,
8.3047565967967209469434E1L,
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 6.16e-22
*/
-static long double R[4] = {
+static const long double R[4] = {
1.9757429581415468984296E-3L,
-7.1990767473014147232598E-1L,
1.0777257190312272158094E1L,
-3.5717684488096787370998E1L,
};
-static long double S[4] = {
+static const long double S[4] = {
/* 1.00000000000000000000E0L,*/
-2.6201045551331104417768E1L,
1.9361891836232102174846E2L,
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 6.2e-22
*/
-static long double P[] = {
+static const long double P[] = {
4.9962495940332550844739E-1L,
1.0767376367209449010438E1L,
7.7671073698359539859595E1L,
3.4258224542413922935104E2L,
1.0747524399916215149070E2L,
};
-static long double Q[] = {
+static const long double Q[] = {
/* 1.0000000000000000000000E0,*/
2.3479774160285863271658E1L,
1.9444210022760132894510E2L,
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 6.16e-22
*/
-static long double R[4] = {
+static const long double R[4] = {
1.9757429581415468984296E-3L,
-7.1990767473014147232598E-1L,
1.0777257190312272158094E1L,
-3.5717684488096787370998E1L,
};
-static long double S[4] = {
+static const long double S[4] = {
/* 1.00000000000000000000E0L,*/
-2.6201045551331104417768E1L,
1.9361891836232102174846E2L,
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 2.32e-20
*/
-static long double P[] = {
+static const long double P[] = {
4.5270000862445199635215E-5L,
4.9854102823193375972212E-1L,
6.5787325942061044846969E0L,
5.7112963590585538103336E1L,
2.0039553499201281259648E1L,
};
-static long double Q[] = {
+static const long double Q[] = {
/* 1.0000000000000000000000E0,*/
1.5062909083469192043167E1L,
8.3047565967967209469434E1L,
* 1/sqrt(2) <= x < sqrt(2)
* Theoretical peak relative error = 6.16e-22
*/
-static long double R[4] = {
+static const long double R[4] = {
1.9757429581415468984296E-3L,
-7.1990767473014147232598E-1L,
1.0777257190312272158094E1L,
-3.5717684488096787370998E1L,
};
-static long double S[4] = {
+static const long double S[4] = {
/* 1.00000000000000000000E0L,*/
-2.6201045551331104417768E1L,
1.9361891836232102174846E2L,
/* log(1+x) = x - .5x^2 + x^3 * P(z)/Q(z)
* on the domain 2^(-1/32) - 1 <= x <= 2^(1/32) - 1
*/
-static long double P[] = {
+static const long double P[] = {
8.3319510773868690346226E-4L,
4.9000050881978028599627E-1L,
1.7500123722550302671919E0L,
1.4000100839971580279335E0L,
};
-static long double Q[] = {
+static const long double Q[] = {
/* 1.0000000000000000000000E0L,*/
5.2500282295834889175431E0L,
8.4000598057587009834666E0L,
/* A[i] = 2^(-i/32), rounded to IEEE long double precision.
* If i is even, A[i] + B[i/2] gives additional accuracy.
*/
-static long double A[33] = {
+static const long double A[33] = {
1.0000000000000000000000E0L,
9.7857206208770013448287E-1L,
9.5760328069857364691013E-1L,
5.1094857432705833910408E-1L,
5.0000000000000000000000E-1L,
};
-static long double B[17] = {
+static const long double B[17] = {
0.0000000000000000000000E0L,
2.6176170809902549338711E-20L,
-1.0126791927256478897086E-20L,
/* 2^x = 1 + x P(x),
* on the interval -1/32 <= x <= 0
*/
-static long double R[] = {
+static const long double R[] = {
1.5089970579127659901157E-5L,
1.5402715328927013076125E-4L,
1.3333556028915671091390E-3L,
static const long double MAXLOGL = 1.1356523406294143949492E4L;
static const long double MINLOGL = -1.13994985314888605586758E4L;
static const long double LOGE2L = 6.9314718055994530941723E-1L;
-static volatile long double z;
-static long double w, W, Wa, Wb, ya, yb, u;
static const long double huge = 0x1p10000L;
/* XXX Prevent gcc from erroneously constant folding this. */
-static volatile long double twom10000 = 0x1p-10000L;
+static const volatile long double twom10000 = 0x1p-10000L;
static long double reducl(long double);
static long double powil(long double, int);
/* double F, Fa, Fb, G, Ga, Gb, H, Ha, Hb */
int i, nflg, iyflg, yoddint;
long e;
+ volatile long double z=0;
+ long double w=0, W=0, Wa=0, Wb=0, ya=0, yb=0, u=0;
if (y == 0.0L)
return 1.0L;
Peak error = 1.83e-20
Relative error spread = 8.4e-23
*/
-static long double P[8] = {
+static const long double P[8] = {
4.212760487471622013093E-5L,
4.542931960608009155600E-4L,
4.092666828394035500949E-3L,
8.378004301573126728826E-1L,
1.000000000000000000009E0L,
};
-static long double Q[9] = {
+static const long double Q[9] = {
-1.397148517476170440917E-5L,
2.346584059160635244282E-4L,
-1.237799246653152231188E-3L,
};
/*
-static long double P[] = {
+static const long double P[] = {
-3.01525602666895735709e0L,
-3.25157411956062339893e1L,
-2.92929976820724030353e2L,
-5.99650230220855581642e4L,
-7.15743521530849602425e4L
};
-static long double Q[] = {
+static const long double Q[] = {
1.00000000000000000000e0L,
-1.67955233807178858919e1L,
8.85946791747759881659e1L,
Peak error = 9.44e-21
Relative error spread = 8.8e-4
*/
-static long double STIR[9] = {
+static const long double STIR[9] = {
7.147391378143610789273E-4L,
-2.363848809501759061727E-5L,
-5.950237554056330156018E-4L,
* 0 < x < 0.03125
* Peak relative error 4.2e-23
*/
-static long double S[9] = {
+static const long double S[9] = {
-1.193945051381510095614E-3L,
7.220599478036909672331E-3L,
-9.622023360406271645744E-3L,
* Peak relative error 5.16e-23
* Relative error spread = 2.5e-24
*/
-static long double SN[9] = {
+static const long double SN[9] = {
1.133374167243894382010E-3L,
7.220837261893170325704E-3L,
9.621911155035976733706E-3L,