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:
Ryan Henry 2026-09-28 05:59:19 -06:00
parent 695f8e84f7
commit 0d22946a0e
1835 changed files with 170291 additions and 2849 deletions

View file

@ -21,9 +21,19 @@ namespace gadgets
{
static constexpr double celu_default_alpha = 1;
/// @brief Cleartext `celu`.
/// @see grotto::eval_closed
/// @tparam alpha functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & alpha = celu_default_alpha>
struct celu
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -25,8 +25,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `elish`.
/// @see grotto::eval_window
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) elish
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -21,9 +21,19 @@ namespace gadgets
{
static constexpr double elu_default_alpha = 1;
/// @brief Cleartext `elu`.
/// @see grotto::eval_closed
/// @tparam alpha functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & alpha = elu_default_alpha>
struct elu
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `gelu`.
/// @see grotto::eval_window
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) gelu
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `hardelish`.
/// @see grotto::eval_window with `window::hardelish`
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct hardelish
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -25,9 +25,19 @@ HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
static constexpr double hardshrink_default_lambda = 0.5;
/// @brief Cleartext `hardshrink`.
/// @see grotto::make_hardshrink_lut
/// @tparam lambda functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & lambda = hardshrink_default_lambda>
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_hardshrink_lut) hardshrink
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `hardsigmoid`.
/// @see grotto::make_hardsigmoid_lut
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_hardsigmoid_lut) hardsigmoid
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `hardswish`.
/// @see grotto::make_hardswish_lut
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_hardswish_lut) hardswish
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `hardtanh`.
/// @see grotto::make_hardtanh_lut
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_hardtanh_lut) hardtanh
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -26,9 +26,21 @@ HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
static constexpr double leakyrelu_default_negative_slope = 0.01;
static constexpr double leakyrelu_zero_negative_slope = 0.0;
/// @brief Cleartext `leakyrelu`. The default slope `0.01` is
/// `make_leaky_relu_hundredth_lut`. A power-of-two slope is
/// `make_leaky_relu_lut`.
/// @see grotto::make_leaky_relu_hundredth_lut
/// @tparam negative_slope functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & negative_slope = leakyrelu_default_negative_slope>
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_leaky_relu_lut) leakyrelu
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_leaky_relu_hundredth_lut) leakyrelu
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -21,8 +21,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `lecun_tanh`.
/// @see grotto::eval_window with `window::lecun_tanh`
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct lecun_tanh
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -25,8 +25,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `logsigmoid`.
/// @see grotto::eval_window
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) logsigmoid
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::log(sigmoid{}(x)); }
};

View file

@ -25,8 +25,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `mish`.
/// @see grotto::eval_window
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) mish
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ namespace gadgets
HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `one_minus_sigmoid`.
/// @see grotto::eval_window with `window::one_minus_sigmoid`
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) one_minus_sigmoid
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -23,6 +23,9 @@ namespace gadgets
HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Alias of another cleartext functor, under the name `relu`.
/// @see grotto::make_relu_lut
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
using relu HEDLEY_DEPRECATED_FOR(2026, grotto::make_relu_lut) = leakyrelu<leakyrelu_zero_negative_slope>;
HEDLEY_DIAGNOSTIC_POP

View file

@ -25,9 +25,19 @@ HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
static constexpr double relu6_default_clip = 6;
/// @brief Cleartext `relu6`.
/// @see grotto::make_relu6_lut
/// @tparam clip functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & clip = 6>
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_relu6_lut) relu6
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -22,10 +22,21 @@ namespace gadgets
static constexpr double selu_default_alpha = 1.6732632423543772848170429916717;
static constexpr double selu_default_scale = 1.0507009873554804934193349852946;
/// @brief Cleartext `selu`.
/// @see grotto::eval_closed
/// @tparam scale functor parameter (a `double` bound or scale)
/// @tparam alpha functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & alpha = selu_default_alpha,
double const & scale = selu_default_scale>
struct selu
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -25,8 +25,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `serf`.
/// @see grotto::eval_window
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) serf
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `sigmoid`.
/// @see grotto::eval_window
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) sigmoid
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return 1/(1+std::exp(-x)); }
};

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `silu`.
/// @see grotto::eval_window
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) silu
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x*sigmoid{}(x); }
};

View file

@ -25,9 +25,19 @@ HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
static constexpr double smoothstep_default_gamma = 1;
/// @brief Cleartext `smoothstep`.
/// @see grotto::eval_window
/// @tparam gamma functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & gamma = smoothstep_default_gamma>
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) smoothstep
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -26,9 +26,19 @@ HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
static constexpr double softminus_default_beta = 1;
/// @brief Cleartext `softminus`.
/// @see grotto::eval_window
/// @tparam beta functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & beta = softminus_default_beta>
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) softminus
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -25,9 +25,19 @@ HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
static constexpr double softplus_default_beta = 1;
/// @brief Cleartext `softplus`.
/// @see grotto::eval_window
/// @tparam beta functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & beta = softplus_default_beta>
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) softplus
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -25,9 +25,19 @@ HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
static constexpr double softshrink_default_lambda = 0.5;
/// @brief Cleartext `softshrink`.
/// @see grotto::make_softshrink_lut
/// @tparam lambda functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & lambda = softshrink_default_lambda>
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_softshrink_lut) softshrink
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `hardsign`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct hardsign
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x/(1+std::abs(x)); }
};

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `squared_relu`.
/// @see grotto::make_squared_relu_lut
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_squared_relu_lut) squared_relu
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -22,10 +22,21 @@ namespace gadgets
static constexpr double starrelu_default_scale = 0.8944;
static constexpr double starrelu_default_shift = -0.4472;
/// @brief Cleartext `starrelu`.
/// @see grotto::make_relu_lut
/// @tparam shift functor parameter (a `double` bound or scale)
/// @tparam scale functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template<double const & scale = starrelu_default_scale,
double const & shift = starrelu_default_shift>
struct starrelu
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `tanhexp`.
/// @see grotto::eval_window
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) tanhexp
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x*std::tanh(std::exp(x)); }
};

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `tanhshrink`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct tanhshrink
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x -std::tanh(x); }
};

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::make_msb_lut
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::eval_bit_ceil
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::eval_bit_floor
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::eval_bit_width
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::exact_constant
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::eval_countl_one
} // namespace gadgets
} // namespace grotto

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `countl_zero`.
/// @see grotto::exact_constant
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) countl_zero
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `has_single_bit`.
/// @see grotto::eval_has_single_bit
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct has_single_bit
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -18,6 +18,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::prefix_parities
} // namespace gadgets
} // namespace grotto

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `sgn`.
/// @see grotto::exact_constant
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) sgn
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::eval_dec_ceil
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::eval_dec_floor
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::eval_dec_width
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::eval_has_single_digit
} // namespace gadgets
} // namespace grotto

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `abs`.
/// @see grotto::make_abs_lut
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_abs_lut) abs
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::abs(static_cast<double>(x)); }
};

View file

@ -23,10 +23,21 @@ namespace gadgets
static constexpr double approx_default_target = 0;
static constexpr unsigned approx_default_ULPs = 1;
/// @brief Cleartext `approx`.
/// @see grotto::make_threshold_lut
/// @tparam ULPs functor parameter (a `double` bound or scale)
/// @tparam target functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & target = approx_default_target,
unsigned const & ULPs = approx_default_ULPs>
struct approx
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::abs(x - target) <= ULPs * ulp_of(target) ? 1 : 0; }
};

View file

@ -22,12 +22,25 @@ namespace gadgets
static constexpr double boxcar_default_outside = 0;
static constexpr double boxcar_default_inside = 1;
/// @brief Cleartext `boxcar`.
/// @see grotto::make_interval_lut
/// @tparam inside functor parameter (a `double` bound or scale)
/// @tparam outside functor parameter (a `double` bound or scale)
/// @tparam to functor parameter (a `double` bound or scale)
/// @tparam from functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & from,
double const & to,
double const & outside = boxcar_default_outside,
double const & inside = boxcar_default_inside>
struct boxcar
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return (x < from || x > to) ? outside : inside; }
};

View file

@ -23,11 +23,22 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `clip`.
/// @see grotto::make_clip_lut
/// @tparam upper functor parameter (a `double` bound or scale)
/// @tparam lower functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & lower,
double const & upper>
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_clip_lut) clip
{
static_assert(lower <= upper);
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::max(std::min(x, upper), lower); }
};

View file

@ -19,9 +19,19 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `eq`.
/// @see grotto::make_threshold_lut
/// @tparam target functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & target>
struct eq
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x == target; }
};

View file

@ -19,9 +19,19 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `geq`.
/// @see grotto::make_threshold_lut
/// @tparam target functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & target>
struct geq
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x >= target; }
};

View file

@ -19,9 +19,19 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `gt`.
/// @see grotto::make_threshold_lut
/// @tparam target functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & target>
struct gt
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x > target; }
};

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::fixedpoint
} // namespace gadgets
} // namespace grotto

View file

@ -19,9 +19,19 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `leq`.
/// @see grotto::make_threshold_lut
/// @tparam target functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & target>
struct leq
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x <= target; }
};

View file

@ -19,9 +19,19 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `lt`.
/// @see grotto::make_threshold_lut
/// @tparam target functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & target>
struct lt
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x < target; }
};

View file

@ -17,6 +17,9 @@ namespace gadgets
{
static constexpr double lt_target_zero = 0;
/// @brief Alias of another cleartext functor, under the name `negative`.
/// @see grotto::exact_constant
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
using negative HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = lt<lt_target_zero>;
} // namespace gadgets

View file

@ -19,9 +19,19 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `neq`.
/// @see grotto::make_nonzero_lut
/// @tparam target functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & target>
struct neq
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x != target; }
};

View file

@ -17,6 +17,9 @@ namespace gadgets
{
static constexpr double geq_target_zero = 0;
/// @brief Alias of another cleartext functor, under the name `nonnegative`.
/// @see grotto::exact_constant
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
using nonnegative HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = geq<geq_target_zero>;
} // namespace gadgets

View file

@ -17,6 +17,9 @@ namespace gadgets
{
static constexpr double leq_target_zero = 0;
/// @brief Alias of another cleartext functor, under the name `nonpositive`.
/// @see grotto::exact_constant
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
using nonpositive HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = leq<leq_target_zero>;
} // namespace gadgets

View file

@ -17,6 +17,9 @@ namespace gadgets
{
static constexpr double neq_target_zero = 0;
/// @brief Alias of another cleartext functor, under the name `nonzero`.
/// @see grotto::exact_constant
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
using nonzero HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = neq<neq_target_zero>;
} // namespace gadgets

View file

@ -16,6 +16,10 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::gadget_hints
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
} // namespace gadgets
} // namespace grotto

View file

@ -17,6 +17,9 @@ namespace gadgets
{
static constexpr double gt_target_zero = 0;
/// @brief Alias of another cleartext functor, under the name `positive`.
/// @see grotto::exact_constant
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
using positive HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = gt<gt_target_zero>;
} // namespace gadgets

View file

@ -19,8 +19,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `rect`.
/// @see grotto::make_zero_lut
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct rect
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x == 0; }
};

View file

@ -22,11 +22,23 @@ namespace gadgets
static constexpr double step_default_before = 0;
static constexpr double step_default_after = 1;
/// @brief Cleartext `step`.
/// @see grotto::make_exact_step_lut
/// @tparam after functor parameter (a `double` bound or scale)
/// @tparam before functor parameter (a `double` bound or scale)
/// @tparam at functor parameter (a `double` bound or scale)
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
template <double const & at,
double const & before = step_default_before,
double const & after = step_default_after>
struct step
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return x < at ? before : after; }
};

View file

@ -16,6 +16,10 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::gadget_hints
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
} // namespace gadgets
} // namespace grotto

View file

@ -17,6 +17,9 @@ namespace gadgets
{
static constexpr double eq_target_zero = 0;
/// @brief Alias of another cleartext functor, under the name `zero`.
/// @see grotto::exact_constant
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
using zero HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = eq<eq_target_zero>;
} // namespace gadgets

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `exp`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) exp
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::min(std::exp(static_cast<double>(x)), std::numeric_limits<T>::max()); }
};

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `exp10`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) exp10
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::min(std::pow(10, static_cast<double>(x)), std::numeric_limits<T>::max()); }
};

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `exp2`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) exp2
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::min(std::exp2(static_cast<double>(x)), std::numeric_limits<T>::max()); }
};

View file

@ -22,8 +22,17 @@ namespace gadgets
// Returns the inverse hyperbolic cosine of a number.
// The number must be greater than or equal to 1.
/// @brief Cleartext `acosh`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct acosh
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) {
if (x < 1) return -1; // TODO

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `acoth`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct acoth
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) {
if (std::abs(x) <= 1) return 0; // TODO

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `acsch`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct acsch
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `asech`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct asech
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `asinh`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct asinh
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::asinh(static_cast<double>(x)); }
};

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `atanh`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct atanh
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `cosh`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) cosh
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::min(std::cosh(static_cast<double>(x)), std::numeric_limits<T>::max()); }
};

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `coth`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) coth
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `csch`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) csch
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `sech`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) sech
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return 1/std::cosh(static_cast<double>(x)); }
};

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `sinh`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) sinh
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `tanh`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) tanh
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::tanh(static_cast<double>(x)); }
};

View file

@ -24,8 +24,17 @@ namespace gadgets
HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `ilog10`.
/// @see grotto::exact_constant
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) ilog10
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `ilog16`.
/// @see grotto::eval_ilog16
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct ilog16
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `ilog256`.
/// @see grotto::eval_ilog256
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct ilog256
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `ilogb`.
/// @see grotto::exact_constant
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) ilogb
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `lg`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) lg
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `ln`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) ln
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `log10`.
/// @see grotto::eval_reduced
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_reduced) log10
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -16,6 +16,10 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::gadget_hints
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,9 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::eval_logstar
} // namespace gadgets
} // namespace grotto

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `entropy`.
/// @see grotto::gadgets::ln
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct entropy
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `erf`.
/// @see grotto::eval_window
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) erf
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { std::erf(static_cast<double>(x)); }
};

View file

@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
/// @brief Cleartext `erfc`.
/// @see grotto::eval_window
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) erfc
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x) { return std::erfc(static_cast<double>(x)); }
};

View file

@ -16,6 +16,10 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::gadget_hints
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,10 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::gadget_hints
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
} // namespace gadgets
} // namespace grotto

View file

@ -17,6 +17,10 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::gadget_hints
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,10 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::gadget_hints
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,10 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::gadget_hints
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
} // namespace gadgets
} // namespace grotto

View file

@ -16,6 +16,10 @@ namespace gadgets
/// @note This header declares no callable.
/// Complexity is stated on the sibling that evaluates the map, when one exists.
/// @see grotto::gadget_hints
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
} // namespace gadgets
} // namespace grotto

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `cbrt`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct cbrt
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `icbrt`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct icbrt
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

View file

@ -20,8 +20,17 @@ namespace grotto
namespace gadgets
{
/// @brief Cleartext `iqtrt`.
/// @see grotto::eval_closed
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
struct iqtrt
{
/// @brief Evaluate the cleartext map.
/// @tparam T argument and result type
/// @param x the input
/// @return the cleartext image of `x`
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
template <typename T>
T operator()(T x)
{

Some files were not shown because too many files have changed in this diff Show more