Changeset a5899c8 in sasmodels


Ignore:
Timestamp:
Nov 25, 2015 4:27:24 PM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
1ec7efa
Parents:
4b41184
Message:

use taylor expansion in ellipsoid model so single precision is more accurate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/ellipsoid.c

    r994d77f ra5899c8  
    1212                   + cos_alpha*cos_alpha*(ratio*ratio - 1.0)); 
    1313    SINCOS(u, sn, cn); 
    14     const double f = ( u==0.0 ? 1.0 : 3.0*(sn-u*cn)/(u*u*u) ); 
     14    //const double f = ( u==0.0 ? 1.0 : 3.0*(sn-u*cn)/(u*u*u) ); 
     15    const double usq = u*u; 
     16    const double f = (u < 1e-1) 
     17        ? 1.0 + usq*(-3./30. + usq*(3./840. + usq*(-3./45360.)))// + qrsq*(3./3991680.)))) 
     18        : 3.0*(sn/u - cn)/usq; 
    1519    return f*f; 
    1620} 
Note: See TracChangeset for help on using the changeset viewer.