Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 38b0917cd2e9
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7fc9fde020ff
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Oct 12, 2020

  1. Copy the full SHA
    faab401 View commit details
  2. Merge pull request #2760 from pleroy/Clang

    Adjust tolerances for Linux and macOS
    pleroy authored Oct 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7fc9fde View commit details
Showing with 11 additions and 10 deletions.
  1. +8 −8 numerics/frequency_analysis_test.cpp
  2. +3 −2 numerics/quadrature_test.cpp
16 changes: 8 additions & 8 deletions numerics/frequency_analysis_test.cpp
Original file line number Diff line number Diff line change
@@ -234,7 +234,7 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesScalarProjection) {
t_min, t_max);
for (int i = 0; i <= 100; ++i) {
EXPECT_THAT(projection4(t0_ + i * Radian / ω),
AlmostEquals(series(t0_ + i * Radian / ω), 0, 768));
AlmostEquals(series(t0_ + i * Radian / ω), 0, 1536));
}

// Projection on a 5th degree basis is also accurate.
@@ -245,7 +245,7 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesScalarProjection) {
t_min, t_max);
for (int i = 0; i <= 100; ++i) {
EXPECT_THAT(projection5(t0_ + i * Radian / ω),
AlmostEquals(series(t0_ + i * Radian / ω), 0, 768));
AlmostEquals(series(t0_ + i * Radian / ω), 0, 1536));
}

// Projection on a 3rd degree basis introduces significant errors.
@@ -312,7 +312,7 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesVectorProjection) {
t_min, t_max);
for (int i = 0; i <= 100; ++i) {
EXPECT_THAT(projection4(t0_ + i * Radian / ω),
AlmostEquals(series(t0_ + i * Radian / ω), 0, 640));
AlmostEquals(series(t0_ + i * Radian / ω), 0, 1024));
}

// Projection on a 5th degree basis is also accurate.
@@ -323,7 +323,7 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesVectorProjection) {
t_min, t_max);
for (int i = 0; i <= 100; ++i) {
EXPECT_THAT(projection5(t0_ + i * Radian / ω),
AlmostEquals(series(t0_ + i * Radian / ω), 0, 640));
AlmostEquals(series(t0_ + i * Radian / ω), 0, 1024));
}

// Projection on a 3rd degree basis introduces significant errors.
@@ -426,7 +426,7 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesIncrementalProjectionNoSecular) {
? AllOf(Gt(6.7e-2 * Metre), Lt(7.9 * Metre))
: ω_index == 2
? AllOf(Gt(1.1e-4 * Metre), Lt(9.7e-1 * Metre))
: AllOf(Gt(1.4e-16 * Metre), Lt(2.8e-13 * Metre)))
: AllOf(Gt(2.1e-17 * Metre), Lt(6.6e-13 * Metre)))
<< ω_index;
}
if (ω_index == ωs.size()) {
@@ -447,7 +447,7 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesIncrementalProjectionNoSecular) {
EXPECT_THAT(
projection4(t_min + i * (t_max - t_min) / 100),
RelativeErrorFrom(series.value()(t_min + i * (t_max - t_min) / 100),
AllOf(Ge(0), Lt(1.4e-11))));
AllOf(Ge(0), Lt(2.0e-11))));
}
}

@@ -490,8 +490,8 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesIncrementalProjectionSecular) {
? AllOf(Gt(3.3e-2 * Metre), Lt(3.6 * Metre))
: ω_index == 3
? AllOf(Gt(7.5e-3 * Metre), Lt(5.4 * Metre))
: AllOf(Gt(1.0e-16 * Metre),
Lt(6.0e-14 * Metre)))
: AllOf(Gt(3.5e-17 * Metre),
Lt(7.5e-14 * Metre)))
<< ω_index;
}
if (ω_index == ωs.size()) {
5 changes: 3 additions & 2 deletions numerics/quadrature_test.cpp
Original file line number Diff line number Diff line change
@@ -126,8 +126,9 @@ TEST_F(QuadratureTest, Sin10) {
5.0 * Radian,
/*max_relative_error=*/std::numeric_limits<double>::epsilon(),
/*max_points=*/std::nullopt),
AlmostEquals(ʃf, 9, 277));
EXPECT_THAT(evaluations, AnyOf(Eq(131088), Eq(524306)));
AlmostEquals(ʃf, 2, 277));
EXPECT_THAT(evaluations,
AnyOf(Eq(65551), Eq(131088), Eq(524306), Eq(1048595)));
}

} // namespace quadrature