diff options
Diffstat (limited to 'lib/libm')
| -rw-r--r-- | lib/libm/__complex.h | 13 | ||||
| -rw-r--r-- | lib/libm/__cosl.c | 5 | ||||
| -rw-r--r-- | lib/libm/__rem_pio2l.c | 44 | ||||
| -rw-r--r-- | lib/libm/__sinl.c | 5 | ||||
| -rw-r--r-- | lib/libm/__tanl.c | 5 | ||||
| -rw-r--r-- | lib/libm/cacoshf.c | 2 | ||||
| -rw-r--r-- | lib/libm/lgamma_r.c | 7 | ||||
| -rw-r--r-- | lib/libm/lgammaf_r.c | 7 | ||||
| -rw-r--r-- | lib/libm/libm.a | bin | 1094304 -> 1215786 bytes | |||
| -rw-r--r-- | lib/libm/projf.c | 4 |
10 files changed, 53 insertions, 39 deletions
diff --git a/lib/libm/__complex.h b/lib/libm/__complex.h index 10b22df9..2c54d1e9 100644 --- a/lib/libm/__complex.h +++ b/lib/libm/__complex.h @@ -1,6 +1,7 @@ #ifndef __LIBC_COMPLEX_H__ #define __LIBC_COMPLEX_H__ +#include <sys/cdefs.h> #include <math.h> #include <complex.h> @@ -45,7 +46,7 @@ static const long double DP3 = 0L; #define MACHEPL 1.1e-19L #endif -static void cchsh(double x, double *c, double *s) +void cchsh(double x, double *c, double *s) { double e, ei; @@ -61,7 +62,7 @@ static void cchsh(double x, double *c, double *s) } } -static void cchshl(long double x, long double *c, long double *s) +void cchshl(long double x, long double *c, long double *s) { long double e, ei; @@ -77,7 +78,7 @@ static void cchshl(long double x, long double *c, long double *s) } } -static void cchshf(float x, float *c, float *s) +void cchshf(float x, float *c, float *s) { float e, ei; @@ -93,7 +94,7 @@ static void cchshf(float x, float *c, float *s) } } -static double redupi(double x) +double redupi(double x) { double t; long i; @@ -110,7 +111,7 @@ static double redupi(double x) return t; } -static float redupif(float x) +float redupif(float x) { float t; long i; @@ -143,7 +144,7 @@ static long double redupil(long double x) return ((x - t * DP1) - t * DP2) - t * DP3; } -static long double ctansl(long double complex z) +long double ctansl(long double complex z) { long double f, x, x2, y, y2, rn, t; long double d; diff --git a/lib/libm/__cosl.c b/lib/libm/__cosl.c index 09d42d6b..c7f72114 100644 --- a/lib/libm/__cosl.c +++ b/lib/libm/__cosl.c @@ -42,8 +42,9 @@ * almost for free from the complications needed to search for the best * higher coefficients. */ -static const long double C1 = 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 - */ +static const long double C1 = + 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 + */ static const double C2 = -0.0013888888888888874, /* -0x16c16c16c16c10.0p-62 */ C3 = 0.000024801587301571716, /* 0x1a01a01a018e22.0p-68 */ C4 = -0.00000027557319215507120, /* -0x127e4fb7602f22.0p-74 */ diff --git a/lib/libm/__rem_pio2l.c b/lib/libm/__rem_pio2l.c index 6576ade1..f6310774 100644 --- a/lib/libm/__rem_pio2l.c +++ b/lib/libm/__rem_pio2l.c @@ -45,9 +45,10 @@ static const double pio2_1 = 1.57079632679597125389e+00, /* 0x3FF921FB, 0x54444000 */ pio2_2 = -1.07463465549783099519e-12, /* -0x12e7b967674000.0p-92 */ pio2_3 = 6.36831716351370313614e-25; /* 0x18a2e037074000.0p-133 */ -static const long double pio4 = 0x1.921fb54442d1846ap-1L, - invpio2 = 6.36619772367581343076e-01L, /* 0xa2f9836e4e44152a.0p-64 - */ +static const long double + pio4 = 0x1.921fb54442d1846ap-1L, + invpio2 = 6.36619772367581343076e-01L, /* 0xa2f9836e4e44152a.0p-64 + */ pio2_1t = -1.07463465549719416346e-12L, /* -0x973dcb3b399d747f.0p-103 */ pio2_2t = 6.36831716351095013979e-25L, /* 0xc51701b839a25205.0p-144 */ pio2_3t = -2.75299651904407171810e-37L; /* -0xbb5bf6c7ddd660ce.0p-185 */ @@ -60,22 +61,29 @@ static const long double pio4 = 0x1.921fb54442d1846ap-1L, #define ROUND2 119 #define NX 5 #define NY 3 -static const long double pio4 = 0x1.921fb54442d18469898cc51701b8p-1L, - invpio2 = - 6.3661977236758134307553505349005747e-01L, /* 0x145f306dc9c882a53f84eafa3ea6a.0p-113 - */ - pio2_1 = 1.5707963267948966192292994253909555e+00L, /* 0x1921fb54442d18469800000000000.0p-112 +static const long double + pio4 = 0x1.921fb54442d18469898cc51701b8p-1L, + invpio2 = + 6.3661977236758134307553505349005747e-01L, /* 0x145f306dc9c882a53f84eafa3ea6a.0p-113 + */ + pio2_1 = + 1.5707963267948966192292994253909555e+00L, /* 0x1921fb54442d18469800000000000.0p-112 + */ + pio2_1t = + 2.0222662487959507323996846200947577e-21L, /* 0x13198a2e03707344a4093822299f3.0p-181 + */ + pio2_2 = + 2.0222662487959507323994779168837751e-21L, /* 0x13198a2e03707344a400000000000.0p-181 + */ + pio2_2t = + 2.0670321098263988236496903051604844e-43L, /* 0x127044533e63a0105df531d89cd91.0p-254 + */ + pio2_3 = + 2.0670321098263988236499468110329591e-43L, /* 0x127044533e63a0105e00000000000.0p-254 + */ + pio2_3t = + -2.5650587247459238361625433492959285e-65L; /* -0x159c4ec64ddaeb5f78671cbfb2210.0p-327 */ - pio2_1t = 2.0222662487959507323996846200947577e-21L, /* 0x13198a2e03707344a4093822299f3.0p-181 - */ - pio2_2 = 2.0222662487959507323994779168837751e-21L, /* 0x13198a2e03707344a400000000000.0p-181 - */ - pio2_2t = 2.0670321098263988236496903051604844e-43L, /* 0x127044533e63a0105df531d89cd91.0p-254 - */ - pio2_3 = 2.0670321098263988236499468110329591e-43L, /* 0x127044533e63a0105e00000000000.0p-254 - */ - pio2_3t = -2.5650587247459238361625433492959285e-65L; /* -0x159c4ec64ddaeb5f78671cbfb2210.0p-327 - */ #endif int __rem_pio2l(long double x, long double *y) diff --git a/lib/libm/__sinl.c b/lib/libm/__sinl.c index afd36211..6b57783e 100644 --- a/lib/libm/__sinl.c +++ b/lib/libm/__sinl.c @@ -25,8 +25,9 @@ * * See __cosl.c for more details about the polynomial. */ -static const long double S1 = -0.166666666666666666671L; /* -0xaaaaaaaaaaaaaaab.0p-66 - */ +static const long double S1 = + -0.166666666666666666671L; /* -0xaaaaaaaaaaaaaaab.0p-66 + */ static const double S2 = 0.0083333333333333332, /* 0x11111111111111.0p-59 */ S3 = -0.00019841269841269427, /* -0x1a01a01a019f81.0p-65 */ S4 = 0.0000027557319223597490, /* 0x171de3a55560f7.0p-71 */ diff --git a/lib/libm/__tanl.c b/lib/libm/__tanl.c index b279051f..7526735c 100644 --- a/lib/libm/__tanl.c +++ b/lib/libm/__tanl.c @@ -24,8 +24,9 @@ * * See __cosl.c for more details about the polynomial. */ -static const long double T3 = 0.333333333333333333180L, /* 0xaaaaaaaaaaaaaaa5.0p-65 - */ +static const long double + T3 = 0.333333333333333333180L, /* 0xaaaaaaaaaaaaaaa5.0p-65 + */ T5 = 0.133333333333333372290L, /* 0x88888888888893c3.0p-66 */ T7 = 0.0539682539682504975744L, /* 0xdd0dd0dd0dc13ba2.0p-68 */ pio4 = 0.785398163397448309628L, /* 0xc90fdaa22168c235.0p-64 */ diff --git a/lib/libm/cacoshf.c b/lib/libm/cacoshf.c index 67c9258b..63d23257 100644 --- a/lib/libm/cacoshf.c +++ b/lib/libm/cacoshf.c @@ -2,7 +2,5 @@ float complex cacoshf(float complex z) { - float complex w; - return clogf(z + csqrtf(z + 1) * csqrtf(z - 1)); } diff --git a/lib/libm/lgamma_r.c b/lib/libm/lgamma_r.c index 00eeb27b..6cb89858 100644 --- a/lib/libm/lgamma_r.c +++ b/lib/libm/lgamma_r.c @@ -253,9 +253,10 @@ double __lgamma_r(double x, int *signgamp) z = y * y; w = z * y; p1 = t0 + - w * (t3 + w * (t6 + w * (t9 + w * t12))); /* parallel - comp - */ + w * (t3 + + w * (t6 + w * (t9 + w * t12))); /* parallel + comp + */ p2 = t1 + w * (t4 + w * (t7 + w * (t10 + w * t13))); p3 = t2 + w * (t5 + w * (t8 + w * (t11 + w * t14))); p = z * p1 - (tt - w * (p2 + y * p3)); diff --git a/lib/libm/lgammaf_r.c b/lib/libm/lgammaf_r.c index 4b63298e..b1a02fb8 100644 --- a/lib/libm/lgammaf_r.c +++ b/lib/libm/lgammaf_r.c @@ -187,9 +187,10 @@ float __lgammaf_r(float x, int *signgamp) z = y * y; w = z * y; p1 = t0 + - w * (t3 + w * (t6 + w * (t9 + w * t12))); /* parallel - comp - */ + w * (t3 + + w * (t6 + w * (t9 + w * t12))); /* parallel + comp + */ p2 = t1 + w * (t4 + w * (t7 + w * (t10 + w * t13))); p3 = t2 + w * (t5 + w * (t8 + w * (t11 + w * t14))); p = z * p1 - (tt - w * (p2 + y * p3)); diff --git a/lib/libm/libm.a b/lib/libm/libm.a Binary files differindex 6a4a03c3..036141da 100644 --- a/lib/libm/libm.a +++ b/lib/libm/libm.a diff --git a/lib/libm/projf.c b/lib/libm/projf.c index 4efd9605..a0bcf369 100644 --- a/lib/libm/projf.c +++ b/lib/libm/projf.c @@ -3,9 +3,11 @@ float complex cprojf(float complex z) { float_complex w = { .z = z }; + if (isinf(crealf(z)) || isinf(cimagf(z))) { REAL_PART(w) = INFINITY; IMAG_PART(w) = copysignf(0.0, cimagf(z)); } - return (w.z); + + return w.z; } |
