Rate This Document
Findability
Accuracy
Completeness
Readability

j1

Compute the Bessel function of the first kind, of order 1.

Interface Definition

C interface:

float j1f(float x);

double j1(double x);

Parameters

Parameter

Type

Description

Input/Output

x

  • For j1f, x is of single-precision floating-point type.
  • For j1, x is of double-precision floating-point type.

Floating-point value of the input data

Input

Return Value

  • The order-1 first-kind Bessel function value y is returned (y ∈ (–1, +1)). The function is an odd function.
  • If the input x is +0, the return value is +0.
  • If the input x is –0, the return value is –0.
  • If the input x is ±∞, the return value is 0.
  • If the input x is NaN, the return value is NaN.

Dependencies

C: "km.h"

Examples

C interface:

    double x1 = 0.0, x2 = -0.0, x3 = 1.5, x4 = -2.5;
    // special handing
    double a = INFINITY, b = -INFINITY, c = NAN;
    // print result
    printf("j1(0.0) = %.15f\n", j1(x1));
    printf("j1(-0.0) = %.15f\n", j1(x2));
    printf("j1(1.5) = %.15f\n", j1(x3));
    printf("j1(-2.5) = %.15f\n", j1(x4));
    printf("j1(INFINITY) = %.15f\n", j1(a));
    printf("j1(-INFINITY) = %.15f\n", j1(b));
    printf("j1(NAN) = %.15f\n", j1(c));

    /* 
     * j1(0.0) = 0.000000000000000
     * j1(-0.0) = -0.000000000000000
     * j1(1.5) = 0.557936507910100
     * j1(-2.5) = -0.497094102464274
     * j1(INFINITY) = 0.000000000000000
     * j1(-INFINITY) = 0.000000000000000
     * j1(NAN) = nan
     * 
     * */