Checkpoint the party/runtime stack before share-program and malicious-mode work.
Ship the TLS mesh, composer, Beaver/Yao/leaf MPC, prep/online paths, apps, and docs so the tree is pushable before elevating share_expr, security_mode, and prep resume. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
695f8e84f7
commit
0d22946a0e
1835 changed files with 170291 additions and 2849 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <tuple>
|
||||
|
||||
#include "grotto/range_lut.hpp"
|
||||
|
||||
|
|
@ -103,16 +104,26 @@ bool near_odd_multiple_of_half_pi(long double x)
|
|||
|
||||
TEST(RangeLut, LogarithmsTrackLibmOnEveryPrecision)
|
||||
{
|
||||
const grotto::reduced maps[] = {
|
||||
grotto::reduced::ln, grotto::reduced::lg, grotto::reduced::log10,
|
||||
};
|
||||
const long double samples[] = {
|
||||
0.125L, 0.3L, 0.5L, 0.75L, 1.0L, 1.5L, 2.0L, 3.0L, 7.5L, 16.0L, 24.0L, 100.0L,
|
||||
};
|
||||
for (auto which : maps)
|
||||
for (unsigned k : grotto::principal_precisions)
|
||||
for (long double x : samples)
|
||||
expect_ulps(which, k, x, 6.0L);
|
||||
for (unsigned k : grotto::principal_precisions)
|
||||
{
|
||||
for (long double x : samples)
|
||||
{
|
||||
expect_ulps(grotto::reduced::ln, k, x, 1.0L);
|
||||
expect_ulps(grotto::reduced::log10, k, x, 1.0L);
|
||||
expect_ulps(grotto::reduced::lg, k, x, 2.0L);
|
||||
}
|
||||
for (int exp : {-20, 20})
|
||||
{
|
||||
const long double x = std::ldexp(1.0L, exp);
|
||||
if (raw_of(x, k) == 0)
|
||||
continue;
|
||||
expect_ulps(grotto::reduced::ln, k, x, 1.0L);
|
||||
expect_ulps(grotto::reduced::log10, k, x, 1.0L);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST(RangeLut, ExponentialsTrackLibmOnEveryPrecision)
|
||||
|
|
@ -120,10 +131,12 @@ TEST(RangeLut, ExponentialsTrackLibmOnEveryPrecision)
|
|||
const long double samples[] = {
|
||||
-2.0L, -1.5L, -0.5L, -0.1L, 0.0L, 0.1L, 0.5L, 1.0L, 1.5L, 2.0L,
|
||||
};
|
||||
for (auto which : {grotto::reduced::exp, grotto::reduced::exp2})
|
||||
for (unsigned k : grotto::principal_precisions)
|
||||
for (long double x : samples)
|
||||
expect_ulps(which, k, x, 16.0L);
|
||||
for (unsigned k : grotto::principal_precisions)
|
||||
for (long double x : samples)
|
||||
{
|
||||
expect_ulps(grotto::reduced::exp, k, x, 1.0L);
|
||||
expect_ulps(grotto::reduced::exp2, k, x, 2.0L);
|
||||
}
|
||||
for (unsigned k : grotto::principal_precisions)
|
||||
{
|
||||
for (long double x : {-0.9L, -0.25L, 0.0L, 0.25L, 0.9L})
|
||||
|
|
@ -259,7 +272,7 @@ TEST(RangeLut, TanAndSecPolesThrow)
|
|||
{
|
||||
try
|
||||
{
|
||||
(void)grotto::eval_reduced(which, k, raw);
|
||||
grotto::eval_reduced(which, k, raw);
|
||||
}
|
||||
catch (const std::domain_error &)
|
||||
{
|
||||
|
|
@ -290,7 +303,7 @@ TEST(RangeLut, Exp10RejectsAnIntegerPowerPast18)
|
|||
{
|
||||
try
|
||||
{
|
||||
(void)grotto::eval_reduced(grotto::reduced::exp10, k, raw_of(static_cast<long double>(n), k));
|
||||
grotto::eval_reduced(grotto::reduced::exp10, k, raw_of(static_cast<long double>(n), k));
|
||||
}
|
||||
catch (const std::overflow_error &)
|
||||
{
|
||||
|
|
@ -302,10 +315,8 @@ TEST(RangeLut, Exp10RejectsAnIntegerPowerPast18)
|
|||
ASSERT_LE(first_overflow, 19);
|
||||
EXPECT_NO_THROW(grotto::eval_reduced(grotto::reduced::exp10, k,
|
||||
raw_of(static_cast<long double>(first_overflow - 1), k)));
|
||||
EXPECT_THROW(grotto::eval_reduced(grotto::reduced::exp10, k, raw_of(19.0L, k)),
|
||||
std::overflow_error);
|
||||
EXPECT_THROW(grotto::eval_reduced(grotto::reduced::exp10, k, raw_of(-19.0L, k)),
|
||||
std::overflow_error);
|
||||
EXPECT_THROW(grotto::eval_reduced(grotto::reduced::exp10, k, raw_of(19.0L, k)), std::overflow_error);
|
||||
EXPECT_THROW(grotto::eval_reduced(grotto::reduced::exp10, k, raw_of(-19.0L, k)), std::overflow_error);
|
||||
}
|
||||
|
||||
TEST(RangeLut, Expm1AndLog1pTrackLibm)
|
||||
|
|
@ -325,9 +336,28 @@ TEST(RangeLut, Expm1AndLog1pTrackLibm)
|
|||
expect_ulps(grotto::reduced::log1p, k, std::ldexp(1.0L, -static_cast<int>(k)), 2.0L);
|
||||
expect_ulps(grotto::reduced::log1p, k, -std::ldexp(1.0L, -static_cast<int>(k)), 2.0L);
|
||||
for (long double x : expm1_samples)
|
||||
expect_ulps(grotto::reduced::expm1, k, x, 20.0L);
|
||||
expect_ulps(grotto::reduced::expm1, k, x, 1.0L);
|
||||
for (long double x : log1p_samples)
|
||||
expect_ulps(grotto::reduced::log1p, k, x, 8.0L);
|
||||
expect_ulps(grotto::reduced::log1p, k, x, 1.0L);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(RangeLut, ReciprocalFamilyStaysInsideOneUlpAfterTheLift)
|
||||
{
|
||||
const long double samples[] = {
|
||||
std::ldexp(1.0L, -12), 0.015625L, 0.125L, 0.5L, 0.75L, 1.0L, 1.5L, 3.0L, 8.0L, 100.0L,
|
||||
};
|
||||
for (auto which : {grotto::reduced::inv, grotto::reduced::rsqrt, grotto::reduced::invsq})
|
||||
{
|
||||
for (unsigned k : {16u, 32u})
|
||||
{
|
||||
for (long double x : samples)
|
||||
{
|
||||
if (k == 16 && x < std::ldexp(1.0L, -10))
|
||||
continue;
|
||||
expect_ulps(which, k, x, 1.0L);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue