Skip to content

feat: add math/base/special/asinf #1950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
37bab21
feat: add math/base/special/asinf
gunjjoshi Mar 18, 2024
90510c7
Update main.js
gunjjoshi Mar 18, 2024
e5797ac
Delete lib/node_modules/@stdlib/math/base/special/asinf/lib/rational_…
gunjjoshi Mar 18, 2024
154e4eb
Update main.js
gunjjoshi Mar 19, 2024
ba409af
Update test.js
gunjjoshi Mar 19, 2024
c96d04c
Update test.js
gunjjoshi Mar 19, 2024
db4d0dc
Update main.js
gunjjoshi Mar 19, 2024
2cb3ae5
Update main.js
gunjjoshi Mar 19, 2024
5533295
Update main.js
gunjjoshi Mar 19, 2024
96daccb
Update README.md
gunjjoshi Mar 19, 2024
eda132b
Merge branch 'develop' into asinf
gunjjoshi Mar 19, 2024
cc034d2
feat: add math/base/special/asinf
gunjjoshi Mar 20, 2024
4b02fbb
feat: add math/base/special/asinf
gunjjoshi Mar 20, 2024
a319e63
feat: add C implementation for math/base/special/asinf
gunjjoshi Mar 20, 2024
c5fb8f2
Update lib/node_modules/@stdlib/math/base/special/asinf/scripts/evalp…
Planeshifter Mar 21, 2024
425398d
Update lib/node_modules/@stdlib/math/base/special/asinf/scripts/evalp…
gunjjoshi Mar 21, 2024
bc5907a
feat: add C implementation for math/base/special/asinf
gunjjoshi Mar 21, 2024
cebe6b3
refactor: used float as dtype instead of double in evalpoly.js for copts
gunjjoshi Mar 21, 2024
c3175fd
Update main.c
gunjjoshi Mar 21, 2024
c40a3f1
Update main.c
gunjjoshi Mar 21, 2024
4a4a373
Update lib/node_modules/@stdlib/math/base/special/asinf/README.md
gunjjoshi Mar 22, 2024
c781c61
Update lib/node_modules/@stdlib/math/base/special/asinf/README.md
gunjjoshi Mar 22, 2024
f0e4826
Update lib/node_modules/@stdlib/math/base/special/asinf/benchmark/ben…
gunjjoshi Mar 22, 2024
d689fb2
Update lib/node_modules/@stdlib/math/base/special/asinf/benchmark/c/n…
gunjjoshi Mar 22, 2024
c265920
Update lib/node_modules/@stdlib/math/base/special/asinf/benchmark/c/n…
gunjjoshi Mar 22, 2024
f7bdd51
Update lib/node_modules/@stdlib/math/base/special/asinf/benchmark/c/n…
gunjjoshi Mar 22, 2024
1b6ab9c
Update lib/node_modules/@stdlib/math/base/special/asinf/benchmark/c/n…
gunjjoshi Mar 22, 2024
75e8980
Update lib/node_modules/@stdlib/math/base/special/asinf/examples/c/ex…
gunjjoshi Mar 22, 2024
c0e7cfd
Update lib/node_modules/@stdlib/math/base/special/asinf/lib/native.js
gunjjoshi Mar 22, 2024
606e05f
Update lib/node_modules/@stdlib/math/base/special/asinf/package.json
gunjjoshi Mar 22, 2024
2be10e3
refactor: improved js implementation
gunjjoshi Mar 22, 2024
606d847
refactor: modified test.native.js
gunjjoshi Mar 22, 2024
d0c239c
refactor: modified test.native.js
gunjjoshi Mar 22, 2024
56e7104
refactor: modified script, main.c regenerated
gunjjoshi Mar 24, 2024
1ce9f68
refactor: modified script, poly_p.js regenerated
gunjjoshi Mar 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .github/workflows/namespace_exports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ name: namespace_exports

# Workflow triggers:
on:
pull_request_target:
branches:
- develop
types:
- closed

# Allow the workflow to be manually run:
workflow_dispatch:

Expand Down
3 changes: 0 additions & 3 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ Matt Cochrane <[email protected]> <[email protected]>

Mihir Pandit <[email protected]> MSP20086

Muhammad Haris <[email protected]> <[email protected]>
Muhammad Haris <[email protected]> headlessNode

# N

Naresh Jagadeesan <[email protected]> <[email protected]>
Expand Down
70 changes: 14 additions & 56 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,7 @@ Create a [GitHub account][github-signup]. The project uses GitHub exclusively fo
$ git clone https://github.com/<username>/stdlib.git
```

where `<username>` is your GitHub username. When cloning, avoid cloning to a directory having spaces in its path. Because this project relies heavily on `make`, any spaces in the directory path will lead to errors and inevitable frustration.

```text
// Bad:
/home/foo/bar/beep boop/stdlib

// Good:
/home/foo/bar/beep_boop/stdlib
```

The repository has a large commit history, leading to slow download times. You can reduce the download time by limiting the clone [depth][git-clone-depth].
where `<username>` is your GitHub username. The repository has a large commit history, leading to slow download times. You can reduce the download time by limiting the clone [depth][git-clone-depth].

<!-- run-disable -->

Expand Down Expand Up @@ -162,27 +152,7 @@ And finally, add an `upstream` [remote][git-remotes] to allow syncing changes be
$ git remote add upstream git://github.com/stdlib-js/stdlib.git
```

#### Step 2: Initial Setup

Install dependencies.

<!-- run-disable -->

```bash
$ make install
```

Initialize Git hooks to enable automated development processes to run prior to authoring commits and pushing changes.

<!-- run-disable -->

```bash
$ make init
```

Note that `make init` only needs to be run once; however, we repeat it below as **not** running it is a common omission by new contributors.

#### Step 3: Branch
#### Step 2: Branch

For modifications intended to be included in stdlib, create a new local branch.

Expand All @@ -194,11 +164,11 @@ $ git checkout -b <branch>

where `<branch>` is the branch name. Both the `master` and `develop` branches for the main stdlib project are protected, and direct modifications to these branches will **not** be accepted. Instead, all contributions should be made on non-master and non-develop local branches, including documentation changes and other non-code modifications. See the project [branching guide][stdlib-branching] for additional guidance.

#### Step 4: Write
#### Step 3: Write

Start making your changes and/or implementing the new feature. Any text you write should follow the [text style guide][stdlib-style-guides-text], including comments and API documentation.

#### Step 5: Commit
#### Step 4: Commit

Ensure that you have configured [Git][git] to know your name and email address.

Expand All @@ -220,7 +190,7 @@ $ git commit

When writing commit messages, follow the Git [style guide][stdlib-style-guides-git]. Adherence to project commit conventions is necessary for project automation which automatically generates release notes and changelogs from commit messages.

#### Step 6: Sync
#### Step 5: Sync

To incorporate recent changes from the `upstream` repository during development, you should [rebase][git-rebase] your local branch, reapplying your local commits on top of the current upstream `HEAD`. This procedure is in contrast to performing a standard [merge][git-merge], which may interleave development histories. The rationale is twofold:

Expand All @@ -236,13 +206,11 @@ $ git fetch upstream
$ git rebase upstream/develop
```

#### Step 7: Test
#### Step 6: Test

Tests should accompany **all** bug fixes and features. For guidance on how to write tests, consult existing tests within the project.

**Before** submitting a [pull request][github-pull-request] to the `upstream` repository, ensure that all tests pass, including linting. To run tests locally, consult the guidance [below](#writing-tests).

If [Git][git] hooks have been enabled,
**Before** submitting a [pull request][github-pull-request] to the `upstream` repository, ensure that all tests pass, including linting. If [Git][git] hooks have been enabled,

<!-- run-disable -->

Expand All @@ -254,7 +222,7 @@ linting should be automatically triggered prior to each commit, and test executi

Any [pull requests][github-pull-request] which include failing tests and/or lint errors will **not** be accepted.

#### Step 8: Push
#### Step 7: Push

Push your changes to your remote GitHub repository.

Expand All @@ -266,7 +234,7 @@ $ git push origin <branch>

where `<branch>` is the name of your branch.

#### Step 9: Pull Request
#### Step 8: Pull Request

Once your contribution is ready to be incorporated in the `upstream` repository, open a [pull request][github-pull-request] against the `develop` branch. One or more project contributors will review the contribution, provide feedback, and potentially request changes.

Expand Down Expand Up @@ -312,13 +280,13 @@ $ git commit -m "fixup! feat: add support for computing the absolute value"

If the history needs modification, a contributor will modify the history during the merge process. The rationale for **not** rewriting public history is that doing so invalidates the commit history for anyone else who has pulled your changes, thus imposing additional burdens on collaborators to ensure that their local versions match the modified history.

#### Step 10: Land
#### Step 9: Land

After any changes have been resolved and continuous integration tests have passed, a contributor will approve a [pull request][github-pull-request] for inclusion in the project. Once merged, the [pull request][github-pull-request] will be updated with the merge commit, and the [pull request][github-pull-request] will be closed.

Note that, during the merge process, multiple commits will often be [squashed][git-rewriting-history].

#### Step 11: Celebrate
#### Step 10: Celebrate

**Congratulations**! You are an official contributor to stdlib! Thank you for your hard work and patience!

Expand Down Expand Up @@ -348,15 +316,15 @@ The project can **never** have enough tests. To address areas lacking sufficient
<!-- run-disable -->

```bash
$ make TESTS_FILTER=".*/<pattern>/.*" test
$ make TESTS_FILTER=.*/<pattern>/.* test
```

where `<pattern>` is a pattern matching a particular path. For example, to test the base math `sin` package

<!-- run-disable -->

```bash
$ make TESTS_FILTER=".*/math/base/special/sin/.*" test
$ make TESTS_FILTER=.*/math/base/special/sin/.* test
```

where the pattern `.*/math/base/special/sin/.*` matches any test file whose absolute path contains `math/base/special/sin`.
Expand All @@ -366,24 +334,14 @@ The project can **never** have enough tests. To address areas lacking sufficient
<!-- run-disable -->

```bash
$ make TESTS_FILTER=".*/<pattern>/.*" test-cov
$ make TESTS_FILTER=.*/<pattern>/.* test-cov
$ make view-cov
```

which opens the coverage report in your default web browser.

7. Submit the test as a [pull request][github-pull-request].

Note that, for contributions targeting C implementations, you'll need to first compile the native add-on which provides the bridge between JavaScript and C (assuming that the package has a native add-on binding).

```bash
$ make install-node-addons NODE_ADDONS_PATTERN="math/base/special/sin"
```

where the pattern `math/base/special/sin` (note the differences from the filter pattern above!) matches any add-on whose absolute path contains `math/base/special/sin`.

Once the add-on is compiled, you can follow steps 5-7 above.

### Writing Documentation

> By contributing documentation to the project, you are agreeing to release it under the project [license][stdlib-license].
Expand Down
6 changes: 0 additions & 6 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ Aman Bhansali <[email protected]>
Amit Jimiwal <[email protected]>
Anudeep Sanapala <[email protected]>
Athan Reines <[email protected]>
Ayaka <[email protected]>
Brendan Graetz <[email protected]>
Bruno Fenzl <[email protected]>
Bryan Elee <[email protected]>
Chinmay Joshi <[email protected]>
Christopher Dambamuromo <[email protected]>
Dan Rose <[email protected]>
Expand Down Expand Up @@ -43,7 +41,6 @@ Matt Cochrane <[email protected]>
Mihir Pandit <[email protected]>
Milan Raj <[email protected]>
Momtchil Momtchev <[email protected]>
Muhammad Haris <[email protected]>
Naresh Jagadeesan <[email protected]>
Nithin Katta <[email protected]>
Ognjen Jevremović <[email protected]>
Expand All @@ -69,13 +66,10 @@ Shubham Mishra <[email protected]>
Snehil Shah <[email protected]>
Spandan Barve <[email protected]>
Stephannie Jiménez Gacha <[email protected]>
Suraj kumar <[email protected]>
Tirtadwipa Manunggal <[email protected]>
Utkarsh <http://[email protected]>
Utkarsh Raj <[email protected]>
Varad Gupta <[email protected]>
Yernar Yergaziyev <[email protected]>
naveen <[email protected]>
nishant-s7 <[email protected]>
orimiles5 <[email protected]>
rei2hu <[email protected]>
25 changes: 0 additions & 25 deletions lib/node_modules/@stdlib/array/mostly-safe-casts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,6 @@ for ( i = 0; i < DTYPES.length; i++ ) {

<section class="related">

* * *

## See Also

- <span class="package-name">[`@stdlib/array/convert`][@stdlib/array/convert]</span><span class="delimiter">: </span><span class="description">convert an array to an array of a different data type.</span>
- <span class="package-name">[`@stdlib/array/convert-same`][@stdlib/array/convert-same]</span><span class="delimiter">: </span><span class="description">convert an array to the same data type as a second input array.</span>
- <span class="package-name">[`@stdlib/array/dtypes`][@stdlib/array/dtypes]</span><span class="delimiter">: </span><span class="description">list of array data types.</span>
- <span class="package-name">[`@stdlib/array/safe-casts`][@stdlib/array/safe-casts]</span><span class="delimiter">: </span><span class="description">return a list of array data types to which a provided array data type can be safely cast.</span>
- <span class="package-name">[`@stdlib/array/same-kind-casts`][@stdlib/array/same-kind-casts]</span><span class="delimiter">: </span><span class="description">return a list of array data types to which a provided array data type can be safely cast or cast within the same kind.</span>
- <span class="package-name">[`@stdlib/ndarray/mostly-safe-casts`][@stdlib/ndarray/mostly-safe-casts]</span><span class="delimiter">: </span><span class="description">return a list of ndarray data types to which a provided ndarray data type can be safely cast and, for floating-point data types, can be downcast.</span>

</section>

<!-- /.related -->
Expand All @@ -142,20 +131,6 @@ for ( i = 0; i < DTYPES.length; i++ ) {

[@stdlib/array/dtypes]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/dtypes

<!-- <related-links> -->

[@stdlib/array/convert]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/convert

[@stdlib/array/convert-same]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/convert-same

[@stdlib/array/safe-casts]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/safe-casts

[@stdlib/array/same-kind-casts]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/same-kind-casts

[@stdlib/ndarray/mostly-safe-casts]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/mostly-safe-casts

<!-- </related-links> -->

</section>

<!-- /.links -->
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ bool = isNonNegativeInteger( null );
## See Also

- <span class="package-name">[`@stdlib/assert/is-integer`][@stdlib/assert/is-integer]</span><span class="delimiter">: </span><span class="description">test if a value is a number having an integer value.</span>
- <span class="package-name">[`@stdlib/assert/is-nonnegative-number`][@stdlib/assert/is-nonnegative-number]</span><span class="delimiter">: </span><span class="description">test if a value is a number having a nonnegative value.</span>
- <span class="package-name">[`@stdlib/assert/is-number`][@stdlib/assert/is-number]</span><span class="delimiter">: </span><span class="description">test if a value is a number.</span>

</section>

Expand All @@ -153,10 +151,6 @@ bool = isNonNegativeInteger( null );

[@stdlib/assert/is-integer]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-integer

[@stdlib/assert/is-nonnegative-number]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-nonnegative-number

[@stdlib/assert/is-number]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-number

<!-- </related-links> -->

</section>
Expand Down
40 changes: 30 additions & 10 deletions lib/node_modules/@stdlib/blas/ext/base/dapx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var dapx = require( '@stdlib/blas/ext/base/dapx' );

#### dapx( N, alpha, x, stride )

Adds a constant `alpha` to each element in a double-precision floating-point strided array.
Adds a constant `alpha` to each element in a double-precision floating-point strided array `x`.

```javascript
var Float64Array = require( '@stdlib/array/float64' );
Expand All @@ -50,36 +50,40 @@ The function has the following parameters:
- **x**: input [`Float64Array`][@stdlib/array/float64].
- **stride**: index increment.

The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to add a constant to every other element
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to add a constant to every other element

```javascript
var Float64Array = require( '@stdlib/array/float64' );
var floor = require( '@stdlib/math/base/special/floor' );

var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
var N = floor( x.length / 2 );

dapx( 4, 5.0, x, 2 );
dapx( N, 5.0, x, 2 );
// x => <Float64Array>[ 3.0, 1.0, 8.0, -5.0, 9.0, 0.0, 4.0, -3.0 ]
```

Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.

```javascript
var Float64Array = require( '@stdlib/array/float64' );
var floor = require( '@stdlib/math/base/special/floor' );

// Initial array...
var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );

// Create an offset view...
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
var N = floor( x0.length/2 );

// Add a constant to every other element...
dapx( 3, 5.0, x1, 2 );
dapx( N, 5.0, x1, 2 );
// x0 => <Float64Array>[ 1.0, 3.0, 3.0, 1.0, 5.0, -1.0 ]
```

#### dapx.ndarray( N, alpha, x, stride, offset )

Adds a constant `alpha` to each element in a double-precision floating-point strided array using alternative indexing semantics.
Adds a constant `alpha` to each element in a double-precision floating-point strided array `x` using alternative indexing semantics.

```javascript
var Float64Array = require( '@stdlib/array/float64' );
Expand All @@ -94,7 +98,7 @@ The function has the following additional parameters:

- **offset**: starting index.

While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x`

```javascript
var Float64Array = require( '@stdlib/array/float64' );
Expand All @@ -113,7 +117,7 @@ dapx.ndarray( 3, 5.0, x, 1, x.length-3 );

## Notes

- If `N <= 0`, both functions return the strided array unchanged.
- If `N <= 0`, both functions return `x` unchanged.

</section>

Expand All @@ -126,11 +130,27 @@ dapx.ndarray( 3, 5.0, x, 1, x.length-3 );
<!-- eslint no-undef: "error" -->

```javascript
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
var filledarrayBy = require( '@stdlib/array/filled-by' );
var round = require( '@stdlib/math/base/special/round' );
var randu = require( '@stdlib/random/base/randu' );
var Float64Array = require( '@stdlib/array/float64' );
var dapx = require( '@stdlib/blas/ext/base/dapx' );

var x = filledarrayBy( 10, 'float64', discreteUniform( -100, 100 ) );
var rand;
var sign;
var x;
var i;

x = new Float64Array( 10 );
for ( i = 0; i < x.length; i++ ) {
rand = round( randu()*100.0 );
sign = randu();
if ( sign < 0.5 ) {
sign = -1.0;
} else {
sign = 1.0;
}
x[ i ] = sign * rand;
}
console.log( x );

dapx( x.length, 5.0, x, 1 );
Expand Down
Loading
Loading