besselJ1¶
Evaluates the real Bessel function of the first kind of order one \(J_1(x)\).
Synopsis¶
besselJ1 (x)
Required Arguments¶
- float
x
(Input) - Point at which the Bessel function is to be evaluated.
Return Value¶
The value of the Bessel function
\[J_1(x) = \frac{1}{\pi} \int_0^{\pi} \cos (x \sin \theta - \theta) d \theta\]
If no solution can be computed, NaN is returned.
Description¶
Because the Bessel function \(J_1(x)\) is oscillatory, its computation becomes inaccurate as \(|x|\) increases.
Example¶
The Bessel function \(J_1(1.5)\) is evaluated.
from __future__ import print_function
from numpy import *
from pyimsl.math.besselJ1 import besselJ1
x = 1.5
ans = besselJ1(x)
print("J1(%f) = %f" % (x, ans))
Output¶
J1(1.500000) = 0.557937
Alert Errors¶
IMSL_SMALL_ABS_ARG_UNDERFLOW |
To prevent \(J_1(x)\) from underflowing, either x must be zero, or \(|x|>2s\) where s is the smallest representable positive number. |
Warning Errors¶
IMSL_LARGE_ABS_ARG_WARN |
\(|x|\) should be less than \(1/\sqrt{\varepsilon}\) where ɛ is the machine precision to prevent the answer from being less accurate than half precision. |
Fatal Errors¶
IMSL_LARGE_ABS_ARG_FATAL |
\(|x|\) should be less than \(1/\varepsilon\) where ɛ is the machine precision for the answer to have any precision. |