source: sasmodels/Kernel/NR_BessJ1.cpp @ a953943

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since a953943 was 099e053, checked in by HMP1 <helen.park@…>, 10 years ago

further organizing

  • Property mode set to 100644
File size: 709 bytes
Line 
1real NR_BessJ1(real x)
2{
3    real xx=0; real y=0; real ans=0; real ans1=0; real ans2=0;
4    real ax = fabs(x);
5        if (ax < 8.0)
6        {
7                y=x*x;
8                ans1=x*(72362614232.0+y*(-7895059235.0+y*(242396853.1+y*(-2972611.439+y*(15704.48260+y*(-30.16036606))))));
9                ans2=144725228442.0+y*(2300535178.0+y*(18583304.74+y*(99447.43394+y*(376.9991397+y*1.0))));
10                ans=ans1/ans2;
11        }
12        else
13        {
14                y=64.0/(ax*ax);
15                xx= ax-2.356194491;
16                ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4+y*(0.2457520174e-5+y*(-0.240337019e-6))));
17                ans2=0.04687499995+y*(-0.2002690873e-3+y*(0.8449199096e-5+y*(-0.88228987e-6+y*0.105787412e-6)));
18                ans=sqrt(0.636619772/ax)*(cos(xx)*ans1-(8.0/ax)*sin(xx)*ans2);
19                if (x < 0.0) {ans*=-1;}
20        }
21        return(ans);
22}
Note: See TracBrowser for help on using the repository browser.