@stdlib/math-base-special-ahaversinf 0.1.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 ADDED
@@ -0,0 +1,177 @@
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
package/NOTICE ADDED
@@ -0,0 +1 @@
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
package/README.md ADDED
@@ -0,0 +1,307 @@
1
+ <!--
2
+
3
+ @license Apache-2.0
4
+
5
+ Copyright (c) 2024 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
+ # ahaversinf
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 [inverse half-value versed sine][archaversine] of a single-precision floating-point number.
37
+
38
+ <section class="intro">
39
+
40
+ The [inverse half-value versed sine][archaversine] is defined as
41
+
42
+ <!-- <equation class="equation" label="eq:archaversine" align="center" raw="\operatorname{ahaversin}(\theta) = 2 \cdot \arcsin(\sqrt{\theta})" alt="Inverse half-value versed sine."> -->
43
+
44
+ <div class="equation" align="center" data-raw-text="\operatorname{ahaversin}(\theta) = 2 \cdot \arcsin(\sqrt{\theta})" data-equation="eq:archaversine">
45
+ <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/ahaversin/docs/img/equation_archaversine.svg" alt="Inverse half-value versed sine.">
46
+ <br>
47
+ </div>
48
+
49
+ <!-- </equation> -->
50
+
51
+ </section>
52
+
53
+ <!-- /.intro -->
54
+
55
+ <section class="installation">
56
+
57
+ ## Installation
58
+
59
+ ```bash
60
+ npm install @stdlib/math-base-special-ahaversinf
61
+ ```
62
+
63
+ </section>
64
+
65
+ <section class="usage">
66
+
67
+ ## Usage
68
+
69
+ ```javascript
70
+ var ahaversinf = require( '@stdlib/math-base-special-ahaversinf' );
71
+ ```
72
+
73
+ #### ahaversinf( x )
74
+
75
+ Computes the [inverse half-value versed sine][archaversine] of a single-precision floating-point number.
76
+
77
+ ```javascript
78
+ var v = ahaversinf( 0.0 );
79
+ // returns 0.0
80
+
81
+ v = ahaversinf( 1.0 );
82
+ // returns ~3.1416
83
+
84
+ v = ahaversinf( 0.5 );
85
+ // returns ~1.5708
86
+ ```
87
+
88
+ If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`.
89
+
90
+ ```javascript
91
+ var v = ahaversinf( 1.5 );
92
+ // returns NaN
93
+
94
+ v = ahaversinf( -3.14 );
95
+ // returns NaN
96
+
97
+ v = ahaversinf( NaN );
98
+ // returns NaN
99
+ ```
100
+
101
+ </section>
102
+
103
+ <!-- /.usage -->
104
+
105
+ <section class="examples">
106
+
107
+ ## Examples
108
+
109
+ <!-- eslint no-undef: "error" -->
110
+
111
+ ```javascript
112
+ var uniform = require( '@stdlib/random-array-uniform' );
113
+ var logEachMap = require( '@stdlib/console-log-each-map' );
114
+ var ahaversinf = require( '@stdlib/math-base-special-ahaversinf' );
115
+
116
+ var x = uniform( 100, 0.0, 1.0, {
117
+ 'dtype': 'float32'
118
+ });
119
+
120
+ logEachMap( 'ahaversinf(%0.4f) = %0.4f', x, ahaversinf );
121
+ ```
122
+
123
+ </section>
124
+
125
+ <!-- /.examples -->
126
+
127
+ <!-- C interface documentation. -->
128
+
129
+ * * *
130
+
131
+ <section class="c">
132
+
133
+ ## C APIs
134
+
135
+ <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
136
+
137
+ <section class="intro">
138
+
139
+ </section>
140
+
141
+ <!-- /.intro -->
142
+
143
+ <!-- C usage documentation. -->
144
+
145
+ <section class="usage">
146
+
147
+ ### Usage
148
+
149
+ ```c
150
+ #include "stdlib/math/base/special/ahaversinf.h"
151
+ ```
152
+
153
+ #### stdlib_base_ahaversinf( x )
154
+
155
+ Computes the [inverse half-value versed sine][archaversine] of a single-precision floating-point number (in radians).
156
+
157
+ ```c
158
+ float out = stdlib_base_ahaversinf( 0.0f );
159
+ // returns 0.0f
160
+ ```
161
+
162
+ If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`.
163
+
164
+ ```c
165
+ float out = stdlib_base_ahaversinf( -3.14f );
166
+ // returns NaN
167
+ ```
168
+
169
+ The function accepts the following arguments:
170
+
171
+ - **x**: `[in] float` input value.
172
+
173
+ ```c
174
+ float stdlib_base_ahaversinf( const float x );
175
+ ```
176
+
177
+ </section>
178
+
179
+ <!-- /.usage -->
180
+
181
+ <!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
182
+
183
+ <section class="notes">
184
+
185
+ </section>
186
+
187
+ <!-- /.notes -->
188
+
189
+ <!-- C API usage examples. -->
190
+
191
+ <section class="examples">
192
+
193
+ ### Examples
194
+
195
+ ```c
196
+ #include "stdlib/math/base/special/ahaversinf.h"
197
+ #include <stdio.h>
198
+
199
+ int main( void ) {
200
+ const float x[] = { -2.0f, -1.6f, -1.2f, -0.8f, -0.4f, 0.4f, 0.8f, 1.2f, 1.6f, 2.0f };
201
+
202
+ float v;
203
+ int i;
204
+ for ( i = 0; i < 10; i++ ) {
205
+ v = stdlib_base_ahaversinf( x[ i ] );
206
+ printf( "ahaversin(%f) = %f\n", x[ i ], v );
207
+ }
208
+ }
209
+ ```
210
+
211
+ </section>
212
+
213
+ <!-- /.examples -->
214
+
215
+ </section>
216
+
217
+ <!-- /.c -->
218
+
219
+ <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
220
+
221
+ <section class="related">
222
+
223
+ </section>
224
+
225
+ <!-- /.related -->
226
+
227
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
228
+
229
+
230
+ <section class="main-repo" >
231
+
232
+ * * *
233
+
234
+ ## Notice
235
+
236
+ 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.
237
+
238
+ 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].
239
+
240
+ #### Community
241
+
242
+ [![Chat][chat-image]][chat-url]
243
+
244
+ ---
245
+
246
+ ## License
247
+
248
+ See [LICENSE][stdlib-license].
249
+
250
+
251
+ ## Copyright
252
+
253
+ Copyright &copy; 2016-2026. The Stdlib [Authors][stdlib-authors].
254
+
255
+ </section>
256
+
257
+ <!-- /.stdlib -->
258
+
259
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
260
+
261
+ <section class="links">
262
+
263
+ [npm-image]: http://img.shields.io/npm/v/@stdlib/math-base-special-ahaversinf.svg
264
+ [npm-url]: https://npmjs.org/package/@stdlib/math-base-special-ahaversinf
265
+
266
+ [test-image]: https://github.com/stdlib-js/math-base-special-ahaversinf/actions/workflows/test.yml/badge.svg?branch=v0.1.0
267
+ [test-url]: https://github.com/stdlib-js/math-base-special-ahaversinf/actions/workflows/test.yml?query=branch:v0.1.0
268
+
269
+ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-special-ahaversinf/main.svg
270
+ [coverage-url]: https://codecov.io/github/stdlib-js/math-base-special-ahaversinf?branch=main
271
+
272
+ <!--
273
+
274
+ [dependencies-image]: https://img.shields.io/david/stdlib-js/math-base-special-ahaversinf.svg
275
+ [dependencies-url]: https://david-dm.org/stdlib-js/math-base-special-ahaversinf/main
276
+
277
+ -->
278
+
279
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
280
+ [chat-url]: https://stdlib.zulipchat.com
281
+
282
+ [stdlib]: https://github.com/stdlib-js/stdlib
283
+
284
+ [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
285
+
286
+ [umd]: https://github.com/umdjs/umd
287
+ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
288
+
289
+ [deno-url]: https://github.com/stdlib-js/math-base-special-ahaversinf/tree/deno
290
+ [deno-readme]: https://github.com/stdlib-js/math-base-special-ahaversinf/blob/deno/README.md
291
+ [umd-url]: https://github.com/stdlib-js/math-base-special-ahaversinf/tree/umd
292
+ [umd-readme]: https://github.com/stdlib-js/math-base-special-ahaversinf/blob/umd/README.md
293
+ [esm-url]: https://github.com/stdlib-js/math-base-special-ahaversinf/tree/esm
294
+ [esm-readme]: https://github.com/stdlib-js/math-base-special-ahaversinf/blob/esm/README.md
295
+ [branches-url]: https://github.com/stdlib-js/math-base-special-ahaversinf/blob/main/branches.md
296
+
297
+ [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/math-base-special-ahaversinf/main/LICENSE
298
+
299
+ [archaversine]: https://en.wikipedia.org/wiki/Versine
300
+
301
+ <!-- <related-links> -->
302
+
303
+ <!-- </related-links> -->
304
+
305
+ </section>
306
+
307
+ <!-- /.links -->
package/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ > Policy for reporting security vulnerabilities.
4
+
5
+ See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import ahaversinf from '../docs/types/index';
3
+ export = ahaversinf;
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";var i=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var a=i(function(v,t){
2
+ var s=require('@stdlib/math-base-special-asinf/dist'),u=require('@stdlib/math-base-special-sqrtf/dist'),n=require('@stdlib/number-float64-base-to-float32/dist');function o(e){return n(2*s(u(e)))}t.exports=o
3
+ });var f=a();module.exports=f;
4
+ /** @license Apache-2.0 */
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/main.js", "../lib/index.js"],
4
+ "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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// MODULES //\n\nvar asinf = require( '@stdlib/math-base-special-asinf' );\nvar sqrtf = require( '@stdlib/math-base-special-sqrtf' );\nvar float64ToFloat32 = require( '@stdlib/number-float64-base-to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the inverse half-value versed sine of a single-precision floating-point number.\n*\n* @param {number} x - input value\n* @returns {number} inverse half-value versed sine\n*\n* @example\n* var v = ahaversinf( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = ahaversinf( 1.0 );\n* // returns ~3.1416\n*\n* @example\n* var v = ahaversinf( 0.5 );\n* // returns ~1.5708\n*\n* @example\n* var v = ahaversinf( NaN );\n* // returns NaN\n*/\nfunction ahaversinf( x ) {\n\treturn float64ToFloat32( 2.0 * asinf( sqrtf( x ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ahaversinf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 inverse half-value versed sine of a single-precision floating-point number.\n*\n* @module @stdlib/math-base-special-ahaversinf\n*\n* @example\n* var ahaversinf = require( '@stdlib/math-base-special-ahaversinf' );\n*\n* var v = ahaversinf( 0.0 );\n* // returns 0.0\n*\n* v = ahaversinf( 1.0 );\n* // returns ~3.1416\n*\n* v = ahaversinf( 0.5 );\n* // returns ~1.5708\n*\n* v = ahaversinf( NaN );\n* // returns NaN\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,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EACnDC,EAAQ,QAAS,iCAAkC,EACnDC,EAAmB,QAAS,wCAAyC,EA2BzE,SAASC,EAAYC,EAAI,CACxB,OAAOF,EAAkB,EAAMF,EAAOC,EAAOG,CAAE,CAAE,CAAE,CACpD,CAKAL,EAAO,QAAUI,ICfjB,IAAIE,EAAO,IAKX,OAAO,QAAUA",
6
+ "names": ["require_main", "__commonJSMin", "exports", "module", "asinf", "sqrtf", "float64ToFloat32", "ahaversinf", "x", "main"]
7
+ }
@@ -0,0 +1,53 @@
1
+ <svg xmlns:xlink="http://www.w3.org/1999/xlink" width="29.282ex" height="3.176ex" style="vertical-align: -0.838ex;" viewBox="0 -1006.6 12607.5 1367.4" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" aria-labelledby="MathJax-SVG-1-Title">
2
+ <title id="MathJax-SVG-1-Title">a h a v e r s i n left-parenthesis theta right-parenthesis equals 2 dot arc sine left-parenthesis StartRoot theta EndRoot right-parenthesis</title>
3
+ <defs aria-hidden="true">
4
+ <path stroke-width="1" id="E1-MJMAIN-61" d="M137 305T115 305T78 320T63 359Q63 394 97 421T218 448Q291 448 336 416T396 340Q401 326 401 309T402 194V124Q402 76 407 58T428 40Q443 40 448 56T453 109V145H493V106Q492 66 490 59Q481 29 455 12T400 -6T353 12T329 54V58L327 55Q325 52 322 49T314 40T302 29T287 17T269 6T247 -2T221 -8T190 -11Q130 -11 82 20T34 107Q34 128 41 147T68 188T116 225T194 253T304 268H318V290Q318 324 312 340Q290 411 215 411Q197 411 181 410T156 406T148 403Q170 388 170 359Q170 334 154 320ZM126 106Q126 75 150 51T209 26Q247 26 276 49T315 109Q317 116 318 175Q318 233 317 233Q309 233 296 232T251 223T193 203T147 166T126 106Z"></path>
5
+ <path stroke-width="1" id="E1-MJMAIN-68" d="M41 46H55Q94 46 102 60V68Q102 77 102 91T102 124T102 167T103 217T103 272T103 329Q103 366 103 407T103 482T102 542T102 586T102 603Q99 622 88 628T43 637H25V660Q25 683 27 683L37 684Q47 685 66 686T103 688Q120 689 140 690T170 693T181 694H184V367Q244 442 328 442Q451 442 463 329Q464 322 464 190V104Q464 66 466 59T477 49Q498 46 526 46H542V0H534L510 1Q487 2 460 2T422 3Q319 3 310 0H302V46H318Q379 46 379 62Q380 64 380 200Q379 335 378 343Q372 371 358 385T334 402T308 404Q263 404 229 370Q202 343 195 315T187 232V168V108Q187 78 188 68T191 55T200 49Q221 46 249 46H265V0H257L234 1Q210 2 183 2T145 3Q42 3 33 0H25V46H41Z"></path>
6
+ <path stroke-width="1" id="E1-MJMAIN-76" d="M338 431Q344 429 422 429Q479 429 503 431H508V385H497Q439 381 423 345Q421 341 356 172T288 -2Q283 -11 263 -11Q244 -11 239 -2Q99 359 98 364Q93 378 82 381T43 385H19V431H25L33 430Q41 430 53 430T79 430T104 429T122 428Q217 428 232 431H240V385H226Q187 384 184 370Q184 366 235 234L286 102L377 341V349Q377 363 367 372T349 383T335 385H331V431H338Z"></path>
7
+ <path stroke-width="1" id="E1-MJMAIN-65" d="M28 218Q28 273 48 318T98 391T163 433T229 448Q282 448 320 430T378 380T406 316T415 245Q415 238 408 231H126V216Q126 68 226 36Q246 30 270 30Q312 30 342 62Q359 79 369 104L379 128Q382 131 395 131H398Q415 131 415 121Q415 117 412 108Q393 53 349 21T250 -11Q155 -11 92 58T28 218ZM333 275Q322 403 238 411H236Q228 411 220 410T195 402T166 381T143 340T127 274V267H333V275Z"></path>
8
+ <path stroke-width="1" id="E1-MJMAIN-72" d="M36 46H50Q89 46 97 60V68Q97 77 97 91T98 122T98 161T98 203Q98 234 98 269T98 328L97 351Q94 370 83 376T38 385H20V408Q20 431 22 431L32 432Q42 433 60 434T96 436Q112 437 131 438T160 441T171 442H174V373Q213 441 271 441H277Q322 441 343 419T364 373Q364 352 351 337T313 322Q288 322 276 338T263 372Q263 381 265 388T270 400T273 405Q271 407 250 401Q234 393 226 386Q179 341 179 207V154Q179 141 179 127T179 101T180 81T180 66V61Q181 59 183 57T188 54T193 51T200 49T207 48T216 47T225 47T235 46T245 46H276V0H267Q249 3 140 3Q37 3 28 0H20V46H36Z"></path>
9
+ <path stroke-width="1" id="E1-MJMAIN-73" d="M295 316Q295 356 268 385T190 414Q154 414 128 401Q98 382 98 349Q97 344 98 336T114 312T157 287Q175 282 201 278T245 269T277 256Q294 248 310 236T342 195T359 133Q359 71 321 31T198 -10H190Q138 -10 94 26L86 19L77 10Q71 4 65 -1L54 -11H46H42Q39 -11 33 -5V74V132Q33 153 35 157T45 162H54Q66 162 70 158T75 146T82 119T101 77Q136 26 198 26Q295 26 295 104Q295 133 277 151Q257 175 194 187T111 210Q75 227 54 256T33 318Q33 357 50 384T93 424T143 442T187 447H198Q238 447 268 432L283 424L292 431Q302 440 314 448H322H326Q329 448 335 442V310L329 304H301Q295 310 295 316Z"></path>
10
+ <path stroke-width="1" id="E1-MJMAIN-69" d="M69 609Q69 637 87 653T131 669Q154 667 171 652T188 609Q188 579 171 564T129 549Q104 549 87 564T69 609ZM247 0Q232 3 143 3Q132 3 106 3T56 1L34 0H26V46H42Q70 46 91 49Q100 53 102 60T104 102V205V293Q104 345 102 359T88 378Q74 385 41 385H30V408Q30 431 32 431L42 432Q52 433 70 434T106 436Q123 437 142 438T171 441T182 442H185V62Q190 52 197 50T232 46H255V0H247Z"></path>
11
+ <path stroke-width="1" id="E1-MJMAIN-6E" d="M41 46H55Q94 46 102 60V68Q102 77 102 91T102 122T103 161T103 203Q103 234 103 269T102 328V351Q99 370 88 376T43 385H25V408Q25 431 27 431L37 432Q47 433 65 434T102 436Q119 437 138 438T167 441T178 442H181V402Q181 364 182 364T187 369T199 384T218 402T247 421T285 437Q305 442 336 442Q450 438 463 329Q464 322 464 190V104Q464 66 466 59T477 49Q498 46 526 46H542V0H534L510 1Q487 2 460 2T422 3Q319 3 310 0H302V46H318Q379 46 379 62Q380 64 380 200Q379 335 378 343Q372 371 358 385T334 402T308 404Q263 404 229 370Q202 343 195 315T187 232V168V108Q187 78 188 68T191 55T200 49Q221 46 249 46H265V0H257L234 1Q210 2 183 2T145 3Q42 3 33 0H25V46H41Z"></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-3B8" d="M35 200Q35 302 74 415T180 610T319 704Q320 704 327 704T339 705Q393 701 423 656Q462 596 462 495Q462 380 417 261T302 66T168 -10H161Q125 -10 99 10T60 63T41 130T35 200ZM383 566Q383 668 330 668Q294 668 260 623T204 521T170 421T157 371Q206 370 254 370L351 371Q352 372 359 404T375 484T383 566ZM113 132Q113 26 166 26Q181 26 198 36T239 74T287 161T335 307L340 324H145Q145 321 136 286T120 208T113 132Z"></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
+ <path stroke-width="1" id="E1-MJMAIN-3D" d="M56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153Z"></path>
16
+ <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>
17
+ <path stroke-width="1" id="E1-MJMAIN-22C5" d="M78 250Q78 274 95 292T138 310Q162 310 180 294T199 251Q199 226 182 208T139 190T96 207T78 250Z"></path>
18
+ <path stroke-width="1" id="E1-MJMAIN-63" d="M370 305T349 305T313 320T297 358Q297 381 312 396Q317 401 317 402T307 404Q281 408 258 408Q209 408 178 376Q131 329 131 219Q131 137 162 90Q203 29 272 29Q313 29 338 55T374 117Q376 125 379 127T395 129H409Q415 123 415 120Q415 116 411 104T395 71T366 33T318 2T249 -11Q163 -11 99 53T34 214Q34 318 99 383T250 448T370 421T404 357Q404 334 387 320Z"></path>
19
+ <path stroke-width="1" id="E1-MJMAIN-221A" d="M95 178Q89 178 81 186T72 200T103 230T169 280T207 309Q209 311 212 311H213Q219 311 227 294T281 177Q300 134 312 108L397 -77Q398 -77 501 136T707 565T814 786Q820 800 834 800Q841 800 846 794T853 782V776L620 293L385 -193Q381 -200 366 -200Q357 -200 354 -197Q352 -195 256 15L160 225L144 214Q129 202 113 190T95 178Z"></path>
20
+ </defs>
21
+ <g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)" aria-hidden="true">
22
+ <use xlink:href="#E1-MJMAIN-61"></use>
23
+ <use xlink:href="#E1-MJMAIN-68" x="500" y="0"></use>
24
+ <use xlink:href="#E1-MJMAIN-61" x="1057" y="0"></use>
25
+ <use xlink:href="#E1-MJMAIN-76" x="1557" y="0"></use>
26
+ <use xlink:href="#E1-MJMAIN-65" x="2086" y="0"></use>
27
+ <use xlink:href="#E1-MJMAIN-72" x="2530" y="0"></use>
28
+ <use xlink:href="#E1-MJMAIN-73" x="2923" y="0"></use>
29
+ <use xlink:href="#E1-MJMAIN-69" x="3317" y="0"></use>
30
+ <use xlink:href="#E1-MJMAIN-6E" x="3596" y="0"></use>
31
+ <use xlink:href="#E1-MJMAIN-28" x="4152" y="0"></use>
32
+ <use xlink:href="#E1-MJMATHI-3B8" x="4542" y="0"></use>
33
+ <use xlink:href="#E1-MJMAIN-29" x="5011" y="0"></use>
34
+ <use xlink:href="#E1-MJMAIN-3D" x="5678" y="0"></use>
35
+ <use xlink:href="#E1-MJMAIN-32" x="6735" y="0"></use>
36
+ <use xlink:href="#E1-MJMAIN-22C5" x="7457" y="0"></use>
37
+ <g transform="translate(7958,0)">
38
+ <use xlink:href="#E1-MJMAIN-61"></use>
39
+ <use xlink:href="#E1-MJMAIN-72" x="500" y="0"></use>
40
+ <use xlink:href="#E1-MJMAIN-63" x="893" y="0"></use>
41
+ <use xlink:href="#E1-MJMAIN-73" x="1337" y="0"></use>
42
+ <use xlink:href="#E1-MJMAIN-69" x="1732" y="0"></use>
43
+ <use xlink:href="#E1-MJMAIN-6E" x="2010" y="0"></use>
44
+ </g>
45
+ <use xlink:href="#E1-MJMAIN-28" x="10525" y="0"></use>
46
+ <g transform="translate(10915,0)">
47
+ <use xlink:href="#E1-MJMAIN-221A" x="0" y="23"></use>
48
+ <rect stroke="none" width="469" height="60" x="833" y="764"></rect>
49
+ <use xlink:href="#E1-MJMATHI-3B8" x="833" y="0"></use>
50
+ </g>
51
+ <use xlink:href="#E1-MJMAIN-29" x="12218" y="0"></use>
52
+ </g>
53
+ </svg>
@@ -0,0 +1,48 @@
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
+ // TypeScript Version: 4.1
20
+
21
+ /**
22
+ * Computes the inverse half-value versed sine of a single-precision floating-point number.
23
+ *
24
+ * @param x - input value
25
+ * @returns inverse half-value versed sine
26
+ *
27
+ * @example
28
+ * var v = ahaversinf( 0.0 );
29
+ * // returns 0.0
30
+ *
31
+ * @example
32
+ * var v = ahaversinf( 1.0 );
33
+ * // returns ~3.1416
34
+ *
35
+ * @example
36
+ * var v = ahaversinf( 0.5 );
37
+ * // returns ~1.5708
38
+ *
39
+ * @example
40
+ * var v = ahaversinf( NaN );
41
+ * // returns NaN
42
+ */
43
+ declare function ahaversinf( x: number ): number;
44
+
45
+
46
+ // EXPORTS //
47
+
48
+ export = ahaversinf;
@@ -0,0 +1,38 @@
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
+ #ifndef STDLIB_MATH_BASE_SPECIAL_AHAVERSINF_H
20
+ #define STDLIB_MATH_BASE_SPECIAL_AHAVERSINF_H
21
+
22
+ /*
23
+ * If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
24
+ */
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ /**
30
+ * Computes the inverse half-value versed sine of a single-precision floating-point number.
31
+ */
32
+ float stdlib_base_ahaversinf( const float x );
33
+
34
+ #ifdef __cplusplus
35
+ }
36
+ #endif
37
+
38
+ #endif // !STDLIB_MATH_BASE_SPECIAL_AHAVERSINF_H
package/lib/index.js ADDED
@@ -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;
package/lib/main.js ADDED
@@ -0,0 +1,59 @@
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
+ var float64ToFloat32 = require( '@stdlib/number-float64-base-to-float32' );
26
+
27
+
28
+ // MAIN //
29
+
30
+ /**
31
+ * Computes the inverse half-value versed sine of a single-precision floating-point number.
32
+ *
33
+ * @param {number} x - input value
34
+ * @returns {number} inverse half-value versed sine
35
+ *
36
+ * @example
37
+ * var v = ahaversinf( 0.0 );
38
+ * // returns 0.0
39
+ *
40
+ * @example
41
+ * var v = ahaversinf( 1.0 );
42
+ * // returns ~3.1416
43
+ *
44
+ * @example
45
+ * var v = ahaversinf( 0.5 );
46
+ * // returns ~1.5708
47
+ *
48
+ * @example
49
+ * var v = ahaversinf( NaN );
50
+ * // returns NaN
51
+ */
52
+ function ahaversinf( x ) {
53
+ return float64ToFloat32( 2.0 * asinf( sqrtf( x ) ) );
54
+ }
55
+
56
+
57
+ // EXPORTS //
58
+
59
+ module.exports = ahaversinf;
package/lib/native.js ADDED
@@ -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;
package/manifest.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "options": {
3
+ "task": "build"
4
+ },
5
+ "fields": [
6
+ {
7
+ "field": "src",
8
+ "resolve": true,
9
+ "relative": true
10
+ },
11
+ {
12
+ "field": "include",
13
+ "resolve": true,
14
+ "relative": true
15
+ },
16
+ {
17
+ "field": "libraries",
18
+ "resolve": false,
19
+ "relative": false
20
+ },
21
+ {
22
+ "field": "libpath",
23
+ "resolve": true,
24
+ "relative": false
25
+ }
26
+ ],
27
+ "confs": [
28
+ {
29
+ "task": "build",
30
+ "src": [
31
+ "./src/main.c"
32
+ ],
33
+ "include": [
34
+ "./include"
35
+ ],
36
+ "libraries": [],
37
+ "libpath": [],
38
+ "dependencies": [
39
+ "@stdlib/math-base-napi-unary",
40
+ "@stdlib/math-base-special-asinf",
41
+ "@stdlib/math-base-special-sqrtf"
42
+ ]
43
+ },
44
+ {
45
+ "task": "benchmark",
46
+ "src": [
47
+ "./src/main.c"
48
+ ],
49
+ "include": [
50
+ "./include"
51
+ ],
52
+ "libraries": [],
53
+ "libpath": [],
54
+ "dependencies": [
55
+ "@stdlib/math-base-special-asinf",
56
+ "@stdlib/math-base-special-sqrtf"
57
+ ]
58
+ },
59
+ {
60
+ "task": "examples",
61
+ "src": [
62
+ "./src/main.c"
63
+ ],
64
+ "include": [
65
+ "./include"
66
+ ],
67
+ "libraries": [],
68
+ "libpath": [],
69
+ "dependencies": [
70
+ "@stdlib/math-base-special-asinf",
71
+ "@stdlib/math-base-special-sqrtf"
72
+ ]
73
+ }
74
+ ]
75
+ }
package/package.json ADDED
@@ -0,0 +1,92 @@
1
+ {
2
+ "name": "@stdlib/math-base-special-ahaversinf",
3
+ "version": "0.1.0",
4
+ "description": "Compute the inverse half-value versed sine of a single-precision floating-point number.",
5
+ "license": "Apache-2.0",
6
+ "author": {
7
+ "name": "The Stdlib Authors",
8
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
9
+ },
10
+ "contributors": [
11
+ {
12
+ "name": "The Stdlib Authors",
13
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
14
+ }
15
+ ],
16
+ "main": "./lib",
17
+ "gypfile": false,
18
+ "directories": {
19
+ "doc": "./docs",
20
+ "include": "./include",
21
+ "lib": "./lib",
22
+ "src": "./src",
23
+ "dist": "./dist"
24
+ },
25
+ "types": "./docs/types",
26
+ "scripts": {},
27
+ "homepage": "https://stdlib.io",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git://github.com/stdlib-js/math-base-special-ahaversinf.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/stdlib-js/stdlib/issues"
34
+ },
35
+ "dependencies": {
36
+ "@stdlib/math-base-napi-unary": "^0.2.5",
37
+ "@stdlib/math-base-special-asinf": "^0.1.1",
38
+ "@stdlib/math-base-special-sqrtf": "^0.2.2",
39
+ "@stdlib/number-float64-base-to-float32": "^0.2.2",
40
+ "@stdlib/utils-library-manifest": "^0.2.3"
41
+ },
42
+ "devDependencies": {},
43
+ "engines": {
44
+ "node": ">=0.10.0",
45
+ "npm": ">2.7.0"
46
+ },
47
+ "os": [
48
+ "aix",
49
+ "darwin",
50
+ "freebsd",
51
+ "linux",
52
+ "macos",
53
+ "openbsd",
54
+ "sunos",
55
+ "win32",
56
+ "windows"
57
+ ],
58
+ "keywords": [
59
+ "stdlib",
60
+ "stdmath",
61
+ "mathematics",
62
+ "math",
63
+ "ahaversin",
64
+ "ahaversine",
65
+ "arcversin",
66
+ "arcversine",
67
+ "versed sine",
68
+ "ahaversinus",
69
+ "haversine",
70
+ "haversin",
71
+ "archav",
72
+ "invhav",
73
+ "ahav",
74
+ "ahvs",
75
+ "ahv",
76
+ "hav",
77
+ "arc",
78
+ "versed",
79
+ "half-value",
80
+ "sine",
81
+ "sin",
82
+ "asin",
83
+ "trig",
84
+ "trigonometry",
85
+ "radians",
86
+ "angle"
87
+ ],
88
+ "funding": {
89
+ "type": "opencollective",
90
+ "url": "https://opencollective.com/stdlib"
91
+ }
92
+ }
package/src/addon.c ADDED
@@ -0,0 +1,22 @@
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
+ #include "stdlib/math/base/special/ahaversinf.h"
20
+ #include "stdlib/math/base/napi/unary.h"
21
+
22
+ STDLIB_MATH_BASE_NAPI_MODULE_F_F( stdlib_base_ahaversinf )
package/src/main.c ADDED
@@ -0,0 +1,35 @@
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
+ #include "stdlib/math/base/special/ahaversinf.h"
20
+ #include "stdlib/math/base/special/asinf.h"
21
+ #include "stdlib/math/base/special/sqrtf.h"
22
+
23
+ /**
24
+ * Computes the inverse half value versed sine of a single-precision floating-point number.
25
+ *
26
+ * @param x input value
27
+ * @return output value
28
+ *
29
+ * @example
30
+ * double out = stdlib_base_ahaversin( 0.0f );
31
+ * // returns 0.0f
32
+ */
33
+ float stdlib_base_ahaversinf( const float x ) {
34
+ return 2.0f * stdlib_base_asinf( stdlib_base_sqrtf( x ) );
35
+ }