Skip to content

Commit 644c1fc

Browse files
committed
feat: basic js files added
1 parent ad22cba commit 644c1fc

File tree

3 files changed

+169
-0
lines changed

3 files changed

+169
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 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+
/**
22+
* Compute the inverse half-value versed sine of a single-precision floating-point number.
23+
*
24+
* @module @stdlib/math/base/special/ahaversinf
25+
*
26+
* @example
27+
* var ahaversinf = require( '@stdlib/math/base/special/ahaversinf' );
28+
*
29+
* var v = ahaversinf( 0.0 );
30+
* // returns 0.0
31+
*
32+
* v = ahaversinf( 1.0 );
33+
* // returns ~3.1416
34+
*
35+
* v = ahaversinf( 0.5 );
36+
* // returns ~1.5708
37+
*
38+
* v = ahaversinf( NaN );
39+
* // returns NaN
40+
*/
41+
42+
// MODULES //
43+
44+
var main = require( './main.js' );
45+
46+
47+
// EXPORTS //
48+
49+
module.exports = main;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 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 asinf = require( '@stdlib/math/base/special/asinf' );
24+
var sqrtf = require( '@stdlib/math/base/special/sqrtf' );
25+
26+
27+
// MAIN //
28+
29+
/**
30+
* Computes the inverse half-value versed sine of a single-precision floating-point number.
31+
*
32+
* @param {number} x - input value
33+
* @returns {number} inverse half-value versed sine
34+
*
35+
* @example
36+
* var v = ahaversinf( 0.0 );
37+
* // returns 0.0
38+
*
39+
* @example
40+
* var v = ahaversinf( 1.0 );
41+
* // returns ~3.1416
42+
*
43+
* @example
44+
* var v = ahaversinf( 0.5 );
45+
* // returns ~1.5708
46+
*
47+
* @example
48+
* var v = ahaversinf( NaN );
49+
* // returns NaN
50+
*/
51+
function ahaversinf( x ) {
52+
return 2.0 * asinf( sqrtf( x ) );
53+
}
54+
55+
56+
// EXPORTS //
57+
58+
module.exports = ahaversinf;
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 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 addon = require( './../src/addon.node' );
24+
25+
26+
// MAIN //
27+
28+
/**
29+
* Computes the inverse half-value versed sine of a single-precision floating-point number.
30+
*
31+
* @private
32+
* @param {number} x - input value
33+
* @returns {number} inverse half-value versed sine (in radians)
34+
*
35+
* @example
36+
* var v = ahaversinf( 0.0 );
37+
* // returns 0.0
38+
*
39+
* @example
40+
* var v = ahaversinf( 1.0 );
41+
* // returns ~3.1416
42+
*
43+
* @example
44+
* var v = ahaversinf( 0.5 );
45+
* // returns ~1.5708
46+
*
47+
* @example
48+
* var v = ahaversinf( -1.0 );
49+
* // returns NaN
50+
*
51+
* @example
52+
* var v = ahaversinf( NaN );
53+
* // returns NaN
54+
*/
55+
function ahaversinf( x ) {
56+
return addon( x );
57+
}
58+
59+
60+
// EXPORTS //
61+
62+
module.exports = ahaversinf;

0 commit comments

Comments
 (0)