@zigc/lib 0.16.0-dev.3070 → 0.16.0-dev.3121

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 (77) hide show
  1. package/c/math.zig +125 -22
  2. package/c/stropts.zig +17 -0
  3. package/c.zig +1 -0
  4. package/compiler_rt/cos.zig +141 -52
  5. package/compiler_rt/limb64.zig +266 -0
  6. package/compiler_rt/long_double.zig +37 -0
  7. package/compiler_rt/rem_pio2l.zig +173 -0
  8. package/compiler_rt/sin.zig +140 -55
  9. package/compiler_rt/sincos.zig +279 -72
  10. package/compiler_rt/tan.zig +118 -47
  11. package/compiler_rt/trig.zig +256 -6
  12. package/compiler_rt.zig +2 -0
  13. package/package.json +1 -1
  14. package/std/Build/Module.zig +1 -1
  15. package/std/Build/abi.zig +8 -4
  16. package/std/Io/Dispatch.zig +2 -0
  17. package/std/Io/File.zig +1 -0
  18. package/std/Io/Threaded.zig +2 -0
  19. package/std/Io/Uring.zig +1 -0
  20. package/std/array_list.zig +22 -31
  21. package/std/debug/Info.zig +4 -0
  22. package/std/debug/SelfInfo/Windows.zig +1 -0
  23. package/std/heap/ArenaAllocator.zig +145 -154
  24. package/std/mem/Allocator.zig +4 -5
  25. package/std/mem.zig +48 -0
  26. package/std/testing/Smith.zig +37 -2
  27. package/std/zig/Ast/Render.zig +186 -458
  28. package/std/zig/Ast.zig +0 -4
  29. package/std/zig/AstSmith.zig +2602 -0
  30. package/std/zig/Parse.zig +83 -74
  31. package/std/zig/system.zig +2 -0
  32. package/std/zig/tokenizer.zig +2 -1
  33. package/std/zig.zig +2 -0
  34. package/libc/mingw/math/arm/sincos.S +0 -30
  35. package/libc/mingw/math/arm-common/sincosl.c +0 -13
  36. package/libc/mingw/math/arm64/rint.c +0 -12
  37. package/libc/mingw/math/arm64/rintf.c +0 -12
  38. package/libc/mingw/math/arm64/sincos.S +0 -32
  39. package/libc/mingw/math/frexpf.c +0 -13
  40. package/libc/mingw/math/frexpl.c +0 -71
  41. package/libc/mingw/math/x86/cos.def.h +0 -65
  42. package/libc/mingw/math/x86/cosl.c +0 -46
  43. package/libc/mingw/math/x86/cosl_internal.S +0 -55
  44. package/libc/mingw/math/x86/sin.def.h +0 -65
  45. package/libc/mingw/math/x86/sinl.c +0 -46
  46. package/libc/mingw/math/x86/sinl_internal.S +0 -58
  47. package/libc/mingw/math/x86/tanl.S +0 -62
  48. package/libc/musl/src/legacy/isastream.c +0 -7
  49. package/libc/musl/src/math/__cosl.c +0 -96
  50. package/libc/musl/src/math/__sinl.c +0 -78
  51. package/libc/musl/src/math/__tanl.c +0 -143
  52. package/libc/musl/src/math/aarch64/lrint.c +0 -10
  53. package/libc/musl/src/math/aarch64/lrintf.c +0 -10
  54. package/libc/musl/src/math/aarch64/rintf.c +0 -7
  55. package/libc/musl/src/math/cosl.c +0 -39
  56. package/libc/musl/src/math/fdim.c +0 -10
  57. package/libc/musl/src/math/finite.c +0 -7
  58. package/libc/musl/src/math/finitef.c +0 -7
  59. package/libc/musl/src/math/frexp.c +0 -23
  60. package/libc/musl/src/math/frexpf.c +0 -23
  61. package/libc/musl/src/math/frexpl.c +0 -29
  62. package/libc/musl/src/math/i386/lrint.c +0 -8
  63. package/libc/musl/src/math/i386/lrintf.c +0 -8
  64. package/libc/musl/src/math/i386/rintf.c +0 -7
  65. package/libc/musl/src/math/lrint.c +0 -72
  66. package/libc/musl/src/math/lrintf.c +0 -8
  67. package/libc/musl/src/math/powerpc64/lrint.c +0 -16
  68. package/libc/musl/src/math/powerpc64/lrintf.c +0 -16
  69. package/libc/musl/src/math/rintf.c +0 -30
  70. package/libc/musl/src/math/s390x/rintf.c +0 -15
  71. package/libc/musl/src/math/sincosl.c +0 -60
  72. package/libc/musl/src/math/sinl.c +0 -41
  73. package/libc/musl/src/math/tanl.c +0 -29
  74. package/libc/musl/src/math/x32/lrint.s +0 -5
  75. package/libc/musl/src/math/x32/lrintf.s +0 -5
  76. package/libc/musl/src/math/x86_64/lrint.c +0 -8
  77. package/libc/musl/src/math/x86_64/lrintf.c +0 -8
@@ -1,65 +0,0 @@
1
- /*
2
- This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
-
4
- Copyright (c) 2009, 2010 by the mingw-w64 project
5
-
6
- See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
-
8
- This license has been certified as open source. It has also been designated
9
- as GPL compatible by the Free Software Foundation (FSF).
10
-
11
- Redistribution and use in source and binary forms, with or without
12
- modification, are permitted provided that the following conditions are met:
13
-
14
- 1. Redistributions in source code must retain the accompanying copyright
15
- notice, this list of conditions, and the following disclaimer.
16
- 2. Redistributions in binary form must reproduce the accompanying
17
- copyright notice, this list of conditions, and the following disclaimer
18
- in the documentation and/or other materials provided with the
19
- distribution.
20
- 3. Names of the copyright holders must not be used to endorse or promote
21
- products derived from this software without prior written permission
22
- from the copyright holders.
23
- 4. The right to distribute this software or to use it for any purpose does
24
- not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25
- the copyright holders. Use of them is covered by separate agreement
26
- with the copyright holders.
27
- 5. If any files are modified, you must cause the modified files to carry
28
- prominent notices stating that you changed the files and the date of
29
- any change.
30
-
31
- Disclaimer
32
-
33
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34
- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36
- EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39
- OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
- */
44
-
45
- #include "../complex/complex_internal.h"
46
- #include <errno.h>
47
-
48
- extern long double __cosl_internal (long double);
49
-
50
- __FLT_TYPE
51
- __FLT_ABI(cos) (__FLT_TYPE x)
52
- {
53
- int x_class = fpclassify (x);
54
- if (x_class == FP_NAN)
55
- {
56
- __FLT_RPT_DOMAIN ("cos", x, 0.0, x);
57
- return x;
58
- }
59
- else if (x_class == FP_INFINITE)
60
- {
61
- __FLT_RPT_DOMAIN ("cos", x, 0.0, __FLT_NAN);
62
- return __FLT_NAN;
63
- }
64
- return (__FLT_TYPE) __cosl_internal ((long double) x);
65
- }
@@ -1,46 +0,0 @@
1
- /*
2
- This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
-
4
- Copyright (c) 2009, 2010 by the mingw-w64 project
5
-
6
- See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
-
8
- This license has been certified as open source. It has also been designated
9
- as GPL compatible by the Free Software Foundation (FSF).
10
-
11
- Redistribution and use in source and binary forms, with or without
12
- modification, are permitted provided that the following conditions are met:
13
-
14
- 1. Redistributions in source code must retain the accompanying copyright
15
- notice, this list of conditions, and the following disclaimer.
16
- 2. Redistributions in binary form must reproduce the accompanying
17
- copyright notice, this list of conditions, and the following disclaimer
18
- in the documentation and/or other materials provided with the
19
- distribution.
20
- 3. Names of the copyright holders must not be used to endorse or promote
21
- products derived from this software without prior written permission
22
- from the copyright holders.
23
- 4. The right to distribute this software or to use it for any purpose does
24
- not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25
- the copyright holders. Use of them is covered by separate agreement
26
- with the copyright holders.
27
- 5. If any files are modified, you must cause the modified files to carry
28
- prominent notices stating that you changed the files and the date of
29
- any change.
30
-
31
- Disclaimer
32
-
33
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34
- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36
- EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39
- OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
- */
44
-
45
- #define _NEW_COMPLEX_LDOUBLE 1
46
- #include "cos.def.h"
@@ -1,55 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
- #include <_mingw_mac.h>
7
-
8
- .file "cosl_internal.S"
9
- .text
10
- #ifdef __x86_64__
11
- .align 8
12
- #else
13
- .align 4
14
- #endif
15
- .globl __MINGW_USYMBOL(__cosl_internal)
16
- .def __MINGW_USYMBOL(__cosl_internal); .scl 2; .type 32; .endef
17
- __MINGW_USYMBOL(__cosl_internal):
18
- #ifdef __x86_64__
19
- fldt (%rdx)
20
- fcos
21
- fnstsw %ax
22
- testl $0x400,%eax
23
- jz 1f
24
- fldpi
25
- fadd %st(0)
26
- fxch %st(1)
27
- 2: fprem1
28
- fnstsw %ax
29
- testl $0x400,%eax
30
- jnz 2b
31
- fstp %st(1)
32
- fcos
33
- 1: movq %rcx,%rax
34
- movq $0,8(%rcx)
35
- fstpt (%rcx)
36
- ret
37
- #else
38
- fldt 4(%esp)
39
- fcos
40
- fnstsw %ax
41
- testl $0x400,%eax
42
- jnz 1f
43
- ret
44
- 1: fldpi
45
- fadd %st(0)
46
- fxch %st(1)
47
- 2: fprem1
48
- fnstsw %ax
49
- testl $0x400,%eax
50
- jnz 2b
51
- fstp %st(1)
52
- fcos
53
- ret
54
- #endif
55
-
@@ -1,65 +0,0 @@
1
- /*
2
- This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
-
4
- Copyright (c) 2009, 2010 by the mingw-w64 project
5
-
6
- See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
-
8
- This license has been certified as open source. It has also been designated
9
- as GPL compatible by the Free Software Foundation (FSF).
10
-
11
- Redistribution and use in source and binary forms, with or without
12
- modification, are permitted provided that the following conditions are met:
13
-
14
- 1. Redistributions in source code must retain the accompanying copyright
15
- notice, this list of conditions, and the following disclaimer.
16
- 2. Redistributions in binary form must reproduce the accompanying
17
- copyright notice, this list of conditions, and the following disclaimer
18
- in the documentation and/or other materials provided with the
19
- distribution.
20
- 3. Names of the copyright holders must not be used to endorse or promote
21
- products derived from this software without prior written permission
22
- from the copyright holders.
23
- 4. The right to distribute this software or to use it for any purpose does
24
- not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25
- the copyright holders. Use of them is covered by separate agreement
26
- with the copyright holders.
27
- 5. If any files are modified, you must cause the modified files to carry
28
- prominent notices stating that you changed the files and the date of
29
- any change.
30
-
31
- Disclaimer
32
-
33
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34
- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36
- EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39
- OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
- */
44
-
45
- #include "../complex/complex_internal.h"
46
- #include <errno.h>
47
-
48
- extern long double __sinl_internal (long double);
49
-
50
- __FLT_TYPE
51
- __FLT_ABI(sin) (__FLT_TYPE x)
52
- {
53
- int x_class = fpclassify (x);
54
- if (x_class == FP_NAN)
55
- {
56
- __FLT_RPT_DOMAIN ("sin", x, 0.0, x);
57
- return x;
58
- }
59
- else if (x_class == FP_INFINITE)
60
- {
61
- __FLT_RPT_DOMAIN ("sin", x, 0.0, __FLT_NAN);
62
- return __FLT_NAN;
63
- }
64
- return (__FLT_TYPE) __sinl_internal ((long double) x);
65
- }
@@ -1,46 +0,0 @@
1
- /*
2
- This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
-
4
- Copyright (c) 2009, 2010 by the mingw-w64 project
5
-
6
- See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
-
8
- This license has been certified as open source. It has also been designated
9
- as GPL compatible by the Free Software Foundation (FSF).
10
-
11
- Redistribution and use in source and binary forms, with or without
12
- modification, are permitted provided that the following conditions are met:
13
-
14
- 1. Redistributions in source code must retain the accompanying copyright
15
- notice, this list of conditions, and the following disclaimer.
16
- 2. Redistributions in binary form must reproduce the accompanying
17
- copyright notice, this list of conditions, and the following disclaimer
18
- in the documentation and/or other materials provided with the
19
- distribution.
20
- 3. Names of the copyright holders must not be used to endorse or promote
21
- products derived from this software without prior written permission
22
- from the copyright holders.
23
- 4. The right to distribute this software or to use it for any purpose does
24
- not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25
- the copyright holders. Use of them is covered by separate agreement
26
- with the copyright holders.
27
- 5. If any files are modified, you must cause the modified files to carry
28
- prominent notices stating that you changed the files and the date of
29
- any change.
30
-
31
- Disclaimer
32
-
33
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34
- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36
- EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39
- OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
- */
44
-
45
- #define _NEW_COMPLEX_LDOUBLE 1
46
- #include "sin.def.h"
@@ -1,58 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
- #include <_mingw_mac.h>
7
-
8
- .file "sinl_internal.S"
9
- .text
10
- #ifdef __x86_64__
11
- .align 8
12
- #else
13
- .align 4
14
- #endif
15
- .globl __MINGW_USYMBOL(__sinl_internal)
16
- .def __MINGW_USYMBOL(__sinl_internal); .scl 2; .type 32; .endef
17
- __MINGW_USYMBOL(__sinl_internal):
18
- #ifdef __x86_64__
19
- fldt (%rdx)
20
- fsin
21
- fnstsw %ax
22
- testl $0x400,%eax
23
- jnz 1f
24
- movq %rcx,%rax
25
- movq $0,8(%rcx)
26
- fstpt (%rcx)
27
- ret
28
- 1: fldpi
29
- fadd %st(0)
30
- fxch %st(1)
31
- 2: fprem1
32
- fnstsw %ax
33
- testl $0x400,%eax
34
- jnz 2b
35
- fstp %st(1)
36
- fsin
37
- movq %rcx,%rax
38
- movq $0,8(%rcx)
39
- fstpt (%rcx)
40
- ret
41
- #else
42
- fldt 4(%esp)
43
- fsin
44
- fnstsw %ax
45
- testl $0x400,%eax
46
- jnz 1f
47
- ret
48
- 1: fldpi
49
- fadd %st(0)
50
- fxch %st(1)
51
- 2: fprem1
52
- fnstsw %ax
53
- testl $0x400,%eax
54
- jnz 2b
55
- fstp %st(1)
56
- fsin
57
- ret
58
- #endif
@@ -1,62 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
- #include <_mingw_mac.h>
7
-
8
- .file "tanl.S"
9
- .text
10
- #ifdef __x86_64__
11
- .align 8
12
- #else
13
- .align 4
14
- #endif
15
- .globl __MINGW_USYMBOL(tanl)
16
- .def __MINGW_USYMBOL(tanl); .scl 2; .type 32; .endef
17
- __MINGW_USYMBOL(tanl):
18
- #ifdef __x86_64__
19
- fldt (%rdx)
20
- fptan
21
- fnstsw %ax
22
- testl $0x400,%eax
23
- jnz 1f
24
- fstp %st(0)
25
- movq %rcx,%rax
26
- movq $0,8(%rcx)
27
- fstpt (%rcx)
28
- ret
29
- 1: fldpi
30
- fadd %st(0)
31
- fxch %st(1)
32
- 2: fprem1
33
- fstsw %ax
34
- testl $0x400,%eax
35
- jnz 2b
36
- fstp %st(1)
37
- fptan
38
- fstp %st(0)
39
- movq %rcx,%rax
40
- movq $0,8(%rcx)
41
- fstpt (%rcx)
42
- ret
43
- #else
44
- fldt 4(%esp)
45
- fptan
46
- fnstsw %ax
47
- testl $0x400,%eax
48
- jnz 1f
49
- fstp %st(0)
50
- ret
51
- 1: fldpi
52
- fadd %st(0)
53
- fxch %st(1)
54
- 2: fprem1
55
- fstsw %ax
56
- testl $0x400,%eax
57
- jnz 2b
58
- fstp %st(1)
59
- fptan
60
- fstp %st(0)
61
- ret
62
- #endif
@@ -1,7 +0,0 @@
1
- #include <stropts.h>
2
- #include <fcntl.h>
3
-
4
- int isastream(int fd)
5
- {
6
- return fcntl(fd, F_GETFD) < 0 ? -1 : 0;
7
- }
@@ -1,96 +0,0 @@
1
- /* origin: FreeBSD /usr/src/lib/msun/ld80/k_cosl.c */
2
- /* origin: FreeBSD /usr/src/lib/msun/ld128/k_cosl.c */
3
- /*
4
- * ====================================================
5
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6
- * Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans.
7
- *
8
- * Developed at SunSoft, a Sun Microsystems, Inc. business.
9
- * Permission to use, copy, modify, and distribute this
10
- * software is freely granted, provided that this notice
11
- * is preserved.
12
- * ====================================================
13
- */
14
-
15
-
16
- #include "libm.h"
17
-
18
- #if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
19
- #if LDBL_MANT_DIG == 64
20
- /*
21
- * ld80 version of __cos.c. See __cos.c for most comments.
22
- */
23
- /*
24
- * Domain [-0.7854, 0.7854], range ~[-2.43e-23, 2.425e-23]:
25
- * |cos(x) - c(x)| < 2**-75.1
26
- *
27
- * The coefficients of c(x) were generated by a pari-gp script using
28
- * a Remez algorithm that searches for the best higher coefficients
29
- * after rounding leading coefficients to a specified precision.
30
- *
31
- * Simpler methods like Chebyshev or basic Remez barely suffice for
32
- * cos() in 64-bit precision, because we want the coefficient of x^2
33
- * to be precisely -0.5 so that multiplying by it is exact, and plain
34
- * rounding of the coefficients of a good polynomial approximation only
35
- * gives this up to about 64-bit precision. Plain rounding also gives
36
- * a mediocre approximation for the coefficient of x^4, but a rounding
37
- * error of 0.5 ulps for this coefficient would only contribute ~0.01
38
- * ulps to the final error, so this is unimportant. Rounding errors in
39
- * higher coefficients are even less important.
40
- *
41
- * In fact, coefficients above the x^4 one only need to have 53-bit
42
- * precision, and this is more efficient. We get this optimization
43
- * almost for free from the complications needed to search for the best
44
- * higher coefficients.
45
- */
46
- static const long double
47
- C1 = 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 */
48
- static const double
49
- C2 = -0.0013888888888888874, /* -0x16c16c16c16c10.0p-62 */
50
- C3 = 0.000024801587301571716, /* 0x1a01a01a018e22.0p-68 */
51
- C4 = -0.00000027557319215507120, /* -0x127e4fb7602f22.0p-74 */
52
- C5 = 0.0000000020876754400407278, /* 0x11eed8caaeccf1.0p-81 */
53
- C6 = -1.1470297442401303e-11, /* -0x19393412bd1529.0p-89 */
54
- C7 = 4.7383039476436467e-14; /* 0x1aac9d9af5c43e.0p-97 */
55
- #define POLY(z) (z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*(C6+z*C7)))))))
56
- #elif LDBL_MANT_DIG == 113
57
- /*
58
- * ld128 version of __cos.c. See __cos.c for most comments.
59
- */
60
- /*
61
- * Domain [-0.7854, 0.7854], range ~[-1.80e-37, 1.79e-37]:
62
- * |cos(x) - c(x))| < 2**-122.0
63
- *
64
- * 113-bit precision requires more care than 64-bit precision, since
65
- * simple methods give a minimax polynomial with coefficient for x^2
66
- * that is 1 ulp below 0.5, but we want it to be precisely 0.5. See
67
- * above for more details.
68
- */
69
- static const long double
70
- C1 = 0.04166666666666666666666666666666658424671L,
71
- C2 = -0.001388888888888888888888888888863490893732L,
72
- C3 = 0.00002480158730158730158730158600795304914210L,
73
- C4 = -0.2755731922398589065255474947078934284324e-6L,
74
- C5 = 0.2087675698786809897659225313136400793948e-8L,
75
- C6 = -0.1147074559772972315817149986812031204775e-10L,
76
- C7 = 0.4779477332386808976875457937252120293400e-13L;
77
- static const double
78
- C8 = -0.1561920696721507929516718307820958119868e-15,
79
- C9 = 0.4110317413744594971475941557607804508039e-18,
80
- C10 = -0.8896592467191938803288521958313920156409e-21,
81
- C11 = 0.1601061435794535138244346256065192782581e-23;
82
- #define POLY(z) (z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*(C6+z*(C7+ \
83
- z*(C8+z*(C9+z*(C10+z*C11)))))))))))
84
- #endif
85
-
86
- long double __cosl(long double x, long double y)
87
- {
88
- long double hz,z,r,w;
89
-
90
- z = x*x;
91
- r = POLY(z);
92
- hz = 0.5*z;
93
- w = 1.0-hz;
94
- return w + (((1.0-w)-hz) + (z*r-x*y));
95
- }
96
- #endif
@@ -1,78 +0,0 @@
1
- /* origin: FreeBSD /usr/src/lib/msun/ld80/k_sinl.c */
2
- /* origin: FreeBSD /usr/src/lib/msun/ld128/k_sinl.c */
3
- /*
4
- * ====================================================
5
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6
- * Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans.
7
- *
8
- * Developed at SunSoft, a Sun Microsystems, Inc. business.
9
- * Permission to use, copy, modify, and distribute this
10
- * software is freely granted, provided that this notice
11
- * is preserved.
12
- * ====================================================
13
- */
14
-
15
- #include "libm.h"
16
-
17
- #if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
18
- #if LDBL_MANT_DIG == 64
19
- /*
20
- * ld80 version of __sin.c. See __sin.c for most comments.
21
- */
22
- /*
23
- * Domain [-0.7854, 0.7854], range ~[-1.89e-22, 1.915e-22]
24
- * |sin(x)/x - s(x)| < 2**-72.1
25
- *
26
- * See __cosl.c for more details about the polynomial.
27
- */
28
- static const long double
29
- S1 = -0.166666666666666666671L; /* -0xaaaaaaaaaaaaaaab.0p-66 */
30
- static const double
31
- S2 = 0.0083333333333333332, /* 0x11111111111111.0p-59 */
32
- S3 = -0.00019841269841269427, /* -0x1a01a01a019f81.0p-65 */
33
- S4 = 0.0000027557319223597490, /* 0x171de3a55560f7.0p-71 */
34
- S5 = -0.000000025052108218074604, /* -0x1ae64564f16cad.0p-78 */
35
- S6 = 1.6059006598854211e-10, /* 0x161242b90243b5.0p-85 */
36
- S7 = -7.6429779983024564e-13, /* -0x1ae42ebd1b2e00.0p-93 */
37
- S8 = 2.6174587166648325e-15; /* 0x179372ea0b3f64.0p-101 */
38
- #define POLY(z) (S2+z*(S3+z*(S4+z*(S5+z*(S6+z*(S7+z*S8))))))
39
- #elif LDBL_MANT_DIG == 113
40
- /*
41
- * ld128 version of __sin.c. See __sin.c for most comments.
42
- */
43
- /*
44
- * Domain [-0.7854, 0.7854], range ~[-1.53e-37, 1.659e-37]
45
- * |sin(x)/x - s(x)| < 2**-122.1
46
- *
47
- * See __cosl.c for more details about the polynomial.
48
- */
49
- static const long double
50
- S1 = -0.16666666666666666666666666666666666606732416116558L,
51
- S2 = 0.0083333333333333333333333333333331135404851288270047L,
52
- S3 = -0.00019841269841269841269841269839935785325638310428717L,
53
- S4 = 0.27557319223985890652557316053039946268333231205686e-5L,
54
- S5 = -0.25052108385441718775048214826384312253862930064745e-7L,
55
- S6 = 0.16059043836821614596571832194524392581082444805729e-9L,
56
- S7 = -0.76471637318198151807063387954939213287488216303768e-12L,
57
- S8 = 0.28114572543451292625024967174638477283187397621303e-14L;
58
- static const double
59
- S9 = -0.82206352458348947812512122163446202498005154296863e-17,
60
- S10 = 0.19572940011906109418080609928334380560135358385256e-19,
61
- S11 = -0.38680813379701966970673724299207480965452616911420e-22,
62
- S12 = 0.64038150078671872796678569586315881020659912139412e-25;
63
- #define POLY(z) (S2+z*(S3+z*(S4+z*(S5+z*(S6+z*(S7+z*(S8+ \
64
- z*(S9+z*(S10+z*(S11+z*S12))))))))))
65
- #endif
66
-
67
- long double __sinl(long double x, long double y, int iy)
68
- {
69
- long double z,r,v;
70
-
71
- z = x*x;
72
- v = z*x;
73
- r = POLY(z);
74
- if (iy == 0)
75
- return x+v*(S1+z*r);
76
- return x-((z*(0.5*y-v*r)-y)-v*S1);
77
- }
78
- #endif