Format
#include <math.h> double _j0(double x); double _j1(double x); double _jn(int n, double x); double _y0(double x); double _y1(double x); double _yn(int n, double x);
Language Level: Extension
Bessel functions solve certain types of differential equations.
The _j0, _j1, and _jn functions are Bessel functions of the first
kind for orders 0, 1, and n, respectively.
The _y0, _y1, and _yn functions are Bessel functions of the second kind for orders 0, 1, and n, respectively. The argument x must be positive. The argument n should be greater than or equal to zero. If n is less than zero, it will be a negative exponent.
Return Value
For _j0, _j1, _y0, or _y1, if the absolute value of x
is too large, the function sets errno to ERANGE, and returns 0.
For _y0, _y1, or _yn, if x is negative, the function
sets errno to EDOM and returns the value -HUGE_VAL. For _y0, _y1,
or _yn, if x causes an overflow, the function sets
errno to ERANGE and returns the value -HUGE_VAL.
Example
This example computes y to be the order 0 Bessel
function of the first kind for x, and z to
be the order 3 Bessel function of the second kind for x.
#include <stdio.h> #include <math.h>
int main(void)
{
double x,y,z;
x = 4.27;
y = _j0(x); /* y = -0.3660 is the order 0 bessel */
/* function of the first kind for x */
printf("_j0( 4.27 ) = %5.4f\n", y);
z = _yn(3, x); /* z = -0.0875 is the order 3 bessel */
/* function of the second kind for x */
printf("_yn( 3,4.27 ) = %5.4f\n", z);
return 0;
}
/*********************************************************
The output should be:
_j0( 4.27 ) = -0.3660
_yn( 3,4.27 ) = -0.0875
*********************************************************/
}
![]()
erf - erfc -- Calculate Error Functions
gamma -- Gamma Function
<math.h>