@zigc/lib 0.16.0-dev.3091 → 0.16.0-dev.3128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/c/math.zig +121 -30
  2. package/compiler/build_runner.zig +1 -0
  3. package/compiler/test_runner.zig +191 -59
  4. package/compiler_rt/cos.zig +141 -52
  5. package/compiler_rt/long_double.zig +37 -0
  6. package/compiler_rt/rem_pio2l.zig +173 -0
  7. package/compiler_rt/sin.zig +140 -55
  8. package/compiler_rt/sincos.zig +279 -72
  9. package/compiler_rt/tan.zig +118 -47
  10. package/compiler_rt/trig.zig +256 -6
  11. package/fuzzer.zig +855 -307
  12. package/package.json +1 -1
  13. package/std/Build/Fuzz.zig +6 -19
  14. package/std/Build/Step/Run.zig +530 -68
  15. package/std/Build/abi.zig +39 -7
  16. package/std/Build.zig +3 -0
  17. package/std/compress/flate/Compress.zig +3 -3
  18. package/std/debug/Info.zig +4 -0
  19. package/std/heap/ArenaAllocator.zig +145 -154
  20. package/std/mem/Allocator.zig +4 -5
  21. package/std/mem.zig +48 -0
  22. package/std/priority_dequeue.zig +13 -12
  23. package/std/priority_queue.zig +5 -4
  24. package/std/zig/Client.zig +8 -3
  25. package/std/zig/Server.zig +26 -0
  26. package/libc/mingw/complex/cabs.c +0 -48
  27. package/libc/mingw/complex/cabsf.c +0 -48
  28. package/libc/mingw/complex/cacos.c +0 -50
  29. package/libc/mingw/complex/cacosf.c +0 -50
  30. package/libc/mingw/complex/carg.c +0 -48
  31. package/libc/mingw/complex/cargf.c +0 -48
  32. package/libc/mingw/complex/casin.c +0 -50
  33. package/libc/mingw/complex/casinf.c +0 -50
  34. package/libc/mingw/complex/catan.c +0 -50
  35. package/libc/mingw/complex/catanf.c +0 -50
  36. package/libc/mingw/complex/ccos.c +0 -50
  37. package/libc/mingw/complex/ccosf.c +0 -50
  38. package/libc/mingw/complex/cexp.c +0 -48
  39. package/libc/mingw/complex/cexpf.c +0 -48
  40. package/libc/mingw/complex/cimag.c +0 -48
  41. package/libc/mingw/complex/cimagf.c +0 -48
  42. package/libc/mingw/complex/clog.c +0 -48
  43. package/libc/mingw/complex/clog10.c +0 -49
  44. package/libc/mingw/complex/clog10f.c +0 -49
  45. package/libc/mingw/complex/clogf.c +0 -48
  46. package/libc/mingw/complex/conj.c +0 -48
  47. package/libc/mingw/complex/conjf.c +0 -48
  48. package/libc/mingw/complex/cpow.c +0 -48
  49. package/libc/mingw/complex/cpowf.c +0 -48
  50. package/libc/mingw/complex/cproj.c +0 -48
  51. package/libc/mingw/complex/cprojf.c +0 -48
  52. package/libc/mingw/complex/creal.c +0 -48
  53. package/libc/mingw/complex/crealf.c +0 -48
  54. package/libc/mingw/complex/csin.c +0 -50
  55. package/libc/mingw/complex/csinf.c +0 -50
  56. package/libc/mingw/complex/csqrt.c +0 -48
  57. package/libc/mingw/complex/csqrtf.c +0 -48
  58. package/libc/mingw/complex/ctan.c +0 -50
  59. package/libc/mingw/complex/ctanf.c +0 -50
  60. package/libc/mingw/math/arm/s_rint.c +0 -86
  61. package/libc/mingw/math/arm/s_rintf.c +0 -51
  62. package/libc/mingw/math/arm/sincos.S +0 -30
  63. package/libc/mingw/math/arm-common/sincosl.c +0 -13
  64. package/libc/mingw/math/arm64/rint.c +0 -12
  65. package/libc/mingw/math/arm64/rintf.c +0 -12
  66. package/libc/mingw/math/arm64/sincos.S +0 -32
  67. package/libc/mingw/math/bsd_private_base.h +0 -148
  68. package/libc/mingw/math/frexpf.c +0 -13
  69. package/libc/mingw/math/frexpl.c +0 -71
  70. package/libc/mingw/math/x86/acosf.c +0 -29
  71. package/libc/mingw/math/x86/atanf.c +0 -23
  72. package/libc/mingw/math/x86/atanl.c +0 -18
  73. package/libc/mingw/math/x86/cos.def.h +0 -65
  74. package/libc/mingw/math/x86/cosl.c +0 -46
  75. package/libc/mingw/math/x86/cosl_internal.S +0 -55
  76. package/libc/mingw/math/x86/ldexp.c +0 -23
  77. package/libc/mingw/math/x86/scalbn.S +0 -41
  78. package/libc/mingw/math/x86/scalbnf.S +0 -40
  79. package/libc/mingw/math/x86/sin.def.h +0 -65
  80. package/libc/mingw/math/x86/sinl.c +0 -46
  81. package/libc/mingw/math/x86/sinl_internal.S +0 -58
  82. package/libc/mingw/math/x86/tanl.S +0 -62
  83. package/libc/mingw/misc/btowc.c +0 -28
  84. package/libc/mingw/misc/wcstof.c +0 -66
  85. package/libc/mingw/misc/wcstoimax.c +0 -132
  86. package/libc/mingw/misc/wcstoumax.c +0 -126
  87. package/libc/mingw/misc/wctob.c +0 -29
  88. package/libc/mingw/misc/winbs_uint64.c +0 -6
  89. package/libc/mingw/misc/winbs_ulong.c +0 -6
  90. package/libc/mingw/misc/winbs_ushort.c +0 -6
  91. package/libc/mingw/stdio/_Exit.c +0 -10
  92. package/libc/mingw/stdio/_findfirst64i32.c +0 -21
  93. package/libc/mingw/stdio/_findnext64i32.c +0 -21
  94. package/libc/mingw/stdio/_fstat64i32.c +0 -37
  95. package/libc/mingw/stdio/_stat64i32.c +0 -37
  96. package/libc/mingw/stdio/_wfindfirst64i32.c +0 -21
  97. package/libc/mingw/stdio/_wfindnext64i32.c +0 -21
  98. package/libc/mingw/stdio/_wstat64i32.c +0 -37
  99. package/libc/musl/src/legacy/valloc.c +0 -8
  100. package/libc/musl/src/math/__cosl.c +0 -96
  101. package/libc/musl/src/math/__sinl.c +0 -78
  102. package/libc/musl/src/math/__tanl.c +0 -143
  103. package/libc/musl/src/math/aarch64/lrint.c +0 -10
  104. package/libc/musl/src/math/aarch64/lrintf.c +0 -10
  105. package/libc/musl/src/math/aarch64/rintf.c +0 -7
  106. package/libc/musl/src/math/cosl.c +0 -39
  107. package/libc/musl/src/math/exp_data.c +0 -182
  108. package/libc/musl/src/math/exp_data.h +0 -26
  109. package/libc/musl/src/math/finite.c +0 -7
  110. package/libc/musl/src/math/finitef.c +0 -7
  111. package/libc/musl/src/math/frexp.c +0 -23
  112. package/libc/musl/src/math/frexpf.c +0 -23
  113. package/libc/musl/src/math/frexpl.c +0 -29
  114. package/libc/musl/src/math/i386/lrint.c +0 -8
  115. package/libc/musl/src/math/i386/lrintf.c +0 -8
  116. package/libc/musl/src/math/i386/rintf.c +0 -7
  117. package/libc/musl/src/math/lrint.c +0 -72
  118. package/libc/musl/src/math/lrintf.c +0 -8
  119. package/libc/musl/src/math/pow_data.c +0 -180
  120. package/libc/musl/src/math/pow_data.h +0 -22
  121. package/libc/musl/src/math/powerpc64/lrint.c +0 -16
  122. package/libc/musl/src/math/powerpc64/lrintf.c +0 -16
  123. package/libc/musl/src/math/rintf.c +0 -30
  124. package/libc/musl/src/math/s390x/rintf.c +0 -15
  125. package/libc/musl/src/math/sincosl.c +0 -60
  126. package/libc/musl/src/math/sinl.c +0 -41
  127. package/libc/musl/src/math/tanl.c +0 -29
  128. package/libc/musl/src/math/x32/lrint.s +0 -5
  129. package/libc/musl/src/math/x32/lrintf.s +0 -5
  130. package/libc/musl/src/math/x86_64/lrint.c +0 -8
  131. package/libc/musl/src/math/x86_64/lrintf.c +0 -8
  132. package/libc/wasi/libc-bottom-half/sources/reallocarray.c +0 -14
@@ -1,143 +0,0 @@
1
- /* origin: FreeBSD /usr/src/lib/msun/ld80/k_tanl.c */
2
- /* origin: FreeBSD /usr/src/lib/msun/ld128/k_tanl.c */
3
- /*
4
- * ====================================================
5
- * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
6
- * Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans.
7
- *
8
- * Permission to use, copy, modify, and distribute this
9
- * software is freely granted, provided that this notice
10
- * is preserved.
11
- * ====================================================
12
- */
13
-
14
- #include "libm.h"
15
-
16
- #if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
17
- #if LDBL_MANT_DIG == 64
18
- /*
19
- * ld80 version of __tan.c. See __tan.c for most comments.
20
- */
21
- /*
22
- * Domain [-0.67434, 0.67434], range ~[-2.25e-22, 1.921e-22]
23
- * |tan(x)/x - t(x)| < 2**-71.9
24
- *
25
- * See __cosl.c for more details about the polynomial.
26
- */
27
- static const long double
28
- T3 = 0.333333333333333333180L, /* 0xaaaaaaaaaaaaaaa5.0p-65 */
29
- T5 = 0.133333333333333372290L, /* 0x88888888888893c3.0p-66 */
30
- T7 = 0.0539682539682504975744L, /* 0xdd0dd0dd0dc13ba2.0p-68 */
31
- pio4 = 0.785398163397448309628L, /* 0xc90fdaa22168c235.0p-64 */
32
- pio4lo = -1.25413940316708300586e-20L; /* -0xece675d1fc8f8cbb.0p-130 */
33
- static const double
34
- T9 = 0.021869488536312216, /* 0x1664f4882cc1c2.0p-58 */
35
- T11 = 0.0088632355256619590, /* 0x1226e355c17612.0p-59 */
36
- T13 = 0.0035921281113786528, /* 0x1d6d3d185d7ff8.0p-61 */
37
- T15 = 0.0014558334756312418, /* 0x17da354aa3f96b.0p-62 */
38
- T17 = 0.00059003538700862256, /* 0x13559358685b83.0p-63 */
39
- T19 = 0.00023907843576635544, /* 0x1f56242026b5be.0p-65 */
40
- T21 = 0.000097154625656538905, /* 0x1977efc26806f4.0p-66 */
41
- T23 = 0.000038440165747303162, /* 0x14275a09b3ceac.0p-67 */
42
- T25 = 0.000018082171885432524, /* 0x12f5e563e5487e.0p-68 */
43
- T27 = 0.0000024196006108814377, /* 0x144c0d80cc6896.0p-71 */
44
- T29 = 0.0000078293456938132840, /* 0x106b59141a6cb3.0p-69 */
45
- T31 = -0.0000032609076735050182, /* -0x1b5abef3ba4b59.0p-71 */
46
- T33 = 0.0000023261313142559411; /* 0x13835436c0c87f.0p-71 */
47
- #define RPOLY(w) (T5 + w * (T9 + w * (T13 + w * (T17 + w * (T21 + \
48
- w * (T25 + w * (T29 + w * T33)))))))
49
- #define VPOLY(w) (T7 + w * (T11 + w * (T15 + w * (T19 + w * (T23 + \
50
- w * (T27 + w * T31))))))
51
- #elif LDBL_MANT_DIG == 113
52
- /*
53
- * ld128 version of __tan.c. See __tan.c for most comments.
54
- */
55
- /*
56
- * Domain [-0.67434, 0.67434], range ~[-3.37e-36, 1.982e-37]
57
- * |tan(x)/x - t(x)| < 2**-117.8 (XXX should be ~1e-37)
58
- *
59
- * See __cosl.c for more details about the polynomial.
60
- */
61
- static const long double
62
- T3 = 0x1.5555555555555555555555555553p-2L,
63
- T5 = 0x1.1111111111111111111111111eb5p-3L,
64
- T7 = 0x1.ba1ba1ba1ba1ba1ba1ba1b694cd6p-5L,
65
- T9 = 0x1.664f4882c10f9f32d6bbe09d8bcdp-6L,
66
- T11 = 0x1.226e355e6c23c8f5b4f5762322eep-7L,
67
- T13 = 0x1.d6d3d0e157ddfb5fed8e84e27b37p-9L,
68
- T15 = 0x1.7da36452b75e2b5fce9ee7c2c92ep-10L,
69
- T17 = 0x1.355824803674477dfcf726649efep-11L,
70
- T19 = 0x1.f57d7734d1656e0aceb716f614c2p-13L,
71
- T21 = 0x1.967e18afcb180ed942dfdc518d6cp-14L,
72
- T23 = 0x1.497d8eea21e95bc7e2aa79b9f2cdp-15L,
73
- T25 = 0x1.0b132d39f055c81be49eff7afd50p-16L,
74
- T27 = 0x1.b0f72d33eff7bfa2fbc1059d90b6p-18L,
75
- T29 = 0x1.5ef2daf21d1113df38d0fbc00267p-19L,
76
- T31 = 0x1.1c77d6eac0234988cdaa04c96626p-20L,
77
- T33 = 0x1.cd2a5a292b180e0bdd701057dfe3p-22L,
78
- T35 = 0x1.75c7357d0298c01a31d0a6f7d518p-23L,
79
- T37 = 0x1.2f3190f4718a9a520f98f50081fcp-24L,
80
- pio4 = 0x1.921fb54442d18469898cc51701b8p-1L,
81
- pio4lo = 0x1.cd129024e088a67cc74020bbea60p-116L;
82
- static const double
83
- T39 = 0.000000028443389121318352, /* 0x1e8a7592977938.0p-78 */
84
- T41 = 0.000000011981013102001973, /* 0x19baa1b1223219.0p-79 */
85
- T43 = 0.0000000038303578044958070, /* 0x107385dfb24529.0p-80 */
86
- T45 = 0.0000000034664378216909893, /* 0x1dc6c702a05262.0p-81 */
87
- T47 = -0.0000000015090641701997785, /* -0x19ecef3569ebb6.0p-82 */
88
- T49 = 0.0000000029449552300483952, /* 0x194c0668da786a.0p-81 */
89
- T51 = -0.0000000022006995706097711, /* -0x12e763b8845268.0p-81 */
90
- T53 = 0.0000000015468200913196612, /* 0x1a92fc98c29554.0p-82 */
91
- T55 = -0.00000000061311613386849674, /* -0x151106cbc779a9.0p-83 */
92
- T57 = 1.4912469681508012e-10; /* 0x147edbdba6f43a.0p-85 */
93
- #define RPOLY(w) (T5 + w * (T9 + w * (T13 + w * (T17 + w * (T21 + \
94
- w * (T25 + w * (T29 + w * (T33 + w * (T37 + w * (T41 + \
95
- w * (T45 + w * (T49 + w * (T53 + w * T57)))))))))))))
96
- #define VPOLY(w) (T7 + w * (T11 + w * (T15 + w * (T19 + w * (T23 + \
97
- w * (T27 + w * (T31 + w * (T35 + w * (T39 + w * (T43 + \
98
- w * (T47 + w * (T51 + w * T55))))))))))))
99
- #endif
100
-
101
- long double __tanl(long double x, long double y, int odd) {
102
- long double z, r, v, w, s, a, t;
103
- int big, sign;
104
-
105
- big = fabsl(x) >= 0.67434;
106
- if (big) {
107
- sign = 0;
108
- if (x < 0) {
109
- sign = 1;
110
- x = -x;
111
- y = -y;
112
- }
113
- x = (pio4 - x) + (pio4lo - y);
114
- y = 0.0;
115
- }
116
- z = x * x;
117
- w = z * z;
118
- r = RPOLY(w);
119
- v = z * VPOLY(w);
120
- s = z * x;
121
- r = y + z * (s * (r + v) + y) + T3 * s;
122
- w = x + r;
123
- if (big) {
124
- s = 1 - 2*odd;
125
- v = s - 2.0 * (x + (r - w * w / (w + s)));
126
- return sign ? -v : v;
127
- }
128
- if (!odd)
129
- return w;
130
- /*
131
- * if allow error up to 2 ulp, simply return
132
- * -1.0 / (x+r) here
133
- */
134
- /* compute -1.0 / (x+r) accurately */
135
- z = w;
136
- z = z + 0x1p32 - 0x1p32;
137
- v = r - (z - x); /* z+v = r+x */
138
- t = a = -1.0 / w; /* a = -1.0/w */
139
- t = t + 0x1p32 - 0x1p32;
140
- s = 1.0 + t * z;
141
- return t + a * (s + t * v);
142
- }
143
- #endif
@@ -1,10 +0,0 @@
1
- #include <math.h>
2
-
3
- long lrint(double x)
4
- {
5
- long n;
6
- __asm__ (
7
- "frintx %d1, %d1\n"
8
- "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x));
9
- return n;
10
- }
@@ -1,10 +0,0 @@
1
- #include <math.h>
2
-
3
- long lrintf(float x)
4
- {
5
- long n;
6
- __asm__ (
7
- "frintx %s1, %s1\n"
8
- "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x));
9
- return n;
10
- }
@@ -1,7 +0,0 @@
1
- #include <math.h>
2
-
3
- float rintf(float x)
4
- {
5
- __asm__ ("frintx %s0, %s1" : "=w"(x) : "w"(x));
6
- return x;
7
- }
@@ -1,39 +0,0 @@
1
- #include "libm.h"
2
-
3
- #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
4
- long double cosl(long double x) {
5
- return cos(x);
6
- }
7
- #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
8
- long double cosl(long double x)
9
- {
10
- union ldshape u = {x};
11
- unsigned n;
12
- long double y[2], hi, lo;
13
-
14
- u.i.se &= 0x7fff;
15
- if (u.i.se == 0x7fff)
16
- return x - x;
17
- x = u.f;
18
- if (x < M_PI_4) {
19
- if (u.i.se < 0x3fff - LDBL_MANT_DIG)
20
- /* raise inexact if x!=0 */
21
- return 1.0 + x;
22
- return __cosl(x, 0);
23
- }
24
- n = __rem_pio2l(x, y);
25
- hi = y[0];
26
- lo = y[1];
27
- switch (n & 3) {
28
- case 0:
29
- return __cosl(hi, lo);
30
- case 1:
31
- return -__sinl(hi, lo, 1);
32
- case 2:
33
- return -__cosl(hi, lo);
34
- case 3:
35
- default:
36
- return __sinl(hi, lo, 1);
37
- }
38
- }
39
- #endif
@@ -1,182 +0,0 @@
1
- /*
2
- * Shared data between exp, exp2 and pow.
3
- *
4
- * Copyright (c) 2018, Arm Limited.
5
- * SPDX-License-Identifier: MIT
6
- */
7
-
8
- #include "exp_data.h"
9
-
10
- #define N (1 << EXP_TABLE_BITS)
11
-
12
- const struct exp_data __exp_data = {
13
- // N/ln2
14
- .invln2N = 0x1.71547652b82fep0 * N,
15
- // -ln2/N
16
- .negln2hiN = -0x1.62e42fefa0000p-8,
17
- .negln2loN = -0x1.cf79abc9e3b3ap-47,
18
- // Used for rounding when !TOINT_INTRINSICS
19
- #if EXP_USE_TOINT_NARROW
20
- .shift = 0x1800000000.8p0,
21
- #else
22
- .shift = 0x1.8p52,
23
- #endif
24
- // exp polynomial coefficients.
25
- .poly = {
26
- // abs error: 1.555*2^-66
27
- // ulp error: 0.509 (0.511 without fma)
28
- // if |x| < ln2/256+eps
29
- // abs error if |x| < ln2/256+0x1p-15: 1.09*2^-65
30
- // abs error if |x| < ln2/128: 1.7145*2^-56
31
- 0x1.ffffffffffdbdp-2,
32
- 0x1.555555555543cp-3,
33
- 0x1.55555cf172b91p-5,
34
- 0x1.1111167a4d017p-7,
35
- },
36
- .exp2_shift = 0x1.8p52 / N,
37
- // exp2 polynomial coefficients.
38
- .exp2_poly = {
39
- // abs error: 1.2195*2^-65
40
- // ulp error: 0.507 (0.511 without fma)
41
- // if |x| < 1/256
42
- // abs error if |x| < 1/128: 1.9941*2^-56
43
- 0x1.62e42fefa39efp-1,
44
- 0x1.ebfbdff82c424p-3,
45
- 0x1.c6b08d70cf4b5p-5,
46
- 0x1.3b2abd24650ccp-7,
47
- 0x1.5d7e09b4e3a84p-10,
48
- },
49
- // 2^(k/N) ~= H[k]*(1 + T[k]) for int k in [0,N)
50
- // tab[2*k] = asuint64(T[k])
51
- // tab[2*k+1] = asuint64(H[k]) - (k << 52)/N
52
- .tab = {
53
- 0x0, 0x3ff0000000000000,
54
- 0x3c9b3b4f1a88bf6e, 0x3feff63da9fb3335,
55
- 0xbc7160139cd8dc5d, 0x3fefec9a3e778061,
56
- 0xbc905e7a108766d1, 0x3fefe315e86e7f85,
57
- 0x3c8cd2523567f613, 0x3fefd9b0d3158574,
58
- 0xbc8bce8023f98efa, 0x3fefd06b29ddf6de,
59
- 0x3c60f74e61e6c861, 0x3fefc74518759bc8,
60
- 0x3c90a3e45b33d399, 0x3fefbe3ecac6f383,
61
- 0x3c979aa65d837b6d, 0x3fefb5586cf9890f,
62
- 0x3c8eb51a92fdeffc, 0x3fefac922b7247f7,
63
- 0x3c3ebe3d702f9cd1, 0x3fefa3ec32d3d1a2,
64
- 0xbc6a033489906e0b, 0x3fef9b66affed31b,
65
- 0xbc9556522a2fbd0e, 0x3fef9301d0125b51,
66
- 0xbc5080ef8c4eea55, 0x3fef8abdc06c31cc,
67
- 0xbc91c923b9d5f416, 0x3fef829aaea92de0,
68
- 0x3c80d3e3e95c55af, 0x3fef7a98c8a58e51,
69
- 0xbc801b15eaa59348, 0x3fef72b83c7d517b,
70
- 0xbc8f1ff055de323d, 0x3fef6af9388c8dea,
71
- 0x3c8b898c3f1353bf, 0x3fef635beb6fcb75,
72
- 0xbc96d99c7611eb26, 0x3fef5be084045cd4,
73
- 0x3c9aecf73e3a2f60, 0x3fef54873168b9aa,
74
- 0xbc8fe782cb86389d, 0x3fef4d5022fcd91d,
75
- 0x3c8a6f4144a6c38d, 0x3fef463b88628cd6,
76
- 0x3c807a05b0e4047d, 0x3fef3f49917ddc96,
77
- 0x3c968efde3a8a894, 0x3fef387a6e756238,
78
- 0x3c875e18f274487d, 0x3fef31ce4fb2a63f,
79
- 0x3c80472b981fe7f2, 0x3fef2b4565e27cdd,
80
- 0xbc96b87b3f71085e, 0x3fef24dfe1f56381,
81
- 0x3c82f7e16d09ab31, 0x3fef1e9df51fdee1,
82
- 0xbc3d219b1a6fbffa, 0x3fef187fd0dad990,
83
- 0x3c8b3782720c0ab4, 0x3fef1285a6e4030b,
84
- 0x3c6e149289cecb8f, 0x3fef0cafa93e2f56,
85
- 0x3c834d754db0abb6, 0x3fef06fe0a31b715,
86
- 0x3c864201e2ac744c, 0x3fef0170fc4cd831,
87
- 0x3c8fdd395dd3f84a, 0x3feefc08b26416ff,
88
- 0xbc86a3803b8e5b04, 0x3feef6c55f929ff1,
89
- 0xbc924aedcc4b5068, 0x3feef1a7373aa9cb,
90
- 0xbc9907f81b512d8e, 0x3feeecae6d05d866,
91
- 0xbc71d1e83e9436d2, 0x3feee7db34e59ff7,
92
- 0xbc991919b3ce1b15, 0x3feee32dc313a8e5,
93
- 0x3c859f48a72a4c6d, 0x3feedea64c123422,
94
- 0xbc9312607a28698a, 0x3feeda4504ac801c,
95
- 0xbc58a78f4817895b, 0x3feed60a21f72e2a,
96
- 0xbc7c2c9b67499a1b, 0x3feed1f5d950a897,
97
- 0x3c4363ed60c2ac11, 0x3feece086061892d,
98
- 0x3c9666093b0664ef, 0x3feeca41ed1d0057,
99
- 0x3c6ecce1daa10379, 0x3feec6a2b5c13cd0,
100
- 0x3c93ff8e3f0f1230, 0x3feec32af0d7d3de,
101
- 0x3c7690cebb7aafb0, 0x3feebfdad5362a27,
102
- 0x3c931dbdeb54e077, 0x3feebcb299fddd0d,
103
- 0xbc8f94340071a38e, 0x3feeb9b2769d2ca7,
104
- 0xbc87deccdc93a349, 0x3feeb6daa2cf6642,
105
- 0xbc78dec6bd0f385f, 0x3feeb42b569d4f82,
106
- 0xbc861246ec7b5cf6, 0x3feeb1a4ca5d920f,
107
- 0x3c93350518fdd78e, 0x3feeaf4736b527da,
108
- 0x3c7b98b72f8a9b05, 0x3feead12d497c7fd,
109
- 0x3c9063e1e21c5409, 0x3feeab07dd485429,
110
- 0x3c34c7855019c6ea, 0x3feea9268a5946b7,
111
- 0x3c9432e62b64c035, 0x3feea76f15ad2148,
112
- 0xbc8ce44a6199769f, 0x3feea5e1b976dc09,
113
- 0xbc8c33c53bef4da8, 0x3feea47eb03a5585,
114
- 0xbc845378892be9ae, 0x3feea34634ccc320,
115
- 0xbc93cedd78565858, 0x3feea23882552225,
116
- 0x3c5710aa807e1964, 0x3feea155d44ca973,
117
- 0xbc93b3efbf5e2228, 0x3feea09e667f3bcd,
118
- 0xbc6a12ad8734b982, 0x3feea012750bdabf,
119
- 0xbc6367efb86da9ee, 0x3fee9fb23c651a2f,
120
- 0xbc80dc3d54e08851, 0x3fee9f7df9519484,
121
- 0xbc781f647e5a3ecf, 0x3fee9f75e8ec5f74,
122
- 0xbc86ee4ac08b7db0, 0x3fee9f9a48a58174,
123
- 0xbc8619321e55e68a, 0x3fee9feb564267c9,
124
- 0x3c909ccb5e09d4d3, 0x3feea0694fde5d3f,
125
- 0xbc7b32dcb94da51d, 0x3feea11473eb0187,
126
- 0x3c94ecfd5467c06b, 0x3feea1ed0130c132,
127
- 0x3c65ebe1abd66c55, 0x3feea2f336cf4e62,
128
- 0xbc88a1c52fb3cf42, 0x3feea427543e1a12,
129
- 0xbc9369b6f13b3734, 0x3feea589994cce13,
130
- 0xbc805e843a19ff1e, 0x3feea71a4623c7ad,
131
- 0xbc94d450d872576e, 0x3feea8d99b4492ed,
132
- 0x3c90ad675b0e8a00, 0x3feeaac7d98a6699,
133
- 0x3c8db72fc1f0eab4, 0x3feeace5422aa0db,
134
- 0xbc65b6609cc5e7ff, 0x3feeaf3216b5448c,
135
- 0x3c7bf68359f35f44, 0x3feeb1ae99157736,
136
- 0xbc93091fa71e3d83, 0x3feeb45b0b91ffc6,
137
- 0xbc5da9b88b6c1e29, 0x3feeb737b0cdc5e5,
138
- 0xbc6c23f97c90b959, 0x3feeba44cbc8520f,
139
- 0xbc92434322f4f9aa, 0x3feebd829fde4e50,
140
- 0xbc85ca6cd7668e4b, 0x3feec0f170ca07ba,
141
- 0x3c71affc2b91ce27, 0x3feec49182a3f090,
142
- 0x3c6dd235e10a73bb, 0x3feec86319e32323,
143
- 0xbc87c50422622263, 0x3feecc667b5de565,
144
- 0x3c8b1c86e3e231d5, 0x3feed09bec4a2d33,
145
- 0xbc91bbd1d3bcbb15, 0x3feed503b23e255d,
146
- 0x3c90cc319cee31d2, 0x3feed99e1330b358,
147
- 0x3c8469846e735ab3, 0x3feede6b5579fdbf,
148
- 0xbc82dfcd978e9db4, 0x3feee36bbfd3f37a,
149
- 0x3c8c1a7792cb3387, 0x3feee89f995ad3ad,
150
- 0xbc907b8f4ad1d9fa, 0x3feeee07298db666,
151
- 0xbc55c3d956dcaeba, 0x3feef3a2b84f15fb,
152
- 0xbc90a40e3da6f640, 0x3feef9728de5593a,
153
- 0xbc68d6f438ad9334, 0x3feeff76f2fb5e47,
154
- 0xbc91eee26b588a35, 0x3fef05b030a1064a,
155
- 0x3c74ffd70a5fddcd, 0x3fef0c1e904bc1d2,
156
- 0xbc91bdfbfa9298ac, 0x3fef12c25bd71e09,
157
- 0x3c736eae30af0cb3, 0x3fef199bdd85529c,
158
- 0x3c8ee3325c9ffd94, 0x3fef20ab5fffd07a,
159
- 0x3c84e08fd10959ac, 0x3fef27f12e57d14b,
160
- 0x3c63cdaf384e1a67, 0x3fef2f6d9406e7b5,
161
- 0x3c676b2c6c921968, 0x3fef3720dcef9069,
162
- 0xbc808a1883ccb5d2, 0x3fef3f0b555dc3fa,
163
- 0xbc8fad5d3ffffa6f, 0x3fef472d4a07897c,
164
- 0xbc900dae3875a949, 0x3fef4f87080d89f2,
165
- 0x3c74a385a63d07a7, 0x3fef5818dcfba487,
166
- 0xbc82919e2040220f, 0x3fef60e316c98398,
167
- 0x3c8e5a50d5c192ac, 0x3fef69e603db3285,
168
- 0x3c843a59ac016b4b, 0x3fef7321f301b460,
169
- 0xbc82d52107b43e1f, 0x3fef7c97337b9b5f,
170
- 0xbc892ab93b470dc9, 0x3fef864614f5a129,
171
- 0x3c74b604603a88d3, 0x3fef902ee78b3ff6,
172
- 0x3c83c5ec519d7271, 0x3fef9a51fbc74c83,
173
- 0xbc8ff7128fd391f0, 0x3fefa4afa2a490da,
174
- 0xbc8dae98e223747d, 0x3fefaf482d8e67f1,
175
- 0x3c8ec3bc41aa2008, 0x3fefba1bee615a27,
176
- 0x3c842b94c3a9eb32, 0x3fefc52b376bba97,
177
- 0x3c8a64a931d185ee, 0x3fefd0765b6e4540,
178
- 0xbc8e37bae43be3ed, 0x3fefdbfdad9cbe14,
179
- 0x3c77893b4d91cd9d, 0x3fefe7c1819e90d8,
180
- 0x3c5305c14160cc89, 0x3feff3c22b8f71f1,
181
- },
182
- };
@@ -1,26 +0,0 @@
1
- /*
2
- * Copyright (c) 2018, Arm Limited.
3
- * SPDX-License-Identifier: MIT
4
- */
5
- #ifndef _EXP_DATA_H
6
- #define _EXP_DATA_H
7
-
8
- #include <features.h>
9
- #include <stdint.h>
10
-
11
- #define EXP_TABLE_BITS 7
12
- #define EXP_POLY_ORDER 5
13
- #define EXP_USE_TOINT_NARROW 0
14
- #define EXP2_POLY_ORDER 5
15
- extern hidden const struct exp_data {
16
- double invln2N;
17
- double shift;
18
- double negln2hiN;
19
- double negln2loN;
20
- double poly[4]; /* Last four coefficients. */
21
- double exp2_shift;
22
- double exp2_poly[EXP2_POLY_ORDER];
23
- uint64_t tab[2*(1 << EXP_TABLE_BITS)];
24
- } __exp_data;
25
-
26
- #endif
@@ -1,7 +0,0 @@
1
- #define _GNU_SOURCE
2
- #include <math.h>
3
-
4
- int finite(double x)
5
- {
6
- return isfinite(x);
7
- }
@@ -1,7 +0,0 @@
1
- #define _GNU_SOURCE
2
- #include <math.h>
3
-
4
- int finitef(float x)
5
- {
6
- return isfinite(x);
7
- }
@@ -1,23 +0,0 @@
1
- #include <math.h>
2
- #include <stdint.h>
3
-
4
- double frexp(double x, int *e)
5
- {
6
- union { double d; uint64_t i; } y = { x };
7
- int ee = y.i>>52 & 0x7ff;
8
-
9
- if (!ee) {
10
- if (x) {
11
- x = frexp(x*0x1p64, e);
12
- *e -= 64;
13
- } else *e = 0;
14
- return x;
15
- } else if (ee == 0x7ff) {
16
- return x;
17
- }
18
-
19
- *e = ee - 0x3fe;
20
- y.i &= 0x800fffffffffffffull;
21
- y.i |= 0x3fe0000000000000ull;
22
- return y.d;
23
- }
@@ -1,23 +0,0 @@
1
- #include <math.h>
2
- #include <stdint.h>
3
-
4
- float frexpf(float x, int *e)
5
- {
6
- union { float f; uint32_t i; } y = { x };
7
- int ee = y.i>>23 & 0xff;
8
-
9
- if (!ee) {
10
- if (x) {
11
- x = frexpf(x*0x1p64, e);
12
- *e -= 64;
13
- } else *e = 0;
14
- return x;
15
- } else if (ee == 0xff) {
16
- return x;
17
- }
18
-
19
- *e = ee - 0x7e;
20
- y.i &= 0x807ffffful;
21
- y.i |= 0x3f000000ul;
22
- return y.f;
23
- }
@@ -1,29 +0,0 @@
1
- #include "libm.h"
2
-
3
- #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
4
- long double frexpl(long double x, int *e)
5
- {
6
- return frexp(x, e);
7
- }
8
- #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
9
- long double frexpl(long double x, int *e)
10
- {
11
- union ldshape u = {x};
12
- int ee = u.i.se & 0x7fff;
13
-
14
- if (!ee) {
15
- if (x) {
16
- x = frexpl(x*0x1p120, e);
17
- *e -= 120;
18
- } else *e = 0;
19
- return x;
20
- } else if (ee == 0x7fff) {
21
- return x;
22
- }
23
-
24
- *e = ee - 0x3ffe;
25
- u.i.se &= 0x8000;
26
- u.i.se |= 0x3ffe;
27
- return u.f;
28
- }
29
- #endif
@@ -1,8 +0,0 @@
1
- #include <math.h>
2
-
3
- long lrint(double x)
4
- {
5
- long r;
6
- __asm__ ("fistpl %0" : "=m"(r) : "t"(x) : "st");
7
- return r;
8
- }
@@ -1,8 +0,0 @@
1
- #include <math.h>
2
-
3
- long lrintf(float x)
4
- {
5
- long r;
6
- __asm__ ("fistpl %0" : "=m"(r) : "t"(x) : "st");
7
- return r;
8
- }
@@ -1,7 +0,0 @@
1
- #include <math.h>
2
-
3
- float rintf(float x)
4
- {
5
- __asm__ ("frndint" : "+t"(x));
6
- return x;
7
- }
@@ -1,72 +0,0 @@
1
- #include <limits.h>
2
- #include <fenv.h>
3
- #include <math.h>
4
- #include "libm.h"
5
-
6
- /*
7
- If the result cannot be represented (overflow, nan), then
8
- lrint raises the invalid exception.
9
-
10
- Otherwise if the input was not an integer then the inexact
11
- exception is raised.
12
-
13
- C99 is a bit vague about whether inexact exception is
14
- allowed to be raised when invalid is raised.
15
- (F.9 explicitly allows spurious inexact exceptions, F.9.6.5
16
- does not make it clear if that rule applies to lrint, but
17
- IEEE 754r 7.8 seems to forbid spurious inexact exception in
18
- the ineger conversion functions)
19
-
20
- So we try to make sure that no spurious inexact exception is
21
- raised in case of an overflow.
22
-
23
- If the bit size of long > precision of double, then there
24
- cannot be inexact rounding in case the result overflows,
25
- otherwise LONG_MAX and LONG_MIN can be represented exactly
26
- as a double.
27
- */
28
-
29
- #if LONG_MAX < 1U<<53 && defined(FE_INEXACT)
30
- #include <float.h>
31
- #include <stdint.h>
32
- #if FLT_EVAL_METHOD==0 || FLT_EVAL_METHOD==1
33
- #define EPS DBL_EPSILON
34
- #elif FLT_EVAL_METHOD==2
35
- #define EPS LDBL_EPSILON
36
- #endif
37
- #ifdef __GNUC__
38
- /* avoid stack frame in lrint */
39
- __attribute__((noinline))
40
- #endif
41
- static long lrint_slow(double x)
42
- {
43
- #pragma STDC FENV_ACCESS ON
44
- int e;
45
-
46
- e = fetestexcept(FE_INEXACT);
47
- x = rint(x);
48
- if (!e && (x > LONG_MAX || x < LONG_MIN))
49
- feclearexcept(FE_INEXACT);
50
- /* conversion */
51
- return x;
52
- }
53
-
54
- long lrint(double x)
55
- {
56
- uint32_t abstop = asuint64(x)>>32 & 0x7fffffff;
57
- uint64_t sign = asuint64(x) & (1ULL << 63);
58
-
59
- if (abstop < 0x41dfffff) {
60
- /* |x| < 0x7ffffc00, no overflow */
61
- double_t toint = asdouble(asuint64(1/EPS) | sign);
62
- double_t y = x + toint - toint;
63
- return (long)y;
64
- }
65
- return lrint_slow(x);
66
- }
67
- #else
68
- long lrint(double x)
69
- {
70
- return rint(x);
71
- }
72
- #endif
@@ -1,8 +0,0 @@
1
- #include <math.h>
2
-
3
- /* uses LONG_MAX > 2^24, see comments in lrint.c */
4
-
5
- long lrintf(float x)
6
- {
7
- return rintf(x);
8
- }