Standards / Extensions | C or C++ | Dependencies |
---|---|---|
SAA |
both |
#include <math.h>
double y0(double x);
double y1(double x);
double yn(int n, double x);
Bessel functions are solutions to certain types of differential equations.
If successful, the function returns the calculated value.
For y0(), y1(), or yn(), if x is negative, the function sets errno to EDOM and returns -HUGE_VAL.
For y0(), y1(), or yn(), if x causes overflow, the function sets errno to ERANGE and returns -HUGE_VAL.
Special behavior for IEEE: If x is negative, y0(), y1(), and yn() return the value NaNQ. If x is 0, y0(), y1(), and yn() return the value -HUGE_VAL. In all cases, errno remains unchanged.
⁄* CELEBY01
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 <math.h>
#include <stdio.h>
int main(void)
{
double x, y, z;
x = 4.27;
y = y0(x); ⁄* y = -0.3660 is the order 0 bessel *⁄
⁄* function of the first kind for x *⁄
z = yn(3,x); ⁄* z = -0.0875 is the order 3 bessel *⁄
⁄* function of the second kind for x *⁄
printf("x = %f\n y = %f\n z = %f\n", x, y, z);
}