core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 5d4777d was
723198c,
checked in by Paul Kienzle <pkienzle@…>, 10 years ago
|
fix compiler error for Mac
|
-
Property mode set to
100644
|
File size:
733 bytes
|
Line | |
---|
1 | real NR_BessJ1(real x); |
---|
2 | real NR_BessJ1(real x) |
---|
3 | { |
---|
4 | real xx=0; real y=0; real ans=0; real ans1=0; real ans2=0; |
---|
5 | real ax = fabs(x); |
---|
6 | if (ax < 8.0) |
---|
7 | { |
---|
8 | y=x*x; |
---|
9 | ans1=x*(72362614232.0+y*(-7895059235.0+y*(242396853.1+y*(-2972611.439+y*(15704.48260+y*(-30.16036606)))))); |
---|
10 | ans2=144725228442.0+y*(2300535178.0+y*(18583304.74+y*(99447.43394+y*(376.9991397+y*1.0)))); |
---|
11 | ans=ans1/ans2; |
---|
12 | } |
---|
13 | else |
---|
14 | { |
---|
15 | y=64.0/(ax*ax); |
---|
16 | xx= ax-2.356194491; |
---|
17 | ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4+y*(0.2457520174e-5+y*(-0.240337019e-6)))); |
---|
18 | ans2=0.04687499995+y*(-0.2002690873e-3+y*(0.8449199096e-5+y*(-0.88228987e-6+y*0.105787412e-6))); |
---|
19 | ans=sqrt(0.636619772/ax)*(cos(xx)*ans1-(8.0/ax)*sin(xx)*ans2); |
---|
20 | if (x < 0.0) {ans*=-1;} |
---|
21 | } |
---|
22 | return(ans); |
---|
23 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.