@ohos-ports/math-base-special-kernel-tan 0.0.0-stage → 0.2.4-beta.0
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.
- package/LICENSE +192 -0
- package/NOTICE +1 -0
- package/README.md +342 -2
- package/SECURITY.md +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +7 -0
- package/docs/img/equation_double_double_inequality.svg +37 -0
- package/docs/types/index.d.ts +68 -0
- package/include/stdlib/math/base/special/kernel_tan.h +40 -0
- package/lib/index.js +49 -0
- package/lib/main.js +183 -0
- package/lib/native.js +72 -0
- package/lib/polyval_t_even.js +47 -0
- package/lib/polyval_t_odd.js +47 -0
- package/manifest.json +84 -0
- package/package.json +80 -4
- package/src/addon.c +43 -0
- package/src/main.c +198 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
DEPENDENCIES & ATTRIBUTION
|
|
180
|
+
|
|
181
|
+
The library links against the following external libraries or contains
|
|
182
|
+
implementations from the following external libraries, which have their own
|
|
183
|
+
licenses:
|
|
184
|
+
|
|
185
|
+
* FreeBSD <https://svnweb.freebsd.org/>
|
|
186
|
+
|
|
187
|
+
Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved.
|
|
188
|
+
|
|
189
|
+
Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
190
|
+
Permission to use, copy, modify, and distribute this
|
|
191
|
+
software is freely granted, provided that this notice
|
|
192
|
+
is preserved.
|
package/NOTICE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -1,3 +1,343 @@
|
|
|
1
|
-
|
|
1
|
+
<!--
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
@license Apache-2.0
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2022 The Stdlib Authors.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<details>
|
|
23
|
+
<summary>
|
|
24
|
+
About stdlib...
|
|
25
|
+
</summary>
|
|
26
|
+
<p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
|
|
27
|
+
<p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
|
|
28
|
+
<p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
|
|
29
|
+
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
|
|
30
|
+
</details>
|
|
31
|
+
|
|
32
|
+
# kernelTan
|
|
33
|
+
|
|
34
|
+
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
35
|
+
|
|
36
|
+
> Compute the [tangent][tangent] of a double-precision floating-point number on `[-π/4, π/4]`.
|
|
37
|
+
|
|
38
|
+
<section class="installation">
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install @stdlib/math-base-special-kernel-tan
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
</section>
|
|
47
|
+
|
|
48
|
+
<section class="usage">
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
var kernelTan = require( '@stdlib/math-base-special-kernel-tan' );
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### kernelTan( x, y, k )
|
|
57
|
+
|
|
58
|
+
Computes the [tangent][tangent] of a double-precision floating-point number on `[-π/4, π/4]`.
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
var out = kernelTan( 3.141592653589793/4.0, 0.0, 1 );
|
|
62
|
+
// returns ~1.0
|
|
63
|
+
|
|
64
|
+
out = kernelTan( 3.141592653589793/6.0, 0.0, 1 );
|
|
65
|
+
// returns ~0.577
|
|
66
|
+
|
|
67
|
+
out = kernelTan( 0.664, 5.288e-17, 1 );
|
|
68
|
+
// returns ~0.783
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
If `k = 1`, the function returns `tan(x+y)`. To return the negative inverse `-1/tan(x+y)`, set `k = -1`.
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
var out = kernelTan( 3.141592653589793/4.0, 0.0, -1 );
|
|
75
|
+
// returns ~-1.0
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
If either `x` or `y` is `NaN`, the function returns `NaN`.
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
var out = kernelTan( NaN, 0.0, 1 );
|
|
82
|
+
// returns NaN
|
|
83
|
+
|
|
84
|
+
out = kernelTan( 3.0, NaN, 1 );
|
|
85
|
+
// returns NaN
|
|
86
|
+
|
|
87
|
+
out = kernelTan( NaN, NaN, 1 );
|
|
88
|
+
// returns NaN
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
</section>
|
|
92
|
+
|
|
93
|
+
<!-- /.usage -->
|
|
94
|
+
|
|
95
|
+
<section class="notes">
|
|
96
|
+
|
|
97
|
+
## Notes
|
|
98
|
+
|
|
99
|
+
- For increased accuracy, the number for which the [tangent][tangent] should be evaluated can be supplied as a [double-double number][double-double-arithmetic] (i.e., a non-evaluated sum of two [double-precision floating-point numbers][ieee754] `x` and `y`).
|
|
100
|
+
|
|
101
|
+
- As components of a [double-double number][double-double-arithmetic], the two [double-precision floating-point numbers][ieee754] `x` and `y` must satisfy
|
|
102
|
+
|
|
103
|
+
<!-- <equation class="equation" label="eq:double_double_inequality" align="center" raw="|y| \leq \frac{1}{2} \operatorname{ulp}(x)" alt="Inequality for the two components of a double-double number."> -->
|
|
104
|
+
|
|
105
|
+
<div class="equation" align="center" data-raw-text="|y| \leq \frac{1}{2} \operatorname{ulp}(x)" data-equation="eq:double_double_inequality">
|
|
106
|
+
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/kernel-tan/docs/img/equation_double_double_inequality.svg" alt="Inequality for the two components of a double-double number.">
|
|
107
|
+
<br>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<!-- </equation> -->
|
|
111
|
+
|
|
112
|
+
where `ulp` stands for [units in the last place][ulp].
|
|
113
|
+
|
|
114
|
+
</section>
|
|
115
|
+
|
|
116
|
+
<!-- /.notes -->
|
|
117
|
+
|
|
118
|
+
<section class="examples">
|
|
119
|
+
|
|
120
|
+
## Examples
|
|
121
|
+
|
|
122
|
+
<!-- eslint no-undef: "error" -->
|
|
123
|
+
|
|
124
|
+
```javascript
|
|
125
|
+
var linspace = require( '@stdlib/array-base-linspace' );
|
|
126
|
+
var binomial = require( '@stdlib/random-base-binomial' ).factory;
|
|
127
|
+
var PI = require( '@stdlib/constants-float64-pi' );
|
|
128
|
+
var kernelTan = require( '@stdlib/math-base-special-kernel-tan' );
|
|
129
|
+
|
|
130
|
+
var x = linspace( -PI/4.0, PI/4.0, 100 );
|
|
131
|
+
var rbinom = binomial( 1, 0.5 );
|
|
132
|
+
|
|
133
|
+
var descr;
|
|
134
|
+
var i;
|
|
135
|
+
var k;
|
|
136
|
+
|
|
137
|
+
for ( i = 0; i < x.length; i++ ) {
|
|
138
|
+
k = rbinom();
|
|
139
|
+
descr = ( k === 1 ) ? 'tan(%d) = %d' : '-1/tan(%d) = %d';
|
|
140
|
+
console.log( descr, x[ i ], kernelTan( x[ i ], 0.0, k ) );
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
</section>
|
|
145
|
+
|
|
146
|
+
<!-- /.examples -->
|
|
147
|
+
|
|
148
|
+
<!-- C interface documentation. -->
|
|
149
|
+
|
|
150
|
+
* * *
|
|
151
|
+
|
|
152
|
+
<section class="c">
|
|
153
|
+
|
|
154
|
+
## C APIs
|
|
155
|
+
|
|
156
|
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
|
|
157
|
+
|
|
158
|
+
<section class="intro">
|
|
159
|
+
|
|
160
|
+
</section>
|
|
161
|
+
|
|
162
|
+
<!-- /.intro -->
|
|
163
|
+
|
|
164
|
+
<!-- C usage documentation. -->
|
|
165
|
+
|
|
166
|
+
<section class="usage">
|
|
167
|
+
|
|
168
|
+
### Usage
|
|
169
|
+
|
|
170
|
+
```c
|
|
171
|
+
#include "stdlib/math/base/special/kernel_tan.h"
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
#### stdlib_base_kernel_tan( x, y, k )
|
|
175
|
+
|
|
176
|
+
Computes the [tangent][tangent] of a double-precision floating-point number on `[-π/4, π/4]`.
|
|
177
|
+
|
|
178
|
+
```c
|
|
179
|
+
double out = stdlib_base_kernel_tan( 3.141592653589793/4.0, 0.0, 1 );
|
|
180
|
+
// returns ~1.0
|
|
181
|
+
|
|
182
|
+
out = stdlib_base_kernel_tan( 3.141592653589793/6.0, 0.0, 1 );
|
|
183
|
+
// returns ~0.577
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The function accepts the following arguments:
|
|
187
|
+
|
|
188
|
+
- **x**: `[in] double` input value (in radians, assumed to be bounded by `~pi/4` in magnitude).
|
|
189
|
+
- **y**: `[in] double` tail of `x`.
|
|
190
|
+
- **k**: `[in] int32_t` indicates whether `tan(x+y)` (if `k = 1`) or `-1/tan(x+y)` (if `k = -1`) is returned.
|
|
191
|
+
|
|
192
|
+
```c
|
|
193
|
+
double stdlib_base_kernel_tan( const double x, const double y, const int32_t k );
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
</section>
|
|
197
|
+
|
|
198
|
+
<!-- /.usage -->
|
|
199
|
+
|
|
200
|
+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
201
|
+
|
|
202
|
+
<section class="notes">
|
|
203
|
+
|
|
204
|
+
### Notes
|
|
205
|
+
|
|
206
|
+
- For increased accuracy, the number for which the [tangent][tangent] should be evaluated can be supplied as a [double-double number][double-double-arithmetic] (i.e., a non-evaluated sum of two [double-precision floating-point numbers][ieee754] `x` and `y`).
|
|
207
|
+
|
|
208
|
+
</section>
|
|
209
|
+
|
|
210
|
+
<!-- /.notes -->
|
|
211
|
+
|
|
212
|
+
<!-- C API usage examples. -->
|
|
213
|
+
|
|
214
|
+
<section class="examples">
|
|
215
|
+
|
|
216
|
+
### Examples
|
|
217
|
+
|
|
218
|
+
```c
|
|
219
|
+
#include "stdlib/math/base/special/kernel_tan.h"
|
|
220
|
+
#include <stdio.h>
|
|
221
|
+
|
|
222
|
+
int main( void ) {
|
|
223
|
+
const double x[] = { -0.7853981633974483, -0.6108652381980153, -0.4363323129985824, -0.26179938779914946, -0.08726646259971649, 0.08726646259971649, 0.26179938779914935, 0.43633231299858233, 0.6108652381980153, 0.7853981633974483 };
|
|
224
|
+
|
|
225
|
+
double out;
|
|
226
|
+
int i;
|
|
227
|
+
for ( i = 0; i < 10; i++ ) {
|
|
228
|
+
out = stdlib_base_kernel_tan( x[ i ], 0.0, 1 );
|
|
229
|
+
printf( "tan(%lf) = %lf\n", x[ i ], out );
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
</section>
|
|
235
|
+
|
|
236
|
+
<!-- /.examples -->
|
|
237
|
+
|
|
238
|
+
</section>
|
|
239
|
+
|
|
240
|
+
<!-- /.c -->
|
|
241
|
+
|
|
242
|
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
243
|
+
|
|
244
|
+
<section class="related">
|
|
245
|
+
|
|
246
|
+
* * *
|
|
247
|
+
|
|
248
|
+
## See Also
|
|
249
|
+
|
|
250
|
+
- <span class="package-name">[`@stdlib/math-base/special/kernel-cos`][@stdlib/math/base/special/kernel-cos]</span><span class="delimiter">: </span><span class="description">compute the cosine of a double-precision floating-point number on \[-π/4, π/4].</span>
|
|
251
|
+
- <span class="package-name">[`@stdlib/math-base/special/kernel-sin`][@stdlib/math/base/special/kernel-sin]</span><span class="delimiter">: </span><span class="description">compute the sine of a double-precision floating-point number on \[-π/4, π/4].</span>
|
|
252
|
+
- <span class="package-name">[`@stdlib/math-base/special/tan`][@stdlib/math/base/special/tan]</span><span class="delimiter">: </span><span class="description">evaluate the tangent of a number.</span>
|
|
253
|
+
|
|
254
|
+
</section>
|
|
255
|
+
|
|
256
|
+
<!-- /.related -->
|
|
257
|
+
|
|
258
|
+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
<section class="main-repo" >
|
|
262
|
+
|
|
263
|
+
* * *
|
|
264
|
+
|
|
265
|
+
## Notice
|
|
266
|
+
|
|
267
|
+
This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
|
|
268
|
+
|
|
269
|
+
For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].
|
|
270
|
+
|
|
271
|
+
#### Community
|
|
272
|
+
|
|
273
|
+
[![Chat][chat-image]][chat-url]
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Copyright
|
|
278
|
+
|
|
279
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
280
|
+
|
|
281
|
+
</section>
|
|
282
|
+
|
|
283
|
+
<!-- /.stdlib -->
|
|
284
|
+
|
|
285
|
+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
286
|
+
|
|
287
|
+
<section class="links">
|
|
288
|
+
|
|
289
|
+
[npm-image]: http://img.shields.io/npm/v/@stdlib/math-base-special-kernel-tan.svg
|
|
290
|
+
[npm-url]: https://npmjs.org/package/@stdlib/math-base-special-kernel-tan
|
|
291
|
+
|
|
292
|
+
[test-image]: https://github.com/stdlib-js/math-base-special-kernel-tan/actions/workflows/test.yml/badge.svg?branch=v0.2.4
|
|
293
|
+
[test-url]: https://github.com/stdlib-js/math-base-special-kernel-tan/actions/workflows/test.yml?query=branch:v0.2.4
|
|
294
|
+
|
|
295
|
+
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-special-kernel-tan/main.svg
|
|
296
|
+
[coverage-url]: https://codecov.io/github/stdlib-js/math-base-special-kernel-tan?branch=main
|
|
297
|
+
|
|
298
|
+
<!--
|
|
299
|
+
|
|
300
|
+
[dependencies-image]: https://img.shields.io/david/stdlib-js/math-base-special-kernel-tan.svg
|
|
301
|
+
[dependencies-url]: https://david-dm.org/stdlib-js/math-base-special-kernel-tan/main
|
|
302
|
+
|
|
303
|
+
-->
|
|
304
|
+
|
|
305
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
306
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
307
|
+
|
|
308
|
+
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
309
|
+
|
|
310
|
+
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
311
|
+
|
|
312
|
+
[umd]: https://github.com/umdjs/umd
|
|
313
|
+
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
314
|
+
|
|
315
|
+
[deno-url]: https://github.com/stdlib-js/math-base-special-kernel-tan/tree/deno
|
|
316
|
+
[deno-readme]: https://github.com/stdlib-js/math-base-special-kernel-tan/blob/deno/README.md
|
|
317
|
+
[umd-url]: https://github.com/stdlib-js/math-base-special-kernel-tan/tree/umd
|
|
318
|
+
[umd-readme]: https://github.com/stdlib-js/math-base-special-kernel-tan/blob/umd/README.md
|
|
319
|
+
[esm-url]: https://github.com/stdlib-js/math-base-special-kernel-tan/tree/esm
|
|
320
|
+
[esm-readme]: https://github.com/stdlib-js/math-base-special-kernel-tan/blob/esm/README.md
|
|
321
|
+
[branches-url]: https://github.com/stdlib-js/math-base-special-kernel-tan/blob/main/branches.md
|
|
322
|
+
|
|
323
|
+
[tangent]: https://en.wikipedia.org/wiki/Tangent
|
|
324
|
+
|
|
325
|
+
[double-double-arithmetic]: https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format#Double-double_arithmetic
|
|
326
|
+
|
|
327
|
+
[ieee754]: https://en.wikipedia.org/wiki/IEEE_floating_point
|
|
328
|
+
|
|
329
|
+
[ulp]: https://en.wikipedia.org/wiki/Unit_in_the_last_place
|
|
330
|
+
|
|
331
|
+
<!-- <related-links> -->
|
|
332
|
+
|
|
333
|
+
[@stdlib/math/base/special/kernel-cos]: https://www.npmjs.com/package/@stdlib/math-base-special-kernel-cos
|
|
334
|
+
|
|
335
|
+
[@stdlib/math/base/special/kernel-sin]: https://www.npmjs.com/package/@stdlib/math-base-special-kernel-sin
|
|
336
|
+
|
|
337
|
+
[@stdlib/math/base/special/tan]: https://www.npmjs.com/package/@stdlib/math-base-special-tan
|
|
338
|
+
|
|
339
|
+
<!-- </related-links> -->
|
|
340
|
+
|
|
341
|
+
</section>
|
|
342
|
+
|
|
343
|
+
<!-- /.links -->
|
package/SECURITY.md
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";var l=function(r,a){return function(){return a||r((a={exports:{}}).exports,a),a.exports}};var q=l(function(z,c){
|
|
2
|
+
function W(r){return r===0?.13333333333320124:.13333333333320124+r*(.021869488294859542+r*(.0035920791075913124+r*(.0005880412408202641+r*(7817944429395571e-20+r*-18558637485527546e-21))))}c.exports=W
|
|
3
|
+
});var d=l(function(B,O){
|
|
4
|
+
function _(r){return r===0?.05396825397622605:.05396825397622605+r*(.0088632398235993+r*(.0014562094543252903+r*(.0002464631348184699+r*(7140724913826082e-20+r*2590730518636337e-20))))}O.exports=_
|
|
5
|
+
});var I=l(function(D,H){
|
|
6
|
+
var g=require('@stdlib/number-float64-base-get-high-word/dist'),E=require('@stdlib/number-float64-base-set-low-word/dist'),h=q(),w=d(),A=.7853981633974483,F=3061616997868383e-32,L=.3333333333333341,P=2147483647;function S(r,a,p){var f,o,s,v,u,n,i,e,t;return f=g(r),o=f&P|0,o>=1072010280&&(r<0&&(r=-r,a=-a),t=A-r,e=F-a,r=t+e,a=0),t=r*r,e=t*t,v=h(e),i=t*w(e),u=t*r,v=a+t*(u*(v+i)+a),v+=L*u,e=r+v,o>=1072010280?(i=p,(1-(f>>30&2))*(i-2*(r-(e*e/(e+i)-v)))):p===1?e:(t=E(e,0),i=v-(t-r),s=-1/e,n=E(s,0),u=1+n*t,n+s*(u+n*i))}H.exports=S
|
|
7
|
+
});var T=I();module.exports=T;
|
|
8
|
+
/** @license Apache-2.0 */
|
|
9
|
+
/** @license Apache-2.0 */
|
|
10
|
+
/** @license Apache-2.0 */
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../lib/polyval_t_odd.js", "../lib/polyval_t_even.js", "../lib/main.js", "../lib/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.13333333333320124;\n\t}\n\treturn 0.13333333333320124 + (x * (0.021869488294859542 + (x * (0.0035920791075913124 + (x * (0.0005880412408202641 + (x * (0.00007817944429395571 + (x * -0.000018558637485527546))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.05396825397622605;\n\t}\n\treturn 0.05396825397622605 + (x * (0.0088632398235993 + (x * (0.0014562094543252903 + (x * (0.0002464631348184699 + (x * (0.00007140724913826082 + (x * 0.00002590730518636337))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/k_tan.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getHighWord = require( '@stdlib/number-float64-base-get-high-word' );\nvar setLowWord = require( '@stdlib/number-float64-base-set-low-word' );\nvar polyvalOdd = require( './polyval_t_odd.js' );\nvar polyvalEven = require( './polyval_t_even.js' );\n\n\n// VARIABLES //\n\nvar PIO4 = 7.85398163397448278999e-01;\nvar PIO4LO = 3.06161699786838301793e-17;\nvar T0 = 3.33333333333334091986e-01; // 3FD55555, 55555563\n\n// Absolute value mask: 2147483647 => 0x7fffffff => 01111111111111111111111111111111\nvar HIGH_WORD_ABS_MASK = 0x7fffffff|0; // asm type annotation\n\n\n// MAIN //\n\n/**\n* Computes the tangent on \\\\( \\approx\\[-\\pi/4, \\pi/4] \\\\) (except on -0), \\\\( \\pi/4 \\approx 0.7854 \\\\).\n*\n* ## Method\n*\n* - Since \\\\( \\tan(-x) = -\\tan(x) \\\\), we need only to consider positive \\\\( x \\\\).\n*\n* - Callers must return \\\\( \\tan(-0) = -0 \\\\) without calling here since our odd polynomial is not evaluated in a way that preserves \\\\( -0 \\\\). Callers may do the optimization \\\\( \\tan(x) \\approx x \\\\) for tiny \\\\( x \\\\).\n*\n* - \\\\( \\tan(x) \\\\) is approximated by a odd polynomial of degree 27 on \\\\( \\[0, 0.67434] \\\\)\n*\n* ```tex\n* \\tan(x) \\approx x + T_1 x^3 + \\ldots + T_{13} x^{27}\n* ```\n* where\n*\n* ```tex\n* \\left| \\frac{\\tan(x)}{x} - \\left( 1 + T_1 x^2 + T_2 x^4 + \\ldots + T_{13} x^{26} \\right) \\right| \\le 2^{-59.2}\n* ```\n*\n* - Note: \\\\( \\tan(x+y) = \\tan(x) + \\tan'(x) \\cdot y \\approx \\tan(x) + ( 1 + x \\cdot x ) \\cdot y \\\\). Therefore, for better accuracy in computing \\\\( \\tan(x+y) \\\\), let\n*\n* ```tex\n* r = x^3 \\cdot \\left( T_2+x^2 \\cdot (T_3+x^2 \\cdot (\\ldots+x^2 \\cdot (T_{12}+x^2 \\cdot T_{13}))) \\right)\n* ```\n*\n* then\n*\n* ```tex\n* \\tan(x+y) = x^3 + \\left( T_1 \\cdot x^2 + (x \\cdot (r+y)+y) \\right)\n* ```\n*\n* - For \\\\( x \\\\) in \\\\( \\[0.67434, \\pi/4] \\\\), let \\\\( y = \\pi/4 - x \\\\), then\n*\n* ```tex\n* \\tan(x) = \\tan\\left(\\tfrac{\\pi}{4}-y\\right) = \\frac{1-\\tan(y)}{1+\\tan(y)} \\\\\n* = 1 - 2 \\cdot \\left( \\tan(y) - \\tfrac{\\tan(y)^2}{1+\\tan(y)} \\right)\n* ```\n*\n* @param {number} x - input value (in radians, assumed to be bounded by ~\u03C0/4 in magnitude)\n* @param {number} y - tail of `x`\n* @param {integer} k - indicates whether tan (if k = 1) or -1/tan (if k = -1) is returned\n* @returns {number} tangent\n*\n* @example\n* var out = kernelTan( 3.141592653589793/4.0, 0.0, 1 );\n* // returns ~1.0\n*\n* @example\n* var out = kernelTan( 3.141592653589793/4.0, 0.0, -1 );\n* // returns ~-1.0\n*\n* @example\n* var out = kernelTan( 3.141592653589793/6.0, 0.0, 1 );\n* // returns ~0.577\n*\n* @example\n* var out = kernelTan( 0.664, 5.288e-17, 1 );\n* // returns ~0.783\n*\n* @example\n* var out = kernelTan( NaN, 0.0, 1 );\n* // returns NaN\n*\n* @example\n* var out = kernelTan( 3.0, NaN, 1 );\n* // returns NaN\n*\n* @example\n* var out = kernelTan( NaN, NaN, 1 );\n* // returns NaN\n*/\nfunction kernelTan( x, y, k ) {\n\tvar hx;\n\tvar ix;\n\tvar a;\n\tvar r;\n\tvar s;\n\tvar t;\n\tvar v;\n\tvar w;\n\tvar z;\n\n\thx = getHighWord( x );\n\n\t// High word of |x|:\n\tix = (hx & HIGH_WORD_ABS_MASK)|0; // asm type annotation\n\n\t// Case: |x| >= 0.6744\n\tif ( ix >= 0x3FE59428 ) {\n\t\tif ( x < 0 ) {\n\t\t\tx = -x;\n\t\t\ty = -y;\n\t\t}\n\t\tz = PIO4 - x;\n\t\tw = PIO4LO - y;\n\t\tx = z + w;\n\t\ty = 0.0;\n\t}\n\tz = x * x;\n\tw = z * z;\n\n\t// Break x^5*(T[1]+x^2*T[2]+...) into x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + x^5(x^2*(T[2]+x^4*T[4]+...+x^22*T[12]))...\n\tr = polyvalOdd( w );\n\tv = z * polyvalEven( w );\n\ts = z * x;\n\tr = y + (z * ((s * (r + v)) + y));\n\tr += T0 * s;\n\tw = x + r;\n\tif ( ix >= 0x3FE59428 ) {\n\t\tv = k;\n\t\treturn ( 1.0 - ( (hx >> 30) & 2 ) ) * ( v - (2.0 * (x - ((w * w / (w + v)) - r)) )); // eslint-disable-line max-len\n\t}\n\tif ( k === 1 ) {\n\t\treturn w;\n\t}\n\t// Compute -1/(x+r) accurately...\n\tz = setLowWord( w, 0 );\n\tv = r - (z - x); // z + v = r + x\n\ta = -1.0 / w; // a = -1/w\n\tt = setLowWord( a, 0 );\n\ts = 1.0 + (t * z);\n\treturn t + (a * (s + (t * v)));\n}\n\n\n// EXPORTS //\n\nmodule.exports = kernelTan;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the tangent of a double-precision floating-point number on `[-\u03C0/4, \u03C0/4]`.\n*\n* @module @stdlib/math-base-special-kernel-tan\n*\n* @example\n* var kernelTan = require( '@stdlib/math-base-special-kernel-tan' );\n*\n* var out = kernelTan( 3.141592653589793/4.0, 0.0, 1 );\n* // returns ~1.0\n*\n* out = kernelTan( 3.141592653589793/4.0, 0.0, -1 );\n* // returns ~-1.0\n*\n* out = kernelTan( 3.141592653589793/6.0, 0.0, 1 );\n* // returns ~0.577\n*\n* out = kernelTan( 0.664, 5.288e-17, 1 );\n* // returns ~0.783\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAoCA,SAASC,EAAUC,EAAI,CACtB,OAAKA,IAAM,EACH,mBAED,mBAAuBA,GAAK,oBAAwBA,GAAK,qBAAyBA,GAAK,qBAAyBA,GAAK,qBAA0BA,EAAI,0BAC3J,CAKAF,EAAO,QAAUC,IC9CjB,IAAAE,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAoCA,SAASC,EAAUC,EAAI,CACtB,OAAKA,IAAM,EACH,mBAED,mBAAuBA,GAAK,kBAAsBA,GAAK,qBAAyBA,GAAK,qBAAyBA,GAAK,qBAA0BA,EAAI,wBACzJ,CAKAF,EAAO,QAAUC,IC9CjB,IAAAE,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAoCA,IAAIC,EAAc,QAAS,2CAA4C,EACnEC,EAAa,QAAS,0CAA2C,EACjEC,EAAa,IACbC,EAAc,IAKdC,EAAO,kBACPC,EAAS,qBACTC,EAAK,kBAGLC,EAAqB,WA6EzB,SAASC,EAAWC,EAAGC,EAAGC,EAAI,CAC7B,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EA4BJ,OA1BAR,EAAKZ,EAAaS,CAAE,EAGpBI,EAAMD,EAAKL,EAAoB,EAG1BM,GAAM,aACLJ,EAAI,IACRA,EAAI,CAACA,EACLC,EAAI,CAACA,GAENU,EAAIhB,EAAOK,EACXU,EAAId,EAASK,EACbD,EAAIW,EAAID,EACRT,EAAI,GAELU,EAAIX,EAAIA,EACRU,EAAIC,EAAIA,EAGRL,EAAIb,EAAYiB,CAAE,EAClBD,EAAIE,EAAIjB,EAAagB,CAAE,EACvBH,EAAII,EAAIX,EACRM,EAAIL,EAAKU,GAAMJ,GAAKD,EAAIG,GAAMR,GAC9BK,GAAKT,EAAKU,EACVG,EAAIV,EAAIM,EACHF,GAAM,YACVK,EAAIP,GACK,GAASC,GAAM,GAAM,KAAUM,EAAK,GAAOT,GAAMU,EAAIA,GAAKA,EAAID,GAAMH,MAEzEJ,IAAM,EACHQ,GAGRC,EAAInB,EAAYkB,EAAG,CAAE,EACrBD,EAAIH,GAAKK,EAAIX,GACbK,EAAI,GAAOK,EACXF,EAAIhB,EAAYa,EAAG,CAAE,EACrBE,EAAI,EAAOC,EAAIG,EACRH,EAAKH,GAAKE,EAAKC,EAAIC,GAC3B,CAKAnB,EAAO,QAAUS,IC3IjB,IAAIa,EAAO,IAKX,OAAO,QAAUA",
|
|
6
|
+
"names": ["require_polyval_t_odd", "__commonJSMin", "exports", "module", "evalpoly", "x", "require_polyval_t_even", "__commonJSMin", "exports", "module", "evalpoly", "x", "require_main", "__commonJSMin", "exports", "module", "getHighWord", "setLowWord", "polyvalOdd", "polyvalEven", "PIO4", "PIO4LO", "T0", "HIGH_WORD_ABS_MASK", "kernelTan", "x", "y", "k", "hx", "ix", "a", "r", "s", "t", "v", "w", "z", "main"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="13.917ex" height="5.176ex" style="vertical-align: -1.838ex;" viewBox="0 -1437.2 5992.1 2228.5" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" aria-labelledby="MathJax-SVG-1-Title">
|
|
2
|
+
<title id="MathJax-SVG-1-Title">StartAbsoluteValue y EndAbsoluteValue less-than-or-equal-to one-half u l p left-parenthesis x right-parenthesis</title>
|
|
3
|
+
<defs aria-hidden="true">
|
|
4
|
+
<path stroke-width="1" id="E1-MJMAIN-7C" d="M139 -249H137Q125 -249 119 -235V251L120 737Q130 750 139 750Q152 750 159 735V-235Q151 -249 141 -249H139Z"></path>
|
|
5
|
+
<path stroke-width="1" id="E1-MJMATHI-79" d="M21 287Q21 301 36 335T84 406T158 442Q199 442 224 419T250 355Q248 336 247 334Q247 331 231 288T198 191T182 105Q182 62 196 45T238 27Q261 27 281 38T312 61T339 94Q339 95 344 114T358 173T377 247Q415 397 419 404Q432 431 462 431Q475 431 483 424T494 412T496 403Q496 390 447 193T391 -23Q363 -106 294 -155T156 -205Q111 -205 77 -183T43 -117Q43 -95 50 -80T69 -58T89 -48T106 -45Q150 -45 150 -87Q150 -107 138 -122T115 -142T102 -147L99 -148Q101 -153 118 -160T152 -167H160Q177 -167 186 -165Q219 -156 247 -127T290 -65T313 -9T321 21L315 17Q309 13 296 6T270 -6Q250 -11 231 -11Q185 -11 150 11T104 82Q103 89 103 113Q103 170 138 262T173 379Q173 380 173 381Q173 390 173 393T169 400T158 404H154Q131 404 112 385T82 344T65 302T57 280Q55 278 41 278H27Q21 284 21 287Z"></path>
|
|
6
|
+
<path stroke-width="1" id="E1-MJMAIN-2264" d="M674 636Q682 636 688 630T694 615T687 601Q686 600 417 472L151 346L399 228Q687 92 691 87Q694 81 694 76Q694 58 676 56H670L382 192Q92 329 90 331Q83 336 83 348Q84 359 96 365Q104 369 382 500T665 634Q669 636 674 636ZM84 -118Q84 -108 99 -98H678Q694 -104 694 -118Q694 -130 679 -138H98Q84 -131 84 -118Z"></path>
|
|
7
|
+
<path stroke-width="1" id="E1-MJMAIN-31" d="M213 578L200 573Q186 568 160 563T102 556H83V602H102Q149 604 189 617T245 641T273 663Q275 666 285 666Q294 666 302 660V361L303 61Q310 54 315 52T339 48T401 46H427V0H416Q395 3 257 3Q121 3 100 0H88V46H114Q136 46 152 46T177 47T193 50T201 52T207 57T213 61V578Z"></path>
|
|
8
|
+
<path stroke-width="1" id="E1-MJMAIN-32" d="M109 429Q82 429 66 447T50 491Q50 562 103 614T235 666Q326 666 387 610T449 465Q449 422 429 383T381 315T301 241Q265 210 201 149L142 93L218 92Q375 92 385 97Q392 99 409 186V189H449V186Q448 183 436 95T421 3V0H50V19V31Q50 38 56 46T86 81Q115 113 136 137Q145 147 170 174T204 211T233 244T261 278T284 308T305 340T320 369T333 401T340 431T343 464Q343 527 309 573T212 619Q179 619 154 602T119 569T109 550Q109 549 114 549Q132 549 151 535T170 489Q170 464 154 447T109 429Z"></path>
|
|
9
|
+
<path stroke-width="1" id="E1-MJMAIN-75" d="M383 58Q327 -10 256 -10H249Q124 -10 105 89Q104 96 103 226Q102 335 102 348T96 369Q86 385 36 385H25V408Q25 431 27 431L38 432Q48 433 67 434T105 436Q122 437 142 438T172 441T184 442H187V261Q188 77 190 64Q193 49 204 40Q224 26 264 26Q290 26 311 35T343 58T363 90T375 120T379 144Q379 145 379 161T380 201T380 248V315Q380 361 370 372T320 385H302V431Q304 431 378 436T457 442H464V264Q464 84 465 81Q468 61 479 55T524 46H542V0Q540 0 467 -5T390 -11H383V58Z"></path>
|
|
10
|
+
<path stroke-width="1" id="E1-MJMAIN-6C" d="M42 46H56Q95 46 103 60V68Q103 77 103 91T103 124T104 167T104 217T104 272T104 329Q104 366 104 407T104 482T104 542T103 586T103 603Q100 622 89 628T44 637H26V660Q26 683 28 683L38 684Q48 685 67 686T104 688Q121 689 141 690T171 693T182 694H185V379Q185 62 186 60Q190 52 198 49Q219 46 247 46H263V0H255L232 1Q209 2 183 2T145 3T107 3T57 1L34 0H26V46H42Z"></path>
|
|
11
|
+
<path stroke-width="1" id="E1-MJMAIN-70" d="M36 -148H50Q89 -148 97 -134V-126Q97 -119 97 -107T97 -77T98 -38T98 6T98 55T98 106Q98 140 98 177T98 243T98 296T97 335T97 351Q94 370 83 376T38 385H20V408Q20 431 22 431L32 432Q42 433 61 434T98 436Q115 437 135 438T165 441T176 442H179V416L180 390L188 397Q247 441 326 441Q407 441 464 377T522 216Q522 115 457 52T310 -11Q242 -11 190 33L182 40V-45V-101Q182 -128 184 -134T195 -145Q216 -148 244 -148H260V-194H252L228 -193Q205 -192 178 -192T140 -191Q37 -191 28 -194H20V-148H36ZM424 218Q424 292 390 347T305 402Q234 402 182 337V98Q222 26 294 26Q345 26 384 80T424 218Z"></path>
|
|
12
|
+
<path stroke-width="1" id="E1-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path>
|
|
13
|
+
<path stroke-width="1" id="E1-MJMATHI-78" d="M52 289Q59 331 106 386T222 442Q257 442 286 424T329 379Q371 442 430 442Q467 442 494 420T522 361Q522 332 508 314T481 292T458 288Q439 288 427 299T415 328Q415 374 465 391Q454 404 425 404Q412 404 406 402Q368 386 350 336Q290 115 290 78Q290 50 306 38T341 26Q378 26 414 59T463 140Q466 150 469 151T485 153H489Q504 153 504 145Q504 144 502 134Q486 77 440 33T333 -11Q263 -11 227 52Q186 -10 133 -10H127Q78 -10 57 16T35 71Q35 103 54 123T99 143Q142 143 142 101Q142 81 130 66T107 46T94 41L91 40Q91 39 97 36T113 29T132 26Q168 26 194 71Q203 87 217 139T245 247T261 313Q266 340 266 352Q266 380 251 392T217 404Q177 404 142 372T93 290Q91 281 88 280T72 278H58Q52 284 52 289Z"></path>
|
|
14
|
+
<path stroke-width="1" id="E1-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path>
|
|
15
|
+
</defs>
|
|
16
|
+
<g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)" aria-hidden="true">
|
|
17
|
+
<use xlink:href="#E1-MJMAIN-7C" x="0" y="0"></use>
|
|
18
|
+
<use xlink:href="#E1-MJMATHI-79" x="278" y="0"></use>
|
|
19
|
+
<use xlink:href="#E1-MJMAIN-7C" x="776" y="0"></use>
|
|
20
|
+
<use xlink:href="#E1-MJMAIN-2264" x="1332" y="0"></use>
|
|
21
|
+
<g transform="translate(2110,0)">
|
|
22
|
+
<g transform="translate(397,0)">
|
|
23
|
+
<rect stroke="none" width="620" height="60" x="0" y="220"></rect>
|
|
24
|
+
<use xlink:href="#E1-MJMAIN-31" x="60" y="676"></use>
|
|
25
|
+
<use xlink:href="#E1-MJMAIN-32" x="60" y="-687"></use>
|
|
26
|
+
</g>
|
|
27
|
+
</g>
|
|
28
|
+
<g transform="translate(3249,0)">
|
|
29
|
+
<use xlink:href="#E1-MJMAIN-75"></use>
|
|
30
|
+
<use xlink:href="#E1-MJMAIN-6C" x="556" y="0"></use>
|
|
31
|
+
<use xlink:href="#E1-MJMAIN-70" x="835" y="0"></use>
|
|
32
|
+
</g>
|
|
33
|
+
<use xlink:href="#E1-MJMAIN-28" x="4640" y="0"></use>
|
|
34
|
+
<use xlink:href="#E1-MJMATHI-78" x="5030" y="0"></use>
|
|
35
|
+
<use xlink:href="#E1-MJMAIN-29" x="5602" y="0"></use>
|
|
36
|
+
</g>
|
|
37
|
+
</svg>
|