-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbessj1.f
28 lines (28 loc) · 1010 Bytes
/
bessj1.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FUNCTION BESSJ1(X)
REAL*8 Y,P1,P2,P3,P4,P5,Q1,Q2,Q3,Q4,Q5,R1,R2,R3,R4,R5,R6,
* S1,S2,S3,S4,S5,S6
DATA R1,R2,R3,R4,R5,R6/72362614232.D0,-7895059235.D0,242396853.1D0
*,
* -2972611.439D0,15704.48260D0,-30.16036606D0/,
* S1,S2,S3,S4,S5,S6/144725228442.D0,2300535178.D0,
* 18583304.74D0,99447.43394D0,376.9991397D0,1.D0/
DATA P1,P2,P3,P4,P5/1.D0,.183105D-2,-.3516396496D-4,.2457520174D-5
*,
* -.240337019D-6/, Q1,Q2,Q3,Q4,Q5/.04687499995D0,-.2002690873D-3
*,
* .8449199096D-5,-.88228987D-6,.105787412D-6/
IF(ABS(X).LT.8.)THEN
Y=X**2
BESSJ1=X*(R1+Y*(R2+Y*(R3+Y*(R4+Y*(R5+Y*R6)))))
* /(S1+Y*(S2+Y*(S3+Y*(S4+Y*(S5+Y*S6)))))
ELSE
AX=ABS(X)
Z=8./AX
Y=Z**2
XX=AX-2.356194491
BESSJ1=SQRT(.636619772/AX)*(COS(XX)*(P1+Y*(P2+Y*(P3+Y*(P4+Y
* *P5))))-Z*SIN(XX)*(Q1+Y*(Q2+Y*(Q3+Y*(Q4+Y*Q5)))))
* *SIGN(1.,X)
ENDIF
RETURN
END