diff --git a/functions/accurate_table_generator_body.hpp b/functions/accurate_table_generator_body.hpp index c5b03c6c56..d4144cebfc 100644 --- a/functions/accurate_table_generator_body.hpp +++ b/functions/accurate_table_generator_body.hpp @@ -278,7 +278,7 @@ absl::StatusOr StehléZimmermannSimultaneousSearch( // The lattice really has integer coefficients, but this is inconvenient to // propagate through the matrix algorithms. (It would require copies instead // of views for all the types, not just the ones we use here.) - Lattice const V = ToInt(LenstraLenstraLovász(ToRational(L))); + Lattice const V = NguyễnStehlé(L); VLOG(2) << "V = " << V; // Step 8: find the three shortest vectors of the reduced lattice. We sort diff --git a/functions/accurate_table_generator_test.cpp b/functions/accurate_table_generator_test.cpp index d387ecd9b5..5b9d2e4fc3 100644 --- a/functions/accurate_table_generator_test.cpp +++ b/functions/accurate_table_generator_test.cpp @@ -457,17 +457,21 @@ TEST_F(AccurateTableGeneratorTest, DISABLED_SECULAR_SinCos18) { -cpp_rational(Cos(x₀) / 2)}, x₀); + // The remainders don't need to be extremely precise, so for speed + // they are computed using double. auto const remainder_sin_taylor2 = - [x₀ = cpp_rational(x₀)](cpp_rational const& x) { - auto const Δx = x - x₀; - auto const Δx³ = static_cast(Δx * Δx * Δx); - return -Δx³ * -Cos(std::min(x, x₀)) / Factorial(3); + [x₀ = static_cast(cpp_rational(x₀))]( + cpp_rational const& x) { + auto const Δx = static_cast(x) - x₀; + auto const Δx³ = Δx * Δx * Δx; + return -Δx³ * -std::cos(std::min(x₀ + Δx, x₀)) / Factorial(3); }; auto const remainder_cos_taylor2 = - [x₀ = cpp_rational(x₀)](cpp_rational const& x) { - auto const Δx = x - x₀; - auto const Δx³ = static_cast(Δx * Δx * Δx); - return Δx³ * Sin(std::max(x, x₀)) / Factorial(3); + [x₀ = static_cast(cpp_rational(x₀))]( + cpp_rational const& x) { + auto const Δx = static_cast(x) - x₀; + auto const Δx³ = Δx * Δx * Δx; + return Δx³ * std::sin(std::max(x₀ + Δx, x₀)) / Factorial(3); }; starting_arguments.push_back(x₀);