13 #include <gtest/gtest.h> 19 const double test_values[][2] = {
21 { 0.79788456080286541, 0.721705924292605 },
22 { 1.0, 0.779893400376823 },
23 { 0.4, 0.397480759172359 },
24 { 1.5, 0.445261176039822 },
25 { 2.0, 0.488253406075341 },
26 { 2.4, 0.554961405856428 },
27 { 3.34, 0.407099627096608 },
28 { 50.0, 0.499999189430728 },
29 { -0.4, -0.397480759172359 },
30 { -1.5, -0.445261176039822 },
31 { -2.0, -0.488253406075341 },
32 { -2.4, -0.554961405856428 },
33 { -3.34, -0.407099627096608 },
34 { -50.0, -0.499999189430728 }
37 const unsigned int nTests =
sizeof(test_values)/
sizeof(test_values[0]);
39 for (
unsigned int i=0;i<nTests;i++)
41 const double x = test_values[i][0], val_good = test_values[i][1];
43 EXPECT_NEAR(
val, val_good, 1e-5) <<
" x: " <<
x <<
"\n val_good: " << val_good <<
"\n val: " <<
val <<
"\n";
50 const double test_values[][2] = {
52 { 1.0, 0.438259147390355 },
53 { 1.5, 0.697504960082093 },
54 { 2.4, 0.619689964945684 },
55 { 50.0, 0.493633802585939 },
56 { -2.0, -0.343415678363698 },
57 { -2.4, -0.619689964945684 },
58 { -3.34, -0.479600423968308 },
59 { -50.0, -0.493633802585939 }
62 const unsigned int nTests =
sizeof(test_values) /
sizeof(test_values[0]);
64 for (
unsigned int i = 0; i<nTests; i++)
66 const double x = test_values[i][0], val_good = test_values[i][1];
68 EXPECT_NEAR(
val, val_good, 1e-5) <<
" x: " <<
x <<
"\n val_good: " << val_good <<
"\n val: " <<
val <<
"\n";
double BASE_IMPEXP fresnel_cos_integral(double x) MRPT_NO_THROWS
Evaluates the integral from 0 to x of sqrt(2/pi) cos(t^2) dt.
double BASE_IMPEXP fresnel_sin_integral(double x) MRPT_NO_THROWS
Evaluates the integral from 0 to x of sqrt(2/pi) sin(t^2) dt.