Changeset f12357f in sasmodels for sasmodels/models/lib/Si.c


Ignore:
Timestamp:
Feb 3, 2016 6:49:57 AM (8 years ago)
Author:
krzywon
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:
a17fe40
Parents:
8696a87
Message:

Modified the pearl_necklace model for better double precision accuracy
and added unit tests.

File:
1 edited

Legend:

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

    r7d256c8 rf12357f  
    1313 
    1414                // Explicitly writing factorial values triples the speed of the calculation 
    15                 out_cos = 1/x - 2/pow(x,3) + 24/pow(x,5) - 720/pow(x,7) + 40320/pow(x,9); 
    16                 out_sin = 1/x - 6/pow(x,4) + 120/pow(x,6) - 5040/pow(x,8) + 362880/pow(x,10); 
     15                out_cos = 1./x - 2./pow(x,3) + 24./pow(x,5) - 720./pow(x,7); 
     16                out_sin = 1./pow(x,2) - 6./pow(x,4) + 120./pow(x,6) - 5040./pow(x,8); 
    1717 
    1818                out -= cos(x) * out_cos; 
     
    2222 
    2323        // Explicitly writing factorial values triples the speed of the calculation 
    24         out = x - pow(x, 3)/18 + pow(x,5)/600 - pow(x,7)/35280 + pow(x,9)/3265920; 
     24        out = x - pow(x, 3)/18. + pow(x,5)/600. - pow(x,7)/35280. + pow(x,9)/3265920. - pow(x,11)/439084800.; 
    2525 
    26         //printf ("Si=%g %g\n", x, out); 
    2726        return out; 
    2827} 
Note: See TracChangeset for help on using the changeset viewer.