3 #include <UnitTest++.h>
20 TEST(TestLogFactorial)
32 complex<double> y =
cdgamma( complex<double>(1.,0.) );
34 y =
cdgamma( complex<double>(2.,0.) );
36 y =
cdgamma( complex<double>(11.,0.) );
38 y =
cdgamma( complex<double>(-0.5,0.) );
39 CHECK(
fp_equal( y.real(), -3.544907701811032054596334966682277e0, 10 ) &&
41 y =
cdgamma( complex<double>(0.,1.) );
42 CHECK(
fp_equal( y.real(), -1.549498283018106851249551304838863e-1, 10 ) &&
43 fp_equal( y.imag(), -4.980156681183560427136911174621973e-1, 10 ) );
44 y =
cdgamma( complex<double>(-1.,-2.) );
45 CHECK(
fp_equal( y.real(), -3.23612885501927256868232032760969e-2, 30 ) &&
46 fp_equal( y.imag(), -1.122942423463261735043406872030743e-2, 30 ) );
235 CHECK(
fp_equal_tol(
erf(1.e-10), 1.1283791671081724525e-10, 3.e-21 ) );
314 for(
int i=0; i < 9; ++i )
317 for(
int i=0; i < NP; ++i )
324 for(
int i=1; i < NP; ++i )
325 integral += (y[i]+y[i-1])*(v[i]-v[i-1]);
327 integral +=
realnum(2.)*v[NP-1]*y[NP-1];
419 for(
int i=0; i < 9; ++i )
422 for(
int i=0; i < NP; ++i )
429 for(
int i=1; i < NP; ++i )
430 integral += (y[i]+y[i-1])*(v[i]-v[i-1]);
432 integral +=
realnum(2.)*v[NP-1]*y[NP-1];
445 CHECK(
MD5string( test ) ==
"d41d8cd98f00b204e9800998ecf8427e" );
449 test =
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh";
450 CHECK( test.length() == 55 );
451 CHECK(
MD5string( test ) ==
"426ec4ac35ad38d125f6efb39da03098" );
452 test =
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh";
453 CHECK( test.length() == 56 );
454 CHECK(
MD5string( test ) ==
"d03607b2c89adc0c4abf5a0f1d9e40c9" );
455 test =
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh";
456 CHECK( test.length() == 57 );
457 CHECK(
MD5string( test ) ==
"bac1b47748411cb6eee0cae3befb8377" );
458 string test64 =
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh";
459 test = test64 +
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh";
460 CHECK( test.length() == 64+55 );
461 CHECK(
MD5string( test ) ==
"10d49aad1fc69976376fbe7c8c5ed118" );
462 test = test64 +
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh";
463 CHECK( test.length() == 64+56 );
464 CHECK(
MD5string( test ) ==
"61ec7da14576f3b585038c6d72cd5bd5" );
465 test = test64 +
"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh";
466 CHECK( test.length() == 64+57 );
467 CHECK(
MD5string( test ) ==
"f17a0475a26d0930e2a35bb320c10e0d" );
470 CHECK(
MD5string( test ) ==
"0256b9cea63bc1f97b8c5aea92c24a98" );
double bessel_k0_scaled(double x)
double bessel_i1_scaled(double x)
double lfactorial(long n)
double bessel_i1(double x)
bool fp_equal_tol(sys_float x, sys_float y, sys_float tol)
double expn(int n, double x)
complex< double > cdgamma(complex< double > x)
bool fp_equal(sys_float x, sys_float y, int n=3)
double bessel_k1(double x)
double bessel_i0_scaled(double x)
double bessel_i0(double x)
double bessel_jn(int n, double x)
double bessel_y0(double x)
double bessel_j0(double x)
double bessel_j1(double x)
double bessel_yn(int n, double x)
double bessel_k1_scaled(double x)
void VoigtU(realnum a, const realnum v[], realnum y[], int n)
double bessel_y1(double x)
static const unsigned int NMD5
double bessel_k0(double x)
string MD5string(const string &str)
void VoigtH(realnum a, const realnum v[], realnum y[], int n)