Skip to content

Commit

Permalink
docs: update function name from j1 to besselj1
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjjoshi committed Aug 11, 2024
1 parent 7a4424b commit bae6126
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions lib/node_modules/@stdlib/math/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
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
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
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 )
Original file line number Diff line number Diff line change
Expand Up @@ -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 bae6126

Please sign in to comment.