Skip to content

Commit d406dd7

Browse files
authored
Merge branch 'stdlib-js:develop' into blas/base
2 parents 3c2aaa6 + 68446dc commit d406dd7

45 files changed

Lines changed: 2795 additions & 44 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/node_modules/@stdlib/_tools/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,42 @@ This directory contains Node.js packages which are used for project development.
3232

3333
<!-- /.intro -->
3434

35+
<section class="usage">
36+
37+
## Usage
38+
39+
```javascript
40+
var tools = require( '@stdlib/_tools' );
41+
```
42+
43+
#### tools
44+
45+
Namespace containing project development utilities.
46+
47+
```javascript
48+
var ns = tools;
49+
// returns null
50+
```
51+
52+
</section>
53+
54+
<!-- /.usage -->
55+
56+
<section class="examples">
57+
58+
## Examples
59+
60+
```javascript
61+
var tools = require( '@stdlib/_tools' );
62+
63+
console.log( tools );
64+
// => null
65+
```
66+
67+
</section>
68+
69+
<!-- /.examples -->
70+
3571
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
3672

3773
<section class="related">

lib/node_modules/@stdlib/_tools/eslint/rules/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ var eslint = rules;
7272
- <span class="signature">[`no-dynamic-exports`][@stdlib/_tools/eslint/rules/no-dynamic-exports]</span><span class="delimiter">: </span><span class="description">ESLint rule enforcing that only statically analyzable values are exported.</span>
7373
- <span class="signature">[`no-dynamic-require`][@stdlib/_tools/eslint/rules/no-dynamic-require]</span><span class="delimiter">: </span><span class="description">ESLint rule enforcing that `require()` calls have only string literals as arguments.</span>
7474
- <span class="signature">[`no-empty-comments`][@stdlib/_tools/eslint/rules/no-empty-comments]</span><span class="delimiter">: </span><span class="description">ESLint rule to disallow empty comments.</span>
75+
- <span class="signature">[`no-empty-lines-between-requires`][@stdlib/_tools/eslint/rules/no-empty-lines-between-requires]</span><span class="delimiter">: </span><span class="description">ESLint rule to enforce no empty lines between module-level require statements.</span>
7576
- <span class="signature">[`no-error-string-concat`][@stdlib/_tools/eslint/rules/no-error-string-concat]</span><span class="delimiter">: </span><span class="description">ESLint rule disallowing string concatenation in error messages.</span>
7677
- <span class="signature">[`no-immediate-require`][@stdlib/_tools/eslint/rules/no-immediate-require]</span><span class="delimiter">: </span><span class="description">ESLint rule enforcing that `require()` expressions are not immediately invoked.</span>
7778
- <span class="signature">[`no-internal-require`][@stdlib/_tools/eslint/rules/no-internal-require]</span><span class="delimiter">: </span><span class="description">ESLint rule disallowing `require()` calls into internals of another stdlib package.</span>
@@ -417,6 +418,8 @@ console.log( getKeys( rules ) );
417418

418419
[@stdlib/_tools/eslint/rules/no-empty-comments]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/_tools/eslint/rules/no-empty-comments
419420

421+
[@stdlib/_tools/eslint/rules/no-empty-lines-between-requires]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/_tools/eslint/rules/no-empty-lines-between-requires
422+
420423
[@stdlib/_tools/eslint/rules/no-error-string-concat]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/_tools/eslint/rules/no-error-string-concat
421424

422425
[@stdlib/_tools/eslint/rules/no-immediate-require]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/_tools/eslint/rules/no-immediate-require

lib/node_modules/@stdlib/complex/float64/base/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ The namespace contains the following functions:
5858
<div class="namespace-toc">
5959

6060
- <span class="signature">[`add( z1, z2 )`][@stdlib/complex/float64/base/add]</span><span class="delimiter">: </span><span class="description">add two double-precision complex floating-point numbers.</span>
61+
- <span class="signature">[`add3( z1, z2, z3 )`][@stdlib/complex/float64/base/add3]</span><span class="delimiter">: </span><span class="description">compute the sum of three double-precision complex floating-point numbers.</span>
6162
- <span class="signature">[`div( z1, z2 )`][@stdlib/complex/float64/base/div]</span><span class="delimiter">: </span><span class="description">divide two double-precision complex floating-point numbers.</span>
6263
- <span class="signature">[`identity( z )`][@stdlib/complex/float64/base/identity]</span><span class="delimiter">: </span><span class="description">evaluate the identity function of a double-precision complex floating-point number.</span>
6364
- <span class="signature">[`muladd( alpha, x, y )`][@stdlib/complex/float64/base/mul-add]</span><span class="delimiter">: </span><span class="description">perform a multiply-add operation involving three double-precision complex floating-point numbers.</span>
@@ -117,6 +118,8 @@ console.log( objectKeys( ns ) );
117118

118119
[@stdlib/complex/float64/base/add]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex/float64/base/add
119120

121+
[@stdlib/complex/float64/base/add3]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex/float64/base/add3
122+
120123
[@stdlib/complex/float64/base/div]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex/float64/base/div
121124

122125
[@stdlib/complex/float64/base/identity]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/complex/float64/base/identity
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2026 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+
# acothf
22+
23+
> Compute the [inverse hyperbolic cotangent][hyperbolic-arctangent] of a single-precision floating-point number.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var acothf = require( '@stdlib/math/base/special/acothf' );
31+
```
32+
33+
#### acothf( x )
34+
35+
Computes the [inverse hyperbolic cotangent][hyperbolic-arctangent] of a single-precision floating-point number.
36+
37+
```javascript
38+
var v = acothf( 2.0 );
39+
// returns ~0.5493
40+
41+
v = acothf( 1.0 );
42+
// returns Infinity
43+
```
44+
45+
The domain of the inverse hyperbolic cotangent is the union of the intervals `(-inf,-1]` and `[1,inf)`. If provided a value on the open interval `(-1,1)`, the function returns `NaN`.
46+
47+
```javascript
48+
var v = acothf( 0.0 );
49+
// returns NaN
50+
51+
v = acothf( 0.5 );
52+
// returns NaN
53+
```
54+
55+
</section>
56+
57+
<!-- /.usage -->
58+
59+
<section class="examples">
60+
61+
## Examples
62+
63+
<!-- eslint no-undef: "error" -->
64+
65+
```javascript
66+
var uniform = require( '@stdlib/random/array/uniform' );
67+
var logEachMap = require( '@stdlib/console/log-each-map' );
68+
var acothf = require( '@stdlib/math/base/special/acothf' );
69+
70+
var x = uniform( 100, 1.0, 5.0, {
71+
'dtype': 'float32'
72+
});
73+
74+
logEachMap( 'acothf(%0.4f) = %0.4f', x, acothf );
75+
```
76+
77+
</section>
78+
79+
<!-- /.examples -->
80+
81+
<!-- C interface documentation. -->
82+
83+
* * *
84+
85+
<section class="c">
86+
87+
## C APIs
88+
89+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
90+
91+
<section class="intro">
92+
93+
</section>
94+
95+
<!-- /.intro -->
96+
97+
<!-- C usage documentation. -->
98+
99+
<section class="usage">
100+
101+
### Usage
102+
103+
```c
104+
#include "stdlib/math/base/special/acothf.h"
105+
```
106+
107+
#### stdlib_base_acothf( x )
108+
109+
Computes the [inverse hyperbolic cotangent][hyperbolic-arctangent] of a single-precision floating-point number.
110+
111+
```c
112+
float out = stdlib_base_acothf( 2.0f );
113+
// returns ~0.5493f
114+
```
115+
116+
The function accepts the following arguments:
117+
118+
- **x**: `[in] float` input value.
119+
120+
```c
121+
float stdlib_base_acothf( const float x );
122+
```
123+
124+
</section>
125+
126+
<!-- /.usage -->
127+
128+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
129+
130+
<section class="notes">
131+
132+
</section>
133+
134+
<!-- /.notes -->
135+
136+
<!-- C API usage examples. -->
137+
138+
<section class="examples">
139+
140+
### Examples
141+
142+
```c
143+
#include "stdlib/math/base/special/acothf.h"
144+
#include <stdio.h>
145+
146+
int main( void ) {
147+
const float x[] = { 1.0f, 1.44f, 1.89f, 2.33f, 2.78f, 3.22f, 3.67f, 4.11f, 4.56f, 5.0f };
148+
149+
float v;
150+
int i;
151+
for ( i = 0; i < 10; i++ ) {
152+
v = stdlib_base_acothf( x[ i ] );
153+
printf( "acothf(%f) = %f\n", x[ i ], v );
154+
}
155+
}
156+
```
157+
158+
</section>
159+
160+
<!-- /.examples -->
161+
162+
</section>
163+
164+
<!-- /.c -->
165+
166+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
167+
168+
<section class="related">
169+
170+
* * *
171+
172+
## See Also
173+
174+
</section>
175+
176+
<!-- /.related -->
177+
178+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
179+
180+
<section class="links">
181+
182+
[hyperbolic-arctangent]: https://en.wikipedia.org/wiki/Inverse_hyperbolic_function
183+
184+
<!-- <related-links> -->
185+
186+
<!-- </related-links> -->
187+
188+
</section>
189+
190+
<!-- /.links -->
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
25+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
26+
var pkg = require( './../package.json' ).name;
27+
var acothf = require( './../lib' );
28+
29+
30+
// MAIN //
31+
32+
bench( pkg, function benchmark( b ) {
33+
var x;
34+
var y;
35+
var i;
36+
37+
x = uniform( 100, 1.1, 100.0, {
38+
'dtype': 'float32'
39+
});
40+
41+
b.tic();
42+
for ( i = 0; i < b.iterations; i++ ) {
43+
y = acothf( x[ i % x.length ] );
44+
if ( isnanf( y ) ) {
45+
b.fail( 'should not return NaN' );
46+
}
47+
}
48+
b.toc();
49+
if ( isnanf( y ) ) {
50+
b.fail( 'should not return NaN' );
51+
}
52+
b.pass( 'benchmark finished' );
53+
b.end();
54+
});
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var resolve = require( 'path' ).resolve;
24+
var bench = require( '@stdlib/bench' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
26+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
27+
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
29+
var pkg = require( './../package.json' ).name;
30+
31+
32+
// VARIABLES //
33+
34+
var acothf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
35+
var opts = {
36+
'skip': ( acothf instanceof Error )
37+
};
38+
39+
40+
// MAIN //
41+
42+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
43+
var x;
44+
var y;
45+
var i;
46+
47+
x = uniform( 100, 1.1, 100.0, {
48+
'dtype': 'float32'
49+
});
50+
51+
b.tic();
52+
for ( i = 0; i < b.iterations; i++ ) {
53+
y = acothf( x[ i % x.length ] );
54+
if ( isnanf( y ) ) {
55+
b.fail( 'should not return NaN' );
56+
}
57+
}
58+
b.toc();
59+
if ( isnanf( y ) ) {
60+
b.fail( 'should not return NaN' );
61+
}
62+
b.pass( 'benchmark finished' );
63+
b.end();
64+
});

0 commit comments

Comments
 (0)