-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbessj0.f
26 lines (26 loc) · 984 Bytes
/
bessj0.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
FUNCTION BESSJ0(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 P1,P2,P3,P4,P5/1.D0,-.1098628627D-2,.2734510407D-4,
* -.2073370639D-5,.2093887211D-6/, Q1,Q2,Q3,Q4,Q5/-.1562499995D-
*1,
* .1430488765D-3,-.6911147651D-5,.7621095161D-6,-.934945152D-7/
DATA R1,R2,R3,R4,R5,R6/57568490574.D0,-13362590354.D0,651619640.7D
*0,
* -11214424.18D0,77392.33017D0,-184.9052456D0/,
* S1,S2,S3,S4,S5,S6/57568490411.D0,1029532985.D0,
* 9494680.718D0,59272.64853D0,267.8532712D0,1.D0/
IF(ABS(X).LT.8.)THEN
Y=X**2
BESSJ0=(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-.785398164
BESSJ0=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)))))
ENDIF
RETURN
END