Changeset 1ec7efa in sasmodels


Ignore:
Timestamp:
Nov 25, 2015 4:44:45 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:
d138d43
Parents:
a5899c8
Message:

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

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    r4b41184 r1ec7efa  
    292292        except ImportError: 
    293293            traceback.print_exc() 
    294             Ncomp = 0 
     294            Nbase = 0 
    295295    elif Nbase > 0: 
    296296        base, base_time = eval_opencl(model_definition, pars, data, 
  • sasmodels/models/triaxial_ellipsoid.c

    r994d77f r1ec7efa  
    3737            const double t = q*sqrt(acosx2 + bsinx2*(1.0-y*y) + c2*y*y); 
    3838            SINCOS(t, st, ct); 
    39             const double fq = ( t==0.0 ? 1.0 : 3.0*(st-t*ct)/(t*t*t) ); 
     39            //const double fq = ( t==0.0 ? 1.0 : 3.0*(st-t*ct)/(t*t*t) ); 
     40            const double tsq = t*t; 
     41            const double fq = (t < 1e-1) 
     42                ? 1.0 + tsq*(-3./30. + tsq*(3./840. + tsq*(-3./45360.)))// + tsq*(3./3991680.)))) 
     43                : 3.0*(st/t - ct)/tsq; 
    4044            inner += Gauss76Wt[j] * fq * fq ; 
    4145        } 
Note: See TracChangeset for help on using the changeset viewer.