Skip to content

Commit 99ca5dc

Browse files
committed
feat: main js files added
1 parent a0e54ec commit 99ca5dc

File tree

3 files changed

+170
-0
lines changed

3 files changed

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

0 commit comments

Comments
 (0)