Changeset c8902ac in sasmodels
- Timestamp:
- Dec 6, 2016 3:21:08 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 447e9aa
- Parents:
- 1e13e35
- Location:
- sasmodels/models/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/lib/sas_J0.c
r1596de3 rc8902ac 55 55 #if FLOAT_SIZE>4 56 56 //Cephes double precission 57 double j0(double x);57 double cephes_j0(double x); 58 58 59 59 constant double PPJ0[8] = { … … 147 147 }; 148 148 149 double j0(double x)149 double cephes_j0(double x) 150 150 { 151 151 double w, z, p, q, xn; … … 186 186 #else 187 187 //Cephes single precission 188 float j0f(float x);188 float cephes_j0f(float x); 189 189 190 190 constant float MOJ0[8] = { … … 221 221 }; 222 222 223 float j0f(float x)223 float cephes_j0f(float x) 224 224 { 225 225 float xx, w, z, p, q, xn; … … 257 257 258 258 #if FLOAT_SIZE>4 259 #define sas_J0 j0259 #define sas_J0 cephes_j0 260 260 #else 261 #define sas_J0 j0f261 #define sas_J0 cephes_j0f 262 262 #endif -
sasmodels/models/lib/sas_J1.c
r1596de3 rc8902ac 42 42 #if FLOAT_SIZE>4 43 43 //Cephes double pression function 44 double j1(double x);44 double cephes_j1(double x); 45 45 46 46 constant double RPJ1[8] = { … … 106 106 0.0 }; 107 107 108 double j1(double x)108 double cephes_j1(double x) 109 109 { 110 110 … … 144 144 #else 145 145 //Single precission version of cephes 146 float j1f(float x);146 float cephes_j1f(float x); 147 147 148 148 constant float JPJ1[8] = { … … 179 179 }; 180 180 181 float j1f(float x)181 float cephes_j1f(float x) 182 182 { 183 183 … … 211 211 212 212 #if FLOAT_SIZE>4 213 #define sas_J1 j1213 #define sas_J1 cephes_j1 214 214 #else 215 #define sas_J1 j1f215 #define sas_J1 cephes_j1f 216 216 #endif 217 217 -
sasmodels/models/lib/sas_JN.c
r1596de3 rc8902ac 50 50 #if FLOAT_SIZE > 4 51 51 52 double jn( int n, double x );53 double jn( int n, double x ) {52 double cephes_jn( int n, double x ); 53 double cephes_jn( int n, double x ) { 54 54 55 55 // PAK: seems to be machine epsilon/2 … … 75 75 76 76 if( n == 0 ) 77 return( sign * j0(x) );77 return( sign * cephes_j0(x) ); 78 78 if( n == 1 ) 79 return( sign * j1(x) );79 return( sign * cephes_j1(x) ); 80 80 if( n == 2 ) 81 return( sign * (2.0 * j1(x) / x -j0(x)) );81 return( sign * (2.0 * cephes_j1(x) / x - cephes_j0(x)) ); 82 82 83 83 if( x < MACHEP ) … … 112 112 113 113 if( fabs(pk) > fabs(pkm1) ) 114 ans = j1(x)/pk;114 ans = cephes_j1(x)/pk; 115 115 else 116 ans = j0(x)/pkm1;116 ans = cephes_j0(x)/pkm1; 117 117 118 118 return( sign * ans ); … … 121 121 #else 122 122 123 float jnf(int n, float x);124 float jnf(int n, float x)123 float cephes_jnf(int n, float x); 124 float cephes_jnf(int n, float x) 125 125 { 126 126 // PAK: seems to be machine epsilon/2 … … 146 146 147 147 if( n == 0 ) 148 return( sign * j0f(x) );148 return( sign * cephes_j0f(x) ); 149 149 if( n == 1 ) 150 return( sign * j1f(x) );150 return( sign * cephes_j1f(x) ); 151 151 if( n == 2 ) 152 return( sign * (2.0 * j1f(x) / x -j0f(x)) );152 return( sign * (2.0 * cephes_j1f(x) / x - cephes_j0f(x)) ); 153 153 154 154 if( x < MACHEP ) … … 189 189 190 190 if( r > ans ) /* if( fabs(pk) > fabs(pkm1) ) */ 191 ans = sign * j1f(x)/pk;191 ans = sign * cephes_j1f(x)/pk; 192 192 else 193 ans = sign * j0f(x)/pkm1;193 ans = sign * cephes_j0f(x)/pkm1; 194 194 return( ans ); 195 195 } … … 197 197 198 198 #if FLOAT_SIZE>4 199 #define sas_JN jn199 #define sas_JN cephes_jn 200 200 #else 201 #define sas_JN jnf201 #define sas_JN cephes_jnf 202 202 #endif
Note: See TracChangeset
for help on using the changeset viewer.