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
6 @@ -35,17 +35,16 @@ __FBSDID("$FreeBSD$");
7 * if x is NaN, return x itself;
8 * if |x|>1, return NaN with invalid signal.
10 * Function needed: sqrt
16 #include "math_private.h"
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
27 @@ -26,17 +26,16 @@ __FBSDID("$FreeBSD$");
30 * acosh(x) is NaN with signal if x<1.
31 * acosh(NaN) is NaN without signal.
37 #include "math_private.h"
41 ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */
44 __ieee754_acosh(double x)
45 diff --git a/e_asin.cpp b/e_asin.cpp
48 @@ -41,17 +41,16 @@ __FBSDID("$FreeBSD$");
50 * if x is NaN, return x itself;
51 * if |x|>1, return NaN with invalid signal.
58 #include "math_private.h"
61 one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
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
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.
79 #include "math_private.h"
81 static volatile double
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
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.
100 #include "math_private.h"
102 static const double one = 1.0, huge = 1e300;
103 static const double zero = 0.0;
106 __ieee754_atanh(double x)
108 diff --git a/e_cosh.cpp b/e_cosh.cpp
111 @@ -32,17 +32,16 @@ __FBSDID("$FreeBSD$");
114 * cosh(x) is |x| if x is +INF, -INF, or NaN.
115 * only cosh(0)=1 is exact for finite x.
121 #include "math_private.h"
123 static const double one = 1.0, half=0.5, huge = 1.0e300;
126 __ieee754_cosh(double x)
129 diff --git a/e_exp.cpp 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.
142 #include "math_private.h"
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
153 @@ -43,17 +43,16 @@ __FBSDID("$FreeBSD$");
156 * hypot(x,y) returns sqrt(x^2+y^2) with error less
157 * than 1 ulps (units in the last place)
163 #include "math_private.h"
166 __ieee754_hypot(double x, double y)
168 double a,b,t1,t2,y1,y2,w;
171 diff --git a/e_log.cpp 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.
184 #include "math_private.h"
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
195 @@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$");
198 * log10(x) = (f - 0.5*f*f + k_log1p(f)) / ln10 + k * log10(2)
199 * in not-quite-routine extra precision.
205 #include "math_private.h"
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
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.
226 #include "math_private.h"
230 two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
231 ivln2hi = 1.44269504072144627571e+00, /* 0x3ff71547, 0x65200000 */
232 ivln2lo = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */
234 diff --git a/e_pow.cpp b/e_pow.cpp
237 @@ -53,17 +53,16 @@ __FBSDID("$FreeBSD$");
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.
247 #include "math_private.h"
251 dp_h[] = { 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */
252 dp_l[] = { 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */
255 diff --git a/e_rem_pio2.cpp b/e_rem_pio2.cpp
258 @@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$");
259 /* __ieee754_rem_pio2(x,y)
261 * return the remainder of x rem pi/2 in y[0]+y[1]
262 * use __kernel_rem_pio2()
268 #include "math_private.h"
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
279 @@ -29,17 +29,16 @@ __FBSDID("$FreeBSD$");
282 * sinh(x) is |x| if x is +INF, -INF, or NaN.
283 * only sinh(0)=0 is exact for finite x.
289 #include "math_private.h"
291 static const double one = 1.0, shuge = 1.0e307;
294 __ieee754_sinh(double x)
297 diff --git a/k_cos.cpp 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.
310 #include "math_private.h"
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
325 #include <sys/cdefs.h>
326 __FBSDID("$FreeBSD$");
331 #include "math_private.h"
333 static const uint32_t k = 1799; /* constant for reduction */
334 static const double kln2 = 1246.97177782734161156; /* k * ln2 */
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
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.
352 #include "math_private.h"
354 static const int init_jk[] = {3,4,4,6}; /* initial value for jk */
357 * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
359 * integer array, contains the (24*i)-th to (24*i+23)-th
360 diff --git a/k_sin.cpp b/k_sin.cpp
363 @@ -39,17 +39,16 @@ __FBSDID("$FreeBSD$");
364 * ~ sin(x) + (1-x*x/2)*y
365 * For better accuracy, let
367 * r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6))))
369 * sin(x) = x + (S1*x + (x *(r-y/2)+y))
373 #include "math_private.h"
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
384 @@ -44,17 +44,16 @@ __FBSDID("$FreeBSD$");
386 * tan(x+y) = x + (T1*x + (x *(r+y)+y))
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)))
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
408 #ifndef _MATH_PRIVATE_H_
409 #define _MATH_PRIVATE_H_
411 #include <sys/types.h>
412 #include <machine/endian.h>
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
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)))
437 #include "math_private.h"
440 one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
441 ln2 = 6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */
442 huge= 1.00000000000000000000e+300;
445 diff --git a/s_atan.cpp 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.
458 #include "math_private.h"
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 */
466 diff --git a/s_cbrt.cpp b/s_cbrt.cpp
471 * Optimized by Bruce D. Evans.
474 #include <sys/cdefs.h>
475 __FBSDID("$FreeBSD$");
479 #include "math_private.h"
482 * Return cube root of x
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
490 @@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$");
494 * Inexact flag raised if x not equal to ceil(x).
500 #include "math_private.h"
502 static const double huge = 1.0e300;
508 diff --git a/s_ceilf.cpp b/s_ceilf.cpp
512 * software is freely granted, provided that this notice
514 * ====================================================
517 #include <sys/cdefs.h>
518 __FBSDID("$FreeBSD$");
521 #include "math_private.h"
523 static const float huge = 1.0e30;
529 diff --git a/s_copysign.cpp b/s_copysign.cpp
533 __FBSDID("$FreeBSD$");
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.
542 #include "math_private.h"
545 copysign(double x, double y)
550 diff --git a/s_cos.cpp b/s_cos.cpp
553 @@ -41,17 +41,16 @@ __FBSDID("$FreeBSD$");
554 * trig(NaN) is that NaN;
557 * TRIG(x) returns trig(x) nearly rounded
563 #define INLINE_REM_PIO2
564 #include "math_private.h"
565 #include "e_rem_pio2.c"
571 diff --git a/s_expm1.cpp 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.
584 #include "math_private.h"
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
597 #include <sys/cdefs.h>
598 __FBSDID("$FreeBSD$");
601 * fabs(x) returns the absolute value of x.
605 #include "math_private.h"
611 GET_HIGH_WORD(high,x);
612 SET_HIGH_WORD(x,high&0x7fffffff);
613 diff --git a/s_floor.cpp b/s_floor.cpp
616 @@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$");
620 * Inexact flag raised if x not equal to floor(x).
626 #include "math_private.h"
628 static const double huge = 1.0e300;
634 diff --git a/s_floorf.cpp b/s_floorf.cpp
637 @@ -20,17 +20,16 @@ __FBSDID("$FreeBSD$");
639 * Return x rounded toward -inf to integral value
643 * Inexact flag raised if x not equal to floorf(x).
647 #include "math_private.h"
649 static const float huge = 1.0e30;
655 diff --git a/s_log1p.cpp 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));
662 * See HP-15C Advanced Functions Handbook, p.193.
668 #include "math_private.h"
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
680 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
684 #include <sys/cdefs.h>
685 __FBSDID("$FreeBSD$");
690 +#include "math_private.h"
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.
699 diff --git a/s_rint.cpp b/s_rint.cpp
702 @@ -20,17 +20,16 @@ __FBSDID("$FreeBSD$");
704 * Using floating addition.
706 * Inexact flag raised if x not equal to rint(x).
712 #include "math_private.h"
716 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
717 -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
720 diff --git a/s_rintf.cpp b/s_rintf.cpp
726 #include <sys/cdefs.h>
727 __FBSDID("$FreeBSD$");
733 #include "math_private.h"
737 8.3886080000e+06, /* 0x4b000000 */
738 -8.3886080000e+06, /* 0xcb000000 */
741 diff --git a/s_scalbn.cpp b/s_scalbn.cpp
745 * Copyright (c) 2005-2020 Rich Felker, et al.
747 * SPDX-License-Identifier: MIT
749 * Please see https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT
750 * for all contributors to musl.
756 +#include "math_private.h"
758 double scalbn(double x, int n)
760 union {double f; uint64_t i;} u;
766 diff --git a/s_scalbnf.cpp b/s_scalbnf.cpp
770 * SPDX-License-Identifier: MIT
772 * Please see https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT
773 * for all contributors to musl.
778 +#include "math_private.h"
780 float scalbnf(float x, int n)
782 union {float f; uint32_t i;} u;
788 diff --git a/s_sin.cpp b/s_sin.cpp
791 @@ -41,17 +41,16 @@ __FBSDID("$FreeBSD$");
792 * trig(NaN) is that NaN;
795 * TRIG(x) returns trig(x) nearly rounded
801 #define INLINE_REM_PIO2
802 #include "math_private.h"
803 #include "e_rem_pio2.c"
809 diff --git a/s_tan.cpp b/s_tan.cpp
812 @@ -40,17 +40,16 @@ __FBSDID("$FreeBSD$");
813 * trig(NaN) is that NaN;
816 * TRIG(x) returns trig(x) nearly rounded
822 #define INLINE_REM_PIO2
823 #include "math_private.h"
824 #include "e_rem_pio2.c"
830 diff --git a/s_tanh.cpp b/s_tanh.cpp
833 @@ -34,17 +34,16 @@ __FBSDID("$FreeBSD$");
837 * only tanh(0)=0 is exact for finite argument.
843 #include "math_private.h"
845 static const volatile double tiny = 1.0e-300;
846 static const double one = 1.0, two = 2.0, huge = 1.0e300;
851 diff --git a/s_trunc.cpp b/s_trunc.cpp
854 @@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$");
858 * Inexact flag raised if x not equal to trunc(x).
864 #include "math_private.h"
866 static const double huge = 1.0e300;
872 diff --git a/s_truncf.cpp b/s_truncf.cpp
875 @@ -17,17 +17,16 @@ __FBSDID("$FreeBSD$");
877 * Return x rounded toward 0 to integral value
881 * Inexact flag raised if x not equal to truncf(x).
885 #include "math_private.h"
887 static const float huge = 1.0e30F;
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
897 * ====================================================
900 #include <sys/cdefs.h>
901 __FBSDID("$FreeBSD$");
904 #include "math_private.h"
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
915 * ====================================================
918 #include <sys/cdefs.h>
919 __FBSDID("$FreeBSD$");
922 #include "math_private.h"
925 one = 1.0000000000e+00, /* 0x3F800000 */
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
934 #include <sys/cdefs.h>
935 __FBSDID("$FreeBSD$");
940 #include "math_private.h"
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
951 * ====================================================
954 #include <sys/cdefs.h>
955 __FBSDID("$FreeBSD$");
958 #include "math_private.h"
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
969 * ====================================================
972 #include <sys/cdefs.h>
973 __FBSDID("$FreeBSD$");
976 #include "math_private.h"
980 dp_h[] = { 0.0, 5.84960938e-01,}, /* 0x3f15c000 */
981 dp_l[] = { 0.0, 1.56322085e-06,}, /* 0x35d1cfdc */
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
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
994 #include "math_private.h"
997 * invpio2: 53 bits of 2/pi
998 * pio2_1: first 25 bits of pi/2
999 * pio2_1t: pi/2 - pio2_1
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
1004 * ====================================================
1008 static char rcsid[] = "$FreeBSD$";
1012 #include "math_private.h"
1014 #ifdef USE_BUILTIN_SQRTF
1016 __ieee754_sqrtf(float x)
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
1024 #ifndef INLINE_KERNEL_COSDF
1025 #include <sys/cdefs.h>
1026 __FBSDID("$FreeBSD$");
1030 #include "math_private.h"
1032 /* |cos(x) - c(x)| < 2**-34.1 (~[-5.37e-11, 5.295e-11]). */
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
1042 #include <sys/cdefs.h>
1043 __FBSDID("$FreeBSD$");
1045 #include <complex.h>
1048 #include "math_private.h"
1050 static const uint32_t k = 235; /* constant for reduction */
1051 static const float kln2 = 162.88958740F; /* k * ln2 */
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
1060 #ifndef INLINE_KERNEL_SINDF
1061 #include <sys/cdefs.h>
1062 __FBSDID("$FreeBSD$");
1066 #include "math_private.h"
1068 /* |sin(x)/x - s(x)| < 2**-37.5 (~[-4.89e-12, 4.824e-12]). */
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
1078 #ifndef INLINE_KERNEL_TANDF
1079 #include <sys/cdefs.h>
1080 __FBSDID("$FreeBSD$");
1084 #include "math_private.h"
1086 /* |tan(x)/x - t(x)| < 2**-25.5 (~[-2e-08, 2e-08]). */
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
1095 * ====================================================
1098 #include <sys/cdefs.h>
1099 __FBSDID("$FreeBSD$");
1102 #include "math_private.h"
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
1114 #include <sys/cdefs.h>
1115 __FBSDID("$FreeBSD$");
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"
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
1132 #include <sys/cdefs.h>
1133 __FBSDID("$FreeBSD$");
1138 #include "math_private.h"
1141 #define TBLSIZE (1 << TBLBITS)
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
1150 #include <sys/cdefs.h>
1151 __FBSDID("$FreeBSD$");
1156 #include "math_private.h"
1159 #define TBLSIZE (1 << TBLBITS)
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
1166 #include <sys/cdefs.h>
1167 __FBSDID("$FreeBSD$");
1170 * fabsf(x) returns the absolute value of x.
1174 #include "math_private.h"
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
1186 #include <sys/cdefs.h>
1187 __FBSDID("$FreeBSD$");
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"
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
1204 #include <sys/cdefs.h>
1205 __FBSDID("$FreeBSD$");
1210 #define INLINE_KERNEL_TANDF
1211 #define INLINE_REM_PIO2F
1212 #include "math_private.h"
1213 #include "e_rem_pio2f.c"
1216 /* Small multiples of pi/2 rounded to double precision. */