Changeset 217590b in sasmodels for sasmodels/models/lib


Ignore:
Timestamp:
Oct 20, 2016 4:48:48 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
5c94f41
Parents:
2b9e63f
git-author:
Paul Kienzle <pkienzle@…> (10/20/16 16:47:25)
git-committer:
Paul Kienzle <pkienzle@…> (10/20/16 16:48:48)
Message:

fractal, fractal_core_shell: support fractal_dim as low as 0.

Location:
sasmodels/models/lib
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/lib/sas_gamma.c

    r1596de3 r217590b  
    137137 
    138138 
    139 inline double sas_gamma( double x) { return tgamma(x+1)/x; } 
     139inline double sas_gamma(double x) { 
     140#if 1 
     141    // Fast reliable gamma in [-n,171], where n is a small integer 
     142    double norm = 1.; 
     143    while (x < 1.) { 
     144        norm *= x; 
     145        x += 1.0; 
     146    } 
     147    return tgamma(x)/norm; 
     148#else 
     149    // Fast reliable gamma in [0,170] 
     150    return tgamma(x+1)/x; 
     151#endif 
     152} 
Note: See TracChangeset for help on using the changeset viewer.