Skip to content

Commit c9edc97

Browse files
committed
Auto-generated commit
1 parent 02a6661 commit c9edc97

File tree

30 files changed

+2088
-2
lines changed

30 files changed

+2088
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
<section class="release" id="unreleased">
66

7-
## Unreleased (2026-01-06)
7+
## Unreleased (2026-01-07)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`cb09f58`](https://github.com/stdlib-js/stdlib/commit/cb09f5862f03c3056c8259164653940108068f30) - add `math/base/special/fast/atanhf` [(#9046)](https://github.com/stdlib-js/stdlib/pull/9046)
1314
- [`542d57c`](https://github.com/stdlib-js/stdlib/commit/542d57c97e7b8e8d9b41221d86c5378fa02d0d87) - add `math/base/special/floornf` [(#4881)](https://github.com/stdlib-js/stdlib/pull/4881)
1415
- [`ea8228b`](https://github.com/stdlib-js/stdlib/commit/ea8228b082c03c6c8c8182d237c709ae279c05d2) - add `math/base/special/acoshf` [(#5812)](https://github.com/stdlib-js/stdlib/pull/5812)
1516
- [`e4442f2`](https://github.com/stdlib-js/stdlib/commit/e4442f21bca0114e934d71da6b3d61e54d3a711b) - update math scaffold databases [(#9453)](https://github.com/stdlib-js/stdlib/pull/9453)
@@ -713,6 +714,7 @@ A total of 80 issues were closed in this release:
713714

714715
<details>
715716

717+
- [`cb09f58`](https://github.com/stdlib-js/stdlib/commit/cb09f5862f03c3056c8259164653940108068f30) - **feat:** add `math/base/special/fast/atanhf` [(#9046)](https://github.com/stdlib-js/stdlib/pull/9046) _(by Nakul Krishnakumar, Philipp Burckhardt, stdlib-bot)_
716718
- [`542d57c`](https://github.com/stdlib-js/stdlib/commit/542d57c97e7b8e8d9b41221d86c5378fa02d0d87) - **feat:** add `math/base/special/floornf` [(#4881)](https://github.com/stdlib-js/stdlib/pull/4881) _(by Gururaj Gurram, Athan Reines, stdlib-bot, Karan Anand)_
717719
- [`27d5d30`](https://github.com/stdlib-js/stdlib/commit/27d5d30af2380909aa925ce955fb7a4b79d5df43) - **style:** fix EditorConfig lint errors [(#9510)](https://github.com/stdlib-js/stdlib/pull/9510) _(by kaushal-kumar-it)_
718720
- [`8289a03`](https://github.com/stdlib-js/stdlib/commit/8289a036ebd5f568c35541a480ccdc341ba706af) - **bench:** refactor to use dynamic memory allocation in `math/strided/special/strunc` [(#9481)](https://github.com/stdlib-js/stdlib/pull/9481) _(by kshitijgarg2811-oss, Athan Reines)_

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Copyright (c) 2016-2025 The Stdlib Authors.
1+
Copyright (c) 2016-2026 The Stdlib Authors.

base/special/fast/atanhf/README.md

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
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+
# atanhf
22+
23+
> Compute the [hyperbolic arctangent][inverse-hyperbolic] of a single‐precision floating-point number.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var atanhf = require( '@stdlib/math/base/special/fast/atanhf' );
31+
```
32+
33+
#### atanhf( x )
34+
35+
Computes the [hyperbolic arctangent][inverse-hyperbolic] of a single‐precision floating-point `number` (in radians).
36+
37+
```javascript
38+
var v = atanhf( 0.0 );
39+
// returns 0.0
40+
41+
v = atanhf( -0.0 );
42+
// returns -0.0
43+
44+
v = atanhf( 0.5 );
45+
// returns ~0.549
46+
47+
v = atanhf( 0.9 );
48+
// returns ~1.472
49+
50+
v = atanhf( 1.0 );
51+
// returns Infinity
52+
53+
v = atanhf( -1.0 );
54+
// returns -Infinity
55+
```
56+
57+
The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`.
58+
59+
```javascript
60+
var v = atanhf( -3.14 );
61+
// returns NaN
62+
```
63+
64+
</section>
65+
66+
<!-- /.usage -->
67+
68+
<section class="notes">
69+
70+
## Notes
71+
72+
- For small `x`, the function will underflow.
73+
74+
```javascript
75+
var v = atanhf( 1.0e-17 );
76+
// returns 0.0
77+
// (expected 1.0e-17)
78+
```
79+
80+
</section>
81+
82+
<!-- /.notes -->
83+
84+
<section class="examples">
85+
86+
## Examples
87+
88+
<!-- eslint no-undef: "error" -->
89+
90+
```javascript
91+
var uniform = require( '@stdlib/random/array/uniform' );
92+
var logEachMap = require( '@stdlib/console/log-each-map' );
93+
var atanhf = require( '@stdlib/math/base/special/fast/atanhf' );
94+
95+
var opts = {
96+
'dtype': 'float32'
97+
};
98+
var x = uniform( 103, -1.0, 1.0, opts );
99+
100+
logEachMap( 'atanhf(%0.4f) = %0.4f', x, atanhf );
101+
```
102+
103+
</section>
104+
105+
<!-- /.examples -->
106+
107+
<!-- C interface documentation. -->
108+
109+
* * *
110+
111+
<section class="c">
112+
113+
## C APIs
114+
115+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
116+
117+
<section class="intro">
118+
119+
</section>
120+
121+
<!-- /.intro -->
122+
123+
<!-- C usage documentation. -->
124+
125+
<section class="usage">
126+
127+
### Usage
128+
129+
```c
130+
#include "stdlib/math/base/special/fast/atanhf.h"
131+
```
132+
133+
#### stdlib_base_fast_atanhf( x )
134+
135+
Computes the [hyperbolic arctangent][inverse-hyperbolic] of a single-precision floating-point number (in radians).
136+
137+
```c
138+
float out = stdlib_base_fast_atanhf( 0.0f );
139+
// returns 0.0f
140+
141+
out = stdlib_base_fast_atanhf( -0.0f );
142+
// returns -0.0f
143+
```
144+
145+
The function accepts the following arguments:
146+
147+
- **x**: `[in] float` input value.
148+
149+
```c
150+
float stdlib_base_fast_atanhf( const float x );
151+
```
152+
153+
</section>
154+
155+
<!-- /.usage -->
156+
157+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
158+
159+
<section class="notes">
160+
161+
</section>
162+
163+
<!-- /.notes -->
164+
165+
<!-- C API usage examples. -->
166+
167+
<section class="examples">
168+
169+
### Examples
170+
171+
```c
172+
#include "stdlib/math/base/special/fast/atanhf.h"
173+
#include <stdio.h>
174+
175+
int main( void ) {
176+
const float x[] = { -1.0f, -0.78f, -0.56f, -0.33f, -0.11f, 0.11f, 0.33f, 0.56f, 0.78f, 1.0f };
177+
178+
float v;
179+
int i;
180+
for ( i = 0; i < 10; i++ ) {
181+
v = stdlib_base_fast_atanhf( x[ i ] );
182+
printf( "atanh(%f) = %f\n", x[ i ], v );
183+
}
184+
}
185+
```
186+
187+
</section>
188+
189+
<!-- /.examples -->
190+
191+
</section>
192+
193+
<!-- /.c -->
194+
195+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
196+
197+
<section class="related">
198+
199+
200+
</section>
201+
202+
<!-- /.related -->
203+
204+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
205+
206+
<section class="links">
207+
208+
[inverse-hyperbolic]: https://en.wikipedia.org/wiki/Inverse_hyperbolic_function
209+
210+
<!-- <related-links> -->
211+
212+
<!-- </related-links> -->
213+
214+
</section>
215+
216+
<!-- /.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( './../../../../../base/assert/is-nanf' );
26+
var pkg = require( './../package.json' ).name;
27+
var atanhf = 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.0, 1.0, {
38+
'dtype': 'float32'
39+
});
40+
41+
b.tic();
42+
for ( i = 0; i < b.iterations; i++ ) {
43+
y = atanhf( 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( './../../../../../base/assert/is-nanf' );
27+
var format = require( '@stdlib/string/format' );
28+
var tryRequire = require( '@stdlib/utils/try-require' );
29+
var pkg = require( './../package.json' ).name;
30+
31+
32+
// VARIABLES //
33+
34+
var atanhf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
35+
var opts = {
36+
'skip': ( atanhf 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.0, 1.0, {
48+
'dtype': 'float32'
49+
});
50+
51+
b.tic();
52+
for ( i = 0; i < b.iterations; i++ ) {
53+
y = atanhf( 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)