Changeset f12357f in sasmodels for sasmodels/models/lib/Si.c
- Timestamp:
- Feb 3, 2016 6:49:57 AM (8 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/lib/Si.c
r7d256c8 rf12357f 13 13 14 14 // 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); 17 17 18 18 out -= cos(x) * out_cos; … … 22 22 23 23 // 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.; 25 25 26 //printf ("Si=%g %g\n", x, out);27 26 return out; 28 27 }
Note: See TracChangeset
for help on using the changeset viewer.