Changeset 3595 in Sophya for trunk/Cosmo/SimLSS/geneutils.cc
- Timestamp:
- Apr 19, 2009, 2:47:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/geneutils.cc
r3500 r3595 296 296 double SinXsX(double x,bool app) 297 297 // Calcul de sin(x)/x 298 // Approx: dernier terme x^6/(6*20*42) ~ 1e-13 -> x^2 ~ 1.7e-4 298 // Le Dl est en O[x]^10 (cad on va jusqu'au terme en x^8 compris) 299 // Approx: terme en x^6/(6*20*42) ~ 1e-13 -> x^2 ~ 1.7e-4 299 300 { 300 301 double x2 = x*x; 301 if(app || x2<1.7e-4) return 1. - x2/6.*(1. - x2/20.*(1. - x2/42.));302 if(app || x2<1.7e-4) return 1.-x2/6.*(1.-x2/20.*(1.-x2/42.*(1.-x2/72.))); 302 303 return sin(x)/x; 303 304 } … … 305 306 double SinXsX_Sqr(double x,bool app) 306 307 // Calcul de (sin(x)/x)^2 307 // Approx: dernier terme 2*x^6/(3*15*14) ~ 1e-13 -> x^2 ~ 6.8e-5 308 // Le Dl est en O[x]^10 (cad on va jusqu'au terme en x^8 compris) 309 // Approx: terme 2*x^6/(3*15*14) ~ 1e-13 -> x^2 ~ 6.8e-5 308 310 { 309 311 double x2 = x*x; 310 if(app || x2<6.8e-5) return 1. - x2/3.*(1. - 2.*x2/15.*(1. - x2/14.));312 if(app || x2<6.8e-5) return 1.-x2/3.*(1.-2.*x2/15.*(1.-x2/14.*(1.-2.*x2/45.))); 311 313 x2 = sin(x)/x; 312 314 return x2*x2; … … 343 345 // Calcul de [sin(N*x)/sin(x)]^2 avec N entier positif 344 346 // ATTENTION: cf remarque pour N entier dans SinNXsX 347 // maximum de la fonction: N^2 345 348 // Approx: dernier terme x^4*2*N^4/45 ~ 1e-13 -> x^2 ~ 1.5e-6/N^2 346 349 { … … 349 352 if(app || sx*sx<1.5e-6/N2) { 350 353 double x2 = asin(sx); x2 *= x2; 351 return N2*(1. - (N-1.)*(N+1.)/3.*x2*(1. - (2.*N2-3.)/15.*x2)); 354 //return N2*(1.-(N*N-1.)/3.*x2); 355 return N2*(1.-(N-1.)*(N+1.)/3.*x2*(1.-(2.*N2-3.)/15.*x2)); 352 356 } 353 357 sx = sin((double)N*x)/sx;
Note:
See TracChangeset
for help on using the changeset viewer.