Changes in / [e81f6dd:273a6d7] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/calculator/c_extensions/libfunc.c
r9e531f2 r197260f 87 87 } 88 88 89 89 /* 90 90 double gamln(double xx) { 91 91 … … 103 103 return -tmp+log(2.5066282746310005*ser/x); 104 104 } 105 105 */ 106 106 // calculate magnetic sld and return total sld 107 107 // bn : contrast (not just sld of the layer) … … 236 236 237 237 /** 238 Implements eq 6.2.5 (small gamma) of Numerical Recipes in C, essentially 239 the incomplete gamma function multiplied by the gamma function. 240 Required for implementation of fast error function (erf) 238 Wojtek's comment Mar 22 2016: The remaing code can mostly likely be deleated 239 Keeping it in order to check if it is not breaking anything 241 240 **/ 242 241 … … 250 249 float sum,del,ap; 251 250 252 *gln = gamln(a);251 *gln = lgamma(a); 253 252 if(x <= 0.0) { 254 253 if (x < 0.0) printf("Error: x less than 0 in routine gser"); … … 280 279 representation 281 280 **/ 282 283 281 void gcf(float *gammcf, float a, float x, float *gln) { 284 282 int i; 285 283 float an,b,c,d,del,h; 286 284 287 *gln = gamln(a);285 *gln = lgamma(a); 288 286 b = x+1.0-a; 289 287 c = 1.0/FPMIN; … … 307 305 } 308 306 309 310 307 /** 311 308 Represents incomplete error function, P(a,x) … … 322 319 } 323 320 } 324 325 321 /** 326 322 Implementation of the error function, erf(x) 327 323 **/ 328 329 324 float erff(float x) { 330 325 return x < 0.0 ? -gammp(0.5,x*x) : gammp(0.5,x*x); 331 326 } 332
Note: See TracChangeset
for help on using the changeset viewer.