Changes in / [08376e7:292fe08] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/hardsphere.py

    re98c1e0 r934f906  
    7575Iq = """ 
    7676      double D,A,B,G,X,X2,X4,S,C,FF,HARDSPH; 
     77      // these are c compiler instructions, can also put normal code inside the "if else" structure  
     78      #if FLOAT_SIZE > 4 
     79      // double precision    orig had 0.2, don't call the variable cutoff as PAK already has one called that! Must use UPPERCASE name please. 
     80      //  0.05 better, 0.1 OK 
     81      #define CUTOFFHS 0.05 
     82      #else 
     83      // 0.1 bad, 0.2 OK, 0.3 good, 0.4 better, 0.8 no good 
     84      #define CUTOFFHS 0.4   
     85      #endif 
    7786 
    7887      if(fabs(radius_effective) < 1.E-12) { 
     
    97106      G=0.5*volfraction*A; 
    98107 
    99       if(X < 0.2) { 
    100       // RKH Feb 2016, use Taylor series expansion for small X, IT IS VERY PICKY ABOUT THE X CUT OFF VALUE, ought to be lower in double.  
     108      if(X < CUTOFFHS) { 
     109      // RKH Feb 2016, use Taylor series expansion for small X 
    101110      // else no obvious way to rearrange the equations to avoid needing a very high number of significant figures.  
    102111      // Series expansion found using Mathematica software. Numerical test in .xls showed terms to X^2 are sufficient  
Note: See TracChangeset for help on using the changeset viewer.