gsl_sf_bessel.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. /* specfunc/gsl_sf_bessel.h
  2. *
  3. * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. /* Author: G. Jungman */
  20. #ifndef __GSL_SF_BESSEL_H__
  21. #define __GSL_SF_BESSEL_H__
  22. #include <stdlib.h>
  23. #include "gsl_mode.h"
  24. #include "gsl_precision.h"
  25. #include "gsl_sf_result.h"
  26. #undef __BEGIN_DECLS
  27. #undef __END_DECLS
  28. #ifdef __cplusplus
  29. # define __BEGIN_DECLS extern "C" {
  30. # define __END_DECLS }
  31. #else
  32. # define __BEGIN_DECLS /* empty */
  33. # define __END_DECLS /* empty */
  34. #endif
  35. __BEGIN_DECLS
  36. /* Regular Bessel Function J_0(x)
  37. *
  38. * exceptions: none
  39. */
  40. int gsl_sf_bessel_J0_e(const double x, gsl_sf_result * result);
  41. double gsl_sf_bessel_J0(const double x);
  42. /* Regular Bessel Function J_1(x)
  43. *
  44. * exceptions: GSL_EUNDRFLW
  45. */
  46. int gsl_sf_bessel_J1_e(const double x, gsl_sf_result * result);
  47. double gsl_sf_bessel_J1(const double x);
  48. /* Regular Bessel Function J_n(x)
  49. *
  50. * exceptions: GSL_EUNDRFLW
  51. */
  52. int gsl_sf_bessel_Jn_e(int n, double x, gsl_sf_result * result);
  53. double gsl_sf_bessel_Jn(const int n, const double x);
  54. /* Regular Bessel Function J_n(x), nmin <= n <= nmax
  55. *
  56. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  57. */
  58. int gsl_sf_bessel_Jn_array(int nmin, int nmax, double x, double * result_array);
  59. /* Irregular Bessel function Y_0(x)
  60. *
  61. * x > 0.0
  62. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  63. */
  64. int gsl_sf_bessel_Y0_e(const double x, gsl_sf_result * result);
  65. double gsl_sf_bessel_Y0(const double x);
  66. /* Irregular Bessel function Y_1(x)
  67. *
  68. * x > 0.0
  69. * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
  70. */
  71. int gsl_sf_bessel_Y1_e(const double x, gsl_sf_result * result);
  72. double gsl_sf_bessel_Y1(const double x);
  73. /* Irregular Bessel function Y_n(x)
  74. *
  75. * x > 0.0
  76. * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
  77. */
  78. int gsl_sf_bessel_Yn_e(int n,const double x, gsl_sf_result * result);
  79. double gsl_sf_bessel_Yn(const int n,const double x);
  80. /* Irregular Bessel function Y_n(x), nmin <= n <= nmax
  81. *
  82. * x > 0.0
  83. * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
  84. */
  85. int gsl_sf_bessel_Yn_array(const int nmin, const int nmax, const double x, double * result_array);
  86. /* Regular modified Bessel function I_0(x)
  87. *
  88. * exceptions: GSL_EOVRFLW
  89. */
  90. int gsl_sf_bessel_I0_e(const double x, gsl_sf_result * result);
  91. double gsl_sf_bessel_I0(const double x);
  92. /* Regular modified Bessel function I_1(x)
  93. *
  94. * exceptions: GSL_EOVRFLW, GSL_EUNDRFLW
  95. */
  96. int gsl_sf_bessel_I1_e(const double x, gsl_sf_result * result);
  97. double gsl_sf_bessel_I1(const double x);
  98. /* Regular modified Bessel function I_n(x)
  99. *
  100. * exceptions: GSL_EOVRFLW, GSL_EUNDRFLW
  101. */
  102. int gsl_sf_bessel_In_e(const int n, const double x, gsl_sf_result * result);
  103. double gsl_sf_bessel_In(const int n, const double x);
  104. /* Regular modified Bessel function I_n(x) for n=nmin,...,nmax
  105. *
  106. * nmin >=0, nmax >= nmin
  107. * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
  108. */
  109. int gsl_sf_bessel_In_array(const int nmin, const int nmax, const double x, double * result_array);
  110. /* Scaled regular modified Bessel function
  111. * exp(-|x|) I_0(x)
  112. *
  113. * exceptions: none
  114. */
  115. int gsl_sf_bessel_I0_scaled_e(const double x, gsl_sf_result * result);
  116. double gsl_sf_bessel_I0_scaled(const double x);
  117. /* Scaled regular modified Bessel function
  118. * exp(-|x|) I_1(x)
  119. *
  120. * exceptions: GSL_EUNDRFLW
  121. */
  122. int gsl_sf_bessel_I1_scaled_e(const double x, gsl_sf_result * result);
  123. double gsl_sf_bessel_I1_scaled(const double x);
  124. /* Scaled regular modified Bessel function
  125. * exp(-|x|) I_n(x)
  126. *
  127. * exceptions: GSL_EUNDRFLW
  128. */
  129. int gsl_sf_bessel_In_scaled_e(int n, const double x, gsl_sf_result * result);
  130. double gsl_sf_bessel_In_scaled(const int n, const double x);
  131. /* Scaled regular modified Bessel function
  132. * exp(-|x|) I_n(x) for n=nmin,...,nmax
  133. *
  134. * nmin >=0, nmax >= nmin
  135. * exceptions: GSL_EUNDRFLW
  136. */
  137. int gsl_sf_bessel_In_scaled_array(const int nmin, const int nmax, const double x, double * result_array);
  138. /* Irregular modified Bessel function K_0(x)
  139. *
  140. * x > 0.0
  141. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  142. */
  143. int gsl_sf_bessel_K0_e(const double x, gsl_sf_result * result);
  144. double gsl_sf_bessel_K0(const double x);
  145. /* Irregular modified Bessel function K_1(x)
  146. *
  147. * x > 0.0
  148. * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
  149. */
  150. int gsl_sf_bessel_K1_e(const double x, gsl_sf_result * result);
  151. double gsl_sf_bessel_K1(const double x);
  152. /* Irregular modified Bessel function K_n(x)
  153. *
  154. * x > 0.0
  155. * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
  156. */
  157. int gsl_sf_bessel_Kn_e(const int n, const double x, gsl_sf_result * result);
  158. double gsl_sf_bessel_Kn(const int n, const double x);
  159. /* Irregular modified Bessel function K_n(x) for n=nmin,...,nmax
  160. *
  161. * x > 0.0, nmin >=0, nmax >= nmin
  162. * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
  163. */
  164. int gsl_sf_bessel_Kn_array(const int nmin, const int nmax, const double x, double * result_array);
  165. /* Scaled irregular modified Bessel function
  166. * exp(x) K_0(x)
  167. *
  168. * x > 0.0
  169. * exceptions: GSL_EDOM
  170. */
  171. int gsl_sf_bessel_K0_scaled_e(const double x, gsl_sf_result * result);
  172. double gsl_sf_bessel_K0_scaled(const double x);
  173. /* Scaled irregular modified Bessel function
  174. * exp(x) K_1(x)
  175. *
  176. * x > 0.0
  177. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  178. */
  179. int gsl_sf_bessel_K1_scaled_e(const double x, gsl_sf_result * result);
  180. double gsl_sf_bessel_K1_scaled(const double x);
  181. /* Scaled irregular modified Bessel function
  182. * exp(x) K_n(x)
  183. *
  184. * x > 0.0
  185. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  186. */
  187. int gsl_sf_bessel_Kn_scaled_e(int n, const double x, gsl_sf_result * result);
  188. double gsl_sf_bessel_Kn_scaled(const int n, const double x);
  189. /* Scaled irregular modified Bessel function exp(x) K_n(x) for n=nmin,...,nmax
  190. *
  191. * x > 0.0, nmin >=0, nmax >= nmin
  192. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  193. */
  194. int gsl_sf_bessel_Kn_scaled_array(const int nmin, const int nmax, const double x, double * result_array);
  195. /* Regular spherical Bessel function j_0(x) = sin(x)/x
  196. *
  197. * exceptions: none
  198. */
  199. int gsl_sf_bessel_j0_e(const double x, gsl_sf_result * result);
  200. double gsl_sf_bessel_j0(const double x);
  201. /* Regular spherical Bessel function j_1(x) = (sin(x)/x - cos(x))/x
  202. *
  203. * exceptions: GSL_EUNDRFLW
  204. */
  205. int gsl_sf_bessel_j1_e(const double x, gsl_sf_result * result);
  206. double gsl_sf_bessel_j1(const double x);
  207. /* Regular spherical Bessel function j_2(x) = ((3/x^2 - 1)sin(x) - 3cos(x)/x)/x
  208. *
  209. * exceptions: GSL_EUNDRFLW
  210. */
  211. int gsl_sf_bessel_j2_e(const double x, gsl_sf_result * result);
  212. double gsl_sf_bessel_j2(const double x);
  213. /* Regular spherical Bessel function j_l(x)
  214. *
  215. * l >= 0, x >= 0.0
  216. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  217. */
  218. int gsl_sf_bessel_jl_e(const int l, const double x, gsl_sf_result * result);
  219. double gsl_sf_bessel_jl(const int l, const double x);
  220. /* Regular spherical Bessel function j_l(x) for l=0,1,...,lmax
  221. *
  222. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  223. */
  224. int gsl_sf_bessel_jl_array(const int lmax, const double x, double * result_array);
  225. /* Regular spherical Bessel function j_l(x) for l=0,1,...,lmax
  226. * Uses Steed's method.
  227. *
  228. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  229. */
  230. int gsl_sf_bessel_jl_steed_array(const int lmax, const double x, double * jl_x_array);
  231. /* Irregular spherical Bessel function y_0(x)
  232. *
  233. * exceptions: none
  234. */
  235. int gsl_sf_bessel_y0_e(const double x, gsl_sf_result * result);
  236. double gsl_sf_bessel_y0(const double x);
  237. /* Irregular spherical Bessel function y_1(x)
  238. *
  239. * exceptions: GSL_EUNDRFLW
  240. */
  241. int gsl_sf_bessel_y1_e(const double x, gsl_sf_result * result);
  242. double gsl_sf_bessel_y1(const double x);
  243. /* Irregular spherical Bessel function y_2(x)
  244. *
  245. * exceptions: GSL_EUNDRFLW
  246. */
  247. int gsl_sf_bessel_y2_e(const double x, gsl_sf_result * result);
  248. double gsl_sf_bessel_y2(const double x);
  249. /* Irregular spherical Bessel function y_l(x)
  250. *
  251. * exceptions: GSL_EUNDRFLW
  252. */
  253. int gsl_sf_bessel_yl_e(int l, const double x, gsl_sf_result * result);
  254. double gsl_sf_bessel_yl(const int l, const double x);
  255. /* Irregular spherical Bessel function y_l(x) for l=0,1,...,lmax
  256. *
  257. * exceptions: GSL_EUNDRFLW
  258. */
  259. int gsl_sf_bessel_yl_array(const int lmax, const double x, double * result_array);
  260. /* Regular scaled modified spherical Bessel function
  261. *
  262. * Exp[-|x|] i_0(x)
  263. *
  264. * exceptions: none
  265. */
  266. int gsl_sf_bessel_i0_scaled_e(const double x, gsl_sf_result * result);
  267. double gsl_sf_bessel_i0_scaled(const double x);
  268. /* Regular scaled modified spherical Bessel function
  269. *
  270. * Exp[-|x|] i_1(x)
  271. *
  272. * exceptions: GSL_EUNDRFLW
  273. */
  274. int gsl_sf_bessel_i1_scaled_e(const double x, gsl_sf_result * result);
  275. double gsl_sf_bessel_i1_scaled(const double x);
  276. /* Regular scaled modified spherical Bessel function
  277. *
  278. * Exp[-|x|] i_2(x)
  279. *
  280. * exceptions: GSL_EUNDRFLW
  281. */
  282. int gsl_sf_bessel_i2_scaled_e(const double x, gsl_sf_result * result);
  283. double gsl_sf_bessel_i2_scaled(const double x);
  284. /* Regular scaled modified spherical Bessel functions
  285. *
  286. * Exp[-|x|] i_l(x)
  287. *
  288. * i_l(x) = Sqrt[Pi/(2x)] BesselI[l+1/2,x]
  289. *
  290. * l >= 0
  291. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  292. */
  293. int gsl_sf_bessel_il_scaled_e(const int l, double x, gsl_sf_result * result);
  294. double gsl_sf_bessel_il_scaled(const int l, const double x);
  295. /* Regular scaled modified spherical Bessel functions
  296. *
  297. * Exp[-|x|] i_l(x)
  298. * for l=0,1,...,lmax
  299. *
  300. * exceptions: GSL_EUNDRFLW
  301. */
  302. int gsl_sf_bessel_il_scaled_array(const int lmax, const double x, double * result_array);
  303. /* Irregular scaled modified spherical Bessel function
  304. * Exp[x] k_0(x)
  305. *
  306. * x > 0.0
  307. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  308. */
  309. int gsl_sf_bessel_k0_scaled_e(const double x, gsl_sf_result * result);
  310. double gsl_sf_bessel_k0_scaled(const double x);
  311. /* Irregular modified spherical Bessel function
  312. * Exp[x] k_1(x)
  313. *
  314. * x > 0.0
  315. * exceptions: GSL_EDOM, GSL_EUNDRFLW, GSL_EOVRFLW
  316. */
  317. int gsl_sf_bessel_k1_scaled_e(const double x, gsl_sf_result * result);
  318. double gsl_sf_bessel_k1_scaled(const double x);
  319. /* Irregular modified spherical Bessel function
  320. * Exp[x] k_2(x)
  321. *
  322. * x > 0.0
  323. * exceptions: GSL_EDOM, GSL_EUNDRFLW, GSL_EOVRFLW
  324. */
  325. int gsl_sf_bessel_k2_scaled_e(const double x, gsl_sf_result * result);
  326. double gsl_sf_bessel_k2_scaled(const double x);
  327. /* Irregular modified spherical Bessel function
  328. * Exp[x] k_l[x]
  329. *
  330. * k_l(x) = Sqrt[Pi/(2x)] BesselK[l+1/2,x]
  331. *
  332. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  333. */
  334. int gsl_sf_bessel_kl_scaled_e(int l, const double x, gsl_sf_result * result);
  335. double gsl_sf_bessel_kl_scaled(const int l, const double x);
  336. /* Irregular scaled modified spherical Bessel function
  337. * Exp[x] k_l(x)
  338. *
  339. * for l=0,1,...,lmax
  340. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  341. */
  342. int gsl_sf_bessel_kl_scaled_array(const int lmax, const double x, double * result_array);
  343. /* Regular cylindrical Bessel function J_nu(x)
  344. *
  345. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  346. */
  347. int gsl_sf_bessel_Jnu_e(const double nu, const double x, gsl_sf_result * result);
  348. double gsl_sf_bessel_Jnu(const double nu, const double x);
  349. /* Irregular cylindrical Bessel function Y_nu(x)
  350. *
  351. * exceptions:
  352. */
  353. int gsl_sf_bessel_Ynu_e(double nu, double x, gsl_sf_result * result);
  354. double gsl_sf_bessel_Ynu(const double nu, const double x);
  355. /* Regular cylindrical Bessel function J_nu(x)
  356. * evaluated at a series of x values. The array
  357. * contains the x values. They are assumed to be
  358. * strictly ordered and positive. The array is
  359. * over-written with the values of J_nu(x_i).
  360. *
  361. * exceptions: GSL_EDOM, GSL_EINVAL
  362. */
  363. int gsl_sf_bessel_sequence_Jnu_e(double nu, gsl_mode_t mode, size_t size, double * v);
  364. /* Scaled modified cylindrical Bessel functions
  365. *
  366. * Exp[-|x|] BesselI[nu, x]
  367. * x >= 0, nu >= 0
  368. *
  369. * exceptions: GSL_EDOM
  370. */
  371. int gsl_sf_bessel_Inu_scaled_e(double nu, double x, gsl_sf_result * result);
  372. double gsl_sf_bessel_Inu_scaled(double nu, double x);
  373. /* Modified cylindrical Bessel functions
  374. *
  375. * BesselI[nu, x]
  376. * x >= 0, nu >= 0
  377. *
  378. * exceptions: GSL_EDOM, GSL_EOVRFLW
  379. */
  380. int gsl_sf_bessel_Inu_e(double nu, double x, gsl_sf_result * result);
  381. double gsl_sf_bessel_Inu(double nu, double x);
  382. /* Scaled modified cylindrical Bessel functions
  383. *
  384. * Exp[+|x|] BesselK[nu, x]
  385. * x > 0, nu >= 0
  386. *
  387. * exceptions: GSL_EDOM
  388. */
  389. int gsl_sf_bessel_Knu_scaled_e(const double nu, const double x, gsl_sf_result * result);
  390. double gsl_sf_bessel_Knu_scaled(const double nu, const double x);
  391. /* Modified cylindrical Bessel functions
  392. *
  393. * BesselK[nu, x]
  394. * x > 0, nu >= 0
  395. *
  396. * exceptions: GSL_EDOM, GSL_EUNDRFLW
  397. */
  398. int gsl_sf_bessel_Knu_e(const double nu, const double x, gsl_sf_result * result);
  399. double gsl_sf_bessel_Knu(const double nu, const double x);
  400. /* Logarithm of modified cylindrical Bessel functions.
  401. *
  402. * Log[BesselK[nu, x]]
  403. * x > 0, nu >= 0
  404. *
  405. * exceptions: GSL_EDOM
  406. */
  407. int gsl_sf_bessel_lnKnu_e(const double nu, const double x, gsl_sf_result * result);
  408. double gsl_sf_bessel_lnKnu(const double nu, const double x);
  409. /* s'th positive zero of the Bessel function J_0(x).
  410. *
  411. * exceptions:
  412. */
  413. int gsl_sf_bessel_zero_J0_e(unsigned int s, gsl_sf_result * result);
  414. double gsl_sf_bessel_zero_J0(unsigned int s);
  415. /* s'th positive zero of the Bessel function J_1(x).
  416. *
  417. * exceptions:
  418. */
  419. int gsl_sf_bessel_zero_J1_e(unsigned int s, gsl_sf_result * result);
  420. double gsl_sf_bessel_zero_J1(unsigned int s);
  421. /* s'th positive zero of the Bessel function J_nu(x).
  422. *
  423. * exceptions:
  424. */
  425. int gsl_sf_bessel_zero_Jnu_e(double nu, unsigned int s, gsl_sf_result * result);
  426. double gsl_sf_bessel_zero_Jnu(double nu, unsigned int s);
  427. __END_DECLS
  428. #endif /* __GSL_SF_BESSEL_H__ */