Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Aug 12, 2024
1 parent 27289b8 commit 61f6435
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 25 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

## Unreleased (2024-08-11)
## Unreleased (2024-08-12)

<section class="packages">

Expand Down Expand Up @@ -1909,12 +1909,25 @@ This release closes the following issue:

##### Features

- [`0ae49fb`](https://github.com/stdlib-js/stdlib/commit/0ae49fba6e79599a4b8b1be464a7570a3c7f6d83) - fix function name and update docs [(#2777)](https://github.com/stdlib-js/stdlib/pull/2777)
- [`18bd1b5`](https://github.com/stdlib-js/stdlib/commit/18bd1b5ace1a7dbd9d26bb66c1a1f0aa91573416) - add C implementation for `math/base/special/besselj1`

</section>

<!-- /.features -->

<section class="breaking-changes">

##### BREAKING CHANGES

- [`0ae49fb`](https://github.com/stdlib-js/stdlib/commit/0ae49fba6e79599a4b8b1be464a7570a3c7f6d83): update C API name

- This commit changes the name of the C API from `stdlib_base_j1` to `stdlib_base_besselj1`. This ensures that the C function name more closely matches the global namespace name and helps protect against future naming collisions. To migrate, users should update their call signatures accordingly.

</section>

<!-- /.breaking-changes -->

</details>

</section>
Expand Down Expand Up @@ -5829,6 +5842,10 @@ This release closes the following issue:

### BREAKING CHANGES

- [`0ae49fb`](https://github.com/stdlib-js/stdlib/commit/0ae49fba6e79599a4b8b1be464a7570a3c7f6d83): update C API name

- This commit changes the name of the C API from `stdlib_base_j1` to `stdlib_base_besselj1`. This ensures that the C function name more closely matches the global namespace name and helps protect against future naming collisions. To migrate, users should update their call signatures accordingly.

- [`fce4265`](https://github.com/stdlib-js/stdlib/commit/fce42651903b96cc6a0f26e84afc812fa4ea94b3): The third argument 'b' in the JavaScript implementation of `truncsd` is now mandatory. To migrate, explicitly supply the old default value of `10` as the third argument.
- [`5df976a`](https://github.com/stdlib-js/stdlib/commit/5df976abacaaf3082890fa852e40edfdf1b79f4b): base parameter is no longer optional

Expand Down Expand Up @@ -5934,6 +5951,7 @@ A total of 24 people contributed to this release. Thank you to the following con

<details>

- [`0ae49fb`](https://github.com/stdlib-js/stdlib/commit/0ae49fba6e79599a4b8b1be464a7570a3c7f6d83) - **feat:** fix function name and update docs [(#2777)](https://github.com/stdlib-js/stdlib/pull/2777) _(by Gunj Joshi)_
- [`779b35c`](https://github.com/stdlib-js/stdlib/commit/779b35ca267629b2dadd9947ad2ba106b8095004) - **feat:** add C implementation for `math/base/special/besselj0` _(by Gunj Joshi, Philipp Burckhardt)_
- [`252286d`](https://github.com/stdlib-js/stdlib/commit/252286d5d3357112ff718f0e3dc5ae758836efd3) - **bench:** remove irrelevant benchmark, update `boost` link in `math/base/special/gamma-delta-ratio` _(by Gunj Joshi)_
- [`01126b1`](https://github.com/stdlib-js/stdlib/commit/01126b1a0519c87778b802efd352d3117028bb88) - **style:** compare `n` with `integer`, not a `double` in `math/base/special/binomcoefln` [(#2775)](https://github.com/stdlib-js/stdlib/pull/2775 ) _(by Gunj Joshi)_
Expand Down
16 changes: 8 additions & 8 deletions base/special/besselj1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ for ( i = 0; i < 100; i++ ) {
### Usage

```c
#include "stdlib/math/base/special/j1.h"
#include "stdlib/math/base/special/besselj1.h"
```

#### stdlib_base_j1( x )
#### stdlib_base_besselj1( x )

Computes the [Bessel function of the first kind][bessel-first-kind] of order one at `x`.

```c
double out = stdlib_base_j1( 0.0 );
double out = stdlib_base_besselj1( 0.0 );
// returns 0.0

out = stdlib_base_j1( 1.0 );
out = stdlib_base_besselj1( 1.0 );
// returns ~0.440
```

Expand All @@ -142,7 +142,7 @@ The function accepts the following arguments:
- **x**: `[in] double` input value.

```c
double stdlib_base_j1( const double x );
double stdlib_base_besselj1( const double x );
```
</section>
Expand All @@ -164,7 +164,7 @@ double stdlib_base_j1( const double x );
### Examples
```c
#include "stdlib/math/base/special/j1.h"
#include "stdlib/math/base/special/besselj1.h"
#include <stdio.h>
int main( void ) {
Expand All @@ -173,8 +173,8 @@ int main( void ) {
int i;
for ( i = 0; i < 7; i++ ) {
v = stdlib_base_j1( x[ i ] );
printf( "j1(%lf) = %lf\n", x[ i ], v );
v = stdlib_base_besselj1( x[ i ] );
printf( "besselj1(%lf) = %lf\n", x[ i ], v );
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions base/special/besselj1/benchmark/c/native/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

#include "stdlib/math/base/special/j1.h"
#include "stdlib/math/base/special/besselj1.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
Expand Down Expand Up @@ -99,7 +99,7 @@ static double benchmark( void ) {
t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
x = ( 100000.0 * rand_double() ) - 0.0;
y = stdlib_base_j1( x );
y = stdlib_base_besselj1( x );
if ( y != y ) {
printf( "should not return NaN\n" );
break;
Expand Down
6 changes: 3 additions & 3 deletions base/special/besselj1/examples/c/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

#include "stdlib/math/base/special/j1.h"
#include "stdlib/math/base/special/besselj1.h"
#include <stdio.h>

int main( void ) {
Expand All @@ -25,7 +25,7 @@ int main( void ) {
int i;

for ( i = 0; i < 7; i++ ) {
v = stdlib_base_j1( x[ i ] );
printf( "j1(%lf) = %lf\n", x[ i ], v );
v = stdlib_base_besselj1( x[ i ] );
printf( "besselj1(%lf) = %lf\n", x[ i ], v );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* limitations under the License.
*/

#ifndef STDLIB_MATH_BASE_SPECIAL_J1_H
#define STDLIB_MATH_BASE_SPECIAL_J1_H
#ifndef STDLIB_MATH_BASE_SPECIAL_BESSELJ1_H
#define STDLIB_MATH_BASE_SPECIAL_BESSELJ1_H

/*
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
Expand All @@ -29,10 +29,10 @@ extern "C" {
/**
* Computes the Bessel function of the first kind of order one.
*/
double stdlib_base_j1( const double x );
double stdlib_base_besselj1( const double x );

#ifdef __cplusplus
}
#endif

#endif // !STDLIB_MATH_BASE_SPECIAL_J1_H
#endif // !STDLIB_MATH_BASE_SPECIAL_BESSELJ1_H
2 changes: 1 addition & 1 deletion base/special/besselj1/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link https://github.com/boostorg/math/blob/develop/include/boost/math/special_functions/detail/bessel_j1.hpp}. The implementation has been modified for JavaScript.
* The original C++ code and copyright notice are from the [Boost library]{@link https://www.boost.org/doc/libs/1_85_0/boost/math/special_functions/detail/bessel_j1.hpp}. The implementation has been modified for JavaScript.
*
* ```text
* Copyright Xiaogang Zhang, 2006.
Expand Down
4 changes: 2 additions & 2 deletions base/special/besselj1/src/addon.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* limitations under the License.
*/

#include "stdlib/math/base/special/j1.h"
#include "stdlib/math/base/special/besselj1.h"
#include "stdlib/math/base/napi/unary.h"

// cppcheck-suppress shadowFunction
STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_j1 )
STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_besselj1 )
8 changes: 4 additions & 4 deletions base/special/besselj1/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link https://github.com/boostorg/math/blob/develop/include/boost/math/special_functions/detail/bessel_j1.hpp}. The implementation has been modified for use in stdlib.
* The original C++ code and copyright notice are from the [Boost library]{@link https://www.boost.org/doc/libs/1_85_0/boost/math/special_functions/detail/bessel_j1.hpp}. The implementation has been modified for use in stdlib.
*
* ```text
* Copyright Xiaogang Zhang, 2006.
Expand All @@ -29,7 +29,7 @@
* ```
*/

#include "stdlib/math/base/special/j1.h"
#include "stdlib/math/base/special/besselj1.h"
#include "stdlib/math/base/special/sqrt.h"
#include "stdlib/math/base/special/abs.h"
#include "stdlib/math/base/special/sincos.h"
Expand Down Expand Up @@ -222,10 +222,10 @@ static double rational_psqs( const double x ) {
* @return evaluated Bessel function
*
* @example
* double out = stdlib_base_j1( 1.0 );
* double out = stdlib_base_besselj1( 1.0 );
* // returns ~0.440
*/
double stdlib_base_j1( const double x ) {
double stdlib_base_besselj1( const double x ) {
double value;
double rc;
double rs;
Expand Down

0 comments on commit 61f6435

Please sign in to comment.