* Copyright (c) 1985 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)jn.c 5.2 (Berkeley) %G%";
floating point Bessel's function of
the first and second kinds and of
returns the value of Jn(x) for all
integer values of n and all real values
There are no error returns.
For n=0, j0(x) is called,
for n=1, j1(x) is called,
for n<x, forward recursion us used starting
from values of j0(x) and j1(x).
for n>x, a continued fraction approximation to
j(n,x)/j(n-1,x) is evaluated and then backward
recursion is used starting from a supposed value
for j(n,x). The resulting value of j(0,x) is
compared with the actual value to correct the
supposed value of j(n,x).
yn(n,x) is similar in all respects, except
that forward recursion is used for all
#if defined(vax)||defined(tahoe)
#else /* defined(vax)||defined(tahoe) */
static double zero
= 0.e0
;
#endif /* defined(vax)||defined(tahoe) */
jn(n
,x
) int n
; double x
;{
yn(n
,x
) int n
; double x
;{
#if defined(vax)||defined(tahoe)
return(infnan(EDOM
)); /* NaN */
#else /* defined(vax)||defined(tahoe) */
return(zero
/zero
); /* IEEE machines: invalid operation */
#endif /* defined(vax)||defined(tahoe) */
if(n
==1) return(sign
*y1(x
));