| 1 |
"math.h" is still included in e_hypotf.cpp for fabsl() and |
| 2 |
in e_log10f.cpp for float_t. |
| 3 |
diff --git a/e_acos.cpp b/e_acos.cpp |
| 4 |
--- a/e_acos.cpp |
| 5 |
+++ b/e_acos.cpp |
| 6 |
@@ -35,17 +35,16 @@ __FBSDID("$FreeBSD$"); |
| 7 |
* if x is NaN, return x itself; |
| 8 |
* if |x|>1, return NaN with invalid signal. |
| 9 |
* |
| 10 |
* Function needed: sqrt |
| 11 |
*/ |
| 12 |
|
| 13 |
#include <float.h> |
| 14 |
|
| 15 |
-#include "math.h" |
| 16 |
#include "math_private.h" |
| 17 |
|
| 18 |
static const double |
| 19 |
one= 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ |
| 20 |
pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */ |
| 21 |
pio2_hi = 1.57079632679489655800e+00; /* 0x3FF921FB, 0x54442D18 */ |
| 22 |
static volatile double |
| 23 |
pio2_lo = 6.12323399573676603587e-17; /* 0x3C91A626, 0x33145C07 */ |
| 24 |
diff --git a/e_acosh.cpp b/e_acosh.cpp |
| 25 |
--- a/e_acosh.cpp |
| 26 |
+++ b/e_acosh.cpp |
| 27 |
@@ -26,17 +26,16 @@ __FBSDID("$FreeBSD$"); |
| 28 |
* |
| 29 |
* Special cases: |
| 30 |
* acosh(x) is NaN with signal if x<1. |
| 31 |
* acosh(NaN) is NaN without signal. |
| 32 |
*/ |
| 33 |
|
| 34 |
#include <float.h> |
| 35 |
|
| 36 |
-#include "math.h" |
| 37 |
#include "math_private.h" |
| 38 |
|
| 39 |
static const double |
| 40 |
one = 1.0, |
| 41 |
ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */ |
| 42 |
|
| 43 |
double |
| 44 |
__ieee754_acosh(double x) |
| 45 |
diff --git a/e_asin.cpp b/e_asin.cpp |
| 46 |
--- a/e_asin.cpp |
| 47 |
+++ b/e_asin.cpp |
| 48 |
@@ -41,17 +41,16 @@ __FBSDID("$FreeBSD$"); |
| 49 |
* Special cases: |
| 50 |
* if x is NaN, return x itself; |
| 51 |
* if |x|>1, return NaN with invalid signal. |
| 52 |
* |
| 53 |
*/ |
| 54 |
|
| 55 |
#include <float.h> |
| 56 |
|
| 57 |
-#include "math.h" |
| 58 |
#include "math_private.h" |
| 59 |
|
| 60 |
static const double |
| 61 |
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ |
| 62 |
huge = 1.000e+300, |
| 63 |
pio2_hi = 1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */ |
| 64 |
pio2_lo = 6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */ |
| 65 |
pio4_hi = 7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */ |
| 66 |
diff --git a/e_atan2.cpp b/e_atan2.cpp |
| 67 |
--- a/e_atan2.cpp |
| 68 |
+++ b/e_atan2.cpp |
| 69 |
@@ -39,17 +39,16 @@ __FBSDID("$FreeBSD$"); |
| 70 |
* The hexadecimal values are the intended ones for the following |
| 71 |
* constants. The decimal values may be used, provided that the |
| 72 |
* compiler will convert from decimal to binary accurately enough |
| 73 |
* to produce the hexadecimal values shown. |
| 74 |
*/ |
| 75 |
|
| 76 |
#include <float.h> |
| 77 |
|
| 78 |
-#include "math.h" |
| 79 |
#include "math_private.h" |
| 80 |
|
| 81 |
static volatile double |
| 82 |
tiny = 1.0e-300; |
| 83 |
static const double |
| 84 |
zero = 0.0, |
| 85 |
pi_o_4 = 7.8539816339744827900E-01, /* 0x3FE921FB, 0x54442D18 */ |
| 86 |
pi_o_2 = 1.5707963267948965580E+00, /* 0x3FF921FB, 0x54442D18 */ |
| 87 |
diff --git a/e_atanh.cpp b/e_atanh.cpp |
| 88 |
--- a/e_atanh.cpp |
| 89 |
+++ b/e_atanh.cpp |
| 90 |
@@ -30,17 +30,16 @@ __FBSDID("$FreeBSD$"); |
| 91 |
* atanh(x) is NaN if |x| > 1 with signal; |
| 92 |
* atanh(NaN) is that NaN with no signal; |
| 93 |
* atanh(+-1) is +-INF with signal. |
| 94 |
* |
| 95 |
*/ |
| 96 |
|
| 97 |
#include <float.h> |
| 98 |
|
| 99 |
-#include "math.h" |
| 100 |
#include "math_private.h" |
| 101 |
|
| 102 |
static const double one = 1.0, huge = 1e300; |
| 103 |
static const double zero = 0.0; |
| 104 |
|
| 105 |
double |
| 106 |
__ieee754_atanh(double x) |
| 107 |
{ |
| 108 |
diff --git a/e_cosh.cpp b/e_cosh.cpp |
| 109 |
--- a/e_cosh.cpp |
| 110 |
+++ b/e_cosh.cpp |
| 111 |
@@ -32,17 +32,16 @@ __FBSDID("$FreeBSD$"); |
| 112 |
* |
| 113 |
* Special cases: |
| 114 |
* cosh(x) is |x| if x is +INF, -INF, or NaN. |
| 115 |
* only cosh(0)=1 is exact for finite x. |
| 116 |
*/ |
| 117 |
|
| 118 |
#include <float.h> |
| 119 |
|
| 120 |
-#include "math.h" |
| 121 |
#include "math_private.h" |
| 122 |
|
| 123 |
static const double one = 1.0, half=0.5, huge = 1.0e300; |
| 124 |
|
| 125 |
double |
| 126 |
__ieee754_cosh(double x) |
| 127 |
{ |
| 128 |
double t,w; |
| 129 |
diff --git a/e_exp.cpp b/e_exp.cpp |
| 130 |
--- a/e_exp.cpp |
| 131 |
+++ b/e_exp.cpp |
| 132 |
@@ -73,17 +73,16 @@ __FBSDID("$FreeBSD$"); |
| 133 |
* The hexadecimal values are the intended ones for the following |
| 134 |
* constants. The decimal values may be used, provided that the |
| 135 |
* compiler will convert from decimal to binary accurately enough |
| 136 |
* to produce the hexadecimal values shown. |
| 137 |
*/ |
| 138 |
|
| 139 |
#include <float.h> |
| 140 |
|
| 141 |
-#include "math.h" |
| 142 |
#include "math_private.h" |
| 143 |
|
| 144 |
static const double |
| 145 |
one = 1.0, |
| 146 |
halF[2] = {0.5,-0.5,}, |
| 147 |
o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */ |
| 148 |
u_threshold= -7.45133219101941108420e+02, /* 0xc0874910, 0xD52D3051 */ |
| 149 |
ln2HI[2] ={ 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */ |
| 150 |
diff --git a/e_hypot.cpp b/e_hypot.cpp |
| 151 |
--- a/e_hypot.cpp |
| 152 |
+++ b/e_hypot.cpp |
| 153 |
@@ -43,17 +43,16 @@ __FBSDID("$FreeBSD$"); |
| 154 |
* |
| 155 |
* Accuracy: |
| 156 |
* hypot(x,y) returns sqrt(x^2+y^2) with error less |
| 157 |
* than 1 ulps (units in the last place) |
| 158 |
*/ |
| 159 |
|
| 160 |
#include <float.h> |
| 161 |
|
| 162 |
-#include "math.h" |
| 163 |
#include "math_private.h" |
| 164 |
|
| 165 |
double |
| 166 |
__ieee754_hypot(double x, double y) |
| 167 |
{ |
| 168 |
double a,b,t1,t2,y1,y2,w; |
| 169 |
int32_t j,k,ha,hb; |
| 170 |
|
| 171 |
diff --git a/e_log.cpp b/e_log.cpp |
| 172 |
--- a/e_log.cpp |
| 173 |
+++ b/e_log.cpp |
| 174 |
@@ -62,17 +62,16 @@ __FBSDID("$FreeBSD$"); |
| 175 |
* The hexadecimal values are the intended ones for the following |
| 176 |
* constants. The decimal values may be used, provided that the |
| 177 |
* compiler will convert from decimal to binary accurately enough |
| 178 |
* to produce the hexadecimal values shown. |
| 179 |
*/ |
| 180 |
|
| 181 |
#include <float.h> |
| 182 |
|
| 183 |
-#include "math.h" |
| 184 |
#include "math_private.h" |
| 185 |
|
| 186 |
static const double |
| 187 |
ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */ |
| 188 |
ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */ |
| 189 |
two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */ |
| 190 |
Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */ |
| 191 |
Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */ |
| 192 |
diff --git a/e_log10.cpp b/e_log10.cpp |
| 193 |
--- a/e_log10.cpp |
| 194 |
+++ b/e_log10.cpp |
| 195 |
@@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$"); |
| 196 |
* comments. |
| 197 |
* |
| 198 |
* log10(x) = (f - 0.5*f*f + k_log1p(f)) / ln10 + k * log10(2) |
| 199 |
* in not-quite-routine extra precision. |
| 200 |
*/ |
| 201 |
|
| 202 |
#include <float.h> |
| 203 |
|
| 204 |
-#include "math.h" |
| 205 |
#include "math_private.h" |
| 206 |
#include "k_log.h" |
| 207 |
|
| 208 |
static const double |
| 209 |
two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ |
| 210 |
ivln10hi = 4.34294481878168880939e-01, /* 0x3fdbcb7b, 0x15200000 */ |
| 211 |
ivln10lo = 2.50829467116452752298e-11, /* 0x3dbb9438, 0xca9aadd5 */ |
| 212 |
log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */ |
| 213 |
diff --git a/e_log2.cpp b/e_log2.cpp |
| 214 |
--- a/e_log2.cpp |
| 215 |
+++ b/e_log2.cpp |
| 216 |
@@ -21,17 +21,16 @@ __FBSDID("$FreeBSD$"); |
| 217 |
* This reduces x to {k, 1+f} exactly as in e_log.c, then calls the kernel, |
| 218 |
* then does the combining and scaling steps |
| 219 |
* log2(x) = (f - 0.5*f*f + k_log1p(f)) / ln2 + k |
| 220 |
* in not-quite-routine extra precision. |
| 221 |
*/ |
| 222 |
|
| 223 |
#include <float.h> |
| 224 |
|
| 225 |
-#include "math.h" |
| 226 |
#include "math_private.h" |
| 227 |
#include "k_log.h" |
| 228 |
|
| 229 |
static const double |
| 230 |
two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ |
| 231 |
ivln2hi = 1.44269504072144627571e+00, /* 0x3ff71547, 0x65200000 */ |
| 232 |
ivln2lo = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */ |
| 233 |
|
| 234 |
diff --git a/e_pow.cpp b/e_pow.cpp |
| 235 |
--- a/e_pow.cpp |
| 236 |
+++ b/e_pow.cpp |
| 237 |
@@ -53,17 +53,16 @@ __FBSDID("$FreeBSD$"); |
| 238 |
* Constants : |
| 239 |
* The hexadecimal values are the intended ones for the following |
| 240 |
* constants. The decimal values may be used, provided that the |
| 241 |
* compiler will convert from decimal to binary accurately enough |
| 242 |
* to produce the hexadecimal values shown. |
| 243 |
*/ |
| 244 |
|
| 245 |
#include <float.h> |
| 246 |
-#include "math.h" |
| 247 |
#include "math_private.h" |
| 248 |
|
| 249 |
static const double |
| 250 |
bp[] = {1.0, 1.5,}, |
| 251 |
dp_h[] = { 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */ |
| 252 |
dp_l[] = { 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */ |
| 253 |
zero = 0.0, |
| 254 |
half = 0.5, |
| 255 |
diff --git a/e_rem_pio2.cpp b/e_rem_pio2.cpp |
| 256 |
--- a/e_rem_pio2.cpp |
| 257 |
+++ b/e_rem_pio2.cpp |
| 258 |
@@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$"); |
| 259 |
/* __ieee754_rem_pio2(x,y) |
| 260 |
* |
| 261 |
* return the remainder of x rem pi/2 in y[0]+y[1] |
| 262 |
* use __kernel_rem_pio2() |
| 263 |
*/ |
| 264 |
|
| 265 |
#include <float.h> |
| 266 |
|
| 267 |
-#include "math.h" |
| 268 |
#include "math_private.h" |
| 269 |
|
| 270 |
/* |
| 271 |
* invpio2: 53 bits of 2/pi |
| 272 |
* pio2_1: first 33 bit of pi/2 |
| 273 |
* pio2_1t: pi/2 - pio2_1 |
| 274 |
* pio2_2: second 33 bit of pi/2 |
| 275 |
* pio2_2t: pi/2 - (pio2_1+pio2_2) |
| 276 |
diff --git a/e_sinh.cpp b/e_sinh.cpp |
| 277 |
--- a/e_sinh.cpp |
| 278 |
+++ b/e_sinh.cpp |
| 279 |
@@ -29,17 +29,16 @@ __FBSDID("$FreeBSD$"); |
| 280 |
* |
| 281 |
* Special cases: |
| 282 |
* sinh(x) is |x| if x is +INF, -INF, or NaN. |
| 283 |
* only sinh(0)=0 is exact for finite x. |
| 284 |
*/ |
| 285 |
|
| 286 |
#include <float.h> |
| 287 |
|
| 288 |
-#include "math.h" |
| 289 |
#include "math_private.h" |
| 290 |
|
| 291 |
static const double one = 1.0, shuge = 1.0e307; |
| 292 |
|
| 293 |
double |
| 294 |
__ieee754_sinh(double x) |
| 295 |
{ |
| 296 |
double t,h; |
| 297 |
diff --git a/k_cos.cpp b/k_cos.cpp |
| 298 |
--- a/k_cos.cpp |
| 299 |
+++ b/k_cos.cpp |
| 300 |
@@ -48,17 +48,16 @@ __FBSDID("$FreeBSD$"); |
| 301 |
* and tmp having the same precision as x. If they have extra |
| 302 |
* precision due to compiler bugs, then the extra precision is |
| 303 |
* only good provided it is retained in all terms of the final |
| 304 |
* expression for cos(). Retention happens in all cases tested |
| 305 |
* under FreeBSD, so don't pessimize things by forcibly clipping |
| 306 |
* any extra precision in w. |
| 307 |
*/ |
| 308 |
|
| 309 |
-#include "math.h" |
| 310 |
#include "math_private.h" |
| 311 |
|
| 312 |
static const double |
| 313 |
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ |
| 314 |
C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */ |
| 315 |
C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */ |
| 316 |
C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */ |
| 317 |
C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */ |
| 318 |
diff --git a/k_exp.cpp b/k_exp.cpp |
| 319 |
--- a/k_exp.cpp |
| 320 |
+++ b/k_exp.cpp |
| 321 |
@@ -26,17 +26,16 @@ |
| 322 |
* SUCH DAMAGE. |
| 323 |
*/ |
| 324 |
|
| 325 |
#include <sys/cdefs.h> |
| 326 |
__FBSDID("$FreeBSD$"); |
| 327 |
|
| 328 |
#include <complex.h> |
| 329 |
|
| 330 |
-#include "math.h" |
| 331 |
#include "math_private.h" |
| 332 |
|
| 333 |
static const uint32_t k = 1799; /* constant for reduction */ |
| 334 |
static const double kln2 = 1246.97177782734161156; /* k * ln2 */ |
| 335 |
|
| 336 |
/* |
| 337 |
* Compute exp(x), scaled to avoid spurious overflow. An exponent is |
| 338 |
* returned separately in 'expt'. |
| 339 |
diff --git a/k_rem_pio2.cpp b/k_rem_pio2.cpp |
| 340 |
--- a/k_rem_pio2.cpp |
| 341 |
+++ b/k_rem_pio2.cpp |
| 342 |
@@ -126,17 +126,16 @@ __FBSDID("$FreeBSD$"); |
| 343 |
* The hexadecimal values are the intended ones for the following |
| 344 |
* constants. The decimal values may be used, provided that the |
| 345 |
* compiler will convert from decimal to binary accurately enough |
| 346 |
* to produce the hexadecimal values shown. |
| 347 |
*/ |
| 348 |
|
| 349 |
#include <float.h> |
| 350 |
|
| 351 |
-#include "math.h" |
| 352 |
#include "math_private.h" |
| 353 |
|
| 354 |
static const int init_jk[] = {3,4,4,6}; /* initial value for jk */ |
| 355 |
|
| 356 |
/* |
| 357 |
* Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi |
| 358 |
* |
| 359 |
* integer array, contains the (24*i)-th to (24*i+23)-th |
| 360 |
diff --git a/k_sin.cpp b/k_sin.cpp |
| 361 |
--- a/k_sin.cpp |
| 362 |
+++ b/k_sin.cpp |
| 363 |
@@ -39,17 +39,16 @@ __FBSDID("$FreeBSD$"); |
| 364 |
* ~ sin(x) + (1-x*x/2)*y |
| 365 |
* For better accuracy, let |
| 366 |
* 3 2 2 2 2 |
| 367 |
* r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6)))) |
| 368 |
* then 3 2 |
| 369 |
* sin(x) = x + (S1*x + (x *(r-y/2)+y)) |
| 370 |
*/ |
| 371 |
|
| 372 |
-#include "math.h" |
| 373 |
#include "math_private.h" |
| 374 |
|
| 375 |
static const double |
| 376 |
half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ |
| 377 |
S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */ |
| 378 |
S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */ |
| 379 |
S3 = -1.98412698298579493134e-04, /* 0xBF2A01A0, 0x19C161D5 */ |
| 380 |
S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */ |
| 381 |
diff --git a/k_tan.cpp b/k_tan.cpp |
| 382 |
--- a/k_tan.cpp |
| 383 |
+++ b/k_tan.cpp |
| 384 |
@@ -44,17 +44,16 @@ __FBSDID("$FreeBSD$"); |
| 385 |
* 3 2 |
| 386 |
* tan(x+y) = x + (T1*x + (x *(r+y)+y)) |
| 387 |
* |
| 388 |
* 4. For x in [0.67434,pi/4], let y = pi/4 - x, then |
| 389 |
* tan(x) = tan(pi/4-y) = (1-tan(y))/(1+tan(y)) |
| 390 |
* = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y))) |
| 391 |
*/ |
| 392 |
|
| 393 |
-#include "math.h" |
| 394 |
#include "math_private.h" |
| 395 |
static const double xxx[] = { |
| 396 |
3.33333333333334091986e-01, /* 3FD55555, 55555563 */ |
| 397 |
1.33333333333201242699e-01, /* 3FC11111, 1110FE7A */ |
| 398 |
5.39682539762260521377e-02, /* 3FABA1BA, 1BB341FE */ |
| 399 |
2.18694882948595424599e-02, /* 3F9664F4, 8406D637 */ |
| 400 |
8.86323982359930005737e-03, /* 3F8226E3, E96E8493 */ |
| 401 |
3.59207910759131235356e-03, /* 3F6D6D22, C9560328 */ |
| 402 |
diff --git a/math_private.h b/math_private.h |
| 403 |
--- a/math_private.h |
| 404 |
+++ b/math_private.h |
| 405 |
@@ -15,16 +15,18 @@ |
| 406 |
*/ |
| 407 |
|
| 408 |
#ifndef _MATH_PRIVATE_H_ |
| 409 |
#define _MATH_PRIVATE_H_ |
| 410 |
|
| 411 |
#include <sys/types.h> |
| 412 |
#include <machine/endian.h> |
| 413 |
|
| 414 |
+#include "fdlibm.h" |
| 415 |
+ |
| 416 |
/* |
| 417 |
* The original fdlibm code used statements like: |
| 418 |
* n0 = ((*(int*)&one)>>29)^1; * index of high word * |
| 419 |
* ix0 = *(n0+(int*)&x); * high word of x * |
| 420 |
* ix1 = *((1-n0)+(int*)&x); * low word of x * |
| 421 |
* to dig two 32 bit words out of the 64 bit IEEE floating point |
| 422 |
* value. That is non-ANSI, and, moreover, the gcc instruction |
| 423 |
* scheduler gets it wrong. We instead use the following macros. |
| 424 |
diff --git a/s_asinh.cpp b/s_asinh.cpp |
| 425 |
--- a/s_asinh.cpp |
| 426 |
+++ b/s_asinh.cpp |
| 427 |
@@ -21,17 +21,16 @@ __FBSDID("$FreeBSD$"); |
| 428 |
* asinh(x) := x if 1+x*x=1, |
| 429 |
* := sign(x)*(log(x)+ln2)) for large |x|, else |
| 430 |
* := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else |
| 431 |
* := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2))) |
| 432 |
*/ |
| 433 |
|
| 434 |
#include <float.h> |
| 435 |
|
| 436 |
-#include "math.h" |
| 437 |
#include "math_private.h" |
| 438 |
|
| 439 |
static const double |
| 440 |
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ |
| 441 |
ln2 = 6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */ |
| 442 |
huge= 1.00000000000000000000e+300; |
| 443 |
|
| 444 |
double |
| 445 |
diff --git a/s_atan.cpp b/s_atan.cpp |
| 446 |
--- a/s_atan.cpp |
| 447 |
+++ b/s_atan.cpp |
| 448 |
@@ -30,17 +30,16 @@ __FBSDID("$FreeBSD$"); |
| 449 |
* The hexadecimal values are the intended ones for the following |
| 450 |
* constants. The decimal values may be used, provided that the |
| 451 |
* compiler will convert from decimal to binary accurately enough |
| 452 |
* to produce the hexadecimal values shown. |
| 453 |
*/ |
| 454 |
|
| 455 |
#include <float.h> |
| 456 |
|
| 457 |
-#include "math.h" |
| 458 |
#include "math_private.h" |
| 459 |
|
| 460 |
static const double atanhi[] = { |
| 461 |
4.63647609000806093515e-01, /* atan(0.5)hi 0x3FDDAC67, 0x0561BB4F */ |
| 462 |
7.85398163397448278999e-01, /* atan(1.0)hi 0x3FE921FB, 0x54442D18 */ |
| 463 |
9.82793723247329054082e-01, /* atan(1.5)hi 0x3FEF730B, 0xD281F69B */ |
| 464 |
1.57079632679489655800e+00, /* atan(inf)hi 0x3FF921FB, 0x54442D18 */ |
| 465 |
}; |
| 466 |
diff --git a/s_cbrt.cpp b/s_cbrt.cpp |
| 467 |
--- a/s_cbrt.cpp |
| 468 |
+++ b/s_cbrt.cpp |
| 469 |
@@ -11,17 +11,16 @@ |
| 470 |
* |
| 471 |
* Optimized by Bruce D. Evans. |
| 472 |
*/ |
| 473 |
|
| 474 |
#include <sys/cdefs.h> |
| 475 |
__FBSDID("$FreeBSD$"); |
| 476 |
|
| 477 |
#include <float.h> |
| 478 |
-#include "math.h" |
| 479 |
#include "math_private.h" |
| 480 |
|
| 481 |
/* cbrt(x) |
| 482 |
* Return cube root of x |
| 483 |
*/ |
| 484 |
static const u_int32_t |
| 485 |
B1 = 715094163, /* B1 = (1023-1023/3-0.03306235651)*2**20 */ |
| 486 |
B2 = 696219795; /* B2 = (1023-1023/3-54/3-0.03306235651)*2**20 */ |
| 487 |
diff --git a/s_ceil.cpp b/s_ceil.cpp |
| 488 |
--- a/s_ceil.cpp |
| 489 |
+++ b/s_ceil.cpp |
| 490 |
@@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$"); |
| 491 |
* Method: |
| 492 |
* Bit twiddling. |
| 493 |
* Exception: |
| 494 |
* Inexact flag raised if x not equal to ceil(x). |
| 495 |
*/ |
| 496 |
|
| 497 |
#include <float.h> |
| 498 |
|
| 499 |
-#include "math.h" |
| 500 |
#include "math_private.h" |
| 501 |
|
| 502 |
static const double huge = 1.0e300; |
| 503 |
|
| 504 |
double |
| 505 |
ceil(double x) |
| 506 |
{ |
| 507 |
int32_t i0,i1,j0; |
| 508 |
diff --git a/s_ceilf.cpp b/s_ceilf.cpp |
| 509 |
--- a/s_ceilf.cpp |
| 510 |
+++ b/s_ceilf.cpp |
| 511 |
@@ -11,17 +11,16 @@ |
| 512 |
* software is freely granted, provided that this notice |
| 513 |
* is preserved. |
| 514 |
* ==================================================== |
| 515 |
*/ |
| 516 |
|
| 517 |
#include <sys/cdefs.h> |
| 518 |
__FBSDID("$FreeBSD$"); |
| 519 |
|
| 520 |
-#include "math.h" |
| 521 |
#include "math_private.h" |
| 522 |
|
| 523 |
static const float huge = 1.0e30; |
| 524 |
|
| 525 |
float |
| 526 |
ceilf(float x) |
| 527 |
{ |
| 528 |
int32_t i0,j0; |
| 529 |
diff --git a/s_copysign.cpp b/s_copysign.cpp |
| 530 |
--- a/s_copysign.cpp |
| 531 |
+++ b/s_copysign.cpp |
| 532 |
@@ -14,17 +14,16 @@ |
| 533 |
__FBSDID("$FreeBSD$"); |
| 534 |
|
| 535 |
/* |
| 536 |
* copysign(double x, double y) |
| 537 |
* copysign(x,y) returns a value with the magnitude of x and |
| 538 |
* with the sign bit of y. |
| 539 |
*/ |
| 540 |
|
| 541 |
-#include "math.h" |
| 542 |
#include "math_private.h" |
| 543 |
|
| 544 |
double |
| 545 |
copysign(double x, double y) |
| 546 |
{ |
| 547 |
u_int32_t hx,hy; |
| 548 |
GET_HIGH_WORD(hx,x); |
| 549 |
GET_HIGH_WORD(hy,y); |
| 550 |
diff --git a/s_cos.cpp b/s_cos.cpp |
| 551 |
--- a/s_cos.cpp |
| 552 |
+++ b/s_cos.cpp |
| 553 |
@@ -41,17 +41,16 @@ __FBSDID("$FreeBSD$"); |
| 554 |
* trig(NaN) is that NaN; |
| 555 |
* |
| 556 |
* Accuracy: |
| 557 |
* TRIG(x) returns trig(x) nearly rounded |
| 558 |
*/ |
| 559 |
|
| 560 |
#include <float.h> |
| 561 |
|
| 562 |
-#include "math.h" |
| 563 |
#define INLINE_REM_PIO2 |
| 564 |
#include "math_private.h" |
| 565 |
#include "e_rem_pio2.c" |
| 566 |
|
| 567 |
double |
| 568 |
cos(double x) |
| 569 |
{ |
| 570 |
double y[2],z=0.0; |
| 571 |
diff --git a/s_expm1.cpp b/s_expm1.cpp |
| 572 |
--- a/s_expm1.cpp |
| 573 |
+++ b/s_expm1.cpp |
| 574 |
@@ -105,17 +105,16 @@ __FBSDID("$FreeBSD$"); |
| 575 |
* The hexadecimal values are the intended ones for the following |
| 576 |
* constants. The decimal values may be used, provided that the |
| 577 |
* compiler will convert from decimal to binary accurately enough |
| 578 |
* to produce the hexadecimal values shown. |
| 579 |
*/ |
| 580 |
|
| 581 |
#include <float.h> |
| 582 |
|
| 583 |
-#include "math.h" |
| 584 |
#include "math_private.h" |
| 585 |
|
| 586 |
static const double |
| 587 |
one = 1.0, |
| 588 |
tiny = 1.0e-300, |
| 589 |
o_threshold = 7.09782712893383973096e+02,/* 0x40862E42, 0xFEFA39EF */ |
| 590 |
ln2_hi = 6.93147180369123816490e-01,/* 0x3fe62e42, 0xfee00000 */ |
| 591 |
ln2_lo = 1.90821492927058770002e-10,/* 0x3dea39ef, 0x35793c76 */ |
| 592 |
diff --git a/s_fabs.cpp b/s_fabs.cpp |
| 593 |
--- a/s_fabs.cpp |
| 594 |
+++ b/s_fabs.cpp |
| 595 |
@@ -12,17 +12,16 @@ |
| 596 |
|
| 597 |
#include <sys/cdefs.h> |
| 598 |
__FBSDID("$FreeBSD$"); |
| 599 |
|
| 600 |
/* |
| 601 |
* fabs(x) returns the absolute value of x. |
| 602 |
*/ |
| 603 |
|
| 604 |
-#include "math.h" |
| 605 |
#include "math_private.h" |
| 606 |
|
| 607 |
double |
| 608 |
fabs(double x) |
| 609 |
{ |
| 610 |
u_int32_t high; |
| 611 |
GET_HIGH_WORD(high,x); |
| 612 |
SET_HIGH_WORD(x,high&0x7fffffff); |
| 613 |
diff --git a/s_floor.cpp b/s_floor.cpp |
| 614 |
--- a/s_floor.cpp |
| 615 |
+++ b/s_floor.cpp |
| 616 |
@@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$"); |
| 617 |
* Method: |
| 618 |
* Bit twiddling. |
| 619 |
* Exception: |
| 620 |
* Inexact flag raised if x not equal to floor(x). |
| 621 |
*/ |
| 622 |
|
| 623 |
#include <float.h> |
| 624 |
|
| 625 |
-#include "math.h" |
| 626 |
#include "math_private.h" |
| 627 |
|
| 628 |
static const double huge = 1.0e300; |
| 629 |
|
| 630 |
double |
| 631 |
floor(double x) |
| 632 |
{ |
| 633 |
int32_t i0,i1,j0; |
| 634 |
diff --git a/s_floorf.cpp b/s_floorf.cpp |
| 635 |
--- a/s_floorf.cpp |
| 636 |
+++ b/s_floorf.cpp |
| 637 |
@@ -20,17 +20,16 @@ __FBSDID("$FreeBSD$"); |
| 638 |
* floorf(x) |
| 639 |
* Return x rounded toward -inf to integral value |
| 640 |
* Method: |
| 641 |
* Bit twiddling. |
| 642 |
* Exception: |
| 643 |
* Inexact flag raised if x not equal to floorf(x). |
| 644 |
*/ |
| 645 |
|
| 646 |
-#include "math.h" |
| 647 |
#include "math_private.h" |
| 648 |
|
| 649 |
static const float huge = 1.0e30; |
| 650 |
|
| 651 |
float |
| 652 |
floorf(float x) |
| 653 |
{ |
| 654 |
int32_t i0,j0; |
| 655 |
diff --git a/s_log1p.cpp b/s_log1p.cpp |
| 656 |
--- a/s_log1p.cpp |
| 657 |
+++ b/s_log1p.cpp |
| 658 |
@@ -75,17 +75,16 @@ __FBSDID("$FreeBSD$"); |
| 659 |
* if(u==1.0) return x ; else |
| 660 |
* return log(u)*(x/(u-1.0)); |
| 661 |
* |
| 662 |
* See HP-15C Advanced Functions Handbook, p.193. |
| 663 |
*/ |
| 664 |
|
| 665 |
#include <float.h> |
| 666 |
|
| 667 |
-#include "math.h" |
| 668 |
#include "math_private.h" |
| 669 |
|
| 670 |
static const double |
| 671 |
ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */ |
| 672 |
ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */ |
| 673 |
two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */ |
| 674 |
Lp1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */ |
| 675 |
Lp2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */ |
| 676 |
diff --git a/s_nearbyint.cpp b/s_nearbyint.cpp |
| 677 |
--- a/s_nearbyint.cpp |
| 678 |
+++ b/s_nearbyint.cpp |
| 679 |
@@ -25,17 +25,18 @@ |
| 680 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 681 |
* SUCH DAMAGE. |
| 682 |
*/ |
| 683 |
|
| 684 |
#include <sys/cdefs.h> |
| 685 |
__FBSDID("$FreeBSD$"); |
| 686 |
|
| 687 |
#include <fenv.h> |
| 688 |
-#include <math.h> |
| 689 |
+ |
| 690 |
+#include "math_private.h" |
| 691 |
|
| 692 |
/* |
| 693 |
* We save and restore the floating-point environment to avoid raising |
| 694 |
* an inexact exception. We can get away with using fesetenv() |
| 695 |
* instead of feclearexcept()/feupdateenv() to restore the environment |
| 696 |
* because the only exception defined for rint() is overflow, and |
| 697 |
* rounding can't overflow as long as emax >= p. |
| 698 |
* |
| 699 |
diff --git a/s_rint.cpp b/s_rint.cpp |
| 700 |
--- a/s_rint.cpp |
| 701 |
+++ b/s_rint.cpp |
| 702 |
@@ -20,17 +20,16 @@ __FBSDID("$FreeBSD$"); |
| 703 |
* Method: |
| 704 |
* Using floating addition. |
| 705 |
* Exception: |
| 706 |
* Inexact flag raised if x not equal to rint(x). |
| 707 |
*/ |
| 708 |
|
| 709 |
#include <float.h> |
| 710 |
|
| 711 |
-#include "math.h" |
| 712 |
#include "math_private.h" |
| 713 |
|
| 714 |
static const double |
| 715 |
TWO52[2]={ |
| 716 |
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */ |
| 717 |
-4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */ |
| 718 |
}; |
| 719 |
|
| 720 |
diff --git a/s_rintf.cpp b/s_rintf.cpp |
| 721 |
--- a/s_rintf.cpp |
| 722 |
+++ b/s_rintf.cpp |
| 723 |
@@ -14,17 +14,16 @@ |
| 724 |
*/ |
| 725 |
|
| 726 |
#include <sys/cdefs.h> |
| 727 |
__FBSDID("$FreeBSD$"); |
| 728 |
|
| 729 |
#include <float.h> |
| 730 |
#include <stdint.h> |
| 731 |
|
| 732 |
-#include "math.h" |
| 733 |
#include "math_private.h" |
| 734 |
|
| 735 |
static const float |
| 736 |
TWO23[2]={ |
| 737 |
8.3886080000e+06, /* 0x4b000000 */ |
| 738 |
-8.3886080000e+06, /* 0xcb000000 */ |
| 739 |
}; |
| 740 |
|
| 741 |
diff --git a/s_scalbn.cpp b/s_scalbn.cpp |
| 742 |
--- a/s_scalbn.cpp |
| 743 |
+++ b/s_scalbn.cpp |
| 744 |
@@ -2,19 +2,20 @@ |
| 745 |
* Copyright (c) 2005-2020 Rich Felker, et al. |
| 746 |
* |
| 747 |
* SPDX-License-Identifier: MIT |
| 748 |
* |
| 749 |
* Please see https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT |
| 750 |
* for all contributors to musl. |
| 751 |
*/ |
| 752 |
#include <float.h> |
| 753 |
-#include <math.h> |
| 754 |
#include <stdint.h> |
| 755 |
|
| 756 |
+#include "math_private.h" |
| 757 |
+ |
| 758 |
double scalbn(double x, int n) |
| 759 |
{ |
| 760 |
union {double f; uint64_t i;} u; |
| 761 |
double_t y = x; |
| 762 |
|
| 763 |
if (n > 1023) { |
| 764 |
y *= 0x1p1023; |
| 765 |
n -= 1023; |
| 766 |
diff --git a/s_scalbnf.cpp b/s_scalbnf.cpp |
| 767 |
--- a/s_scalbnf.cpp |
| 768 |
+++ b/s_scalbnf.cpp |
| 769 |
@@ -8,16 +4,17 @@ |
| 770 |
* SPDX-License-Identifier: MIT |
| 771 |
* |
| 772 |
* Please see https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT |
| 773 |
* for all contributors to musl. |
| 774 |
*/ |
| 775 |
-#include <math.h> |
| 776 |
#include <stdint.h> |
| 777 |
|
| 778 |
+#include "math_private.h" |
| 779 |
+ |
| 780 |
float scalbnf(float x, int n) |
| 781 |
{ |
| 782 |
union {float f; uint32_t i;} u; |
| 783 |
float_t y = x; |
| 784 |
|
| 785 |
if (n > 127) { |
| 786 |
y *= 0x1p127f; |
| 787 |
n -= 127; |
| 788 |
diff --git a/s_sin.cpp b/s_sin.cpp |
| 789 |
--- a/s_sin.cpp |
| 790 |
+++ b/s_sin.cpp |
| 791 |
@@ -41,17 +41,16 @@ __FBSDID("$FreeBSD$"); |
| 792 |
* trig(NaN) is that NaN; |
| 793 |
* |
| 794 |
* Accuracy: |
| 795 |
* TRIG(x) returns trig(x) nearly rounded |
| 796 |
*/ |
| 797 |
|
| 798 |
#include <float.h> |
| 799 |
|
| 800 |
-#include "math.h" |
| 801 |
#define INLINE_REM_PIO2 |
| 802 |
#include "math_private.h" |
| 803 |
#include "e_rem_pio2.c" |
| 804 |
|
| 805 |
double |
| 806 |
sin(double x) |
| 807 |
{ |
| 808 |
double y[2],z=0.0; |
| 809 |
diff --git a/s_tan.cpp b/s_tan.cpp |
| 810 |
--- a/s_tan.cpp |
| 811 |
+++ b/s_tan.cpp |
| 812 |
@@ -40,17 +40,16 @@ __FBSDID("$FreeBSD$"); |
| 813 |
* trig(NaN) is that NaN; |
| 814 |
* |
| 815 |
* Accuracy: |
| 816 |
* TRIG(x) returns trig(x) nearly rounded |
| 817 |
*/ |
| 818 |
|
| 819 |
#include <float.h> |
| 820 |
|
| 821 |
-#include "math.h" |
| 822 |
#define INLINE_REM_PIO2 |
| 823 |
#include "math_private.h" |
| 824 |
#include "e_rem_pio2.c" |
| 825 |
|
| 826 |
double |
| 827 |
tan(double x) |
| 828 |
{ |
| 829 |
double y[2],z=0.0; |
| 830 |
diff --git a/s_tanh.cpp b/s_tanh.cpp |
| 831 |
--- a/s_tanh.cpp |
| 832 |
+++ b/s_tanh.cpp |
| 833 |
@@ -34,17 +34,16 @@ __FBSDID("$FreeBSD$"); |
| 834 |
* |
| 835 |
* Special cases: |
| 836 |
* tanh(NaN) is NaN; |
| 837 |
* only tanh(0)=0 is exact for finite argument. |
| 838 |
*/ |
| 839 |
|
| 840 |
#include <float.h> |
| 841 |
|
| 842 |
-#include "math.h" |
| 843 |
#include "math_private.h" |
| 844 |
|
| 845 |
static const volatile double tiny = 1.0e-300; |
| 846 |
static const double one = 1.0, two = 2.0, huge = 1.0e300; |
| 847 |
|
| 848 |
double |
| 849 |
tanh(double x) |
| 850 |
{ |
| 851 |
diff --git a/s_trunc.cpp b/s_trunc.cpp |
| 852 |
--- a/s_trunc.cpp |
| 853 |
+++ b/s_trunc.cpp |
| 854 |
@@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$"); |
| 855 |
* Method: |
| 856 |
* Bit twiddling. |
| 857 |
* Exception: |
| 858 |
* Inexact flag raised if x not equal to trunc(x). |
| 859 |
*/ |
| 860 |
|
| 861 |
#include <float.h> |
| 862 |
|
| 863 |
-#include "math.h" |
| 864 |
#include "math_private.h" |
| 865 |
|
| 866 |
static const double huge = 1.0e300; |
| 867 |
|
| 868 |
double |
| 869 |
trunc(double x) |
| 870 |
{ |
| 871 |
int32_t i0,i1,j0; |
| 872 |
diff --git a/s_truncf.cpp b/s_truncf.cpp |
| 873 |
--- a/s_truncf.cpp |
| 874 |
+++ b/s_truncf.cpp |
| 875 |
@@ -17,17 +17,16 @@ __FBSDID("$FreeBSD$"); |
| 876 |
* truncf(x) |
| 877 |
* Return x rounded toward 0 to integral value |
| 878 |
* Method: |
| 879 |
* Bit twiddling. |
| 880 |
* Exception: |
| 881 |
* Inexact flag raised if x not equal to truncf(x). |
| 882 |
*/ |
| 883 |
|
| 884 |
-#include "math.h" |
| 885 |
#include "math_private.h" |
| 886 |
|
| 887 |
static const float huge = 1.0e30F; |
| 888 |
|
| 889 |
float |
| 890 |
truncf(float x) |
| 891 |
{ |
| 892 |
int32_t i0,j0; |
| 893 |
--- a/e_acosf.cpp 2022-12-11 21:15:50.058431053 -0500 |
| 894 |
+++ b/e_acosf.cpp_new 2022-12-11 21:13:10.532515637 -0500 |
| 895 |
@@ -12,15 +12,14 @@ |
| 896 |
* is preserved. |
| 897 |
* ==================================================== |
| 898 |
*/ |
| 899 |
|
| 900 |
#include <sys/cdefs.h> |
| 901 |
__FBSDID("$FreeBSD$"); |
| 902 |
|
| 903 |
-#include "math.h" |
| 904 |
#include "math_private.h" |
| 905 |
|
| 906 |
static const float |
| 907 |
one = 1.0000000000e+00, /* 0x3F800000 */ |
| 908 |
pi = 3.1415925026e+00, /* 0x40490fda */ |
| 909 |
pio2_hi = 1.5707962513e+00; /* 0x3fc90fda */ |
| 910 |
static volatile float |
| 911 |
--- a/e_asinf.cpp 2022-12-11 21:15:50.486437124 -0500 |
| 912 |
+++ b/e_asinf.cpp_new 2022-12-11 21:13:07.876498396 -0500 |
| 913 |
@@ -12,15 +12,14 @@ |
| 914 |
* is preserved. |
| 915 |
* ==================================================== |
| 916 |
*/ |
| 917 |
|
| 918 |
#include <sys/cdefs.h> |
| 919 |
__FBSDID("$FreeBSD$"); |
| 920 |
|
| 921 |
-#include "math.h" |
| 922 |
#include "math_private.h" |
| 923 |
|
| 924 |
static const float |
| 925 |
one = 1.0000000000e+00, /* 0x3F800000 */ |
| 926 |
huge = 1.000e+30, |
| 927 |
/* coefficient for R(x^2) */ |
| 928 |
pS0 = 1.6666586697e-01, |
| 929 |
--- a/e_expf.cpp 2022-12-11 21:15:51.250447960 -0500 |
| 930 |
+++ b/e_expf.cpp_new 2022-12-11 21:13:05.212481099 -0500 |
| 931 |
@@ -14,15 +14,14 @@ |
| 932 |
*/ |
| 933 |
|
| 934 |
#include <sys/cdefs.h> |
| 935 |
__FBSDID("$FreeBSD$"); |
| 936 |
|
| 937 |
#include <float.h> |
| 938 |
|
| 939 |
-#include "math.h" |
| 940 |
#include "math_private.h" |
| 941 |
|
| 942 |
static const float |
| 943 |
one = 1.0, |
| 944 |
halF[2] = {0.5,-0.5,}, |
| 945 |
o_threshold= 8.8721679688e+01, /* 0x42b17180 */ |
| 946 |
u_threshold= -1.0397208405e+02, /* 0xc2cff1b5 */ |
| 947 |
--- a/e_logf.cpp 2022-12-11 21:15:51.978458278 -0500 |
| 948 |
+++ b/e_logf.cpp_new 2022-12-11 21:13:02.644464418 -0500 |
| 949 |
@@ -12,15 +12,14 @@ |
| 950 |
* is preserved. |
| 951 |
* ==================================================== |
| 952 |
*/ |
| 953 |
|
| 954 |
#include <sys/cdefs.h> |
| 955 |
__FBSDID("$FreeBSD$"); |
| 956 |
|
| 957 |
-#include "math.h" |
| 958 |
#include "math_private.h" |
| 959 |
|
| 960 |
static const float |
| 961 |
ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ |
| 962 |
ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */ |
| 963 |
two25 = 3.355443200e+07, /* 0x4c000000 */ |
| 964 |
/* |(log(1+s)-log(1-s))/s - Lg(s)| < 2**-34.24 (~[-4.95e-11, 4.97e-11]). */ |
| 965 |
--- a/e_powf.cpp 2022-12-11 21:15:52.242462016 -0500 |
| 966 |
+++ b/e_powf.cpp_new 2022-12-11 21:13:00.164448306 -0500 |
| 967 |
@@ -12,15 +12,14 @@ |
| 968 |
* is preserved. |
| 969 |
* ==================================================== |
| 970 |
*/ |
| 971 |
|
| 972 |
#include <sys/cdefs.h> |
| 973 |
__FBSDID("$FreeBSD$"); |
| 974 |
|
| 975 |
-#include "math.h" |
| 976 |
#include "math_private.h" |
| 977 |
|
| 978 |
static const float |
| 979 |
bp[] = {1.0, 1.5,}, |
| 980 |
dp_h[] = { 0.0, 5.84960938e-01,}, /* 0x3f15c000 */ |
| 981 |
dp_l[] = { 0.0, 1.56322085e-06,}, /* 0x35d1cfdc */ |
| 982 |
zero = 0.0, |
| 983 |
--- a/e_rem_pio2f.cpp 2022-12-11 21:15:52.626467454 -0500 |
| 984 |
+++ b/e_rem_pio2f.cpp_new 2022-12-11 21:12:57.300429693 -0500 |
| 985 |
@@ -22,15 +22,14 @@ |
| 986 |
* return the remainder of x rem pi/2 in *y |
| 987 |
* use double precision for everything except passing x |
| 988 |
* use __kernel_rem_pio2() for large x |
| 989 |
*/ |
| 990 |
|
| 991 |
#include <float.h> |
| 992 |
|
| 993 |
-#include "math.h" |
| 994 |
#include "math_private.h" |
| 995 |
|
| 996 |
/* |
| 997 |
* invpio2: 53 bits of 2/pi |
| 998 |
* pio2_1: first 25 bits of pi/2 |
| 999 |
* pio2_1t: pi/2 - pio2_1 |
| 1000 |
*/ |
| 1001 |
--- a/e_sqrtf.cpp 2022-12-11 21:15:52.922471645 -0500 |
| 1002 |
+++ b/e_sqrtf.cpp_new 2022-12-11 21:12:54.596412113 -0500 |
| 1003 |
@@ -13,15 +13,14 @@ |
| 1004 |
* ==================================================== |
| 1005 |
*/ |
| 1006 |
|
| 1007 |
#ifndef lint |
| 1008 |
static char rcsid[] = "$FreeBSD$"; |
| 1009 |
#endif |
| 1010 |
|
| 1011 |
-#include "math.h" |
| 1012 |
#include "math_private.h" |
| 1013 |
|
| 1014 |
#ifdef USE_BUILTIN_SQRTF |
| 1015 |
float |
| 1016 |
__ieee754_sqrtf(float x) |
| 1017 |
{ |
| 1018 |
return (__builtin_sqrtf(x)); |
| 1019 |
--- a/k_cosf.cpp 2022-12-11 21:15:53.178475268 -0500 |
| 1020 |
+++ b/k_cosf.cpp_new 2022-12-11 21:12:52.012395309 -0500 |
| 1021 |
@@ -15,15 +15,14 @@ |
| 1022 |
*/ |
| 1023 |
|
| 1024 |
#ifndef INLINE_KERNEL_COSDF |
| 1025 |
#include <sys/cdefs.h> |
| 1026 |
__FBSDID("$FreeBSD$"); |
| 1027 |
#endif |
| 1028 |
|
| 1029 |
-#include "math.h" |
| 1030 |
#include "math_private.h" |
| 1031 |
|
| 1032 |
/* |cos(x) - c(x)| < 2**-34.1 (~[-5.37e-11, 5.295e-11]). */ |
| 1033 |
static const double |
| 1034 |
one = 1.0, |
| 1035 |
C0 = -0x1ffffffd0c5e81.0p-54, /* -0.499999997251031003120 */ |
| 1036 |
C1 = 0x155553e1053a42.0p-57, /* 0.0416666233237390631894 */ |
| 1037 |
--- a/k_expf.cpp 2022-12-11 21:15:53.434478888 -0500 |
| 1038 |
+++ b/k_expf.cpp_new 2022-12-11 21:12:49.012375792 -0500 |
| 1039 |
@@ -27,15 +27,14 @@ |
| 1040 |
*/ |
| 1041 |
|
| 1042 |
#include <sys/cdefs.h> |
| 1043 |
__FBSDID("$FreeBSD$"); |
| 1044 |
|
| 1045 |
#include <complex.h> |
| 1046 |
|
| 1047 |
-#include "math.h" |
| 1048 |
#include "math_private.h" |
| 1049 |
|
| 1050 |
static const uint32_t k = 235; /* constant for reduction */ |
| 1051 |
static const float kln2 = 162.88958740F; /* k * ln2 */ |
| 1052 |
|
| 1053 |
/* |
| 1054 |
* See k_exp.c for details. |
| 1055 |
--- a/k_sinf.cpp 2022-12-11 21:15:53.946486130 -0500 |
| 1056 |
+++ b/k_sinf.cpp_new 2022-12-11 21:12:46.020356322 -0500 |
| 1057 |
@@ -15,15 +15,14 @@ |
| 1058 |
*/ |
| 1059 |
|
| 1060 |
#ifndef INLINE_KERNEL_SINDF |
| 1061 |
#include <sys/cdefs.h> |
| 1062 |
__FBSDID("$FreeBSD$"); |
| 1063 |
#endif |
| 1064 |
|
| 1065 |
-#include "math.h" |
| 1066 |
#include "math_private.h" |
| 1067 |
|
| 1068 |
/* |sin(x)/x - s(x)| < 2**-37.5 (~[-4.89e-12, 4.824e-12]). */ |
| 1069 |
static const double |
| 1070 |
S1 = -0x15555554cbac77.0p-55, /* -0.166666666416265235595 */ |
| 1071 |
S2 = 0x111110896efbb2.0p-59, /* 0.0083333293858894631756 */ |
| 1072 |
S3 = -0x1a00f9e2cae774.0p-65, /* -0.000198393348360966317347 */ |
| 1073 |
--- a/k_tanf.cpp 2022-12-11 21:15:54.254490484 -0500 |
| 1074 |
+++ b/k_tanf.cpp_new 2022-12-11 21:12:42.972336479 -0500 |
| 1075 |
@@ -14,15 +14,14 @@ |
| 1076 |
*/ |
| 1077 |
|
| 1078 |
#ifndef INLINE_KERNEL_TANDF |
| 1079 |
#include <sys/cdefs.h> |
| 1080 |
__FBSDID("$FreeBSD$"); |
| 1081 |
#endif |
| 1082 |
|
| 1083 |
-#include "math.h" |
| 1084 |
#include "math_private.h" |
| 1085 |
|
| 1086 |
/* |tan(x)/x - t(x)| < 2**-25.5 (~[-2e-08, 2e-08]). */ |
| 1087 |
static const double |
| 1088 |
T[] = { |
| 1089 |
0x15554d3418c99f.0p-54, /* 0.333331395030791399758 */ |
| 1090 |
0x1112fd38999f72.0p-55, /* 0.133392002712976742718 */ |
| 1091 |
--- a/s_atanf.cpp 2022-12-11 21:15:54.670496364 -0500 |
| 1092 |
+++ b/s_atanf.cpp_new 2022-12-11 21:12:39.940316733 -0500 |
| 1093 |
@@ -12,15 +12,14 @@ |
| 1094 |
* is preserved. |
| 1095 |
* ==================================================== |
| 1096 |
*/ |
| 1097 |
|
| 1098 |
#include <sys/cdefs.h> |
| 1099 |
__FBSDID("$FreeBSD$"); |
| 1100 |
|
| 1101 |
-#include "math.h" |
| 1102 |
#include "math_private.h" |
| 1103 |
|
| 1104 |
static const float atanhi[] = { |
| 1105 |
4.6364760399e-01, /* atan(0.5)hi 0x3eed6338 */ |
| 1106 |
7.8539812565e-01, /* atan(1.0)hi 0x3f490fda */ |
| 1107 |
9.8279368877e-01, /* atan(1.5)hi 0x3f7b985e */ |
| 1108 |
1.5707962513e+00, /* atan(inf)hi 0x3fc90fda */ |
| 1109 |
--- a/s_cosf.cpp 2022-12-11 21:15:55.494508001 -0500 |
| 1110 |
+++ b/s_cosf.cpp_new 2022-12-11 21:12:37.396300160 -0500 |
| 1111 |
@@ -15,15 +15,14 @@ |
| 1112 |
*/ |
| 1113 |
|
| 1114 |
#include <sys/cdefs.h> |
| 1115 |
__FBSDID("$FreeBSD$"); |
| 1116 |
|
| 1117 |
#include <float.h> |
| 1118 |
|
| 1119 |
-#include "math.h" |
| 1120 |
#define INLINE_KERNEL_COSDF |
| 1121 |
#define INLINE_KERNEL_SINDF |
| 1122 |
#define INLINE_REM_PIO2F |
| 1123 |
#include "math_private.h" |
| 1124 |
#include "e_rem_pio2f.c" |
| 1125 |
#include "k_cosf.c" |
| 1126 |
#include "k_sinf.c" |
| 1127 |
--- a/s_exp2.cpp 2022-12-11 21:15:55.790512181 -0500 |
| 1128 |
+++ b/s_exp2.cpp_new 2022-12-11 21:12:34.476281131 -0500 |
| 1129 |
@@ -27,15 +27,14 @@ |
| 1130 |
*/ |
| 1131 |
|
| 1132 |
#include <sys/cdefs.h> |
| 1133 |
__FBSDID("$FreeBSD$"); |
| 1134 |
|
| 1135 |
#include <float.h> |
| 1136 |
|
| 1137 |
-#include "math.h" |
| 1138 |
#include "math_private.h" |
| 1139 |
|
| 1140 |
#define TBLBITS 8 |
| 1141 |
#define TBLSIZE (1 << TBLBITS) |
| 1142 |
|
| 1143 |
static const double |
| 1144 |
redux = 0x1.8p52 / TBLSIZE, |
| 1145 |
--- a/s_exp2f.cpp 2022-12-11 21:15:55.926514101 -0500 |
| 1146 |
+++ b/s_exp2f.cpp_new 2022-12-11 21:12:30.644256149 -0500 |
| 1147 |
@@ -27,15 +27,14 @@ |
| 1148 |
*/ |
| 1149 |
|
| 1150 |
#include <sys/cdefs.h> |
| 1151 |
__FBSDID("$FreeBSD$"); |
| 1152 |
|
| 1153 |
#include <float.h> |
| 1154 |
|
| 1155 |
-#include "math.h" |
| 1156 |
#include "math_private.h" |
| 1157 |
|
| 1158 |
#define TBLBITS 4 |
| 1159 |
#define TBLSIZE (1 << TBLBITS) |
| 1160 |
|
| 1161 |
static const float |
| 1162 |
redux = 0x1.8p23f / TBLSIZE, |
| 1163 |
--- a/s_fabsf.cpp 2022-12-11 21:15:56.202517995 -0500 |
| 1164 |
+++ b/s_fabsf.cpp_new 2022-12-11 21:12:27.244233973 -0500 |
| 1165 |
@@ -16,15 +16,14 @@ |
| 1166 |
#include <sys/cdefs.h> |
| 1167 |
__FBSDID("$FreeBSD$"); |
| 1168 |
|
| 1169 |
/* |
| 1170 |
* fabsf(x) returns the absolute value of x. |
| 1171 |
*/ |
| 1172 |
|
| 1173 |
-#include "math.h" |
| 1174 |
#include "math_private.h" |
| 1175 |
|
| 1176 |
float |
| 1177 |
fabsf(float x) |
| 1178 |
{ |
| 1179 |
u_int32_t ix; |
| 1180 |
GET_FLOAT_WORD(ix,x); |
| 1181 |
--- a/s_sinf.cpp 2022-12-11 21:15:57.618537960 -0500 |
| 1182 |
+++ b/s_sinf.cpp_new 2022-12-11 21:12:24.684217270 -0500 |
| 1183 |
@@ -15,15 +15,14 @@ |
| 1184 |
*/ |
| 1185 |
|
| 1186 |
#include <sys/cdefs.h> |
| 1187 |
__FBSDID("$FreeBSD$"); |
| 1188 |
|
| 1189 |
#include <float.h> |
| 1190 |
|
| 1191 |
-#include "math.h" |
| 1192 |
#define INLINE_KERNEL_COSDF |
| 1193 |
#define INLINE_KERNEL_SINDF |
| 1194 |
#define INLINE_REM_PIO2F |
| 1195 |
#include "math_private.h" |
| 1196 |
#include "e_rem_pio2f.c" |
| 1197 |
#include "k_cosf.c" |
| 1198 |
#include "k_sinf.c" |
| 1199 |
--- a/s_tanf.cpp 2022-12-11 21:15:57.930542357 -0500 |
| 1200 |
+++ b/s_tanf.cpp_new 2022-12-11 21:12:20.420189437 -0500 |
| 1201 |
@@ -15,15 +15,14 @@ |
| 1202 |
*/ |
| 1203 |
|
| 1204 |
#include <sys/cdefs.h> |
| 1205 |
__FBSDID("$FreeBSD$"); |
| 1206 |
|
| 1207 |
#include <float.h> |
| 1208 |
|
| 1209 |
-#include "math.h" |
| 1210 |
#define INLINE_KERNEL_TANDF |
| 1211 |
#define INLINE_REM_PIO2F |
| 1212 |
#include "math_private.h" |
| 1213 |
#include "e_rem_pio2f.c" |
| 1214 |
#include "k_tanf.c" |
| 1215 |
|
| 1216 |
/* Small multiples of pi/2 rounded to double precision. */ |