core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 14de349 was
14de349,
checked in by Paul Kienzle <pkienzle@…>, 10 years ago
|
add autogenerated polydispersity loops
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | real J1(real x); |
---|
2 | real J1(real x) |
---|
3 | { |
---|
4 | const real ax = fabs(x); |
---|
5 | if (ax < REAL(8.0)) { |
---|
6 | const real y = x*x; |
---|
7 | const real ans1 = x*(REAL(72362614232.0) |
---|
8 | + y*(REAL(-7895059235.0) |
---|
9 | + y*(REAL(242396853.1) |
---|
10 | + y*(REAL(-2972611.439) |
---|
11 | + y*(REAL(15704.48260) |
---|
12 | + y*(REAL(-30.16036606))))))); |
---|
13 | const real ans2 = REAL(144725228442.0) |
---|
14 | + y*(REAL(2300535178.0) |
---|
15 | + y*(REAL(18583304.74) |
---|
16 | + y*(REAL(99447.43394) |
---|
17 | + y*(REAL(376.9991397) |
---|
18 | + y)))); |
---|
19 | return ans1/ans2; |
---|
20 | } else { |
---|
21 | const real y = REAL(64.0)/(ax*ax); |
---|
22 | const real xx = ax - REAL(2.356194491); |
---|
23 | const real ans1 = REAL(1.0) |
---|
24 | + y*(REAL(0.183105e-2) |
---|
25 | + y*(REAL(-0.3516396496e-4) |
---|
26 | + y*(REAL(0.2457520174e-5) |
---|
27 | + y*REAL(-0.240337019e-6)))); |
---|
28 | const real ans2 = REAL(0.04687499995) |
---|
29 | + y*(REAL(-0.2002690873e-3) |
---|
30 | + y*(REAL(0.8449199096e-5) |
---|
31 | + y*(REAL(-0.88228987e-6) |
---|
32 | + y*REAL(0.105787412e-6)))); |
---|
33 | real sn,cn; |
---|
34 | SINCOS(xx, sn, cn); |
---|
35 | const real ans = sqrt(REAL(0.636619772)/ax) * (cn*ans1 - (REAL(8.0)/ax)*sn*ans2); |
---|
36 | return (x < REAL(0.0)) ? -ans : ans; |
---|
37 | } |
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.