Skip to content

Commit

Permalink
docs: update function name for C implementation from j0 to besselj0
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjjoshi committed Aug 11, 2024
1 parent e42b976 commit 6d951c2
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
14 changes: 7 additions & 7 deletions lib/node_modules/@stdlib/math/base/special/besselj0/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/j0.h"
#include "stdlib/math/base/special/besselj0.h"
```

#### stdlib_base_j0( x )
#### stdlib_base_besselj0( x )

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

```c
double out = stdlib_base_j0( 0.0 );
double out = stdlib_base_besselj0( 0.0 );
// returns 1.0

out = stdlib_base_j0( 1.0 );
out = stdlib_base_besselj0( 1.0 );
// returns ~0.765
```

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

```c
double stdlib_base_j0( const double x );
double stdlib_base_besselj0( const double x );
```
</section>
Expand All @@ -164,7 +164,7 @@ double stdlib_base_j0( const double x );
### Examples
```c
#include "stdlib/math/base/special/j0.h"
#include "stdlib/math/base/special/besselj0.h"
#include <stdio.h>
int main( void ) {
Expand All @@ -173,7 +173,7 @@ int main( void ) {
double y;
int i;
for ( i = 0; i < 5; i++ ) {
y = stdlib_base_j0( x[ i ] );
y = stdlib_base_besselj0( x[ i ] );
printf( "besselj0(%lf) = %lf\n", x[ i ], y );
}
}
Expand Down
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/j0.h"
#include "stdlib/math/base/special/besselj0.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_j0( x );
y = stdlib_base_besselj0( x );
if ( y != y ) {
printf( "should not return NaN\n" );
break;
Expand Down
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/j0.h"
#include "stdlib/math/base/special/besselj0.h"
#include <stdio.h>

int main( void ) {
Expand All @@ -25,7 +25,7 @@ int main( void ) {
double y;
int i;
for ( i = 0; i < 5; i++ ) {
y = stdlib_base_j0( x[ i ] );
y = stdlib_base_besselj0( x[ i ] );
printf( "besselj0(%lf) = %lf\n", x[ i ], y );
}
}
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_J0_H
#define STDLIB_MATH_BASE_SPECIAL_J0_H
#ifndef STDLIB_MATH_BASE_SPECIAL_BESSELJ0_H
#define STDLIB_MATH_BASE_SPECIAL_BESSELJ0_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 zero.
*/
double stdlib_base_j0( const double x );
double stdlib_base_besselj0( const double x );

#ifdef __cplusplus
}
#endif

#endif // !STDLIB_MATH_BASE_SPECIAL_J0_H
#endif // !STDLIB_MATH_BASE_SPECIAL_BESSELJ0_H
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/j0.h"
#include "stdlib/math/base/special/besselj0.h"
#include "stdlib/math/base/napi/unary.h"

STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_j0 )
STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_besselj0 )
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* ```
*/

#include "stdlib/math/base/special/j0.h"
#include "stdlib/math/base/special/besselj0.h"
#include "stdlib/math/base/special/sqrt.h"
#include "stdlib/math/base/special/sincos.h"
#include "stdlib/constants/float64/pinf.h"
Expand Down Expand Up @@ -217,10 +217,10 @@ static double rational_psqs( const double x ) {
* @return evaluated Bessel function
*
* @example
* double y = stdlib_base_j0( 0.0 );
* double y = stdlib_base_besselj0( 0.0 );
* // returns 1.0
*/
double stdlib_base_j0( const double x ) {
double stdlib_base_besselj0( const double x ) {
double rc;
double rs;
double y2;
Expand Down

0 comments on commit 6d951c2

Please sign in to comment.