Changeset 3a48772 in sasmodels for sasmodels/models/star_polymer.c


Ignore:
Timestamp:
Oct 14, 2016 5:23:40 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:
a5b6997
Parents:
b716cc6
Message:

use predefined constants for fractions of pi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/star_polymer.c

    r2c74c11 r3a48772  
    66{ 
    77 
    8     double u_2 = radius2 * pow(q,2); 
     8    double u_2 = radius2 * q * q; 
    99    double v = u_2 * arms / (3.0 * arms - 2.0); 
    1010 
    11     double term1 = v - 1.0 + exp(-v); 
    12     double term2 = ((arms - 1.0)/2.0)* pow((1.0 - exp(-v)),2.0); 
     11    double term1 = v + expm1(-v); 
     12    double term2 = ((arms - 1.0)/2.0) * square(expm1(-v)); 
    1313 
    14     return (2.0 * (term1 + term2)) / (arms * pow(v,2.0)); 
     14    return (2.0 * (term1 + term2)) / (arms * v * v); 
    1515 
    1616} 
Note: See TracChangeset for help on using the changeset viewer.