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: f5cf1786cced
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6ecf8ceed35b
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jun 8, 2021

  1. no exported namespace

    eggrobin committed Jun 8, 2021
    Copy the full SHA
    62300ac View commit details
  2. Merge pull request #3030 from eggrobin/fma-polynomials

    No exported namespace
    eggrobin authored Jun 8, 2021
    Copy the full SHA
    6ecf8ce View commit details
Showing with 9 additions and 15 deletions.
  1. +4 −10 numerics/polynomial_evaluators.hpp
  2. +5 −5 numerics/polynomial_evaluators_body.hpp
14 changes: 4 additions & 10 deletions numerics/polynomial_evaluators.hpp
Original file line number Diff line number Diff line change
@@ -15,8 +15,8 @@ template<typename Value, typename Argument, int degree, bool allow_fma>
struct EstrinEvaluator;
template<typename Value, typename Argument, int degree, bool allow_fma>
struct HornerEvaluator;
} // namespace internal_polynomial_evaluators

namespace exported {
template<typename Value, typename Argument, int degree>
using EstrinEvaluator = internal_polynomial_evaluators::
EstrinEvaluator<Value, Argument, degree, /*allow_fma=*/true>;
@@ -29,8 +29,8 @@ using HornerEvaluator = internal_polynomial_evaluators::
template<typename Value, typename Argument, int degree>
using HornerEvaluatorWithoutFMA = internal_polynomial_evaluators::
HornerEvaluator<Value, Argument, degree, /*allow_fma=*/false>;
} // namespace exported

namespace internal_polynomial_evaluators {
// We use FORCE_INLINE because we have to write this recursively, but we really
// want linear code.

@@ -42,7 +42,7 @@ struct EstrinEvaluator {
Value,
Argument,
degree,
exported::EstrinEvaluator>::Coefficients;
numerics::EstrinEvaluator>::Coefficients;

FORCE_INLINE(static) Value Evaluate(Coefficients const& coefficients,
Argument const& argument);
@@ -59,7 +59,7 @@ struct HornerEvaluator {
Value,
Argument,
degree,
exported::HornerEvaluator>::Coefficients;
numerics::HornerEvaluator>::Coefficients;

FORCE_INLINE(static) Value Evaluate(Coefficients const& coefficients,
Argument const& argument);
@@ -69,12 +69,6 @@ struct HornerEvaluator {
};

} // namespace internal_polynomial_evaluators

using internal_polynomial_evaluators::exported::EstrinEvaluator;
using internal_polynomial_evaluators::exported::EstrinEvaluatorWithoutFMA;
using internal_polynomial_evaluators::exported::HornerEvaluator;
using internal_polynomial_evaluators::exported::HornerEvaluatorWithoutFMA;

} // namespace numerics
} // namespace principia

10 changes: 5 additions & 5 deletions numerics/polynomial_evaluators_body.hpp
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ struct InternalEstrinEvaluator {
using ArgumentSquares = typename ArgumentSquaresGenerator::Type;
using Coefficients =
typename PolynomialInMonomialBasis<
Value, Argument, degree, exported::EstrinEvaluator>::Coefficients;
Value, Argument, degree, numerics::EstrinEvaluator>::Coefficients;

FORCE_INLINE(static) Derivative<Value, Argument, low> Evaluate(
Coefficients const& coefficients,
@@ -90,7 +90,7 @@ struct InternalEstrinEvaluator<Value, Argument, degree, fma, low, 1> {
using ArgumentSquares = typename ArgumentSquaresGenerator::Type;
using Coefficients =
typename PolynomialInMonomialBasis<
Value, Argument, degree, exported::EstrinEvaluator>::Coefficients;
Value, Argument, degree, numerics::EstrinEvaluator>::Coefficients;

FORCE_INLINE(static) Derivative<Value, Argument, low> Evaluate(
Coefficients const& coefficients,
@@ -109,7 +109,7 @@ struct InternalEstrinEvaluator<Value, Argument, degree, fma, low, 0> {
using ArgumentSquares = typename ArgumentSquaresGenerator::Type;
using Coefficients =
typename PolynomialInMonomialBasis<
Value, Argument, degree, exported::EstrinEvaluator>::Coefficients;
Value, Argument, degree, numerics::EstrinEvaluator>::Coefficients;

FORCE_INLINE(static) Derivative<Value, Argument, low> Evaluate(
Coefficients const& coefficients,
@@ -299,7 +299,7 @@ template<typename Value, typename Argument, int degree, bool fma, int low>
struct InternalHornerEvaluator {
using Coefficients =
typename PolynomialInMonomialBasis<
Value, Argument, degree, exported::HornerEvaluator>::Coefficients;
Value, Argument, degree, numerics::HornerEvaluator>::Coefficients;

FORCE_INLINE(static) Derivative<Value, Argument, low>
Evaluate(Coefficients const& coefficients,
@@ -313,7 +313,7 @@ template<typename Value, typename Argument, int degree, bool fma>
struct InternalHornerEvaluator<Value, Argument, degree, fma, degree> {
using Coefficients =
typename PolynomialInMonomialBasis<
Value, Argument, degree, exported::HornerEvaluator>::Coefficients;
Value, Argument, degree, numerics::HornerEvaluator>::Coefficients;

FORCE_INLINE(static) Derivative<Value, Argument, degree>
Evaluate(Coefficients const& coefficients,