From 40a81510d94534059969d3040b60ca1f67b86344 Mon Sep 17 00:00:00 2001 From: ianpike Date: Mon, 24 Aug 2026 15:27:28 -0400 Subject: [PATCH 1/6] Rework our doxygen comments to be inline with our current standing style conventions. --- CONTRIBUTING.md | 3 +- CONVENTIONS.md | 3 + docs/ULP_STATUS.md | 11 +- include/ccmath/ext/abs_diff.hpp | 10 +- include/ccmath/ext/align.hpp | 32 +- include/ccmath/ext/approximately.hpp | 12 +- include/ccmath/ext/ceil_div.hpp | 10 +- include/ccmath/ext/clamp.hpp | 28 +- include/ccmath/ext/cubic.hpp | 16 +- include/ccmath/ext/degrees.hpp | 8 +- include/ccmath/ext/delta_angle.hpp | 10 +- include/ccmath/ext/fract.hpp | 8 +- include/ccmath/ext/inverse_lerp.hpp | 12 +- include/ccmath/ext/is_power_of_two.hpp | 24 +- include/ccmath/ext/lerp_angle.hpp | 12 +- include/ccmath/ext/lerp_smooth.hpp | 14 +- include/ccmath/ext/move_towards.hpp | 12 +- include/ccmath/ext/move_towards_angle.hpp | 12 +- include/ccmath/ext/normalize.hpp | 24 +- include/ccmath/ext/ping_pong.hpp | 10 +- include/ccmath/ext/radians.hpp | 8 +- include/ccmath/ext/rcp.hpp | 8 +- include/ccmath/ext/remap.hpp | 32 +- include/ccmath/ext/repeat.hpp | 20 +- include/ccmath/ext/saturate.hpp | 8 +- include/ccmath/ext/sign.hpp | 8 +- include/ccmath/ext/smoothstep.hpp | 12 +- include/ccmath/ext/step.hpp | 10 +- include/ccmath/ext/unlerp.hpp | 24 +- .../internal/math/common/basic/fabs.hpp | 2 +- .../internal/math/common/basic/fdim.hpp | 2 +- .../ccmath/internal/math/common/basic/fma.hpp | 76 ++-- .../internal/math/common/basic/fmod.hpp | 56 +-- .../ccmath/internal/math/common/basic/max.hpp | 70 ++-- .../ccmath/internal/math/common/basic/min.hpp | 56 +-- .../ccmath/internal/math/common/basic/nan.hpp | 18 +- .../internal/math/common/basic/remainder.hpp | 38 +- .../internal/math/common/basic/remquo.hpp | 72 ++-- .../math/common/compare/fpclassify.hpp | 10 +- .../internal/math/common/compare/isfinite.hpp | 14 +- .../math/common/compare/isgreater.hpp | 24 +- .../math/common/compare/isgreaterequal.hpp | 24 +- .../internal/math/common/compare/isinf.hpp | 14 +- .../internal/math/common/compare/isless.hpp | 24 +- .../math/common/compare/islessequal.hpp | 24 +- .../math/common/compare/islessgreater.hpp | 24 +- .../internal/math/common/compare/isnan.hpp | 16 +- .../internal/math/common/compare/isnormal.hpp | 16 +- .../math/common/compare/isunordered.hpp | 30 +- .../internal/math/common/compare/signbit.hpp | 30 +- .../ccmath/internal/math/common/expo/exp.hpp | 28 +- .../ccmath/internal/math/common/expo/exp2.hpp | 28 +- .../ccmath/internal/math/common/expo/log.hpp | 28 +- .../ccmath/internal/math/common/expo/log2.hpp | 28 +- .../internal/math/common/fmanip/copysign.hpp | 36 +- .../internal/math/common/fmanip/ldexp.hpp | 56 +-- .../internal/math/common/fmanip/scalbn.hpp | 72 ++-- .../internal/math/common/nearest/floor.hpp | 28 +- .../math/common/nearest/nearbyint.hpp | 28 +- .../internal/math/common/nearest/trunc.hpp | 28 +- .../internal/math/common/power/sqrt.hpp | 30 +- .../ccmath/internal/math/common/trig/cos.hpp | 2 +- .../ccmath/internal/math/common/trig/sin.hpp | 2 +- .../ccmath/internal/math/common/trig/tan.hpp | 2 +- .../math/generic/builtins/basic/fabs.hpp | 4 +- .../math/generic/builtins/basic/fdim.hpp | 4 +- .../math/generic/builtins/basic/fma.hpp | 8 +- .../math/generic/builtins/basic/fmax.hpp | 4 +- .../math/generic/builtins/basic/fmin.hpp | 4 +- .../math/generic/builtins/basic/fmod.hpp | 4 +- .../math/generic/builtins/basic/nan.hpp | 4 +- .../math/generic/builtins/basic/remainder.hpp | 4 +- .../math/generic/builtins/basic/remquo.hpp | 4 +- .../math/generic/builtins/builtin_helpers.hpp | 8 +- .../generic/builtins/compare/isfinite.hpp | 4 +- .../builtins/compare/isgreaterequal.hpp | 4 +- .../math/generic/builtins/compare/isinf.hpp | 4 +- .../math/generic/builtins/compare/isless.hpp | 4 +- .../generic/builtins/compare/islessequal.hpp | 4 +- .../builtins/compare/islessgreater.hpp | 4 +- .../math/generic/builtins/compare/isnan.hpp | 4 +- .../generic/builtins/compare/isnormal.hpp | 4 +- .../generic/builtins/compare/isunordered.hpp | 4 +- .../math/generic/builtins/compare/signbit.hpp | 4 +- .../math/generic/builtins/expo/exp.hpp | 4 +- .../math/generic/builtins/expo/exp2.hpp | 4 +- .../math/generic/builtins/expo/expm1.hpp | 4 +- .../math/generic/builtins/expo/log.hpp | 4 +- .../math/generic/builtins/expo/log10.hpp | 4 +- .../math/generic/builtins/expo/log1p.hpp | 4 +- .../math/generic/builtins/expo/log2.hpp | 4 +- .../math/generic/builtins/fmanip/copysign.hpp | 4 +- .../math/generic/builtins/fmanip/frexp.hpp | 4 +- .../math/generic/builtins/fmanip/ilogb.hpp | 4 +- .../math/generic/builtins/fmanip/ldexp.hpp | 4 +- .../math/generic/builtins/fmanip/logb.hpp | 4 +- .../math/generic/builtins/fmanip/modf.hpp | 4 +- .../generic/builtins/fmanip/nextafter.hpp | 4 +- .../generic/builtins/fmanip/nexttoward.hpp | 4 +- .../math/generic/builtins/fmanip/scalbn.hpp | 6 +- .../math/generic/builtins/hyper/acosh.hpp | 4 +- .../math/generic/builtins/hyper/asinh.hpp | 4 +- .../math/generic/builtins/hyper/atanh.hpp | 4 +- .../math/generic/builtins/hyper/cosh.hpp | 4 +- .../math/generic/builtins/hyper/sinh.hpp | 4 +- .../math/generic/builtins/hyper/tanh.hpp | 4 +- .../math/generic/builtins/misc/erf.hpp | 4 +- .../math/generic/builtins/misc/erfc.hpp | 4 +- .../math/generic/builtins/misc/tgamma.hpp | 4 +- .../math/generic/builtins/nearest/ceil.hpp | 4 +- .../math/generic/builtins/nearest/floor.hpp | 4 +- .../generic/builtins/nearest/nearbyint.hpp | 4 +- .../math/generic/builtins/nearest/rint.hpp | 4 +- .../math/generic/builtins/nearest/round.hpp | 8 +- .../math/generic/builtins/nearest/trunc.hpp | 4 +- .../math/generic/builtins/power/cbrt.hpp | 4 +- .../math/generic/builtins/power/hypot.hpp | 4 +- .../math/generic/builtins/power/pow.hpp | 4 +- .../math/generic/builtins/power/sqrt.hpp | 4 +- .../math/generic/builtins/trig/acos.hpp | 4 +- .../math/generic/builtins/trig/asin.hpp | 4 +- .../math/generic/builtins/trig/atan.hpp | 4 +- .../math/generic/builtins/trig/atan2.hpp | 4 +- .../math/generic/builtins/trig/sin.hpp | 4 +- .../math/generic/builtins/trig/tan.hpp | 4 +- .../math/generic/func/basic/abs_gen.hpp | 10 +- .../math/generic/func/basic/fdim_gen.hpp | 12 +- .../math/generic/func/basic/fmod_gen.hpp | 56 +-- .../math/generic/func/basic/max_gen.hpp | 10 +- .../math/generic/func/basic/min_gen.hpp | 10 +- .../math/generic/func/basic/remainder_gen.hpp | 38 +- .../math/generic/func/compare/fpclassify.hpp | 10 +- .../math/generic/func/compare/isfinite.hpp | 14 +- .../math/generic/func/compare/isgreater.hpp | 24 +- .../generic/func/compare/isgreaterequal.hpp | 24 +- .../math/generic/func/compare/isinf.hpp | 14 +- .../math/generic/func/compare/isless.hpp | 24 +- .../math/generic/func/compare/islessequal.hpp | 24 +- .../generic/func/compare/islessgreater.hpp | 24 +- .../math/generic/func/compare/isnan.hpp | 16 +- .../math/generic/func/compare/isnormal.hpp | 16 +- .../math/generic/func/compare/isunordered.hpp | 30 +- .../math/generic/func/compare/signbit.hpp | 30 +- .../math/generic/func/fmanip/ldexp_gen.hpp | 44 +-- .../math/generic/func/fmanip/scalbn_gen.hpp | 72 ++-- .../math/generic/func/nearest/floor_gen.hpp | 28 +- .../math/generic/func/nearest/trunc_gen.hpp | 28 +- .../predef/expects_bool_condition.hpp | 2 +- include/ccmath/internal/support/bits.hpp | 16 +- .../internal/support/fenv/rounding_mode.hpp | 24 +- .../ccmath/internal/support/fp/fp_bits.hpp | 132 +++---- .../ccmath/internal/support/math_support.hpp | 10 +- .../ccmath/internal/support/meta_compare.hpp | 4 +- .../ccmath/internal/support/type_traits.hpp | 16 +- include/ccmath/internal/types/big_int.hpp | 330 +++++++++--------- .../ccmath/internal/types/dyadic_float.hpp | 142 ++++---- include/ccmath/math/basic/fabs.hpp | 66 ++-- include/ccmath/math/basic/fdim.hpp | 50 +-- include/ccmath/math/basic/fmod.hpp | 56 +-- include/ccmath/math/basic/max.hpp | 70 ++-- include/ccmath/math/basic/min.hpp | 56 +-- include/ccmath/math/basic/nan.hpp | 20 +- include/ccmath/math/basic/remainder.hpp | 38 +- include/ccmath/math/basic/remquo.hpp | 72 ++-- include/ccmath/math/compare/fpclassify.hpp | 10 +- include/ccmath/math/compare/isfinite.hpp | 14 +- include/ccmath/math/compare/isgreater.hpp | 24 +- .../ccmath/math/compare/isgreaterequal.hpp | 24 +- include/ccmath/math/compare/isinf.hpp | 14 +- include/ccmath/math/compare/isless.hpp | 24 +- include/ccmath/math/compare/islessequal.hpp | 24 +- include/ccmath/math/compare/islessgreater.hpp | 24 +- include/ccmath/math/compare/isnan.hpp | 16 +- include/ccmath/math/compare/isnormal.hpp | 16 +- include/ccmath/math/compare/isunordered.hpp | 30 +- include/ccmath/math/compare/signbit.hpp | 30 +- include/ccmath/math/expo/exp.hpp | 28 +- include/ccmath/math/expo/exp2.hpp | 28 +- include/ccmath/math/expo/expm1.hpp | 28 +- include/ccmath/math/expo/log.hpp | 28 +- include/ccmath/math/expo/log10.hpp | 28 +- include/ccmath/math/expo/log1p.hpp | 28 +- include/ccmath/math/expo/log2.hpp | 28 +- include/ccmath/math/fmanip/copysign.hpp | 36 +- include/ccmath/math/fmanip/frexp.hpp | 26 +- include/ccmath/math/fmanip/ilogb.hpp | 20 +- include/ccmath/math/fmanip/ldexp.hpp | 56 +-- include/ccmath/math/fmanip/logb.hpp | 20 +- include/ccmath/math/fmanip/modf.hpp | 26 +- include/ccmath/math/fmanip/nextafter.hpp | 38 +- include/ccmath/math/fmanip/nexttoward.hpp | 36 +- include/ccmath/math/fmanip/scalbn.hpp | 72 ++-- include/ccmath/math/misc/gamma.hpp | 28 +- include/ccmath/math/misc/lerp.hpp | 42 +-- include/ccmath/math/misc/lgamma.hpp | 28 +- include/ccmath/math/nearest/ceil.hpp | 30 +- include/ccmath/math/nearest/floor.hpp | 28 +- include/ccmath/math/nearest/nearbyint.hpp | 28 +- include/ccmath/math/nearest/rint.hpp | 30 +- include/ccmath/math/nearest/round.hpp | 30 +- include/ccmath/math/nearest/trunc.hpp | 28 +- include/ccmath/math/numbers.hpp | 2 +- include/ccmath/math/power/cbrt.hpp | 22 +- include/ccmath/math/power/hypot.hpp | 40 +-- include/ccmath/math/power/pow.hpp | 40 +-- include/ccmath/math/power/sqrt.hpp | 30 +- include/ccmath/math/trig/acos.hpp | 30 +- include/ccmath/math/trig/asin.hpp | 30 +- include/ccmath/math/trig/atan.hpp | 30 +- include/ccmath/math/trig/atan2.hpp | 28 +- include/ccmath/math/trig/cos.hpp | 30 +- include/ccmath/math/trig/sin.hpp | 30 +- include/ccmath/math/trig/tan.hpp | 30 +- 213 files changed, 2373 insertions(+), 2374 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62e8566a..28f089f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,8 @@ A quick map of the repository: 7. Mirror supported compiler behavior where the standard leaves details unspecified (for example `fpclassify` payload bits). 8. Add tests in the same change. Cover standards-mandated edge cases and ULP checks on public APIs. -9. Doxygen on exported entry points (`@brief`, `@param`, `@return`). +9. Doxygen on exported entry points (`\brief`, `\param` or `\tparam`, `\return`). Use the backslash form, not the + at-sign form. See [CONVENTIONS.md](CONVENTIONS.md). 10. Keep the public header layout and naming conventions aligned with [cppreference ``](https://en.cppreference.com/w/cpp/header/cmath). diff --git a/CONVENTIONS.md b/CONVENTIONS.md index a15f2e18..36a6803a 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -160,6 +160,9 @@ Everything builds clean under `-Werror` with aggressive warnings. ## Comments Public entry points get Doxygen: `\brief`, `\param` or `\tparam`, and `\return`. +Commands take the backslash form throughout. Doxygen accepts `@brief` as a synonym and +warns about neither, so nothing in the toolchain catches a mixed file. Keeping one form is +a review matter, and the tree is currently uniform. Implementation comments are for the why, not the what: the constraint, the tradeoff, the reason a builtin is or is not trusted. `pow.hpp` is a good model. diff --git a/docs/ULP_STATUS.md b/docs/ULP_STATUS.md index 3ffa0b90..23d8df31 100644 --- a/docs/ULP_STATUS.md +++ b/docs/ULP_STATUS.md @@ -1,13 +1,8 @@ # ULP status -The goal for ccmath is correctly rounded results in all four IEEE 754 rounding modes for every -function. We are not there yet, and this page is meant to be an honest picture of where each -function actually stands rather than a promise. It reports what was measured, how it was measured, -and what is still left to do. - -The companion page ROUNDING_STATUS.md tracks which rounding modes each function handles at runtime. -This page is about accuracy, the distance between the ccm result and the true correctly rounded -value. +ccmath aims for correctly rounded results in all four IEEE 754 rounding modes for every function. +This page records how close each function is, measured in ULP. ROUNDING_STATUS.md covers which +modes each function handles at runtime. ## How to read this diff --git a/include/ccmath/ext/abs_diff.hpp b/include/ccmath/ext/abs_diff.hpp index abfd66c2..6b4df372 100644 --- a/include/ccmath/ext/abs_diff.hpp +++ b/include/ccmath/ext/abs_diff.hpp @@ -15,11 +15,11 @@ namespace ccm::ext { /** - * @brief Compute the absolute difference between two integral values. - * @tparam T Integral type of both inputs. - * @param lhs The first value. - * @param rhs The second value. - * @return The absolute difference between lhs and rhs as the matching unsigned type. + * \brief Compute the absolute difference between two integral values. + * \tparam T Integral type of both inputs. + * \param lhs The first value. + * \param rhs The second value. + * \return The absolute difference between lhs and rhs as the matching unsigned type. */ template && !std::is_same_v, bool>, bool> = true> constexpr std::make_unsigned_t abs_diff(T lhs, T rhs) noexcept diff --git a/include/ccmath/ext/align.hpp b/include/ccmath/ext/align.hpp index a6c7f135..32e976db 100644 --- a/include/ccmath/ext/align.hpp +++ b/include/ccmath/ext/align.hpp @@ -29,12 +29,12 @@ namespace ccm::ext namespace AR = AlignmentRounding; /** - * @brief Aligns a value to the nearest multiple of the alignment. - * @tparam T The type of the value to align. - * @tparam alignment Alignment boundary as a compile-time constant. - * @tparam mode Alignment direction (eUP or eDOWN). - * @param value Value to align. - * @return value rounded to the nearest aligned multiple according to mode. + * \brief Aligns a value to the nearest multiple of the alignment. + * \tparam T The type of the value to align. + * \tparam alignment Alignment boundary as a compile-time constant. + * \tparam mode Alignment direction (eUP or eDOWN). + * \param value Value to align. + * \return value rounded to the nearest aligned multiple according to mode. */ template , bool> = true> constexpr T align(T value) noexcept { @@ -84,11 +84,11 @@ namespace ccm::ext } /** - * @brief Aligns a value upward to the next multiple of alignment. - * @tparam T Integral type. - * @tparam alignment Alignment boundary as a compile-time constant. - * @param value Value to align. - * @return value rounded up to the alignment boundary. + * \brief Aligns a value upward to the next multiple of alignment. + * \tparam T Integral type. + * \tparam alignment Alignment boundary as a compile-time constant. + * \param value Value to align. + * \return value rounded up to the alignment boundary. */ template , bool> = true> constexpr T align_up(T value) noexcept { @@ -96,11 +96,11 @@ namespace ccm::ext } /** - * @brief Aligns a value downward to the previous multiple of alignment. - * @tparam T Integral type. - * @tparam alignment Alignment boundary as a compile-time constant. - * @param value Value to align. - * @return value rounded down to the alignment boundary. + * \brief Aligns a value downward to the previous multiple of alignment. + * \tparam T Integral type. + * \tparam alignment Alignment boundary as a compile-time constant. + * \param value Value to align. + * \return value rounded down to the alignment boundary. */ template , bool> = true> constexpr T align_down(T value) noexcept { diff --git a/include/ccmath/ext/approximately.hpp b/include/ccmath/ext/approximately.hpp index 8a685a1c..b9dd7d7b 100644 --- a/include/ccmath/ext/approximately.hpp +++ b/include/ccmath/ext/approximately.hpp @@ -17,12 +17,12 @@ namespace ccm::ext { /** - * @brief Check whether two floating-point values are approximately equal. - * @tparam T Type of the input values. - * @param lhs The first value. - * @param rhs The second value. - * @param epsilon The maximum allowed absolute difference. - * @return True if the absolute difference between lhs and rhs is less than or equal to epsilon. + * \brief Check whether two floating-point values are approximately equal. + * \tparam T Type of the input values. + * \param lhs The first value. + * \param rhs The second value. + * \param epsilon The maximum allowed absolute difference. + * \return True if the absolute difference between lhs and rhs is less than or equal to epsilon. */ template , bool> = true> constexpr bool approximately(T lhs, T rhs, T epsilon) noexcept { diff --git a/include/ccmath/ext/ceil_div.hpp b/include/ccmath/ext/ceil_div.hpp index dac6b646..c3d5e349 100644 --- a/include/ccmath/ext/ceil_div.hpp +++ b/include/ccmath/ext/ceil_div.hpp @@ -15,17 +15,17 @@ namespace ccm::ext { /** - * @brief Divide two integral values and round the quotient toward positive infinity. + * \brief Divide two integral values and round the quotient toward positive infinity. * * If divisor is zero, this function returns 0. Otherwise it works for signed * and unsigned types and rounds correctly for negative operands. The behavior * is still undefined if the exact quotient is not representable in T, for * example the most negative value divided by minus one. * - * @tparam T Integral type of the inputs and output. - * @param value The dividend. - * @param divisor The divisor. - * @return The ceiling of value divided by divisor. + * \tparam T Integral type of the inputs and output. + * \param value The dividend. + * \param divisor The divisor. + * \return The ceiling of value divided by divisor. */ template && !std::is_same_v, bool>, bool> = true> constexpr T ceil_div(T value, T divisor) noexcept diff --git a/include/ccmath/ext/clamp.hpp b/include/ccmath/ext/clamp.hpp index c43d76c7..b3e5f3f3 100644 --- a/include/ccmath/ext/clamp.hpp +++ b/include/ccmath/ext/clamp.hpp @@ -18,12 +18,12 @@ namespace ccm::ext { /** - * @brief Clamps a value between a minimum and maximum value. - * @tparam T Type of the input and output. - * @param v Value to clamp. - * @param lo Minimum value. - * @param hi Maximum value. - * @return The clamped value. + * \brief Clamps a value between a minimum and maximum value. + * \tparam T Type of the input and output. + * \param v Value to clamp. + * \param lo Minimum value. + * \param hi Maximum value. + * \return The clamped value. */ template constexpr T clamp(T v, T lo = T{ 0 }, T hi = T{ 1 }) { @@ -31,14 +31,14 @@ namespace ccm::ext } /** - * @brief Clamps a value between a minimum and maximum value. - * @tparam TVal Type of the input value. - * @tparam TLow Type of the lower bound. - * @tparam THigh Type of the upper bound. - * @param v Value to clamp. - * @param lo Minimum value. - * @param hi Maximum value. - * @return The clamped value. + * \brief Clamps a value between a minimum and maximum value. + * \tparam TVal Type of the input value. + * \tparam TLow Type of the lower bound. + * \tparam THigh Type of the upper bound. + * \param v Value to clamp. + * \param lo Minimum value. + * \param hi Maximum value. + * \return The clamped value. */ template constexpr std::common_type_t clamp(TVal v, TLow lo = TLow{ 0 }, THigh hi = THigh{ 1 }) diff --git a/include/ccmath/ext/cubic.hpp b/include/ccmath/ext/cubic.hpp index 2f03f0ab..c5b53e43 100644 --- a/include/ccmath/ext/cubic.hpp +++ b/include/ccmath/ext/cubic.hpp @@ -15,14 +15,14 @@ namespace ccm::ext { /** - * @brief Cubic interpolation. - * @tparam T Type of the input and output. - * @param y0 The first value. - * @param y1 The second value. - * @param y2 The third value. - * @param y3 The fourth value. - * @param t The interpolation value. - * @return The interpolated value. + * \brief Cubic interpolation. + * \tparam T Type of the input and output. + * \param y0 The first value. + * \param y1 The second value. + * \param y2 The third value. + * \param y3 The fourth value. + * \param t The interpolation value. + * \return The interpolated value. */ template , bool> = true> constexpr T cubic(T y0, T y1, T y2, T y3, T t) { diff --git a/include/ccmath/ext/degrees.hpp b/include/ccmath/ext/degrees.hpp index c65cc35b..8789b23f 100644 --- a/include/ccmath/ext/degrees.hpp +++ b/include/ccmath/ext/degrees.hpp @@ -17,10 +17,10 @@ namespace ccm::ext { /** - * @brief Converts an angle in radians to degrees. - * @tparam T Floating-point type. - * @param radians Angle in radians. - * @return Angle in degrees. + * \brief Converts an angle in radians to degrees. + * \tparam T Floating-point type. + * \param radians Angle in radians. + * \return Angle in degrees. */ template , bool> = true> constexpr T degrees(T radians) noexcept { diff --git a/include/ccmath/ext/delta_angle.hpp b/include/ccmath/ext/delta_angle.hpp index b495d6b5..5bd577fb 100644 --- a/include/ccmath/ext/delta_angle.hpp +++ b/include/ccmath/ext/delta_angle.hpp @@ -18,11 +18,11 @@ namespace ccm::ext { /** - * @brief Compute the shortest signed difference between two angles in radians. - * @tparam T Type of the input and output. - * @param current The current angle, in radians. - * @param target The target angle, in radians. - * @return The shortest signed angular difference in the range [-pi, pi]. + * \brief Compute the shortest signed difference between two angles in radians. + * \tparam T Type of the input and output. + * \param current The current angle, in radians. + * \param target The target angle, in radians. + * \return The shortest signed angular difference in the range [-pi, pi]. */ template , bool> = true> constexpr T delta_angle(T current, T target) noexcept { diff --git a/include/ccmath/ext/fract.hpp b/include/ccmath/ext/fract.hpp index 461ddda7..3cca52ff 100644 --- a/include/ccmath/ext/fract.hpp +++ b/include/ccmath/ext/fract.hpp @@ -17,10 +17,10 @@ namespace ccm::ext { /** - * @brief Returns the fractional part of a floating-point number. - * @tparam T Type of the input and output. - * @param x Value to get the fractional part of. - * @return The fractional part of the input. + * \brief Returns the fractional part of a floating-point number. + * \tparam T Type of the input and output. + * \param x Value to get the fractional part of. + * \return The fractional part of the input. */ template , bool> = true> constexpr T fract(T x) noexcept { diff --git a/include/ccmath/ext/inverse_lerp.hpp b/include/ccmath/ext/inverse_lerp.hpp index b63542f5..7142791c 100644 --- a/include/ccmath/ext/inverse_lerp.hpp +++ b/include/ccmath/ext/inverse_lerp.hpp @@ -17,7 +17,7 @@ namespace ccm::ext { /** - * @brief Compute the inverse linear interpolation parameter of a value. + * \brief Compute the inverse linear interpolation parameter of a value. * * This is an alias-style wrapper around ext::unlerp. * @@ -25,11 +25,11 @@ namespace ccm::ext * function returns 0 to avoid division by zero and NaN propagation. For the * unguarded form see ccm::ext::unsafe::unlerp. * - * @tparam T Type of the input and output. - * @param start The start of the source range. - * @param end The end of the source range. - * @param value The value to evaluate. - * @return The interpolation parameter of value in the range [start, end]. + * \tparam T Type of the input and output. + * \param start The start of the source range. + * \param end The end of the source range. + * \param value The value to evaluate. + * \return The interpolation parameter of value in the range [start, end]. */ template , bool> = true> constexpr T inverse_lerp(T start, T end, T value) noexcept { diff --git a/include/ccmath/ext/is_power_of_two.hpp b/include/ccmath/ext/is_power_of_two.hpp index 4b425bc5..8c4ee6a3 100644 --- a/include/ccmath/ext/is_power_of_two.hpp +++ b/include/ccmath/ext/is_power_of_two.hpp @@ -17,11 +17,11 @@ namespace ccm::ext { /** - * @brief Determines if an unsigned integer value is a power of two. + * \brief Determines if an unsigned integer value is a power of two. * - * @tparam T Type of the input. - * @param n Value to check. - * @return True if the input is a power of two, false otherwise. + * \tparam T Type of the input. + * \param n Value to check. + * \return True if the input is a power of two, false otherwise. */ template && !std::is_same_v, bool> = true> constexpr bool is_power_of_two(T n) noexcept { @@ -29,15 +29,15 @@ namespace ccm::ext } /** - * @brief Determines if a signed integer value is a power of two. + * \brief Determines if a signed integer value is a power of two. * * Negative values and zero are never a power of two. The positive check is * done on the unsigned value, so the minimum representable value does not * trigger signed overflow. * - * @tparam T Type of the input. - * @param n Value to check. - * @return True if the input is a power of two, false otherwise. + * \tparam T Type of the input. + * \param n Value to check. + * \return True if the input is a power of two, false otherwise. */ template && !std::is_same_v, bool> = true> constexpr bool is_power_of_two(T n) noexcept { @@ -47,11 +47,11 @@ namespace ccm::ext } /** - * @brief Alias for is_power_of_two. + * \brief Alias for is_power_of_two. * - * @tparam T Type of the input. - * @param n Value to check. - * @return True if the input is a power of two, false otherwise. + * \tparam T Type of the input. + * \param n Value to check. + * \return True if the input is a power of two, false otherwise. */ template && !std::is_same_v, bool> = true> constexpr bool ispow2(T n) noexcept { diff --git a/include/ccmath/ext/lerp_angle.hpp b/include/ccmath/ext/lerp_angle.hpp index a28aaaac..f6aefe25 100644 --- a/include/ccmath/ext/lerp_angle.hpp +++ b/include/ccmath/ext/lerp_angle.hpp @@ -17,15 +17,15 @@ namespace ccm::ext { /** - * @brief Linearly interpolate between two angles in radians along the shortest arc. + * \brief Linearly interpolate between two angles in radians along the shortest arc. * * This function does not clamp t. Values of t outside [0, 1] extrapolate. * - * @tparam T Type of the input and output. - * @param start The start angle, in radians. - * @param end The end angle, in radians. - * @param t The interpolation parameter. - * @return The interpolated angle, in radians. + * \tparam T Type of the input and output. + * \param start The start angle, in radians. + * \param end The end angle, in radians. + * \param t The interpolation parameter. + * \return The interpolated angle, in radians. */ template , bool> = true> constexpr T lerp_angle(T start, T end, T t) noexcept { diff --git a/include/ccmath/ext/lerp_smooth.hpp b/include/ccmath/ext/lerp_smooth.hpp index 52a97f7f..29e32470 100644 --- a/include/ccmath/ext/lerp_smooth.hpp +++ b/include/ccmath/ext/lerp_smooth.hpp @@ -15,13 +15,13 @@ namespace ccm::ext { /** - * @brief Frame rate independent linear interpolation smoothing. - * @tparam T Type of the input and output. - * @param a Current value. - * @param b Target value. - * @param t Delta time, in seconds. - * @param h Half-life, time until halfway, in seconds. - * @return The smoothed value. + * \brief Frame rate independent linear interpolation smoothing. + * \tparam T Type of the input and output. + * \param a Current value. + * \param b Target value. + * \param t Delta time, in seconds. + * \param h Half-life, time until halfway, in seconds. + * \return The smoothed value. */ template constexpr T lerp_smooth(T a, T b, T t, T h) { diff --git a/include/ccmath/ext/move_towards.hpp b/include/ccmath/ext/move_towards.hpp index 7b9ea643..148ad7f2 100644 --- a/include/ccmath/ext/move_towards.hpp +++ b/include/ccmath/ext/move_towards.hpp @@ -17,12 +17,12 @@ namespace ccm::ext { /** - * @brief Move a value toward a target without overshooting. - * @tparam T Type of the input and output. - * @param current The current value. - * @param target The target value. - * @param max_delta The maximum change to apply. - * @return The moved value. + * \brief Move a value toward a target without overshooting. + * \tparam T Type of the input and output. + * \param current The current value. + * \param target The target value. + * \param max_delta The maximum change to apply. + * \return The moved value. */ template , bool> = true> constexpr T move_towards(T current, T target, T max_delta) noexcept { diff --git a/include/ccmath/ext/move_towards_angle.hpp b/include/ccmath/ext/move_towards_angle.hpp index 21465885..5ce48939 100644 --- a/include/ccmath/ext/move_towards_angle.hpp +++ b/include/ccmath/ext/move_towards_angle.hpp @@ -18,12 +18,12 @@ namespace ccm::ext { /** - * @brief Move an angle toward a target angle without overshooting. - * @tparam T Type of the input and output. - * @param current The current angle, in radians. - * @param target The target angle, in radians. - * @param max_delta The maximum angular change to apply, in radians. - * @return The moved angle, in radians. + * \brief Move an angle toward a target angle without overshooting. + * \tparam T Type of the input and output. + * \param current The current angle, in radians. + * \param target The target angle, in radians. + * \param max_delta The maximum angular change to apply, in radians. + * \return The moved angle, in radians. */ template , bool> = true> constexpr T move_towards_angle(T current, T target, T max_delta) noexcept { diff --git a/include/ccmath/ext/normalize.hpp b/include/ccmath/ext/normalize.hpp index 6bd0922f..2ce10956 100644 --- a/include/ccmath/ext/normalize.hpp +++ b/include/ccmath/ext/normalize.hpp @@ -19,17 +19,17 @@ namespace ccm::ext namespace unsafe { /** - * @brief Normalize a value to a range without guarding the range length. + * \brief Normalize a value to a range without guarding the range length. * * Maps value from the range [min, max] to [0, 1]. This is the raw form * with no zero check. If min == max the result follows normal * floating-point division semantics and may be NaN. * - * @tparam T Type of the input and output. - * @param value The value to normalize. - * @param min The minimum value of the range. - * @param max The maximum value of the range. - * @return The normalized value. + * \tparam T Type of the input and output. + * \param value The value to normalize. + * \param min The minimum value of the range. + * \param max The maximum value of the range. + * \return The normalized value. */ template , bool> = true> constexpr T normalize(T value, T min = T(0), T max = T(1)) noexcept { @@ -38,7 +38,7 @@ namespace ccm::ext } // namespace unsafe /** - * @brief Normalize a value to a range. + * \brief Normalize a value to a range. * * Maps value from the range [min, max] to [0, 1]. * @@ -46,11 +46,11 @@ namespace ccm::ext * function returns 0 to avoid division by zero and NaN propagation. For the * unguarded form see ccm::ext::unsafe::normalize. * - * @tparam T Type of the input and output. - * @param value The value to normalize. - * @param min The minimum value of the range. - * @param max The maximum value of the range. - * @return The normalized value. + * \tparam T Type of the input and output. + * \param value The value to normalize. + * \param min The minimum value of the range. + * \param max The maximum value of the range. + * \return The normalized value. */ template , bool> = true> constexpr T normalize(T value, T min = T(0), T max = T(1)) noexcept { diff --git a/include/ccmath/ext/ping_pong.hpp b/include/ccmath/ext/ping_pong.hpp index 2eff8ec7..2ff55547 100644 --- a/include/ccmath/ext/ping_pong.hpp +++ b/include/ccmath/ext/ping_pong.hpp @@ -18,11 +18,11 @@ namespace ccm::ext { /** - * @brief Ping-pong a value between 0 and a specified range. - * @tparam T Type of the input. - * @param a Value to ping-pong. - * @param b Range to ping-pong within. - * @return The ping-ponged value. + * \brief Ping-pong a value between 0 and a specified range. + * \tparam T Type of the input. + * \param a Value to ping-pong. + * \param b Range to ping-pong within. + * \return The ping-ponged value. */ template , bool> = true> constexpr T ping_pong(T a, T b) noexcept { diff --git a/include/ccmath/ext/radians.hpp b/include/ccmath/ext/radians.hpp index 5521310c..e71f5a0b 100644 --- a/include/ccmath/ext/radians.hpp +++ b/include/ccmath/ext/radians.hpp @@ -17,10 +17,10 @@ namespace ccm::ext { /** - * @brief Converts an angle in degrees to radians. - * @tparam T Floating-point type. - * @param degrees Angle in degrees. - * @return The angle in radians. + * \brief Converts an angle in degrees to radians. + * \tparam T Floating-point type. + * \param degrees Angle in degrees. + * \return The angle in radians. */ template , bool> = true> constexpr T radians(T degrees) noexcept { diff --git a/include/ccmath/ext/rcp.hpp b/include/ccmath/ext/rcp.hpp index 1c6a7037..29b67319 100644 --- a/include/ccmath/ext/rcp.hpp +++ b/include/ccmath/ext/rcp.hpp @@ -15,10 +15,10 @@ namespace ccm::ext { /** - * @brief Calculates a fast, approximate, reciprocal. - * @tparam T Type of the input and output. - * @param x Value to get the reciprocal of. - * @return The reciprocal of the input. + * \brief Calculates a fast, approximate, reciprocal. + * \tparam T Type of the input and output. + * \param x Value to get the reciprocal of. + * \return The reciprocal of the input. */ template , bool> = true> constexpr T rcp(T x) noexcept { diff --git a/include/ccmath/ext/remap.hpp b/include/ccmath/ext/remap.hpp index a24711e8..33481b38 100644 --- a/include/ccmath/ext/remap.hpp +++ b/include/ccmath/ext/remap.hpp @@ -17,7 +17,7 @@ namespace ccm::ext namespace unsafe { /** - * @brief Remap a value from one range to another without guarding the source length. + * \brief Remap a value from one range to another without guarding the source length. * * Maps x from the source range [src_start, src_end] to the destination * range [dst_start, dst_end]. @@ -28,13 +28,13 @@ namespace ccm::ext * This is the raw form with no zero check. If src_start == src_end the * result follows normal floating-point division semantics and may be NaN. * - * @tparam T Built-in floating-point type of the input and output. - * @param src_start Start of the source range. - * @param src_end End of the source range. - * @param dst_start Start of the destination range. - * @param dst_end End of the destination range. - * @param x Value to remap. - * @return The remapped value. + * \tparam T Built-in floating-point type of the input and output. + * \param src_start Start of the source range. + * \param src_end End of the source range. + * \param dst_start Start of the destination range. + * \param dst_end End of the destination range. + * \param x Value to remap. + * \return The remapped value. */ template , bool> = true> constexpr T remap(T src_start, T src_end, T dst_start, T dst_end, T x) noexcept @@ -44,7 +44,7 @@ namespace ccm::ext } // namespace unsafe /** - * @brief Remap a value from one range to another. + * \brief Remap a value from one range to another. * * Maps x from the source range [src_start, src_end] to the destination * range [dst_start, dst_end]. @@ -56,13 +56,13 @@ namespace ccm::ext * this function returns dst_start to avoid division by zero and NaN * propagation. For the unguarded form see ccm::ext::unsafe::remap. * - * @tparam T Built-in floating-point type of the input and output. - * @param src_start Start of the source range. - * @param src_end End of the source range. - * @param dst_start Start of the destination range. - * @param dst_end End of the destination range. - * @param x Value to remap. - * @return The remapped value. + * \tparam T Built-in floating-point type of the input and output. + * \param src_start Start of the source range. + * \param src_end End of the source range. + * \param dst_start Start of the destination range. + * \param dst_end End of the destination range. + * \param x Value to remap. + * \return The remapped value. */ template , bool> = true> constexpr T remap(T src_start, T src_end, T dst_start, T dst_end, T x) noexcept diff --git a/include/ccmath/ext/repeat.hpp b/include/ccmath/ext/repeat.hpp index 8622db7a..8d3b290c 100644 --- a/include/ccmath/ext/repeat.hpp +++ b/include/ccmath/ext/repeat.hpp @@ -19,15 +19,15 @@ namespace ccm::ext namespace unsafe { /** - * @brief Repeat a value within the range [0, length) without guarding the length. + * \brief Repeat a value within the range [0, length) without guarding the length. * * This is the raw form with no zero check. If length is zero the result * follows normal floating-point division semantics and may be NaN. * - * @tparam T Type of the input and output. - * @param value The value to repeat. - * @param length The length of the repeating interval. - * @return The repeated value in the range [0, length). + * \tparam T Type of the input and output. + * \param value The value to repeat. + * \param length The length of the repeating interval. + * \return The repeated value in the range [0, length). */ template , bool> = true> constexpr T repeat(T value, T length) noexcept { @@ -36,15 +36,15 @@ namespace ccm::ext } // namespace unsafe /** - * @brief Repeat a value within the range [0, length). + * \brief Repeat a value within the range [0, length). * * If length is zero, this function returns 0 to avoid division by zero and * NaN propagation. For the unguarded form see ccm::ext::unsafe::repeat. * - * @tparam T Type of the input and output. - * @param value The value to repeat. - * @param length The length of the repeating interval. - * @return The repeated value in the range [0, length). + * \tparam T Type of the input and output. + * \param value The value to repeat. + * \param length The length of the repeating interval. + * \return The repeated value in the range [0, length). */ template , bool> = true> constexpr T repeat(T value, T length) noexcept { diff --git a/include/ccmath/ext/saturate.hpp b/include/ccmath/ext/saturate.hpp index a75e7c6b..91e25b40 100644 --- a/include/ccmath/ext/saturate.hpp +++ b/include/ccmath/ext/saturate.hpp @@ -17,10 +17,10 @@ namespace ccm::ext { /** - * @brief Saturate a floating-point value to the range [0, 1]. - * @tparam T Type of the input and output. - * @param value The value to saturate. - * @return The value clamped to the range [0, 1]. + * \brief Saturate a floating-point value to the range [0, 1]. + * \tparam T Type of the input and output. + * \param value The value to saturate. + * \return The value clamped to the range [0, 1]. */ template , bool> = true> constexpr T saturate(T value) noexcept { diff --git a/include/ccmath/ext/sign.hpp b/include/ccmath/ext/sign.hpp index 82937453..afa15546 100644 --- a/include/ccmath/ext/sign.hpp +++ b/include/ccmath/ext/sign.hpp @@ -15,10 +15,10 @@ namespace ccm::ext { /** - * @brief Return the sign of a value. - * @tparam T Type of the input and output. - * @param value The value whose sign is queried. - * @return -1 if value is negative, 0 if value is zero, otherwise 1. + * \brief Return the sign of a value. + * \tparam T Type of the input and output. + * \param value The value whose sign is queried. + * \return -1 if value is negative, 0 if value is zero, otherwise 1. */ template && !std::is_same_v, bool> = true> constexpr T sign(T value) noexcept { diff --git a/include/ccmath/ext/smoothstep.hpp b/include/ccmath/ext/smoothstep.hpp index ac9d0d06..06998bb8 100644 --- a/include/ccmath/ext/smoothstep.hpp +++ b/include/ccmath/ext/smoothstep.hpp @@ -17,12 +17,12 @@ namespace ccm::ext { /** - * @brief Smooth hermite interpolation. - * @tparam T Type of the input and output. - * @param edge0 Lower edge. - * @param edge1 Upper edge. - * @param x Value to interpolate. - * @return The interpolated value. + * \brief Smooth hermite interpolation. + * \tparam T Type of the input and output. + * \param edge0 Lower edge. + * \param edge1 Upper edge. + * \param x Value to interpolate. + * \return The interpolated value. */ template , bool> = true> constexpr T smoothstep(T edge0, T edge1, T x) { diff --git a/include/ccmath/ext/step.hpp b/include/ccmath/ext/step.hpp index f2eb194a..aa8e973d 100644 --- a/include/ccmath/ext/step.hpp +++ b/include/ccmath/ext/step.hpp @@ -15,11 +15,11 @@ namespace ccm::ext { /** - * @brief Return 0 if value is less than edge, otherwise return 1. - * @tparam T Type of the input and output. - * @param edge The comparison edge. - * @param value The value to compare against edge. - * @return 0 if value is less than edge, otherwise 1. + * \brief Return 0 if value is less than edge, otherwise return 1. + * \tparam T Type of the input and output. + * \param edge The comparison edge. + * \param value The value to compare against edge. + * \return 0 if value is less than edge, otherwise 1. */ template && !std::is_same_v, bool> = true> constexpr T step(T edge, T value) noexcept { diff --git a/include/ccmath/ext/unlerp.hpp b/include/ccmath/ext/unlerp.hpp index 7e59b85d..fdcaad62 100644 --- a/include/ccmath/ext/unlerp.hpp +++ b/include/ccmath/ext/unlerp.hpp @@ -17,7 +17,7 @@ namespace ccm::ext namespace unsafe { /** - * @brief Compute the inverse linear interpolation parameter of a value without guarding the range length. + * \brief Compute the inverse linear interpolation parameter of a value without guarding the range length. * * This function does not clamp the result. Values outside [start, end] * return values outside [0, 1]. @@ -25,11 +25,11 @@ namespace ccm::ext * This is the raw form with no zero check. If start == end the result * follows normal floating-point division semantics and may be NaN. * - * @tparam T Type of the input and output. - * @param start The start of the source range. - * @param end The end of the source range. - * @param value The value to evaluate. - * @return The interpolation parameter of value in the range [start, end]. + * \tparam T Type of the input and output. + * \param start The start of the source range. + * \param end The end of the source range. + * \param value The value to evaluate. + * \return The interpolation parameter of value in the range [start, end]. */ template , bool> = true> constexpr T unlerp(T start, T end, T value) noexcept { @@ -38,7 +38,7 @@ namespace ccm::ext } // namespace unsafe /** - * @brief Compute the inverse linear interpolation parameter of a value. + * \brief Compute the inverse linear interpolation parameter of a value. * * This function does not clamp the result. Values outside [start, end] * return values outside [0, 1]. @@ -47,11 +47,11 @@ namespace ccm::ext * function returns 0 to avoid division by zero and NaN propagation. For the * unguarded form see ccm::ext::unsafe::unlerp. * - * @tparam T Type of the input and output. - * @param start The start of the source range. - * @param end The end of the source range. - * @param value The value to evaluate. - * @return The interpolation parameter of value in the range [start, end]. + * \tparam T Type of the input and output. + * \param start The start of the source range. + * \param end The end of the source range. + * \param value The value to evaluate. + * \return The interpolation parameter of value in the range [start, end]. */ template , bool> = true> constexpr T unlerp(T start, T end, T value) noexcept { diff --git a/include/ccmath/internal/math/common/basic/fabs.hpp b/include/ccmath/internal/math/common/basic/fabs.hpp index 7f34c2a2..f58fee9a 100644 --- a/include/ccmath/internal/math/common/basic/fabs.hpp +++ b/include/ccmath/internal/math/common/basic/fabs.hpp @@ -16,7 +16,7 @@ namespace ccm::func { /** - * @internal + * \internal * Internal implementation that switches between compile time and runtime implementations. */ template diff --git a/include/ccmath/internal/math/common/basic/fdim.hpp b/include/ccmath/internal/math/common/basic/fdim.hpp index e052ea20..b5f521b6 100644 --- a/include/ccmath/internal/math/common/basic/fdim.hpp +++ b/include/ccmath/internal/math/common/basic/fdim.hpp @@ -18,7 +18,7 @@ namespace ccm::func { /** - * @internal + * \internal * Internal implementation that switches between compile time and runtime implementations. */ template constexpr auto fdim(T x, T y) -> std::enable_if_t, T> diff --git a/include/ccmath/internal/math/common/basic/fma.hpp b/include/ccmath/internal/math/common/basic/fma.hpp index 091c30b1..d4d2146b 100644 --- a/include/ccmath/internal/math/common/basic/fma.hpp +++ b/include/ccmath/internal/math/common/basic/fma.hpp @@ -18,12 +18,12 @@ namespace ccm { /** - * @brief Fused multiply-add operation. - * @tparam T Numeric type. - * @param x Floating-point or integer value. - * @param y Floating-point or integer value. - * @param z Floating-point or integer value. - * @return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, + * \brief Fused multiply-add operation. + * \tparam T Numeric type. + * \param x Floating-point or integer value. + * \param y Floating-point or integer value. + * \param z Floating-point or integer value. + * \return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, * calculated as a single ternary floating-point operation). */ template , bool> = true> constexpr T fma(T x, T y, T z) noexcept // NOLINT(bugprone-exception-escape) @@ -37,14 +37,14 @@ namespace ccm } /** - * @brief Fused multiply-add operation. - * @tparam T Floating-point or integer type converted to a common type. - * @tparam U Floating-point or integer type converted to a common type. - * @tparam V Floating-point or integer type converted to a common type. - * @param x Floating-point or integer value converted to a common type. - * @param y Floating-point or integer value converted to a common type. - * @param z Floating-point or integer value converted to a common type. - * @return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, + * \brief Fused multiply-add operation. + * \tparam T Floating-point or integer type converted to a common type. + * \tparam U Floating-point or integer type converted to a common type. + * \tparam V Floating-point or integer type converted to a common type. + * \param x Floating-point or integer value converted to a common type. + * \param y Floating-point or integer value converted to a common type. + * \param z Floating-point or integer value converted to a common type. + * \return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, * calculated as a single ternary floating-point operation). */ template constexpr auto fma(T x, U y, V z) noexcept @@ -66,14 +66,14 @@ namespace ccm } /** - * @brief Fused multiply-add operation. - * @tparam T Integer type converted to a common type. - * @tparam U Integer type converted to a common type. - * @tparam V Integer type converted to a common type. - * @param x Integer value converted to a common type. - * @param y Integer value converted to a common type. - * @param z Integer value converted to a common type. - * @return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, + * \brief Fused multiply-add operation. + * \tparam T Integer type converted to a common type. + * \tparam U Integer type converted to a common type. + * \tparam V Integer type converted to a common type. + * \param x Integer value converted to a common type. + * \param y Integer value converted to a common type. + * \param z Integer value converted to a common type. + * \return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, * calculated as a single ternary floating-point operation). */ template && std::is_integral_v && std::is_integral_v, bool> = true> @@ -84,11 +84,11 @@ namespace ccm } /** - * @brief Fused multiply-add operation. - * @param x Floating-point value. - * @param y Floating-point value. - * @param z Floating-point value. - * @return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, + * \brief Fused multiply-add operation. + * \param x Floating-point value. + * \param y Floating-point value. + * \param z Floating-point value. + * \return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, * calculated as a single ternary floating-point operation). */ constexpr double fma(double x, double y, double z) noexcept @@ -97,11 +97,11 @@ namespace ccm } /** - * @brief Fused multiply-add operation. - * @param x Floating-point value. - * @param y Floating-point value. - * @param z Floating-point value. - * @return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, + * \brief Fused multiply-add operation. + * \param x Floating-point value. + * \param y Floating-point value. + * \param z Floating-point value. + * \return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, * calculated as a single ternary floating-point operation). */ constexpr float fmaf(float x, float y, float z) noexcept @@ -110,11 +110,11 @@ namespace ccm } /** - * @brief Fused multiply-add operation. - * @param x Floating-point value. - * @param y Floating-point value. - * @param z Floating-point value. - * @return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, + * \brief Fused multiply-add operation. + * \param x Floating-point value. + * \param y Floating-point value. + * \param z Floating-point value. + * \return If successful, returns the value of x * y + z as if calculated to infinite precision and rounded once to fit the result type (or, alternatively, * calculated as a single ternary floating-point operation). */ constexpr long double fmal(long double x, long double y, long double z) noexcept @@ -123,4 +123,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/internal/math/common/basic/fmod.hpp b/include/ccmath/internal/math/common/basic/fmod.hpp index e782daf0..94822c10 100644 --- a/include/ccmath/internal/math/common/basic/fmod.hpp +++ b/include/ccmath/internal/math/common/basic/fmod.hpp @@ -18,7 +18,7 @@ namespace ccm { - /// @cond CCMATH_INTERNAL + /// \cond CCMATH_INTERNAL namespace internal::impl { template constexpr T fmod_impl_check(T x, T y) noexcept @@ -70,15 +70,15 @@ namespace ccm return fmod_impl_check(static_cast(x), static_cast(y)); } } // namespace internal::impl - /// @endcond + /// \endcond /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @note Some edge cases where NaN is returned are different from std::fmod due to the standard allowing implementation based returns. - * @tparam T A floating-point type. - * @param x A floating-point value. - * @param y A floating-point value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \note Some edge cases where NaN is returned are different from std::fmod due to the standard allowing implementation based returns. + * \tparam T A floating-point type. + * \param x A floating-point value. + * \param y A floating-point value. + * \return The floating-point remainder of the division operation x/y. */ template , bool> = true> constexpr Real fmod(Real x, Real y) { @@ -86,11 +86,11 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @tparam Integer An integral type. - * @param x An integral value. - * @param y An integral value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \tparam Integer An integral type. + * \param x An integral value. + * \param y An integral value. + * \return The floating-point remainder of the division operation x/y. */ template , bool> = true> constexpr double fmod(Integer x, Integer y) { @@ -98,12 +98,12 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @tparam T A floating-point or integral type. - * @tparam U A floating-point or integral type. - * @param x A floating-point or integral value. - * @param y A floating-point or integral value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \tparam T A floating-point or integral type. + * \tparam U A floating-point or integral type. + * \param x A floating-point or integral value. + * \param y A floating-point or integral value. + * \return The floating-point remainder of the division operation x/y. */ template constexpr auto fmod(T x, T y) { @@ -111,10 +111,10 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @param x A floating-point value. - * @param y A floating-point value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \param x A floating-point value. + * \param y A floating-point value. + * \return The floating-point remainder of the division operation x/y. */ constexpr float fmodf(float x, float y) { @@ -122,10 +122,10 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @param x A floating-point value. - * @param y A floating-point value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \param x A floating-point value. + * \param y A floating-point value. + * \return The floating-point remainder of the division operation x/y. */ constexpr long double fmodl(long double x, long double y) { @@ -133,4 +133,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/internal/math/common/basic/max.hpp b/include/ccmath/internal/math/common/basic/max.hpp index b8de567d..06e6c49d 100644 --- a/include/ccmath/internal/math/common/basic/max.hpp +++ b/include/ccmath/internal/math/common/basic/max.hpp @@ -21,11 +21,11 @@ namespace ccm { /** - * @brief Computes the larger of the two values. - * @tparam T Type of the values to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two values. + * \tparam T Type of the values to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr T max(T x, T y) noexcept { @@ -39,12 +39,12 @@ namespace ccm } /** - * @brief Computes the larger of the two values. - * @tparam T Type of left-hand side of the comparison. - * @tparam U Type of right-hand side of the comparison. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return + * \brief Computes the larger of the two values. + * \tparam T Type of left-hand side of the comparison. + * \tparam U Type of right-hand side of the comparison. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return */ template constexpr auto max(T x, U y) noexcept { @@ -56,11 +56,11 @@ namespace ccm } /** - * @brief Computes the larger of the two floating point values. - * @tparam T Type of the values to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two floating point values. + * \tparam T Type of the values to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr T fmax(T x, T y) noexcept { @@ -68,12 +68,12 @@ namespace ccm } /** - * @brief Computes the larger of the two values. - * @tparam T Type of left-hand side of the comparison. - * @tparam U Type of right-hand side of the comparison. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two values. + * \tparam T Type of left-hand side of the comparison. + * \tparam U Type of right-hand side of the comparison. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr auto fmax(T x, U y) noexcept { @@ -85,10 +85,10 @@ namespace ccm } /** - * @brief Computes the larger of the two floating point values. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two floating point values. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template , bool> = true> constexpr double fmax(Integer x, Integer y) noexcept { @@ -96,10 +96,10 @@ namespace ccm } /** - * @brief Computes the larger of the two floating point values. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two floating point values. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ constexpr float fmaxf(float x, float y) noexcept { @@ -107,10 +107,10 @@ namespace ccm } /** - * @brief Computes the larger of the two floating point values. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two floating point values. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ constexpr long double fmaxl(long double x, long double y) noexcept { @@ -118,4 +118,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/internal/math/common/basic/min.hpp b/include/ccmath/internal/math/common/basic/min.hpp index c3184f2e..3bfc7edd 100644 --- a/include/ccmath/internal/math/common/basic/min.hpp +++ b/include/ccmath/internal/math/common/basic/min.hpp @@ -20,11 +20,11 @@ namespace ccm { /** - * @brief Computes the smaller of the two values. - * @tparam T Type of the values to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam T Type of the values to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr T min(const T x, const T y) noexcept { @@ -38,12 +38,12 @@ namespace ccm } /** - * @brief Computes the smaller of the two values. - * @tparam T Left-hand type of the left-hand value to compare. - * @tparam U Right-hand type of the right-hand value to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam T Left-hand type of the left-hand value to compare. + * \tparam U Right-hand type of the right-hand value to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr T min(const T x, const U y) noexcept { @@ -55,11 +55,11 @@ namespace ccm } /** - * @brief Computes the smaller of the two values. - * @tparam Real Type of of the values to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam Real Type of of the values to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template , bool> = true> constexpr Real fmin(const Real x, const Real y) noexcept { @@ -67,12 +67,12 @@ namespace ccm } /** - * @brief Computes the smaller of the two values. - * @tparam T Left-hand type of the left-hand value to compare. - * @tparam U Right-hand type of the right-hand value to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam T Left-hand type of the left-hand value to compare. + * \tparam U Right-hand type of the right-hand value to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr auto fmin(const T x, const U y) noexcept { @@ -84,11 +84,11 @@ namespace ccm } /** - * @brief Computes the smaller of the two values. - * @tparam Integer An integral type. - * @param x Right-hand side of the comparison. - * @param y Left-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam Integer An integral type. + * \param x Right-hand side of the comparison. + * \param y Left-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template , bool> = true> constexpr Integer fmin(const Integer x, const Integer y) noexcept { @@ -96,4 +96,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/internal/math/common/basic/nan.hpp b/include/ccmath/internal/math/common/basic/nan.hpp index 4ba2ee66..66d41b8e 100644 --- a/include/ccmath/internal/math/common/basic/nan.hpp +++ b/include/ccmath/internal/math/common/basic/nan.hpp @@ -17,9 +17,9 @@ namespace ccm { /** - * @brief not-a-number (NaN) function - * @param arg Narrow character string identifying the contents of a NaN - * @return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. + * \brief not-a-number (NaN) function + * \param arg Narrow character string identifying the contents of a NaN + * \return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. */ constexpr double nan(const char * arg) noexcept { @@ -27,9 +27,9 @@ namespace ccm } /** - * @brief not-a-number (NaN) function - * @param arg Narrow character string identifying the contents of a NaN - * @return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. + * \brief not-a-number (NaN) function + * \param arg Narrow character string identifying the contents of a NaN + * \return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. */ constexpr float nanf(const char * arg) noexcept { @@ -37,9 +37,9 @@ namespace ccm } /** - * @brief not-a-number (NaN) function - * @return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. - * @note This function is not yet supported for long double and can only return either 0.0 or a quiet NaN based on if quiet NaNs are supported. + * \brief not-a-number (NaN) function + * \return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. + * \note This function is not yet supported for long double and can only return either 0.0 or a quiet NaN based on if quiet NaNs are supported. */ constexpr long double nanl(const char * arg) noexcept { diff --git a/include/ccmath/internal/math/common/basic/remainder.hpp b/include/ccmath/internal/math/common/basic/remainder.hpp index 76e0e7a0..39ab643b 100644 --- a/include/ccmath/internal/math/common/basic/remainder.hpp +++ b/include/ccmath/internal/math/common/basic/remainder.hpp @@ -17,11 +17,11 @@ namespace ccm { /** - * @brief Returns the remainder of the division of x by y. - * @tparam T Type of the values to compare. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y. + * \brief Returns the remainder of the division of x by y. + * \tparam T Type of the values to compare. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y. */ template , bool> = true> constexpr T remainder(T x, T y) { @@ -45,11 +45,11 @@ namespace ccm } /** - * @brief Returns the remainder of the division of x by y. - * @tparam Integer Type of the values to compare. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y as a double. + * \brief Returns the remainder of the division of x by y. + * \tparam Integer Type of the values to compare. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y as a double. */ template , bool> = true> constexpr double remainder(Integer x, Integer y) { @@ -57,10 +57,10 @@ namespace ccm } /** - * @brief Returns the remainder of the division of x by y. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y. + * \brief Returns the remainder of the division of x by y. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y. */ constexpr float remainderf(float x, float y) { @@ -68,10 +68,10 @@ namespace ccm } /** - * @brief Returns the remainder of the division of x by y. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y. + * \brief Returns the remainder of the division of x by y. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y. */ constexpr long double remainderl(long double x, long double y) { @@ -79,4 +79,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/internal/math/common/basic/remquo.hpp b/include/ccmath/internal/math/common/basic/remquo.hpp index 90efcfcd..03d12568 100644 --- a/include/ccmath/internal/math/common/basic/remquo.hpp +++ b/include/ccmath/internal/math/common/basic/remquo.hpp @@ -16,18 +16,18 @@ namespace ccm { /** - * @brief Signed remainder as well as the three last bits of the division operation - * @tparam T The type of the arguments - * @param x Floating-point or integer value - * @param y Floating-point or integer value - * @param quo Pointer to int to store the sign and some bits of x / y - * @return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at + * \brief Signed remainder as well as the three last bits of the division operation + * \tparam T The type of the arguments + * \param x Floating-point or integer value + * \param y Floating-point or integer value + * \param quo Pointer to int to store the sign and some bits of x / y + * \return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at * least three of the least significant bits of x / y * - * @attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with + * \attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with * constexpr and static_assert) * - * @code + * \code * constexpr double get_remainder(double x, double y) * { * int quotient {0}; @@ -41,7 +41,7 @@ namespace ccm * ccm::remquo(x, y, "ient); * return quotient; * } - * @endcode + * \endcode */ template , bool> = true> constexpr T remquo(T x, T y, int * quo) { @@ -55,19 +55,19 @@ namespace ccm } /** - * @brief Signed remainder as well as the three last bits of the division operation - * @tparam Arithmetic1 The type of the first argument - * @tparam Arithmetic2 The type of the second argument - * @param x Floating-point or integer values - * @param y Floating-point or integer values - * @param quo Pointer to int to store the sign and some bits of x / y - * @return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at + * \brief Signed remainder as well as the three last bits of the division operation + * \tparam Arithmetic1 The type of the first argument + * \tparam Arithmetic2 The type of the second argument + * \param x Floating-point or integer values + * \param y Floating-point or integer values + * \param quo Pointer to int to store the sign and some bits of x / y + * \return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at * least three of the least significant bits of x / y * - * @attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with + * \attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with * constexpr and static_assert) * - * @code + * \code * constexpr double get_remainder(double x, double y) * { * int quotient {0}; @@ -81,7 +81,7 @@ namespace ccm * ccm::remquo(x, y, "ient); * return quotient; * } - * @endcode + * \endcode */ template && std::is_arithmetic_v, bool> = true> constexpr std::common_type_t remquo(Arithmetic1 x, Arithmetic2 y, int * quo) @@ -91,17 +91,17 @@ namespace ccm } /** - * @brief Signed remainder as well as the three last bits of the division operation - * @param x Floating-point value - * @param y Floating-point value - * @param quo Pointer to int to store the sign and some bits of x / y - * @return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at + * \brief Signed remainder as well as the three last bits of the division operation + * \param x Floating-point value + * \param y Floating-point value + * \param quo Pointer to int to store the sign and some bits of x / y + * \return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at * least three of the least significant bits of x / y * - * @attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with + * \attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with * constexpr and static_assert) * - * @code + * \code * constexpr double get_remainder(double x, double y) * { * int quotient {0}; @@ -115,7 +115,7 @@ namespace ccm * ccm::remquo(x, y, "ient); * return quotient; * } - * @endcode + * \endcode */ constexpr float remquof(float x, float y, int * quo) { @@ -123,17 +123,17 @@ namespace ccm } /** - * @brief Signed remainder as well as the three last bits of the division operation - * @param x Floating-point value - * @param y Floating-point value - * @param quo Pointer to int to store the sign and some bits of x / y - * @return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at + * \brief Signed remainder as well as the three last bits of the division operation + * \param x Floating-point value + * \param y Floating-point value + * \param quo Pointer to int to store the sign and some bits of x / y + * \return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at * least three of the least significant bits of x / y * - * @attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with + * \attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with * constexpr and static_assert) * - * @code + * \code * constexpr double get_remainder(double x, double y) * { * int quotient {0}; @@ -147,7 +147,7 @@ namespace ccm * ccm::remquo(x, y, "ient); * return quotient; * } - * @endcode + * \endcode */ constexpr long double remquol(long double x, long double y, int * quo) { @@ -157,4 +157,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/internal/math/common/compare/fpclassify.hpp b/include/ccmath/internal/math/common/compare/fpclassify.hpp index f627716c..309e75ba 100644 --- a/include/ccmath/internal/math/common/compare/fpclassify.hpp +++ b/include/ccmath/internal/math/common/compare/fpclassify.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Classify the floating point number - * @attention This function is heavily implementation defined and may not work as expected on unknown compilers - * @tparam T The type of the floating point number - * @param num The number to classify - * @return The classification of the number as an integer + * \brief Classify the floating point number + * \attention This function is heavily implementation defined and may not work as expected on unknown compilers + * \tparam T The type of the floating point number + * \param num The number to classify + * \return The classification of the number as an integer */ template , bool> = true> constexpr int fpclassify(T num) { diff --git a/include/ccmath/internal/math/common/compare/isfinite.hpp b/include/ccmath/internal/math/common/compare/isfinite.hpp index c7c79d17..b9cd7d58 100644 --- a/include/ccmath/internal/math/common/compare/isfinite.hpp +++ b/include/ccmath/internal/math/common/compare/isfinite.hpp @@ -16,10 +16,10 @@ namespace ccm { /** - * @brief Checks if the given number has a finite value. - * @tparam T The type of the number. - * @param num A floating-point or integer value - * @return true if the number has a finite value, false otherwise. + * \brief Checks if the given number has a finite value. + * \tparam T The type of the number. + * \param num A floating-point or integer value + * \return true if the number has a finite value, false otherwise. */ template , bool> = true> constexpr bool isfinite(T num) { @@ -35,9 +35,9 @@ namespace ccm } /** - * @brief Checks if the given number has a finite value. - * @tparam Integer The type of the integer. - * @return true if the number has a finite value, false otherwise. + * \brief Checks if the given number has a finite value. + * \tparam Integer The type of the integer. + * \return true if the number has a finite value, false otherwise. */ template , bool> = true> constexpr bool isfinite(Integer /* x */) { diff --git a/include/ccmath/internal/math/common/compare/isgreater.hpp b/include/ccmath/internal/math/common/compare/isgreater.hpp index 71eb684d..794b70dd 100644 --- a/include/ccmath/internal/math/common/compare/isgreater.hpp +++ b/include/ccmath/internal/math/common/compare/isgreater.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is greater than the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is greater than the second, false otherwise. + * \brief Checks if the first argument is greater than the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is greater than the second, false otherwise. */ template , bool> = true> constexpr bool isgreater(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is greater than the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is greater than the second, false otherwise. + * \brief Checks if the first argument is greater than the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is greater than the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool isgreater(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/common/compare/isgreaterequal.hpp b/include/ccmath/internal/math/common/compare/isgreaterequal.hpp index 4fc0942d..60008e0d 100644 --- a/include/ccmath/internal/math/common/compare/isgreaterequal.hpp +++ b/include/ccmath/internal/math/common/compare/isgreaterequal.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is greater than or equal to the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is greater than or equal to the second, false otherwise. + * \brief Checks if the first argument is greater than or equal to the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is greater than or equal to the second, false otherwise. */ template , bool> = true> constexpr bool isgreaterequal(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is greater than or equal to the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is greater than or equal to the second, false otherwise. + * \brief Checks if the first argument is greater than or equal to the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is greater than or equal to the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool isgreaterequal(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/common/compare/isinf.hpp b/include/ccmath/internal/math/common/compare/isinf.hpp index 7cc1d9c8..f1e33bd5 100644 --- a/include/ccmath/internal/math/common/compare/isinf.hpp +++ b/include/ccmath/internal/math/common/compare/isinf.hpp @@ -19,10 +19,10 @@ namespace ccm { /** - * @brief Checks if the given number is infinite. - * @tparam T The type of the number to check. - * @param num The number to check. - * @return True if the number is infinite, false otherwise. + * \brief Checks if the given number is infinite. + * \tparam T The type of the number to check. + * \param num The number to check. + * \return True if the number is infinite, false otherwise. */ template , bool> = true> constexpr bool isinf(T num) noexcept { @@ -39,9 +39,9 @@ namespace ccm } /** - * @brief Checks if the given number is infinite. - * @tparam Integer The type of the integer to check. - * @return True if the number is infinite, false otherwise. + * \brief Checks if the given number is infinite. + * \tparam Integer The type of the integer to check. + * \return True if the number is infinite, false otherwise. */ template , bool> = true> constexpr bool isinf(Integer /* num */) noexcept { diff --git a/include/ccmath/internal/math/common/compare/isless.hpp b/include/ccmath/internal/math/common/compare/isless.hpp index 1478a63c..50822008 100644 --- a/include/ccmath/internal/math/common/compare/isless.hpp +++ b/include/ccmath/internal/math/common/compare/isless.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is less than the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is less than the second, false otherwise. + * \brief Checks if the first argument is less than the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is less than the second, false otherwise. */ template , bool> = true> constexpr bool isless(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is less than the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is less than the second, false otherwise. + * \brief Checks if the first argument is less than the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is less than the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool isless(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/common/compare/islessequal.hpp b/include/ccmath/internal/math/common/compare/islessequal.hpp index ab9438bb..0a58c978 100644 --- a/include/ccmath/internal/math/common/compare/islessequal.hpp +++ b/include/ccmath/internal/math/common/compare/islessequal.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is less than or equal to the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is less than or equal to the second, false otherwise. + * \brief Checks if the first argument is less than or equal to the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is less than or equal to the second, false otherwise. */ template , bool> = true> constexpr bool islessequal(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is less than or equal to the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is less than or equal to the second, false otherwise. + * \brief Checks if the first argument is less than or equal to the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is less than or equal to the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool islessequal(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/common/compare/islessgreater.hpp b/include/ccmath/internal/math/common/compare/islessgreater.hpp index cf389c6e..8511370c 100644 --- a/include/ccmath/internal/math/common/compare/islessgreater.hpp +++ b/include/ccmath/internal/math/common/compare/islessgreater.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is less than the second or greater than the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is less than the second or greater than the second, false otherwise. + * \brief Checks if the first argument is less than the second or greater than the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is less than the second or greater than the second, false otherwise. */ template , bool> = true> constexpr bool islessgreater(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is less than the second or greater than the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is less than the second or greater than the second, false otherwise. + * \brief Checks if the first argument is less than the second or greater than the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is less than the second or greater than the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool islessgreater(Arithmetic1 x, Arithmetic2 y) noexcept @@ -51,4 +51,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/common/compare/isnan.hpp b/include/ccmath/internal/math/common/compare/isnan.hpp index 4bdf7fce..1c4c6bad 100644 --- a/include/ccmath/internal/math/common/compare/isnan.hpp +++ b/include/ccmath/internal/math/common/compare/isnan.hpp @@ -18,10 +18,10 @@ namespace ccm { /** - * @brief Check if the given number is NaN. - * @tparam T The type of the number to check. - * @param num The number to check. - * @return True if the number is NaN, false otherwise. + * \brief Check if the given number is NaN. + * \tparam T The type of the number to check. + * \param num The number to check. + * \return True if the number is NaN, false otherwise. */ template , bool> = true> [[nodiscard]] constexpr bool isnan(T num) noexcept { @@ -38,9 +38,9 @@ namespace ccm } /** - * @brief Check if the given number is NaN. - * @tparam Integer The type of the number to check. - * @return False, as integers can never be NaN. + * \brief Check if the given number is NaN. + * \tparam Integer The type of the number to check. + * \return False, as integers can never be NaN. */ template , bool> = true> [[nodiscard]] constexpr bool isnan(Integer /* num */) { @@ -48,4 +48,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/common/compare/isnormal.hpp b/include/ccmath/internal/math/common/compare/isnormal.hpp index ded9d3bf..63f07afb 100644 --- a/include/ccmath/internal/math/common/compare/isnormal.hpp +++ b/include/ccmath/internal/math/common/compare/isnormal.hpp @@ -18,10 +18,10 @@ namespace ccm { /** - * @brief Checks if the given number has a normal value. - * @tparam T The type of the number. - * @param num A floating-point or integer value - * @return true if the number has a normal value, false otherwise. + * \brief Checks if the given number has a normal value. + * \tparam T The type of the number. + * \param num A floating-point or integer value + * \return true if the number has a normal value, false otherwise. */ template , bool> = true> constexpr bool isnormal(T num) noexcept { @@ -35,10 +35,10 @@ namespace ccm } /** - * @brief Checks if the given number has a normal value. - * @tparam Integer The type of the integer. - * @param num A integer value to check. - * @return true if the number has a normal value, false otherwise. + * \brief Checks if the given number has a normal value. + * \tparam Integer The type of the integer. + * \param num A integer value to check. + * \return true if the number has a normal value, false otherwise. */ template , bool> = true> constexpr bool isnormal(Integer num) noexcept { diff --git a/include/ccmath/internal/math/common/compare/isunordered.hpp b/include/ccmath/internal/math/common/compare/isunordered.hpp index 463d30b1..da56b91f 100644 --- a/include/ccmath/internal/math/common/compare/isunordered.hpp +++ b/include/ccmath/internal/math/common/compare/isunordered.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. - * @tparam T The type of the number. - * @param x A floating-point or integer value - * @param y A floating-point or integer value - * @return true if either x or y is NaN, false otherwise. + * \brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. + * \tparam T The type of the number. + * \param x A floating-point or integer value + * \param y A floating-point or integer value + * \return true if either x or y is NaN, false otherwise. */ template , bool> = true> constexpr bool isunordered(T x, T y) noexcept { @@ -36,9 +36,9 @@ namespace ccm } /** - * @brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. - * @tparam Integer The type of the integer. - * @return false, as all integers are ordered. + * \brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. + * \tparam Integer The type of the integer. + * \return false, as all integers are ordered. */ template , bool> = true> constexpr bool isunordered(Integer /* x */, Integer /* y */) noexcept @@ -47,12 +47,12 @@ namespace ccm } /** - * @brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. - * @tparam T Type of the left-hand side. - * @tparam U Type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if either x or y is NaN, false otherwise. + * \brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. + * \tparam T Type of the left-hand side. + * \tparam U Type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if either x or y is NaN, false otherwise. */ template constexpr bool isunordered(T x, U y) noexcept { @@ -61,4 +61,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/common/compare/signbit.hpp b/include/ccmath/internal/math/common/compare/signbit.hpp index f844fb5a..da173dd1 100644 --- a/include/ccmath/internal/math/common/compare/signbit.hpp +++ b/include/ccmath/internal/math/common/compare/signbit.hpp @@ -18,16 +18,16 @@ namespace ccm { /** - * @brief Detects the sign bit of zeroes, infinities, and NaNs. - * @tparam T A floating-point type. - * @param num A floating-point number. - * @return true if \p x is negative, false otherwise. + * \brief Detects the sign bit of zeroes, infinities, and NaNs. + * \tparam T A floating-point type. + * \param num A floating-point number. + * \return true if \p x is negative, false otherwise. * - * @note This function has multiple implementations based on the compiler and the version of the compiler used. + * \note This function has multiple implementations based on the compiler and the version of the compiler used. * With nearly all implementations, this function is fully constexpr and will return * the same values as std::signbit along with being static_assert-able. * - * @warning ccm::signbit may fail + * \warning ccm::signbit may fail * to compile if you are not using the cmake build for ccmath or do not have access to __builtin_bit_cast. */ template , bool> = true> [[nodiscard]] constexpr bool signbit(T num) noexcept @@ -49,12 +49,12 @@ namespace ccm } /** - * @brief Detects the sign bit of a number. - * @tparam Integer An integral type. - * @param num An integral number. - * @return true if \p x is negative, false otherwise. + * \brief Detects the sign bit of a number. + * \tparam Integer An integral type. + * \param num An integral number. + * \return true if \p x is negative, false otherwise. * - * @note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. + * \note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. */ template && std::is_signed_v, bool> = true> [[nodiscard]] constexpr bool signbit(Integer num) noexcept @@ -64,11 +64,11 @@ namespace ccm } /** - * @brief Detects the sign bit of a number. - * @tparam Integer An integral type. - * @return false as an unsigned number can't be negative. + * \brief Detects the sign bit of a number. + * \tparam Integer An integral type. + * \return false as an unsigned number can't be negative. * - * @note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. + * \note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. */ template && !std::is_signed_v, bool> = true> [[nodiscard]] constexpr bool signbit(Integer /* num */) noexcept diff --git a/include/ccmath/internal/math/common/expo/exp.hpp b/include/ccmath/internal/math/common/expo/exp.hpp index 1a3bd32a..54d16d36 100644 --- a/include/ccmath/internal/math/common/expo/exp.hpp +++ b/include/ccmath/internal/math/common/expo/exp.hpp @@ -21,10 +21,10 @@ CCM_DISABLE_MSVC_WARNING(4702) // 4702: unreachable code namespace ccm { /** - * @brief Computes e raised to the given power - * @tparam T floating-point or integer type - * @param num floating-point or integer value - * @return If no errors occur, the base-e exponential of num (e^num) is returned. + * \brief Computes e raised to the given power + * \tparam T floating-point or integer type + * \param num floating-point or integer value + * \return If no errors occur, the base-e exponential of num (e^num) is returned. */ template , bool> = true> constexpr T exp(T num) { @@ -38,10 +38,10 @@ namespace ccm } /** - * @brief Computes e raised to the given power - * @tparam Integer integer type - * @param num integer value - * @return If no errors occur, the base-e exponential of num (e^num) is returned as double. + * \brief Computes e raised to the given power + * \tparam Integer integer type + * \param num integer value + * \return If no errors occur, the base-e exponential of num (e^num) is returned as double. */ template , bool> = true> constexpr double exp(Integer num) { @@ -49,9 +49,9 @@ namespace ccm } /** - * @brief Computes e raised to the given power - * @param num floating-point value - * @return If no errors occur, the base-e exponential of num (e^num) is returned as float. + * \brief Computes e raised to the given power + * \param num floating-point value + * \return If no errors occur, the base-e exponential of num (e^num) is returned as float. */ constexpr float expf(float num) { @@ -59,9 +59,9 @@ namespace ccm } /** - * @brief Computes e raised to the given power - * @param num floating-point value - * @return If no errors occur, the base-e exponential of num (e^num) is returned as double. + * \brief Computes e raised to the given power + * \param num floating-point value + * \return If no errors occur, the base-e exponential of num (e^num) is returned as double. */ constexpr long double expl(long double num) { diff --git a/include/ccmath/internal/math/common/expo/exp2.hpp b/include/ccmath/internal/math/common/expo/exp2.hpp index 75c8e5cd..4989702d 100644 --- a/include/ccmath/internal/math/common/expo/exp2.hpp +++ b/include/ccmath/internal/math/common/expo/exp2.hpp @@ -24,10 +24,10 @@ CCM_DISABLE_MSVC_WARNING(4702) // 4702: unreachable code namespace ccm { /** - * @brief Returns 2 raised to the given power (2^x) - * @tparam T Floating-point or integer type - * @param num Floating-point or integer value - * @return If no errors occur, the base-2 exponential of num (2^num) is returned. + * \brief Returns 2 raised to the given power (2^x) + * \tparam T Floating-point or integer type + * \param num Floating-point or integer value + * \return If no errors occur, the base-2 exponential of num (2^num) is returned. */ template , bool> = true> constexpr T exp2(T num) { @@ -41,10 +41,10 @@ namespace ccm } /** - * @brief Returns 2 raised to the given power (2^x) - * @tparam Integer Integer type - * @param num Integer value - * @return If no errors occur, the base-2 exponential of num (2^num) is returned as a double. + * \brief Returns 2 raised to the given power (2^x) + * \tparam Integer Integer type + * \param num Integer value + * \return If no errors occur, the base-2 exponential of num (2^num) is returned as a double. */ template , bool> = true> constexpr double exp2(Integer num) { @@ -52,9 +52,9 @@ namespace ccm } /** - * @brief Returns 2 raised to the given power (2^x) - * @param num Floating-point value - * @return If no errors occur, the base-2 exponential of num (2^num) is returned as a float. + * \brief Returns 2 raised to the given power (2^x) + * \param num Floating-point value + * \return If no errors occur, the base-2 exponential of num (2^num) is returned as a float. */ constexpr float exp2f(float num) { @@ -62,9 +62,9 @@ namespace ccm } /** - * @brief Returns 2 raised to the given power (2^x) - * @param num Floating-point value - * @return If no errors occur, the base-2 exponential of num (2^num) is returned as a double. + * \brief Returns 2 raised to the given power (2^x) + * \param num Floating-point value + * \return If no errors occur, the base-2 exponential of num (2^num) is returned as a double. */ constexpr long double exp2l(long double num) { diff --git a/include/ccmath/internal/math/common/expo/log.hpp b/include/ccmath/internal/math/common/expo/log.hpp index 83103d43..1ea2a474 100644 --- a/include/ccmath/internal/math/common/expo/log.hpp +++ b/include/ccmath/internal/math/common/expo/log.hpp @@ -22,10 +22,10 @@ CCM_DISABLE_MSVC_WARNING(4702) namespace ccm { /** - * @brief Computes the natural (base e) logarithm (lnx) of a number. - * @tparam T The type of the number. - * @param num A floating-point or integer value to find the natural logarithm of. - * @return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. + * \brief Computes the natural (base e) logarithm (lnx) of a number. + * \tparam T The type of the number. + * \param num A floating-point or integer value to find the natural logarithm of. + * \return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. */ template , bool> = true> constexpr T log(const T num) noexcept { @@ -73,10 +73,10 @@ namespace ccm } /** - * @brief Computes the natural (base e) logarithm (lnx) of a number. - * @tparam Integer The type of the integer. - * @param num An integer value to find the natural logarithm of. - * @return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. + * \brief Computes the natural (base e) logarithm (lnx) of a number. + * \tparam Integer The type of the integer. + * \param num An integer value to find the natural logarithm of. + * \return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. */ template , bool> = true> constexpr double log(const Integer num) noexcept { @@ -84,9 +84,9 @@ namespace ccm } /** - * @brief Computes the natural (base e) logarithm (lnx) of a number. - * @param num A floating-point value to find the natural logarithm of. - * @return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. + * \brief Computes the natural (base e) logarithm (lnx) of a number. + * \param num A floating-point value to find the natural logarithm of. + * \return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. */ constexpr float logf(const float num) noexcept { @@ -94,9 +94,9 @@ namespace ccm } /** - * @brief Computes the natural (base e) logarithm (lnx) of a number. - * @param num A floating-point value to find the natural logarithm of. - * @return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. + * \brief Computes the natural (base e) logarithm (lnx) of a number. + * \param num A floating-point value to find the natural logarithm of. + * \return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. */ constexpr long double logl(long double num) noexcept { diff --git a/include/ccmath/internal/math/common/expo/log2.hpp b/include/ccmath/internal/math/common/expo/log2.hpp index b1b833de..42a97ba0 100644 --- a/include/ccmath/internal/math/common/expo/log2.hpp +++ b/include/ccmath/internal/math/common/expo/log2.hpp @@ -28,10 +28,10 @@ CCM_DISABLE_MSVC_WARNING(4702) namespace ccm { /** - * @brief Returns the base 2 logarithm of a number. - * @tparam T The type of the number. - * @param num The number to calculate the base 2 logarithm of. - * @return The base 2 logarithm of the number. + * \brief Returns the base 2 logarithm of a number. + * \tparam T The type of the number. + * \param num The number to calculate the base 2 logarithm of. + * \return The base 2 logarithm of the number. */ template , bool> = true> constexpr T log2(T num) noexcept { @@ -82,10 +82,10 @@ namespace ccm } /** - * @brief Returns the base 2 logarithm of a number. - * @tparam Integer The type of the integer. - * @param num The number to calculate the base 2 logarithm of. - * @return The base 2 logarithm of the number as a double. + * \brief Returns the base 2 logarithm of a number. + * \tparam Integer The type of the integer. + * \param num The number to calculate the base 2 logarithm of. + * \return The base 2 logarithm of the number as a double. */ template , bool> = true> constexpr double log2(Integer num) noexcept { @@ -93,9 +93,9 @@ namespace ccm } /** - * @brief Returns the base 2 logarithm of a number. - * @param num The number to calculate the base 2 logarithm of. - * @return The base 2 logarithm of the number as a float. + * \brief Returns the base 2 logarithm of a number. + * \param num The number to calculate the base 2 logarithm of. + * \return The base 2 logarithm of the number as a float. */ constexpr float log2f(float num) { @@ -103,9 +103,9 @@ namespace ccm } /** - * @brief Returns the base 2 logarithm of a number. - * @param num The number to calculate the base 2 logarithm of. - * @return The base 2 logarithm of the number as a double. + * \brief Returns the base 2 logarithm of a number. + * \param num The number to calculate the base 2 logarithm of. + * \return The base 2 logarithm of the number as a double. */ constexpr long double log2l(long double num) { diff --git a/include/ccmath/internal/math/common/fmanip/copysign.hpp b/include/ccmath/internal/math/common/fmanip/copysign.hpp index 0e366aac..14608376 100644 --- a/include/ccmath/internal/math/common/fmanip/copysign.hpp +++ b/include/ccmath/internal/math/common/fmanip/copysign.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Copies the sign of a floating point or integer value. - * @tparam T Type of the floating-point or integer value. - * @param mag A floating-point or integer value - * @param sgn A floating-point or integer value - * @return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. + * \brief Copies the sign of a floating point or integer value. + * \tparam T Type of the floating-point or integer value. + * \param mag A floating-point or integer value + * \param sgn A floating-point or integer value + * \return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. */ template , bool> = true> constexpr T copysign(T mag, T sgn) { @@ -46,11 +46,11 @@ namespace ccm } /** - * @brief Copies the sign of an integer value. - * @tparam Integer Type of the integer value. - * @param mag A integer value - * @param sgn A integer value - * @return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. + * \brief Copies the sign of an integer value. + * \tparam Integer Type of the integer value. + * \param mag A integer value + * \param sgn A integer value + * \return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. */ template , bool> = true> constexpr double copysign(Integer mag, Integer sgn) { @@ -58,10 +58,10 @@ namespace ccm } /** - * @brief Copies the sign of a floating point value. - * @param mag A floating-point. - * @param sgn A floating-point. - * @return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. + * \brief Copies the sign of a floating point value. + * \param mag A floating-point. + * \param sgn A floating-point. + * \return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. */ constexpr float copysignf(float mag, float sgn) { @@ -69,10 +69,10 @@ namespace ccm } /** - * @brief Copies the sign of a floating point value. - * @param mag A floating-point. - * @param sgn A floating-point. - * @return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. + * \brief Copies the sign of a floating point value. + * \param mag A floating-point. + * \param sgn A floating-point. + * \return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. */ constexpr long double copysignl(long double mag, long double sgn) { diff --git a/include/ccmath/internal/math/common/fmanip/ldexp.hpp b/include/ccmath/internal/math/common/fmanip/ldexp.hpp index 89212bde..4dc28a09 100644 --- a/include/ccmath/internal/math/common/fmanip/ldexp.hpp +++ b/include/ccmath/internal/math/common/fmanip/ldexp.hpp @@ -9,9 +9,9 @@ */ /** - * @file ldexp.hpp - * @defgroup fmanip Floating-Point Manipulation - * @brief Provides functions for scaling floating-point (and integer) values by a power of two. + * \file ldexp.hpp + * \defgroup fmanip Floating-Point Manipulation + * \brief Provides functions for scaling floating-point (and integer) values by a power of two. * * This header defines a family of ldexp-like functions, including \c ldexp for * generic floating-point types, integer overloads, and specialized variants for @@ -19,10 +19,10 @@ * while handling overflow, underflow, and special values (NaN, ±∞, etc.) as per * the rules of floating-point arithmetic so long as errno has not been disabled in cmake. * - * @author + * \author * Ian Pike * - * @copyright + * \copyright * Copyright (c) Ian Pike * Copyright (c) CCMath contributors * Licensed under the Apache-2.0 License WITH LLVM-exception. @@ -38,12 +38,12 @@ #include "ccmath/internal/support/helpers/internal_ldexp.hpp" /** - * @brief global ccm namespace + * \brief global ccm namespace */ namespace ccm { /** - * @brief Scales a floating-point \p num by \f$2^\text{exp}\f$. + * \brief Scales a floating-point \p num by \f$2^\text{exp}\f$. * * Overflow returns ±HUGE_VAL (or its float and long double forms), underflow returns the * correctly rounded result, possibly a subnormal or zero. ±0, ±∞, and NaN pass through @@ -51,11 +51,11 @@ namespace ccm * errno was disabled in cmake, \c errno may be set to \c ERANGE and \c FE_OVERFLOW or * \c FE_UNDERFLOW raised, depending on the platform. * - * @tparam T Floating-point type. - * @param num Value to scale. - * @param exp Power of two to scale by. - * @return \f$\text{num} \times 2^\text{exp}\f$. - * @attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. + * \tparam T Floating-point type. + * \param num Value to scale. + * \param exp Power of two to scale by. + * \return \f$\text{num} \times 2^\text{exp}\f$. + * \attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. */ template , bool> = true> constexpr T ldexp(T num, int exp) noexcept { @@ -69,16 +69,16 @@ namespace ccm } /** - * @brief Scales an integer \p num by \f$2^\text{exp}\f$, converting it to \c double first. + * \brief Scales an integer \p num by \f$2^\text{exp}\f$, converting it to \c double first. * * Equivalent to \c ldexp(static_cast(num), exp), so it shares the * floating-point overload's behavior after the conversion. Overflow returns ±HUGE_VAL. * - * @tparam Integer Integer type. - * @param num Value to scale, converted to \c double. - * @param exp Power of two to scale by. - * @return \f$\text{num} \times 2^\text{exp}\f$ as a \c double. - * @attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. + * \tparam Integer Integer type. + * \param num Value to scale, converted to \c double. + * \param exp Power of two to scale by. + * \return \f$\text{num} \times 2^\text{exp}\f$ as a \c double. + * \attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. */ template , bool> = true> constexpr double ldexp(Integer num, int exp) noexcept { @@ -86,14 +86,14 @@ namespace ccm } /** - * @brief Scales a \c float \p num by \f$2^\text{exp}\f$. Equivalent to \c ldexp(num, exp). + * \brief Scales a \c float \p num by \f$2^\text{exp}\f$. Equivalent to \c ldexp(num, exp). * * Overflow returns ±HUGE_VALF, underflow a subnormal or zero. * - * @param num Value to scale. - * @param exp Power of two to scale by. - * @return \f$\text{num} \times 2^\text{exp}\f$ as a \c float. - * @attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. + * \param num Value to scale. + * \param exp Power of two to scale by. + * \return \f$\text{num} \times 2^\text{exp}\f$ as a \c float. + * \attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. */ constexpr float ldexpf(float num, int exp) noexcept { @@ -101,17 +101,17 @@ namespace ccm } /** - * @brief Scales a \c long double \p num by \f$2^\text{exp}\f$ using native long double support. + * \brief Scales a \c long double \p num by \f$2^\text{exp}\f$ using native long double support. * * Overflow returns ±HUGE_VALL, underflow a subnormal or zero. ±0, ±∞, and NaN pass through * unchanged, and \p num is returned as-is when \p exp is 0. On a range error, and unless errno * was disabled in cmake, \c errno may be set to \c ERANGE and \c FE_OVERFLOW or \c FE_UNDERFLOW * raised, depending on the platform. * - * @param num Value to scale. - * @param exp Power of two to scale by. - * @return \f$\text{num} \times 2^\text{exp}\f$ as a \c long double. - * @attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. + * \param num Value to scale. + * \param exp Power of two to scale by. + * \return \f$\text{num} \times 2^\text{exp}\f$ as a \c long double. + * \attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. */ constexpr long double ldexpl(long double num, int exp) noexcept { diff --git a/include/ccmath/internal/math/common/fmanip/scalbn.hpp b/include/ccmath/internal/math/common/fmanip/scalbn.hpp index 516d4cd8..e453ed5d 100644 --- a/include/ccmath/internal/math/common/fmanip/scalbn.hpp +++ b/include/ccmath/internal/math/common/fmanip/scalbn.hpp @@ -23,11 +23,11 @@ CCM_DISABLE_MSVC_WARNING(4702) // 4702: unreachable code namespace ccm { /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam T Floating-point or integer type. - * @param num Floating-point or integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam T Floating-point or integer type. + * \param num Floating-point or integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. */ template , bool> = true> constexpr T scalbn(T num, int exp) noexcept { @@ -53,11 +53,11 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam T Floating-point or integer type. - * @param num Floating-point or integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam T Floating-point or integer type. + * \param num Floating-point or integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. */ template , bool> = true> constexpr T scalbn(T num, long exp) noexcept { @@ -83,11 +83,11 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam Integer Integer type. - * @param num Integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam Integer Integer type. + * \param num Integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. */ template , bool> = true> constexpr double scalbn(Integer num, int exp) noexcept { @@ -95,11 +95,11 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam Integer Integer type. - * @param num Integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam Integer Integer type. + * \param num Integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. */ template , bool> = true> constexpr double scalbn(Integer num, long exp) noexcept { @@ -107,10 +107,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. */ constexpr float scalbnf(float num, int exp) noexcept { @@ -118,10 +118,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. */ constexpr float scalbnf(float num, long exp) noexcept { @@ -129,10 +129,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. */ constexpr long double scalbnl(long double num, int exp) noexcept { @@ -140,10 +140,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. */ constexpr long double scalbnl(long double num, long exp) noexcept { diff --git a/include/ccmath/internal/math/common/nearest/floor.hpp b/include/ccmath/internal/math/common/nearest/floor.hpp index fa5b0f78..ee3e4127 100644 --- a/include/ccmath/internal/math/common/nearest/floor.hpp +++ b/include/ccmath/internal/math/common/nearest/floor.hpp @@ -78,10 +78,10 @@ namespace ccm } // namespace internal::impl /** - * @brief Computes the largest integer value not greater than num. - * @tparam T The type of the number. - * @param num A floating-point or integer value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \tparam T The type of the number. + * \param num A floating-point or integer value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ template , bool> = true> constexpr T floor(T num) noexcept { @@ -106,9 +106,9 @@ namespace ccm } /** - * @brief Computes the largest integer value not greater than num. - * @param num A integer value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \param num A integer value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ template , bool> = true> constexpr double floor(Integer num) noexcept { @@ -116,9 +116,9 @@ namespace ccm } /** - * @brief Computes the largest integer value not greater than num. - * @param num A floating-point value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \param num A floating-point value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ constexpr float floorf(float num) noexcept { @@ -126,9 +126,9 @@ namespace ccm } /** - * @brief Computes the largest integer value not greater than num. - * @param num A floating-point value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \param num A floating-point value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ constexpr double floorl(double num) noexcept { @@ -136,4 +136,4 @@ namespace ccm } } // namespace ccm -/// @ingroup nearest +/// \ingroup nearest diff --git a/include/ccmath/internal/math/common/nearest/nearbyint.hpp b/include/ccmath/internal/math/common/nearest/nearbyint.hpp index 12897494..90a7a8a1 100644 --- a/include/ccmath/internal/math/common/nearest/nearbyint.hpp +++ b/include/ccmath/internal/math/common/nearest/nearbyint.hpp @@ -23,10 +23,10 @@ namespace ccm { /** - * @brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. - * @tparam T The type of the number. - * @param num A floating-point value. - * @return If no errors occur, the rounded floating point value. Otherwise, returns the input floating point value unmodified. + * \brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. + * \tparam T The type of the number. + * \param num A floating-point value. + * \return If no errors occur, the rounded floating point value. Otherwise, returns the input floating point value unmodified. */ template , bool> = true> constexpr T nearbyint(T num) noexcept { @@ -40,10 +40,10 @@ namespace ccm } /** - * @brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. - * @tparam Integer The type of the number. - * @param num An integral value. - * @return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. + * \brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. + * \tparam Integer The type of the number. + * \param num An integral value. + * \return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. */ template , bool> = true> constexpr double nearbyint(Integer num) noexcept { @@ -51,9 +51,9 @@ namespace ccm } /** - * @brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. - * @param num A float value. - * @return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. + * \brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. + * \param num A float value. + * \return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. */ constexpr float nearbyintf(float num) noexcept { @@ -61,9 +61,9 @@ namespace ccm } /** - * @brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. - * @param num A long double value. - * @return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. + * \brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. + * \param num A long double value. + * \return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. */ constexpr long double nearbyintl(long double num) noexcept { diff --git a/include/ccmath/internal/math/common/nearest/trunc.hpp b/include/ccmath/internal/math/common/nearest/trunc.hpp index 62146394..5fa0253f 100644 --- a/include/ccmath/internal/math/common/nearest/trunc.hpp +++ b/include/ccmath/internal/math/common/nearest/trunc.hpp @@ -17,10 +17,10 @@ namespace ccm { /** - * @brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. - * @tparam T The type of the input. - * @param num The value to truncate. - * @return Returns a truncated value. + * \brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. + * \tparam T The type of the input. + * \param num The value to truncate. + * \return Returns a truncated value. */ template , bool> = true> constexpr T trunc(T num) noexcept { @@ -70,10 +70,10 @@ namespace ccm } /** - * @brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. - * @tparam Integer The type of the input. - * @param num The value to truncate. - * @return Returns a truncated value. + * \brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. + * \tparam Integer The type of the input. + * \param num The value to truncate. + * \return Returns a truncated value. */ template , bool> = true> constexpr double trunc(Integer num) noexcept { @@ -81,9 +81,9 @@ namespace ccm } /** - * @brief Specialization for float that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. - * @param num The float to truncate. - * @return Returns a truncated float. + * \brief Specialization for float that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. + * \param num The float to truncate. + * \return Returns a truncated float. */ constexpr float truncf(float num) noexcept { @@ -91,10 +91,10 @@ namespace ccm } /** - * @brief Specialization for long double that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to + * \brief Specialization for long double that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to * x. - * @param num The long double to truncate. - * @return Returns a truncated long double. + * \param num The long double to truncate. + * \return Returns a truncated long double. */ constexpr long double truncl(long double num) noexcept { diff --git a/include/ccmath/internal/math/common/power/sqrt.hpp b/include/ccmath/internal/math/common/power/sqrt.hpp index afb31c20..af90db9c 100644 --- a/include/ccmath/internal/math/common/power/sqrt.hpp +++ b/include/ccmath/internal/math/common/power/sqrt.hpp @@ -21,10 +21,10 @@ namespace ccm { /** - * @brief Calculates the square root of a number. - * @tparam T Floating-point type or integer type. - * @param num Floating-point or integer number. - * @return If no errors occur, square root of num (√num), is returned. + * \brief Calculates the square root of a number. + * \tparam T Floating-point type or integer type. + * \param num Floating-point or integer number. + * \return If no errors occur, square root of num (√num), is returned. */ template , bool> = true> constexpr T sqrt(T num) { @@ -42,10 +42,10 @@ namespace ccm } /** - * @brief Calculates the square root of a number. - * @tparam Integer Integer type. - * @param num Integer number. - * @return If no errors occur, square root of num (√num), is returned. + * \brief Calculates the square root of a number. + * \tparam Integer Integer type. + * \param num Integer number. + * \return If no errors occur, square root of num (√num), is returned. */ template , bool> = true> constexpr double sqrt(Integer num) { @@ -53,9 +53,9 @@ namespace ccm } /** - * @brief Calculates the square root of a number. - * @param num Floating-point number. - * @return If no errors occur, square root of num (√num), is returned. + * \brief Calculates the square root of a number. + * \param num Floating-point number. + * \return If no errors occur, square root of num (√num), is returned. */ constexpr float sqrtf(float num) { @@ -63,9 +63,9 @@ namespace ccm } /** - * @brief Calculates the square root of a number. - * @param num Floating-point number. - * @return If no errors occur, square root of num (√num), is returned. + * \brief Calculates the square root of a number. + * \param num Floating-point number. + * \return If no errors occur, square root of num (√num), is returned. */ constexpr long double sqrtl(long double num) { @@ -73,4 +73,4 @@ namespace ccm } } // namespace ccm -/// @ingroup power +/// \ingroup power diff --git a/include/ccmath/internal/math/common/trig/cos.hpp b/include/ccmath/internal/math/common/trig/cos.hpp index ad9ffba4..1dfe9589 100644 --- a/include/ccmath/internal/math/common/trig/cos.hpp +++ b/include/ccmath/internal/math/common/trig/cos.hpp @@ -50,4 +50,4 @@ namespace ccm } } // namespace ccm -/// @ingroup trig +/// \ingroup trig diff --git a/include/ccmath/internal/math/common/trig/sin.hpp b/include/ccmath/internal/math/common/trig/sin.hpp index 08a02d0a..a0168ace 100644 --- a/include/ccmath/internal/math/common/trig/sin.hpp +++ b/include/ccmath/internal/math/common/trig/sin.hpp @@ -50,4 +50,4 @@ namespace ccm } } // namespace ccm -/// @ingroup trig +/// \ingroup trig diff --git a/include/ccmath/internal/math/common/trig/tan.hpp b/include/ccmath/internal/math/common/trig/tan.hpp index 27e4251d..d18e4a67 100644 --- a/include/ccmath/internal/math/common/trig/tan.hpp +++ b/include/ccmath/internal/math/common/trig/tan.hpp @@ -50,4 +50,4 @@ namespace ccm } } // namespace ccm -/// @ingroup trig +/// \ingroup trig diff --git a/include/ccmath/internal/math/generic/builtins/basic/fabs.hpp b/include/ccmath/internal/math/generic/builtins/basic/fabs.hpp index 2b24009c..fdb289bc 100644 --- a/include/ccmath/internal/math/generic/builtins/basic/fabs.hpp +++ b/include/ccmath/internal/math/generic/builtins/basic/fabs.hpp @@ -68,7 +68,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_abs = @@ -89,7 +89,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_fabs functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_fabs functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/basic/fdim.hpp b/include/ccmath/internal/math/generic/builtins/basic/fdim.hpp index 08b9e86a..c18b6427 100644 --- a/include/ccmath/internal/math/generic/builtins/basic/fdim.hpp +++ b/include/ccmath/internal/math/generic/builtins/basic/fdim.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_fdim = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_fdim functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_fdim functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/basic/fma.hpp b/include/ccmath/internal/math/generic/builtins/basic/fma.hpp index 5f158d97..570994ee 100644 --- a/include/ccmath/internal/math/generic/builtins/basic/fma.hpp +++ b/include/ccmath/internal/math/generic/builtins/basic/fma.hpp @@ -66,7 +66,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_fma = @@ -76,7 +76,7 @@ namespace ccm::builtin false; #endif /** - * @internal + * \internal */ template inline constexpr bool has_fma = @@ -134,7 +134,7 @@ namespace ccm::builtin runtime_builtin_fma_enabled && has_fma && runtime_builtin_fma_validated_target && runtime_builtin_fma_long_double_supported; /** - * @internal + * \internal * Wrapper for constexpr __builtin_fma. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_fma without triggering a compiler error @@ -161,7 +161,7 @@ namespace ccm::builtin } /** - * @internal + * \internal * Wrapper for runtime __builtin_fma. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_fma without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/basic/fmax.hpp b/include/ccmath/internal/math/generic/builtins/basic/fmax.hpp index 9752b145..c9c8666b 100644 --- a/include/ccmath/internal/math/generic/builtins/basic/fmax.hpp +++ b/include/ccmath/internal/math/generic/builtins/basic/fmax.hpp @@ -61,7 +61,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_fmax = @@ -82,7 +82,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_fmax functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_fmax functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/basic/fmin.hpp b/include/ccmath/internal/math/generic/builtins/basic/fmin.hpp index 471a826d..733a5fb2 100644 --- a/include/ccmath/internal/math/generic/builtins/basic/fmin.hpp +++ b/include/ccmath/internal/math/generic/builtins/basic/fmin.hpp @@ -59,7 +59,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_fmin = @@ -80,7 +80,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_fmin functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_fmin functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/basic/fmod.hpp b/include/ccmath/internal/math/generic/builtins/basic/fmod.hpp index a46a3ab2..3ab76754 100644 --- a/include/ccmath/internal/math/generic/builtins/basic/fmod.hpp +++ b/include/ccmath/internal/math/generic/builtins/basic/fmod.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_fmod = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_fmod functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_fmod functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/basic/nan.hpp b/include/ccmath/internal/math/generic/builtins/basic/nan.hpp index 7f0fa2b7..b39d5662 100644 --- a/include/ccmath/internal/math/generic/builtins/basic/nan.hpp +++ b/include/ccmath/internal/math/generic/builtins/basic/nan.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_nan = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_nan functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_nan functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/basic/remainder.hpp b/include/ccmath/internal/math/generic/builtins/basic/remainder.hpp index 10b0c92e..c6b7ac06 100644 --- a/include/ccmath/internal/math/generic/builtins/basic/remainder.hpp +++ b/include/ccmath/internal/math/generic/builtins/basic/remainder.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_remainder = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_remainder functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_remainder functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/basic/remquo.hpp b/include/ccmath/internal/math/generic/builtins/basic/remquo.hpp index 86baf8d7..7a674131 100644 --- a/include/ccmath/internal/math/generic/builtins/basic/remquo.hpp +++ b/include/ccmath/internal/math/generic/builtins/basic/remquo.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_remquo = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_remquo functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_remquo functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/builtin_helpers.hpp b/include/ccmath/internal/math/generic/builtins/builtin_helpers.hpp index ac46b407..122ca214 100644 --- a/include/ccmath/internal/math/generic/builtins/builtin_helpers.hpp +++ b/include/ccmath/internal/math/generic/builtins/builtin_helpers.hpp @@ -5,14 +5,14 @@ namespace ccm::builtin { /** - * @internal - * @brief Helper to check that a valid builtin type is used + * \internal + * \brief Helper to check that a valid builtin type is used */ template inline constexpr bool is_valid_builtin_type = std::is_same_v || std::is_same_v || std::is_same_v; /** - * @internal - * @brief Like is_valid_builtin_type, but false in deterministic builds. + * \internal + * \brief Like is_valid_builtin_type, but false in deterministic builds. * * Transcendental builtins lower to system libm, which is not correctly rounded and differs * across platforms. Deterministic mode routes those functions through the generic kernels by diff --git a/include/ccmath/internal/math/generic/builtins/compare/isfinite.hpp b/include/ccmath/internal/math/generic/builtins/compare/isfinite.hpp index 5f9b4ebc..e90aceaa 100644 --- a/include/ccmath/internal/math/generic/builtins/compare/isfinite.hpp +++ b/include/ccmath/internal/math/generic/builtins/compare/isfinite.hpp @@ -60,7 +60,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_isfinite = @@ -81,7 +81,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_isfinite functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_isfinite functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/compare/isgreaterequal.hpp b/include/ccmath/internal/math/generic/builtins/compare/isgreaterequal.hpp index e86728b3..65b13bc3 100644 --- a/include/ccmath/internal/math/generic/builtins/compare/isgreaterequal.hpp +++ b/include/ccmath/internal/math/generic/builtins/compare/isgreaterequal.hpp @@ -46,7 +46,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_isgreaterequal = @@ -67,7 +67,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_isgreaterequal. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_isgreaterequal without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/compare/isinf.hpp b/include/ccmath/internal/math/generic/builtins/compare/isinf.hpp index ecd2bbd4..4416e1ef 100644 --- a/include/ccmath/internal/math/generic/builtins/compare/isinf.hpp +++ b/include/ccmath/internal/math/generic/builtins/compare/isinf.hpp @@ -67,7 +67,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_isinf = @@ -88,7 +88,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_isinf functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_isinf functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/compare/isless.hpp b/include/ccmath/internal/math/generic/builtins/compare/isless.hpp index 574bcd39..c02e2ff2 100644 --- a/include/ccmath/internal/math/generic/builtins/compare/isless.hpp +++ b/include/ccmath/internal/math/generic/builtins/compare/isless.hpp @@ -46,7 +46,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_isless = @@ -67,7 +67,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_isless. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_isless without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/compare/islessequal.hpp b/include/ccmath/internal/math/generic/builtins/compare/islessequal.hpp index de5ffbd3..a8da19fa 100644 --- a/include/ccmath/internal/math/generic/builtins/compare/islessequal.hpp +++ b/include/ccmath/internal/math/generic/builtins/compare/islessequal.hpp @@ -46,7 +46,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_islessequal = @@ -67,7 +67,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_islessequal. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_islessequal without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/compare/islessgreater.hpp b/include/ccmath/internal/math/generic/builtins/compare/islessgreater.hpp index afde7dcd..25b5aa15 100644 --- a/include/ccmath/internal/math/generic/builtins/compare/islessgreater.hpp +++ b/include/ccmath/internal/math/generic/builtins/compare/islessgreater.hpp @@ -46,7 +46,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_islessgreater = @@ -67,7 +67,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_islessgreater. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_islessgreater without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/compare/isnan.hpp b/include/ccmath/internal/math/generic/builtins/compare/isnan.hpp index a1de01bd..7932076e 100644 --- a/include/ccmath/internal/math/generic/builtins/compare/isnan.hpp +++ b/include/ccmath/internal/math/generic/builtins/compare/isnan.hpp @@ -67,7 +67,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_isnan = @@ -88,7 +88,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_isnan functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_isnan functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/compare/isnormal.hpp b/include/ccmath/internal/math/generic/builtins/compare/isnormal.hpp index 75cd2366..d0a69545 100644 --- a/include/ccmath/internal/math/generic/builtins/compare/isnormal.hpp +++ b/include/ccmath/internal/math/generic/builtins/compare/isnormal.hpp @@ -68,7 +68,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_isnormal = @@ -89,7 +89,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_isnormal functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_isnormal functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/compare/isunordered.hpp b/include/ccmath/internal/math/generic/builtins/compare/isunordered.hpp index 78a3d176..1aef9e9a 100644 --- a/include/ccmath/internal/math/generic/builtins/compare/isunordered.hpp +++ b/include/ccmath/internal/math/generic/builtins/compare/isunordered.hpp @@ -46,7 +46,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_isunordered = @@ -67,7 +67,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_isunordered functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_isunordered functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/compare/signbit.hpp b/include/ccmath/internal/math/generic/builtins/compare/signbit.hpp index ac247cba..58a3918f 100644 --- a/include/ccmath/internal/math/generic/builtins/compare/signbit.hpp +++ b/include/ccmath/internal/math/generic/builtins/compare/signbit.hpp @@ -53,7 +53,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_signbit = @@ -74,7 +74,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_signbit functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_signbit functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/expo/exp.hpp b/include/ccmath/internal/math/generic/builtins/expo/exp.hpp index 7dc45db4..98b0b6ef 100644 --- a/include/ccmath/internal/math/generic/builtins/expo/exp.hpp +++ b/include/ccmath/internal/math/generic/builtins/expo/exp.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_exp = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_exp functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_exp functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/expo/exp2.hpp b/include/ccmath/internal/math/generic/builtins/expo/exp2.hpp index 661701e8..74cb5d89 100644 --- a/include/ccmath/internal/math/generic/builtins/expo/exp2.hpp +++ b/include/ccmath/internal/math/generic/builtins/expo/exp2.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_exp2 = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_exp2 functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_exp2 functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/expo/expm1.hpp b/include/ccmath/internal/math/generic/builtins/expo/expm1.hpp index 9937c222..9b2efe38 100644 --- a/include/ccmath/internal/math/generic/builtins/expo/expm1.hpp +++ b/include/ccmath/internal/math/generic/builtins/expo/expm1.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_expm1 = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_expm1 functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_expm1 functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/expo/log.hpp b/include/ccmath/internal/math/generic/builtins/expo/log.hpp index f56c2d94..e42ac7aa 100644 --- a/include/ccmath/internal/math/generic/builtins/expo/log.hpp +++ b/include/ccmath/internal/math/generic/builtins/expo/log.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_log = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_log functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_log functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/expo/log10.hpp b/include/ccmath/internal/math/generic/builtins/expo/log10.hpp index 3183d8a6..a9a24791 100644 --- a/include/ccmath/internal/math/generic/builtins/expo/log10.hpp +++ b/include/ccmath/internal/math/generic/builtins/expo/log10.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_log10 = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_log10 functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_log10 functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/expo/log1p.hpp b/include/ccmath/internal/math/generic/builtins/expo/log1p.hpp index eca96d0d..3ac03d27 100644 --- a/include/ccmath/internal/math/generic/builtins/expo/log1p.hpp +++ b/include/ccmath/internal/math/generic/builtins/expo/log1p.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_log1p = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_log1p functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_log1p functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/expo/log2.hpp b/include/ccmath/internal/math/generic/builtins/expo/log2.hpp index 9fb4ea7b..0367efa4 100644 --- a/include/ccmath/internal/math/generic/builtins/expo/log2.hpp +++ b/include/ccmath/internal/math/generic/builtins/expo/log2.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_log2 = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_log2 functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_log2 functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/fmanip/copysign.hpp b/include/ccmath/internal/math/generic/builtins/fmanip/copysign.hpp index 2af1e5d1..5f89ed2b 100644 --- a/include/ccmath/internal/math/generic/builtins/fmanip/copysign.hpp +++ b/include/ccmath/internal/math/generic/builtins/fmanip/copysign.hpp @@ -68,7 +68,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_copysign = @@ -89,7 +89,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_copysign functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_copysign functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/fmanip/frexp.hpp b/include/ccmath/internal/math/generic/builtins/fmanip/frexp.hpp index 01ed6e5b..0674bfba 100644 --- a/include/ccmath/internal/math/generic/builtins/fmanip/frexp.hpp +++ b/include/ccmath/internal/math/generic/builtins/fmanip/frexp.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_frexp = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_frexp functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_frexp functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/fmanip/ilogb.hpp b/include/ccmath/internal/math/generic/builtins/fmanip/ilogb.hpp index dc20a080..c596c1f8 100644 --- a/include/ccmath/internal/math/generic/builtins/fmanip/ilogb.hpp +++ b/include/ccmath/internal/math/generic/builtins/fmanip/ilogb.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_ilogb = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_ilogb functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_ilogb functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/fmanip/ldexp.hpp b/include/ccmath/internal/math/generic/builtins/fmanip/ldexp.hpp index 870e90d5..dd37674c 100644 --- a/include/ccmath/internal/math/generic/builtins/fmanip/ldexp.hpp +++ b/include/ccmath/internal/math/generic/builtins/fmanip/ldexp.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_ldexp = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_ldexp functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_ldexp functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/fmanip/logb.hpp b/include/ccmath/internal/math/generic/builtins/fmanip/logb.hpp index 95136ca7..89c3c981 100644 --- a/include/ccmath/internal/math/generic/builtins/fmanip/logb.hpp +++ b/include/ccmath/internal/math/generic/builtins/fmanip/logb.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_logb = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_logb functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_logb functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/fmanip/modf.hpp b/include/ccmath/internal/math/generic/builtins/fmanip/modf.hpp index 6b1d2896..cf19e688 100644 --- a/include/ccmath/internal/math/generic/builtins/fmanip/modf.hpp +++ b/include/ccmath/internal/math/generic/builtins/fmanip/modf.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_modf = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_modf functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_modf functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/fmanip/nextafter.hpp b/include/ccmath/internal/math/generic/builtins/fmanip/nextafter.hpp index 8cf82430..a01bf657 100644 --- a/include/ccmath/internal/math/generic/builtins/fmanip/nextafter.hpp +++ b/include/ccmath/internal/math/generic/builtins/fmanip/nextafter.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_nextafter = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_nextafter functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_nextafter functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/fmanip/nexttoward.hpp b/include/ccmath/internal/math/generic/builtins/fmanip/nexttoward.hpp index dc2451f8..a3969fc1 100644 --- a/include/ccmath/internal/math/generic/builtins/fmanip/nexttoward.hpp +++ b/include/ccmath/internal/math/generic/builtins/fmanip/nexttoward.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_nexttoward = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_nexttoward functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_nexttoward functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/fmanip/scalbn.hpp b/include/ccmath/internal/math/generic/builtins/fmanip/scalbn.hpp index c975cbad..bb65f0ad 100644 --- a/include/ccmath/internal/math/generic/builtins/fmanip/scalbn.hpp +++ b/include/ccmath/internal/math/generic/builtins/fmanip/scalbn.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_scalbn = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_scalbn functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_scalbn functions without triggering a compiler error @@ -113,7 +113,7 @@ namespace ccm::builtin } /** - * @internal + * \internal * Wrapper for constexpr __builtin_scalbn functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_scalbn functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/hyper/acosh.hpp b/include/ccmath/internal/math/generic/builtins/hyper/acosh.hpp index 4592b6b0..e2affe53 100644 --- a/include/ccmath/internal/math/generic/builtins/hyper/acosh.hpp +++ b/include/ccmath/internal/math/generic/builtins/hyper/acosh.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_acosh = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_acosh functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_acosh functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/hyper/asinh.hpp b/include/ccmath/internal/math/generic/builtins/hyper/asinh.hpp index 0d9f5201..1f1ccced 100644 --- a/include/ccmath/internal/math/generic/builtins/hyper/asinh.hpp +++ b/include/ccmath/internal/math/generic/builtins/hyper/asinh.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_asinh = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_asinh functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_asinh functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/hyper/atanh.hpp b/include/ccmath/internal/math/generic/builtins/hyper/atanh.hpp index 2d2f2541..187f4635 100644 --- a/include/ccmath/internal/math/generic/builtins/hyper/atanh.hpp +++ b/include/ccmath/internal/math/generic/builtins/hyper/atanh.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_atanh = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_atanh functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_atanh functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/hyper/cosh.hpp b/include/ccmath/internal/math/generic/builtins/hyper/cosh.hpp index 30890768..2535a3c6 100644 --- a/include/ccmath/internal/math/generic/builtins/hyper/cosh.hpp +++ b/include/ccmath/internal/math/generic/builtins/hyper/cosh.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_cosh = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_cosh functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_cosh functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/hyper/sinh.hpp b/include/ccmath/internal/math/generic/builtins/hyper/sinh.hpp index 0626449c..b4191c67 100644 --- a/include/ccmath/internal/math/generic/builtins/hyper/sinh.hpp +++ b/include/ccmath/internal/math/generic/builtins/hyper/sinh.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_sinh = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_sinh functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_sinh functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/hyper/tanh.hpp b/include/ccmath/internal/math/generic/builtins/hyper/tanh.hpp index d9581cf5..301d4827 100644 --- a/include/ccmath/internal/math/generic/builtins/hyper/tanh.hpp +++ b/include/ccmath/internal/math/generic/builtins/hyper/tanh.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_tanh = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_tanh functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_tanh functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/misc/erf.hpp b/include/ccmath/internal/math/generic/builtins/misc/erf.hpp index 92b6eb65..cb477543 100644 --- a/include/ccmath/internal/math/generic/builtins/misc/erf.hpp +++ b/include/ccmath/internal/math/generic/builtins/misc/erf.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_erf = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_erf functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_erf without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/misc/erfc.hpp b/include/ccmath/internal/math/generic/builtins/misc/erfc.hpp index 0bfb176d..5be16185 100644 --- a/include/ccmath/internal/math/generic/builtins/misc/erfc.hpp +++ b/include/ccmath/internal/math/generic/builtins/misc/erfc.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_erfc = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_erfc functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_erfc without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/misc/tgamma.hpp b/include/ccmath/internal/math/generic/builtins/misc/tgamma.hpp index 12a1687a..9c1ccbd9 100644 --- a/include/ccmath/internal/math/generic/builtins/misc/tgamma.hpp +++ b/include/ccmath/internal/math/generic/builtins/misc/tgamma.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_gamma = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_tgamma functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_tgamma functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/nearest/ceil.hpp b/include/ccmath/internal/math/generic/builtins/nearest/ceil.hpp index af15292c..1800c883 100644 --- a/include/ccmath/internal/math/generic/builtins/nearest/ceil.hpp +++ b/include/ccmath/internal/math/generic/builtins/nearest/ceil.hpp @@ -54,7 +54,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_ceil = @@ -75,7 +75,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_ceil functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_ceil functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/nearest/floor.hpp b/include/ccmath/internal/math/generic/builtins/nearest/floor.hpp index 5e345094..69d7f324 100644 --- a/include/ccmath/internal/math/generic/builtins/nearest/floor.hpp +++ b/include/ccmath/internal/math/generic/builtins/nearest/floor.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_floor = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_floor functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_floor functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/nearest/nearbyint.hpp b/include/ccmath/internal/math/generic/builtins/nearest/nearbyint.hpp index 7e283e76..06839593 100644 --- a/include/ccmath/internal/math/generic/builtins/nearest/nearbyint.hpp +++ b/include/ccmath/internal/math/generic/builtins/nearest/nearbyint.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_nearbyint = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_nearbyint functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_nearbyint functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/nearest/rint.hpp b/include/ccmath/internal/math/generic/builtins/nearest/rint.hpp index e6c13184..6f551459 100644 --- a/include/ccmath/internal/math/generic/builtins/nearest/rint.hpp +++ b/include/ccmath/internal/math/generic/builtins/nearest/rint.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_rint = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_rint functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_rint functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/nearest/round.hpp b/include/ccmath/internal/math/generic/builtins/nearest/round.hpp index 8da259ea..8726c446 100644 --- a/include/ccmath/internal/math/generic/builtins/nearest/round.hpp +++ b/include/ccmath/internal/math/generic/builtins/nearest/round.hpp @@ -74,7 +74,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_round = @@ -85,7 +85,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_lround = @@ -115,7 +115,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_round functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_round functions without triggering a compiler error @@ -141,7 +141,7 @@ namespace ccm::builtin } /** - * @internal + * \internal * Wrapper for constexpr __builtin_lround functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_lround functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/nearest/trunc.hpp b/include/ccmath/internal/math/generic/builtins/nearest/trunc.hpp index 039440c3..927a14a5 100644 --- a/include/ccmath/internal/math/generic/builtins/nearest/trunc.hpp +++ b/include/ccmath/internal/math/generic/builtins/nearest/trunc.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_trunc = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_trunc functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_trunc functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/power/cbrt.hpp b/include/ccmath/internal/math/generic/builtins/power/cbrt.hpp index 5195c9d2..137789b0 100644 --- a/include/ccmath/internal/math/generic/builtins/power/cbrt.hpp +++ b/include/ccmath/internal/math/generic/builtins/power/cbrt.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_cbrt = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_cbrt functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_cbrt functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/power/hypot.hpp b/include/ccmath/internal/math/generic/builtins/power/hypot.hpp index f47cb3c9..d6704b0c 100644 --- a/include/ccmath/internal/math/generic/builtins/power/hypot.hpp +++ b/include/ccmath/internal/math/generic/builtins/power/hypot.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_hypot = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_hypot functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_hypot functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/power/pow.hpp b/include/ccmath/internal/math/generic/builtins/power/pow.hpp index 3f52f435..8ce1e44f 100644 --- a/include/ccmath/internal/math/generic/builtins/power/pow.hpp +++ b/include/ccmath/internal/math/generic/builtins/power/pow.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_pow = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_pow functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_pow functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/power/sqrt.hpp b/include/ccmath/internal/math/generic/builtins/power/sqrt.hpp index c70e8cd2..ced7a695 100644 --- a/include/ccmath/internal/math/generic/builtins/power/sqrt.hpp +++ b/include/ccmath/internal/math/generic/builtins/power/sqrt.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_sqrt = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_sqrt functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_sqrt functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/trig/acos.hpp b/include/ccmath/internal/math/generic/builtins/trig/acos.hpp index 730f8b18..c6448b4e 100644 --- a/include/ccmath/internal/math/generic/builtins/trig/acos.hpp +++ b/include/ccmath/internal/math/generic/builtins/trig/acos.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_acos = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_acos functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_acos functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/trig/asin.hpp b/include/ccmath/internal/math/generic/builtins/trig/asin.hpp index 30a414bb..13d09dd1 100644 --- a/include/ccmath/internal/math/generic/builtins/trig/asin.hpp +++ b/include/ccmath/internal/math/generic/builtins/trig/asin.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_asin = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_asin functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_asin functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/trig/atan.hpp b/include/ccmath/internal/math/generic/builtins/trig/atan.hpp index 8539e971..1cc5b7ed 100644 --- a/include/ccmath/internal/math/generic/builtins/trig/atan.hpp +++ b/include/ccmath/internal/math/generic/builtins/trig/atan.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_atan = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_atan functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_atan functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/trig/atan2.hpp b/include/ccmath/internal/math/generic/builtins/trig/atan2.hpp index 667c3533..b2be5218 100644 --- a/include/ccmath/internal/math/generic/builtins/trig/atan2.hpp +++ b/include/ccmath/internal/math/generic/builtins/trig/atan2.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_atan2 = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_atan2 functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_atan2 functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/trig/sin.hpp b/include/ccmath/internal/math/generic/builtins/trig/sin.hpp index 64f5b1f0..eab5505c 100644 --- a/include/ccmath/internal/math/generic/builtins/trig/sin.hpp +++ b/include/ccmath/internal/math/generic/builtins/trig/sin.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_sin = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_sin functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_sin functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/builtins/trig/tan.hpp b/include/ccmath/internal/math/generic/builtins/trig/tan.hpp index 4f446a8e..14b18109 100644 --- a/include/ccmath/internal/math/generic/builtins/trig/tan.hpp +++ b/include/ccmath/internal/math/generic/builtins/trig/tan.hpp @@ -47,7 +47,7 @@ namespace ccm::builtin { // clang-format off /** - * @internal + * \internal */ template inline constexpr bool has_constexpr_tan = @@ -68,7 +68,7 @@ namespace ccm::builtin #endif /** - * @internal + * \internal * Wrapper for constexpr __builtin_tan functions. * This should be used internally and always be wrapped in an if constexpr statement. * It exists only to allow for usage of __builtin_tan functions without triggering a compiler error diff --git a/include/ccmath/internal/math/generic/func/basic/abs_gen.hpp b/include/ccmath/internal/math/generic/func/basic/abs_gen.hpp index 693a500c..62ab8455 100644 --- a/include/ccmath/internal/math/generic/func/basic/abs_gen.hpp +++ b/include/ccmath/internal/math/generic/func/basic/abs_gen.hpp @@ -19,11 +19,11 @@ namespace ccm::gen { /** - * @internal - * @brief Computes the absolute value of a number. - * @tparam T Numeric type. - * @param num Floating-point or integer value. - * @return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. + * \internal + * \brief Computes the absolute value of a number. + * \tparam T Numeric type. + * \param num Floating-point or integer value. + * \return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. */ template constexpr auto abs(T num) -> std::enable_if_t && std::is_signed_v, T> { diff --git a/include/ccmath/internal/math/generic/func/basic/fdim_gen.hpp b/include/ccmath/internal/math/generic/func/basic/fdim_gen.hpp index 32142fc6..5835509e 100644 --- a/include/ccmath/internal/math/generic/func/basic/fdim_gen.hpp +++ b/include/ccmath/internal/math/generic/func/basic/fdim_gen.hpp @@ -20,12 +20,12 @@ namespace ccm::gen { /** - * @internal - * @brief Computes the positive difference of two floating point values (max(0,x−y)) - * @tparam T A floating-point type. - * @param x A floating-point or integer values - * @param y A floating-point or integer values - * @return If successful, returns the positive difference between x and y. + * \internal + * \brief Computes the positive difference of two floating point values (max(0,x−y)) + * \tparam T A floating-point type. + * \param x A floating-point or integer values + * \param y A floating-point or integer values + * \return If successful, returns the positive difference between x and y. */ template constexpr auto fdim(T x, T y) -> std::enable_if_t, T> { diff --git a/include/ccmath/internal/math/generic/func/basic/fmod_gen.hpp b/include/ccmath/internal/math/generic/func/basic/fmod_gen.hpp index e782daf0..94822c10 100644 --- a/include/ccmath/internal/math/generic/func/basic/fmod_gen.hpp +++ b/include/ccmath/internal/math/generic/func/basic/fmod_gen.hpp @@ -18,7 +18,7 @@ namespace ccm { - /// @cond CCMATH_INTERNAL + /// \cond CCMATH_INTERNAL namespace internal::impl { template constexpr T fmod_impl_check(T x, T y) noexcept @@ -70,15 +70,15 @@ namespace ccm return fmod_impl_check(static_cast(x), static_cast(y)); } } // namespace internal::impl - /// @endcond + /// \endcond /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @note Some edge cases where NaN is returned are different from std::fmod due to the standard allowing implementation based returns. - * @tparam T A floating-point type. - * @param x A floating-point value. - * @param y A floating-point value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \note Some edge cases where NaN is returned are different from std::fmod due to the standard allowing implementation based returns. + * \tparam T A floating-point type. + * \param x A floating-point value. + * \param y A floating-point value. + * \return The floating-point remainder of the division operation x/y. */ template , bool> = true> constexpr Real fmod(Real x, Real y) { @@ -86,11 +86,11 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @tparam Integer An integral type. - * @param x An integral value. - * @param y An integral value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \tparam Integer An integral type. + * \param x An integral value. + * \param y An integral value. + * \return The floating-point remainder of the division operation x/y. */ template , bool> = true> constexpr double fmod(Integer x, Integer y) { @@ -98,12 +98,12 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @tparam T A floating-point or integral type. - * @tparam U A floating-point or integral type. - * @param x A floating-point or integral value. - * @param y A floating-point or integral value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \tparam T A floating-point or integral type. + * \tparam U A floating-point or integral type. + * \param x A floating-point or integral value. + * \param y A floating-point or integral value. + * \return The floating-point remainder of the division operation x/y. */ template constexpr auto fmod(T x, T y) { @@ -111,10 +111,10 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @param x A floating-point value. - * @param y A floating-point value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \param x A floating-point value. + * \param y A floating-point value. + * \return The floating-point remainder of the division operation x/y. */ constexpr float fmodf(float x, float y) { @@ -122,10 +122,10 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @param x A floating-point value. - * @param y A floating-point value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \param x A floating-point value. + * \param y A floating-point value. + * \return The floating-point remainder of the division operation x/y. */ constexpr long double fmodl(long double x, long double y) { @@ -133,4 +133,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/internal/math/generic/func/basic/max_gen.hpp b/include/ccmath/internal/math/generic/func/basic/max_gen.hpp index 53f01467..936f8a00 100644 --- a/include/ccmath/internal/math/generic/func/basic/max_gen.hpp +++ b/include/ccmath/internal/math/generic/func/basic/max_gen.hpp @@ -19,11 +19,11 @@ namespace ccm::gen { /** - * @brief Computes the larger of the two values. - * @tparam T Type of the values to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two values. + * \tparam T Type of the values to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr T max(T x, T y) noexcept { diff --git a/include/ccmath/internal/math/generic/func/basic/min_gen.hpp b/include/ccmath/internal/math/generic/func/basic/min_gen.hpp index 712ac327..d678b9be 100644 --- a/include/ccmath/internal/math/generic/func/basic/min_gen.hpp +++ b/include/ccmath/internal/math/generic/func/basic/min_gen.hpp @@ -18,11 +18,11 @@ namespace ccm::gen { /** - * @brief Computes the smaller of the two values. - * @tparam T Type of the values to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam T Type of the values to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr T min(const T x, const T y) noexcept { diff --git a/include/ccmath/internal/math/generic/func/basic/remainder_gen.hpp b/include/ccmath/internal/math/generic/func/basic/remainder_gen.hpp index 76e0e7a0..39ab643b 100644 --- a/include/ccmath/internal/math/generic/func/basic/remainder_gen.hpp +++ b/include/ccmath/internal/math/generic/func/basic/remainder_gen.hpp @@ -17,11 +17,11 @@ namespace ccm { /** - * @brief Returns the remainder of the division of x by y. - * @tparam T Type of the values to compare. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y. + * \brief Returns the remainder of the division of x by y. + * \tparam T Type of the values to compare. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y. */ template , bool> = true> constexpr T remainder(T x, T y) { @@ -45,11 +45,11 @@ namespace ccm } /** - * @brief Returns the remainder of the division of x by y. - * @tparam Integer Type of the values to compare. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y as a double. + * \brief Returns the remainder of the division of x by y. + * \tparam Integer Type of the values to compare. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y as a double. */ template , bool> = true> constexpr double remainder(Integer x, Integer y) { @@ -57,10 +57,10 @@ namespace ccm } /** - * @brief Returns the remainder of the division of x by y. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y. + * \brief Returns the remainder of the division of x by y. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y. */ constexpr float remainderf(float x, float y) { @@ -68,10 +68,10 @@ namespace ccm } /** - * @brief Returns the remainder of the division of x by y. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y. + * \brief Returns the remainder of the division of x by y. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y. */ constexpr long double remainderl(long double x, long double y) { @@ -79,4 +79,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/internal/math/generic/func/compare/fpclassify.hpp b/include/ccmath/internal/math/generic/func/compare/fpclassify.hpp index f627716c..309e75ba 100644 --- a/include/ccmath/internal/math/generic/func/compare/fpclassify.hpp +++ b/include/ccmath/internal/math/generic/func/compare/fpclassify.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Classify the floating point number - * @attention This function is heavily implementation defined and may not work as expected on unknown compilers - * @tparam T The type of the floating point number - * @param num The number to classify - * @return The classification of the number as an integer + * \brief Classify the floating point number + * \attention This function is heavily implementation defined and may not work as expected on unknown compilers + * \tparam T The type of the floating point number + * \param num The number to classify + * \return The classification of the number as an integer */ template , bool> = true> constexpr int fpclassify(T num) { diff --git a/include/ccmath/internal/math/generic/func/compare/isfinite.hpp b/include/ccmath/internal/math/generic/func/compare/isfinite.hpp index c7c79d17..b9cd7d58 100644 --- a/include/ccmath/internal/math/generic/func/compare/isfinite.hpp +++ b/include/ccmath/internal/math/generic/func/compare/isfinite.hpp @@ -16,10 +16,10 @@ namespace ccm { /** - * @brief Checks if the given number has a finite value. - * @tparam T The type of the number. - * @param num A floating-point or integer value - * @return true if the number has a finite value, false otherwise. + * \brief Checks if the given number has a finite value. + * \tparam T The type of the number. + * \param num A floating-point or integer value + * \return true if the number has a finite value, false otherwise. */ template , bool> = true> constexpr bool isfinite(T num) { @@ -35,9 +35,9 @@ namespace ccm } /** - * @brief Checks if the given number has a finite value. - * @tparam Integer The type of the integer. - * @return true if the number has a finite value, false otherwise. + * \brief Checks if the given number has a finite value. + * \tparam Integer The type of the integer. + * \return true if the number has a finite value, false otherwise. */ template , bool> = true> constexpr bool isfinite(Integer /* x */) { diff --git a/include/ccmath/internal/math/generic/func/compare/isgreater.hpp b/include/ccmath/internal/math/generic/func/compare/isgreater.hpp index 71eb684d..794b70dd 100644 --- a/include/ccmath/internal/math/generic/func/compare/isgreater.hpp +++ b/include/ccmath/internal/math/generic/func/compare/isgreater.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is greater than the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is greater than the second, false otherwise. + * \brief Checks if the first argument is greater than the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is greater than the second, false otherwise. */ template , bool> = true> constexpr bool isgreater(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is greater than the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is greater than the second, false otherwise. + * \brief Checks if the first argument is greater than the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is greater than the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool isgreater(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/generic/func/compare/isgreaterequal.hpp b/include/ccmath/internal/math/generic/func/compare/isgreaterequal.hpp index 4fc0942d..60008e0d 100644 --- a/include/ccmath/internal/math/generic/func/compare/isgreaterequal.hpp +++ b/include/ccmath/internal/math/generic/func/compare/isgreaterequal.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is greater than or equal to the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is greater than or equal to the second, false otherwise. + * \brief Checks if the first argument is greater than or equal to the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is greater than or equal to the second, false otherwise. */ template , bool> = true> constexpr bool isgreaterequal(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is greater than or equal to the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is greater than or equal to the second, false otherwise. + * \brief Checks if the first argument is greater than or equal to the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is greater than or equal to the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool isgreaterequal(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/generic/func/compare/isinf.hpp b/include/ccmath/internal/math/generic/func/compare/isinf.hpp index 7cc1d9c8..f1e33bd5 100644 --- a/include/ccmath/internal/math/generic/func/compare/isinf.hpp +++ b/include/ccmath/internal/math/generic/func/compare/isinf.hpp @@ -19,10 +19,10 @@ namespace ccm { /** - * @brief Checks if the given number is infinite. - * @tparam T The type of the number to check. - * @param num The number to check. - * @return True if the number is infinite, false otherwise. + * \brief Checks if the given number is infinite. + * \tparam T The type of the number to check. + * \param num The number to check. + * \return True if the number is infinite, false otherwise. */ template , bool> = true> constexpr bool isinf(T num) noexcept { @@ -39,9 +39,9 @@ namespace ccm } /** - * @brief Checks if the given number is infinite. - * @tparam Integer The type of the integer to check. - * @return True if the number is infinite, false otherwise. + * \brief Checks if the given number is infinite. + * \tparam Integer The type of the integer to check. + * \return True if the number is infinite, false otherwise. */ template , bool> = true> constexpr bool isinf(Integer /* num */) noexcept { diff --git a/include/ccmath/internal/math/generic/func/compare/isless.hpp b/include/ccmath/internal/math/generic/func/compare/isless.hpp index 1478a63c..50822008 100644 --- a/include/ccmath/internal/math/generic/func/compare/isless.hpp +++ b/include/ccmath/internal/math/generic/func/compare/isless.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is less than the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is less than the second, false otherwise. + * \brief Checks if the first argument is less than the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is less than the second, false otherwise. */ template , bool> = true> constexpr bool isless(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is less than the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is less than the second, false otherwise. + * \brief Checks if the first argument is less than the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is less than the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool isless(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/generic/func/compare/islessequal.hpp b/include/ccmath/internal/math/generic/func/compare/islessequal.hpp index ab9438bb..0a58c978 100644 --- a/include/ccmath/internal/math/generic/func/compare/islessequal.hpp +++ b/include/ccmath/internal/math/generic/func/compare/islessequal.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is less than or equal to the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is less than or equal to the second, false otherwise. + * \brief Checks if the first argument is less than or equal to the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is less than or equal to the second, false otherwise. */ template , bool> = true> constexpr bool islessequal(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is less than or equal to the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is less than or equal to the second, false otherwise. + * \brief Checks if the first argument is less than or equal to the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is less than or equal to the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool islessequal(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/generic/func/compare/islessgreater.hpp b/include/ccmath/internal/math/generic/func/compare/islessgreater.hpp index cf389c6e..8511370c 100644 --- a/include/ccmath/internal/math/generic/func/compare/islessgreater.hpp +++ b/include/ccmath/internal/math/generic/func/compare/islessgreater.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is less than the second or greater than the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is less than the second or greater than the second, false otherwise. + * \brief Checks if the first argument is less than the second or greater than the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is less than the second or greater than the second, false otherwise. */ template , bool> = true> constexpr bool islessgreater(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is less than the second or greater than the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is less than the second or greater than the second, false otherwise. + * \brief Checks if the first argument is less than the second or greater than the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is less than the second or greater than the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool islessgreater(Arithmetic1 x, Arithmetic2 y) noexcept @@ -51,4 +51,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/generic/func/compare/isnan.hpp b/include/ccmath/internal/math/generic/func/compare/isnan.hpp index 4bdf7fce..1c4c6bad 100644 --- a/include/ccmath/internal/math/generic/func/compare/isnan.hpp +++ b/include/ccmath/internal/math/generic/func/compare/isnan.hpp @@ -18,10 +18,10 @@ namespace ccm { /** - * @brief Check if the given number is NaN. - * @tparam T The type of the number to check. - * @param num The number to check. - * @return True if the number is NaN, false otherwise. + * \brief Check if the given number is NaN. + * \tparam T The type of the number to check. + * \param num The number to check. + * \return True if the number is NaN, false otherwise. */ template , bool> = true> [[nodiscard]] constexpr bool isnan(T num) noexcept { @@ -38,9 +38,9 @@ namespace ccm } /** - * @brief Check if the given number is NaN. - * @tparam Integer The type of the number to check. - * @return False, as integers can never be NaN. + * \brief Check if the given number is NaN. + * \tparam Integer The type of the number to check. + * \return False, as integers can never be NaN. */ template , bool> = true> [[nodiscard]] constexpr bool isnan(Integer /* num */) { @@ -48,4 +48,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/generic/func/compare/isnormal.hpp b/include/ccmath/internal/math/generic/func/compare/isnormal.hpp index ded9d3bf..63f07afb 100644 --- a/include/ccmath/internal/math/generic/func/compare/isnormal.hpp +++ b/include/ccmath/internal/math/generic/func/compare/isnormal.hpp @@ -18,10 +18,10 @@ namespace ccm { /** - * @brief Checks if the given number has a normal value. - * @tparam T The type of the number. - * @param num A floating-point or integer value - * @return true if the number has a normal value, false otherwise. + * \brief Checks if the given number has a normal value. + * \tparam T The type of the number. + * \param num A floating-point or integer value + * \return true if the number has a normal value, false otherwise. */ template , bool> = true> constexpr bool isnormal(T num) noexcept { @@ -35,10 +35,10 @@ namespace ccm } /** - * @brief Checks if the given number has a normal value. - * @tparam Integer The type of the integer. - * @param num A integer value to check. - * @return true if the number has a normal value, false otherwise. + * \brief Checks if the given number has a normal value. + * \tparam Integer The type of the integer. + * \param num A integer value to check. + * \return true if the number has a normal value, false otherwise. */ template , bool> = true> constexpr bool isnormal(Integer num) noexcept { diff --git a/include/ccmath/internal/math/generic/func/compare/isunordered.hpp b/include/ccmath/internal/math/generic/func/compare/isunordered.hpp index 463d30b1..da56b91f 100644 --- a/include/ccmath/internal/math/generic/func/compare/isunordered.hpp +++ b/include/ccmath/internal/math/generic/func/compare/isunordered.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. - * @tparam T The type of the number. - * @param x A floating-point or integer value - * @param y A floating-point or integer value - * @return true if either x or y is NaN, false otherwise. + * \brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. + * \tparam T The type of the number. + * \param x A floating-point or integer value + * \param y A floating-point or integer value + * \return true if either x or y is NaN, false otherwise. */ template , bool> = true> constexpr bool isunordered(T x, T y) noexcept { @@ -36,9 +36,9 @@ namespace ccm } /** - * @brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. - * @tparam Integer The type of the integer. - * @return false, as all integers are ordered. + * \brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. + * \tparam Integer The type of the integer. + * \return false, as all integers are ordered. */ template , bool> = true> constexpr bool isunordered(Integer /* x */, Integer /* y */) noexcept @@ -47,12 +47,12 @@ namespace ccm } /** - * @brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. - * @tparam T Type of the left-hand side. - * @tparam U Type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if either x or y is NaN, false otherwise. + * \brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. + * \tparam T Type of the left-hand side. + * \tparam U Type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if either x or y is NaN, false otherwise. */ template constexpr bool isunordered(T x, U y) noexcept { @@ -61,4 +61,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/internal/math/generic/func/compare/signbit.hpp b/include/ccmath/internal/math/generic/func/compare/signbit.hpp index 4832e7ad..e3456fd0 100644 --- a/include/ccmath/internal/math/generic/func/compare/signbit.hpp +++ b/include/ccmath/internal/math/generic/func/compare/signbit.hpp @@ -18,16 +18,16 @@ namespace ccm { /** - * @brief Detects the sign bit of zeroes, infinities, and NaNs. - * @tparam T A floating-point type. - * @param num A floating-point number. - * @return true if \p x is negative, false otherwise. + * \brief Detects the sign bit of zeroes, infinities, and NaNs. + * \tparam T A floating-point type. + * \param num A floating-point number. + * \return true if \p x is negative, false otherwise. * - * @note This function has multiple implementations based on the compiler and the version of the compiler used. + * \note This function has multiple implementations based on the compiler and the version of the compiler used. * With nearly all implementations, this function is fully constexpr and will return * the same values as std::signbit along with being static_assert-able. * - * @warning ccm::signbit may fail + * \warning ccm::signbit may fail * to compile if you are not using the cmake build for ccmath or do not have access to __builtin_bit_cast. */ template , bool> = true> [[nodiscard]] constexpr bool signbit(T num) noexcept @@ -49,12 +49,12 @@ namespace ccm } /** - * @brief Detects the sign bit of a number. - * @tparam Integer An integral type. - * @param num An integral number. - * @return true if \p x is negative, false otherwise. + * \brief Detects the sign bit of a number. + * \tparam Integer An integral type. + * \param num An integral number. + * \return true if \p x is negative, false otherwise. * - * @note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. + * \note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. */ template && std::is_signed_v, bool> = true> [[nodiscard]] constexpr bool signbit(Integer num) noexcept @@ -64,11 +64,11 @@ namespace ccm } /** - * @brief Detects the sign bit of a number. - * @tparam Integer An integral type. - * @return false as an unsigned number can't be negative. + * \brief Detects the sign bit of a number. + * \tparam Integer An integral type. + * \return false as an unsigned number can't be negative. * - * @note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. + * \note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. */ template && !std::is_signed_v, bool> = true> [[nodiscard]] constexpr bool signbit(Integer /* num */) noexcept diff --git a/include/ccmath/internal/math/generic/func/fmanip/ldexp_gen.hpp b/include/ccmath/internal/math/generic/func/fmanip/ldexp_gen.hpp index 5e46b644..6ba82679 100644 --- a/include/ccmath/internal/math/generic/func/fmanip/ldexp_gen.hpp +++ b/include/ccmath/internal/math/generic/func/fmanip/ldexp_gen.hpp @@ -28,12 +28,12 @@ namespace ccm { /** - * @brief Multiplies a floating point value num by the number 2 raised to the exp power. - * @note On many implementations, std::ldexp is less efficient than multiplication or division by a power of two using arithmetic operators. - * @tparam T A floating-point type or an integer type. - * @param num A floating-point type or an integer value. - * @param exp An integer value. - * @return If no errors occur, num multiplied by 2 to the power of exp (num×2exp) is returned.\nIf a range error due to overflow occurs, ±HUGE_VAL, + * \brief Multiplies a floating point value num by the number 2 raised to the exp power. + * \note On many implementations, std::ldexp is less efficient than multiplication or division by a power of two using arithmetic operators. + * \tparam T A floating-point type or an integer type. + * \param num A floating-point type or an integer value. + * \param exp An integer value. + * \return If no errors occur, num multiplied by 2 to the power of exp (num×2exp) is returned.\nIf a range error due to overflow occurs, ±HUGE_VAL, * ±HUGE_VALF, or ±HUGE_VALL is returned.\nIf a range error due to underflow occurs, the correct result (after rounding) is returned. */ template , bool> = true> constexpr T ldexp(T num, int exp) noexcept @@ -117,12 +117,12 @@ namespace ccm } /** - * @brief Multiplies a floating point value num by the number 2 raised to the exp power. - * @note On many implementations, std::ldexp is less efficient than multiplication or division by a power of two using arithmetic operators. - * @tparam Integer An integer type - * @param num An integer value. - * @param exp An integer value. - * @return If no errors occur, num multiplied by 2 to the power of exp (num×2exp) is returned.\nIf a range error due to overflow occurs, ±HUGE_VAL, + * \brief Multiplies a floating point value num by the number 2 raised to the exp power. + * \note On many implementations, std::ldexp is less efficient than multiplication or division by a power of two using arithmetic operators. + * \tparam Integer An integer type + * \param num An integer value. + * \param exp An integer value. + * \return If no errors occur, num multiplied by 2 to the power of exp (num×2exp) is returned.\nIf a range error due to overflow occurs, ±HUGE_VAL, * ±HUGE_VALF, or ±HUGE_VALL is returned.\nIf a range error due to underflow occurs, the correct result (after rounding) is returned. */ template , bool> = true> constexpr double ldexp(Integer num, int exp) noexcept @@ -130,22 +130,22 @@ namespace ccm return ccm::ldexp(static_cast(num), exp); } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @note - * @param num A float value. - * @param exp An integer value. - * @return The result of parameter num multiplied by 2 to the power of parameter exp. + * \brief Returns the floating-point remainder of the division operation x/y. + * \note + * \param num A float value. + * \param exp An integer value. + * \return The result of parameter num multiplied by 2 to the power of parameter exp. */ constexpr float ldexpf(float num, int exp) noexcept { return ccm::ldexp(num, exp); } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @note - * @param num A long double value. - * @param exp An integer value. - * @return The result of parameter num multiplied by 2 to the power of parameter exp. + * \brief Returns the floating-point remainder of the division operation x/y. + * \note + * \param num A long double value. + * \param exp An integer value. + * \return The result of parameter num multiplied by 2 to the power of parameter exp. */ constexpr long double ldexpl(long double num, int exp) noexcept { diff --git a/include/ccmath/internal/math/generic/func/fmanip/scalbn_gen.hpp b/include/ccmath/internal/math/generic/func/fmanip/scalbn_gen.hpp index 3b75458b..b0d92356 100644 --- a/include/ccmath/internal/math/generic/func/fmanip/scalbn_gen.hpp +++ b/include/ccmath/internal/math/generic/func/fmanip/scalbn_gen.hpp @@ -17,11 +17,11 @@ namespace ccm { /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam T Floating-point or integer type. - * @param num Floating-point or integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam T Floating-point or integer type. + * \param num Floating-point or integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. */ template , bool> = true> constexpr T scalbn(T num, int exp) noexcept { @@ -57,11 +57,11 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam T Floating-point or integer type. - * @param num Floating-point or integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam T Floating-point or integer type. + * \param num Floating-point or integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. */ template , bool> = true> constexpr T scalbn(T num, long exp) noexcept { @@ -97,11 +97,11 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam Integer Integer type. - * @param num Integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam Integer Integer type. + * \param num Integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. */ template , bool> = true> constexpr double scalbn(Integer num, int exp) noexcept { @@ -109,11 +109,11 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam Integer Integer type. - * @param num Integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam Integer Integer type. + * \param num Integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. */ template , bool> = true> constexpr double scalbn(Integer num, long exp) noexcept { @@ -121,10 +121,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. */ constexpr float scalbnf(float num, int exp) noexcept { @@ -132,10 +132,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. */ constexpr float scalbnf(float num, long exp) noexcept { @@ -143,10 +143,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. */ constexpr long double scalbnl(long double num, int exp) noexcept { @@ -154,10 +154,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. */ constexpr long double scalbnl(long double num, long exp) noexcept { diff --git a/include/ccmath/internal/math/generic/func/nearest/floor_gen.hpp b/include/ccmath/internal/math/generic/func/nearest/floor_gen.hpp index b12d8904..e67e4653 100644 --- a/include/ccmath/internal/math/generic/func/nearest/floor_gen.hpp +++ b/include/ccmath/internal/math/generic/func/nearest/floor_gen.hpp @@ -77,10 +77,10 @@ namespace ccm } // namespace internal::impl /** - * @brief Computes the largest integer value not greater than num. - * @tparam T The type of the number. - * @param num A floating-point or integer value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \tparam T The type of the number. + * \param num A floating-point or integer value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ template , bool> = true> constexpr T floor(T num) noexcept { @@ -101,9 +101,9 @@ namespace ccm } /** - * @brief Computes the largest integer value not greater than num. - * @param num A integer value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \param num A integer value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ template , bool> = true> constexpr double floor(Integer num) noexcept { @@ -111,9 +111,9 @@ namespace ccm } /** - * @brief Computes the largest integer value not greater than num. - * @param num A floating-point value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \param num A floating-point value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ constexpr float floorf(float num) noexcept { @@ -121,9 +121,9 @@ namespace ccm } /** - * @brief Computes the largest integer value not greater than num. - * @param num A floating-point value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \param num A floating-point value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ constexpr double floorl(double num) noexcept { @@ -131,4 +131,4 @@ namespace ccm } } // namespace ccm -/// @ingroup nearest +/// \ingroup nearest diff --git a/include/ccmath/internal/math/generic/func/nearest/trunc_gen.hpp b/include/ccmath/internal/math/generic/func/nearest/trunc_gen.hpp index 431b65e3..43aa5751 100644 --- a/include/ccmath/internal/math/generic/func/nearest/trunc_gen.hpp +++ b/include/ccmath/internal/math/generic/func/nearest/trunc_gen.hpp @@ -16,10 +16,10 @@ namespace ccm { /** - * @brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. - * @tparam T The type of the input. - * @param num The value to truncate. - * @return Returns a truncated value. + * \brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. + * \tparam T The type of the input. + * \param num The value to truncate. + * \return Returns a truncated value. */ template , bool> = true> constexpr T trunc(T num) noexcept { @@ -63,10 +63,10 @@ namespace ccm } /** - * @brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. - * @tparam Integer The type of the input. - * @param num The value to truncate. - * @return Returns a truncated value. + * \brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. + * \tparam Integer The type of the input. + * \param num The value to truncate. + * \return Returns a truncated value. */ template , bool> = true> constexpr double trunc(Integer num) noexcept { @@ -74,9 +74,9 @@ namespace ccm } /** - * @brief Specialization for float that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. - * @param num The float to truncate. - * @return Returns a truncated float. + * \brief Specialization for float that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. + * \param num The float to truncate. + * \return Returns a truncated float. */ constexpr float truncf(float num) noexcept { @@ -84,10 +84,10 @@ namespace ccm } /** - * @brief Specialization for long double that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to + * \brief Specialization for long double that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to * x. - * @param num The long double to truncate. - * @return Returns a truncated long double. + * \param num The long double to truncate. + * \return Returns a truncated long double. */ constexpr long double truncl(long double num) noexcept { diff --git a/include/ccmath/internal/predef/expects_bool_condition.hpp b/include/ccmath/internal/predef/expects_bool_condition.hpp index 2008df3e..441020d0 100644 --- a/include/ccmath/internal/predef/expects_bool_condition.hpp +++ b/include/ccmath/internal/predef/expects_bool_condition.hpp @@ -15,7 +15,7 @@ namespace ccm::predef::internal { /** - * @brief Helper function to prevent the user from accidentally passing an integer to an expect function. + * \brief Helper function to prevent the user from accidentally passing an integer to an expect function. */ template , bool> = true> constexpr bool expects_bool_condition(T value, [[maybe_unused]] bool expected) { diff --git a/include/ccmath/internal/support/bits.hpp b/include/ccmath/internal/support/bits.hpp index 070144e1..d7c6f042 100644 --- a/include/ccmath/internal/support/bits.hpp +++ b/include/ccmath/internal/support/bits.hpp @@ -123,9 +123,9 @@ namespace ccm::support } /** - * @brief Helper function to get the top 16-bits of a double. - * @param x Double to get the bits from. - * @return + * \brief Helper function to get the top 16-bits of a double. + * \param x Double to get the bits from. + * \return */ constexpr std::uint32_t top16_bits_of_double(double x) noexcept { @@ -183,7 +183,7 @@ namespace ccm::support } /** - * @brief Rotates unsigned integer bits to the right. + * \brief Rotates unsigned integer bits to the right. * https://en.cppreference.com/w/cpp/numeric/rotr */ template , bool> = true> constexpr T rotr(T t, int cnt) noexcept @@ -220,7 +220,7 @@ namespace ccm::support } /** - * @brief Rotates unsigned integer bits to the left. + * \brief Rotates unsigned integer bits to the left. * https://en.cppreference.com/w/cpp/numeric/rotl */ template , bool> = true> constexpr T rotl(T t, int cnt) noexcept @@ -254,7 +254,7 @@ namespace ccm::support #if CCM_HAS_BUILTIN(__builtin_ctzg) /** - * @brief Returns the number of consecutive 0 bits in the value of x, starting from the least significant bit ("right"). + * \brief Returns the number of consecutive 0 bits in the value of x, starting from the least significant bit ("right"). * https://en.cppreference.com/w/cpp/numeric/countr_zero */ template [[nodiscard]] constexpr std::enable_if_t, int> countr_zero(T value) @@ -263,7 +263,7 @@ namespace ccm::support } #else // !CCM_HAS_BUILTIN(__builtin_ctzg) /** - * @brief Returns the number of consecutive 0 bits in the value of x, starting from the least significant bit ("right"). + * \brief Returns the number of consecutive 0 bits in the value of x, starting from the least significant bit ("right"). * https://en.cppreference.com/w/cpp/numeric/countr_zero */ template [[nodiscard]] constexpr std::enable_if_t, int> countr_zero(T value) @@ -384,7 +384,7 @@ namespace ccm::support } /** - * @brief Returns the smallest power of 2 that is greater than or equal to x. + * \brief Returns the smallest power of 2 that is greater than or equal to x. */ template constexpr std::enable_if_t || std::is_same_v || std::is_same_v || diff --git a/include/ccmath/internal/support/fenv/rounding_mode.hpp b/include/ccmath/internal/support/fenv/rounding_mode.hpp index 163956b4..26aeea65 100644 --- a/include/ccmath/internal/support/fenv/rounding_mode.hpp +++ b/include/ccmath/internal/support/fenv/rounding_mode.hpp @@ -26,8 +26,8 @@ namespace ccm::support::fenv { /** - * @brief The rounding mode ccmath assumes while a function is being constant-evaluated. - * @return CCM_CONSTEXPR_ROUNDING_MODE, which defaults to FE_TONEAREST. + * \brief The rounding mode ccmath assumes while a function is being constant-evaluated. + * \return CCM_CONSTEXPR_ROUNDING_MODE, which defaults to FE_TONEAREST. */ constexpr int constant_eval_rounding_mode() noexcept { @@ -63,8 +63,8 @@ namespace ccm::support::fenv } // namespace internal /** - * @brief Free-standing function that tests whether fegetround() == FE_UPWARD using common floating point observations. - * @return True if the rounding mode is set to FE_UPWARD, false otherwise. + * \brief Free-standing function that tests whether fegetround() == FE_UPWARD using common floating point observations. + * \return True if the rounding mode is set to FE_UPWARD, false otherwise. */ constexpr bool rounding_mode_is_round_up() { @@ -76,8 +76,8 @@ namespace ccm::support::fenv } /** - * @brief Free-standing function that tests whether fegetround() == FE_DOWNWARD using common floating point observations. - * @return True if the rounding mode is set to FE_DOWNWARD, false otherwise. + * \brief Free-standing function that tests whether fegetround() == FE_DOWNWARD using common floating point observations. + * \return True if the rounding mode is set to FE_DOWNWARD, false otherwise. */ constexpr bool rounding_mode_is_round_down() { @@ -89,8 +89,8 @@ namespace ccm::support::fenv } /** - * @brief Quick free-standing function that tests whether fegetround() == FE_TONEAREST using common floating point observations. - * @return True if the rounding mode is set to FE_TONEAREST, false otherwise. + * \brief Quick free-standing function that tests whether fegetround() == FE_TONEAREST using common floating point observations. + * \return True if the rounding mode is set to FE_TONEAREST, false otherwise. */ constexpr bool rounding_mode_is_round_to_nearest() { @@ -102,8 +102,8 @@ namespace ccm::support::fenv } /** - * @brief Free-standing function that tests whether fegetround() == FE_TOWARDZERO using common floating point observations. - * @return True if the rounding mode is set to FE_TOWARDZERO, false otherwise. + * \brief Free-standing function that tests whether fegetround() == FE_TOWARDZERO using common floating point observations. + * \return True if the rounding mode is set to FE_TOWARDZERO, false otherwise. */ constexpr bool rounding_mode_is_round_to_zero() { @@ -115,8 +115,8 @@ namespace ccm::support::fenv } /** - * @brief Free-standing function that identifies the current rounding mode. - * @return The current rounding mode. + * \brief Free-standing function that identifies the current rounding mode. + * \return The current rounding mode. */ constexpr int get_rounding_mode() { diff --git a/include/ccmath/internal/support/fp/fp_bits.hpp b/include/ccmath/internal/support/fp/fp_bits.hpp index d2931ebc..4963247a 100644 --- a/include/ccmath/internal/support/fp/fp_bits.hpp +++ b/include/ccmath/internal/support/fp/fp_bits.hpp @@ -41,7 +41,7 @@ namespace ccm::support::fp namespace internal { /** - * @brief Defines the layout of a floating point in memory and all of its parts along with the associated storage type. + * \brief Defines the layout of a floating point in memory and all of its parts along with the associated storage type. */ template struct FPLayout {}; @@ -92,75 +92,75 @@ namespace ccm::support::fp using BASE = FPLayout; /** - * @brief The number of bits in the exponent part. + * \brief The number of bits in the exponent part. */ using BASE::exponent_length; /** - * @brief The number of bits in the significand part. + * \brief The number of bits in the significand part. */ using BASE::significand_length; /** - * @brief The number of bits in the sign part. + * \brief The number of bits in the sign part. */ using BASE::sign_length; /** - * @brief The total number of bits in the floating point number. Provided as a convenience. + * \brief The total number of bits in the floating point number. Provided as a convenience. */ static constexpr int total_length = sign_length + exponent_length + significand_length; /** - * @brief The number of bits after the decimal dot when the number is in normal form. + * \brief The number of bits after the decimal dot when the number is in normal form. */ using BASE::fraction_length; /** - * @brief The storage type for the floating point number represented as an unsigned integer wide enough to contain all of the floating point bits. + * \brief The storage type for the floating point number represented as an unsigned integer wide enough to contain all of the floating point bits. */ using storage_type = typename BASE::storage_type; /** - * @brief The number of bits in the storage type. + * \brief The number of bits in the storage type. */ static constexpr int storage_length = sizeof(storage_type) * CHAR_BIT; static_assert(storage_length >= total_length, "ccmath - FPBits: Some how the storage is not able to hold the entire floating point number. This should never happen!"); /** - * @brief The exponent bias for the floating point type that should always be positive. + * \brief The exponent bias for the floating point type that should always be positive. */ static constexpr std::int32_t exponent_bias = (1U << (exponent_length - 1U)) - 1U; static_assert(exponent_bias > 0, "ccmath - FPBits: The exponent bias should always be positive. This should never happen!"); /** - * @brief The bit mask that keeps only the significand part. + * \brief The bit mask that keeps only the significand part. */ static constexpr storage_type significand_mask = support::mask_trailing_ones(); /** - * @brief The bit mask that keeps only the exponent part. + * \brief The bit mask that keeps only the exponent part. */ static constexpr storage_type exponent_mask = support::mask_trailing_ones() << significand_length; /** - * @brief The bit mask that keeps only the sign part. + * \brief The bit mask that keeps only the sign part. */ static constexpr storage_type sign_mask = support::mask_trailing_ones() << (exponent_length + significand_length); /** - * @brief The bit mask that keeps only the exponent and significand parts. + * \brief The bit mask that keeps only the exponent and significand parts. */ static constexpr storage_type exponent_significand_mask = support::mask_trailing_ones(); /** - * @brief The bit mask that keeps the entire bit pattern. (sign + exponent + significand) + * \brief The bit mask that keeps the entire bit pattern. (sign + exponent + significand) */ static constexpr storage_type fp_bits_mask = support::mask_trailing_ones(); /** - * @brief The bit mask that keeps only the fraction part. (i.e., the significand without the leading one) + * \brief The bit mask that keeps only the fraction part. (i.e., the significand without the leading one) */ static constexpr storage_type fraction_mask = support::mask_trailing_ones(); @@ -170,11 +170,11 @@ namespace ccm::support::fp protected: /** - * @brief Merges the bits from 'a' and 'b' values according to 'mask'. - * @param a Value to merge in non-masked bits - * @param b Value to merge in masked bits - * @param mask Mask that uses 'a' bits when corresponding 'mask' bits are zeroes and 'b' bits when corresponding bits are ones. - * @return Merged bits from 'a' and 'b' according to 'mask'. + * \brief Merges the bits from 'a' and 'b' values according to 'mask'. + * \param a Value to merge in non-masked bits + * \param b Value to merge in masked bits + * \param mask Mask that uses 'a' bits when corresponding 'mask' bits are zeroes and 'b' bits when corresponding bits are ones. + * \return Merged bits from 'a' and 'b' according to 'mask'. */ static constexpr storage_type merge(storage_type a, storage_type b, storage_type mask) { @@ -184,8 +184,8 @@ namespace ccm::support::fp } /** - * @brief A strongly typed integer that prevents mixing and matching integers with different semantics. - * @tparam T The type of the integer. + * \brief A strongly typed integer that prevents mixing and matching integers with different semantics. + * \tparam T The type of the integer. */ template struct TypedInt // NOLINT(cppcoreguidelines-special-member-functions) { @@ -218,7 +218,7 @@ namespace ccm::support::fp }; /** - * @brief An opaque type for storing floating point exponents. + * \brief An opaque type for storing floating point exponents. * * Inherits from TypedInt and defines special values like subnormal, min, zero, max, and inf. * Arbitrary values are valid within the range [min, max]. @@ -255,7 +255,7 @@ namespace ccm::support::fp }; /** - * @brief An opaque type for storing a floating point biased exponent. + * \brief An opaque type for storing a floating point biased exponent. * * Inherits from TypedInt and allows storage of biased exponents. * Provides conversion to and from the Exponent type and includes increment and decrement operators. @@ -270,7 +270,7 @@ namespace ccm::support::fp constexpr BiasedExponent(Exponent exp) : BASE(static_cast(static_cast(exp) + exponent_bias)) {} /** - * @brief Cast operator to convert from BiasedExponent to Exponent. + * \brief Cast operator to convert from BiasedExponent to Exponent. */ // NOLINTNEXTLINE(google-explicit-constructor) constexpr operator Exponent() const @@ -294,7 +294,7 @@ namespace ccm::support::fp }; /** - * @brief An opaque type for storing a floating point significand. + * \brief An opaque type for storing a floating point significand. * * Inherits from TypedInt and allows storage of significand values. * Provides operators for bitwise OR, XOR, and right shift. @@ -302,7 +302,7 @@ namespace ccm::support::fp * and all bits set to one. Arbitrary values are valid within the range [zero, bits_all_ones]. * Values exceeding this range are truncated. * - * @attention The semantics of the Significand are implementation dependent. + * \attention The semantics of the Significand are implementation dependent. */ struct Significand : TypedInt { @@ -404,7 +404,7 @@ namespace ccm::support::fp } /** - * @brief The bits of the floating point number represented as an unsigned integer. + * \brief The bits of the floating point number represented as an unsigned integer. */ storage_type bits{}; @@ -423,7 +423,7 @@ namespace ccm::support::fp }; /** - * @brief This layer defines all func related to the encoding of the floating point type. + * \brief This layer defines all func related to the encoding of the floating point type. * * It facilitates the construction, modification, and observation of values manipulated as 'storage_type'. */ @@ -544,8 +544,8 @@ namespace ccm::support::fp } /** - * @brief Returns the mantissa with the implicit bit set if the current value is a valid normal number. - * @return The explicit mantissa as a storage_type. + * \brief Returns the mantissa with the implicit bit set if the current value is a valid normal number. + * \return The explicit mantissa as a storage_type. * * This function checks if the current value is subnormal. If it is, it returns the significand bits. * Otherwise, it returns the mantissa with the implicit bit set. @@ -561,7 +561,7 @@ namespace ccm::support::fp }; /** - * @brief Template specialization for the X86 Extended Precision floating point type. + * \brief Template specialization for the X86 Extended Precision floating point type. */ template struct FPRepSem : FPStorage { @@ -571,7 +571,7 @@ namespace ccm::support::fp using BASE::storage_type; /** - * @brief Mask for the leading digit of the mantissa in the x86 80-bit float. + * \brief Mask for the leading digit of the mantissa in the x86 80-bit float. * * The x86 80-bit float represents the leading digit of the mantissa explicitly. * This constant defines the mask for that bit. @@ -740,13 +740,13 @@ namespace ccm::support::fp } /** - * @brief Checks if the implicit bit is set. + * \brief Checks if the implicit bit is set. * - * @return True if the implicit bit is set, false otherwise. + * \return True if the implicit bit is set, false otherwise. * * This function examines the bits and returns whether the implicit bit, as defined by EXPLICIT_BIT_MASK, is set. * - * @attention This function is specific to FPRepSem. + * \attention This function is specific to FPRepSem. */ [[nodiscard]] constexpr bool get_implicit_bit() const { @@ -754,14 +754,14 @@ namespace ccm::support::fp } /** - * @brief Sets the implicit bit to the specified value. + * \brief Sets the implicit bit to the specified value. * - * @param implicitVal The value to set the implicit bit to (true or false). + * \param implicitVal The value to set the implicit bit to (true or false). * * This function sets the implicit bit, defined by EXPLICIT_BIT_MASK, to the given value. * If the current state of the implicit bit differs from the specified value, it toggles the bit. * - * @attention This function is specific to FPRepSem. + * \attention This function is specific to FPRepSem. */ constexpr void set_implicit_bit(bool implicitVal) { @@ -773,7 +773,7 @@ namespace ccm::support::fp }; /** - * @brief 'FPRepImpl' is the base of the class hierarchy that handles 'FPType'. + * \brief 'FPRepImpl' is the base of the class hierarchy that handles 'FPType'. * * Specific float semantics are implemented by 'FPRepSem' above and specialized as needed. * @@ -902,9 +902,9 @@ namespace ccm::support::fp } /** - * @brief Retrieves the explicit exponent value, adjusted for subnormal and zero values. + * \brief Retrieves the explicit exponent value, adjusted for subnormal and zero values. * - * @return The explicit exponent as an integer. + * \return The explicit exponent as an integer. * * For subnormal numbers, the exponent is treated as the minimum exponent for a normal number * to maintain continuity between normal and subnormal ranges. This adjustment prevents slight @@ -931,8 +931,8 @@ namespace ccm::support::fp } /** - * @brief Sets the mantissa value of the internal bits. - * @param mantVal The mantissa value to set. + * \brief Sets the mantissa value of the internal bits. + * \param mantVal The mantissa value to set. */ constexpr void set_mantissa(storage_type mantVal) { @@ -940,8 +940,8 @@ namespace ccm::support::fp } /** - * @brief Sets the significand value of the internal bits. - * @param sigVal The significand value to set. + * \brief Sets the significand value of the internal bits. + * \param sigVal The significand value to set. */ constexpr void set_significand(storage_type sigVal) { @@ -949,14 +949,14 @@ namespace ccm::support::fp } /** - * @brief Unsafe function that creates a floating point representation that simply packs the sign, biased exponent, and mantissa values without + * \brief Unsafe function that creates a floating point representation that simply packs the sign, biased exponent, and mantissa values without *checking bounds nor normalization. - * @param sign Sign of the number. - * @param biased_exp Biased exponent. - * @param mantissa Mantissa value. - * @return The created floating point representation. + * \param sign Sign of the number. + * \param biased_exp Biased exponent. + * \param mantissa Mantissa value. + * \return The created floating point representation. * - * @warning For Binary80 Extended Precision, implicit bit needs to be set correctly in the 'mantissa' by the caller. + * \warning For Binary80 Extended Precision, implicit bit needs to be set correctly in the 'mantissa' by the caller. * This function will not check for its validity and assumes the caller has set it correctly. */ static constexpr RetT create_value(types::Sign sign, storage_type biased_exp, storage_type mantissa) @@ -965,12 +965,12 @@ namespace ccm::support::fp } /** - * @brief Converts an integer number and unbiased exponent to a proper float type. - * @param number The number to convert. - * @param expo The raw exponent value. - * @return The converted number. + * \brief Converts an integer number and unbiased exponent to a proper float type. + * \param number The number to convert. + * \param expo The raw exponent value. + * \return The converted number. * - * @attention Pay close attention to the following items about this function: + * \attention Pay close attention to the following items about this function: * 1) "ep" is the raw exponent value. * 2) The function adds +1 to ep for a smooth normalized to denormalized transition. * 3) The function does not check exponent high limit. @@ -1001,8 +1001,8 @@ namespace ccm::support::fp }; /** - * @brief A generic class to manipulate floating point formats. - * @tparam fp_type The floating point type to manipulate. + * \brief A generic class to manipulate floating point formats. + * \tparam fp_type The floating point type to manipulate. */ template // TODO(IanP): Review whether FPRep is still needed or should fold into FPRepImpl. @@ -1021,9 +1021,9 @@ namespace ccm::support::fp } // namespace internal /** - * @brief Identifies what the FPType corresponding to C++ type T is on the host. - * @tparam T The type to identify the FPType for. - * @return The FPType corresponding to the C++ type T. + * \brief Identifies what the FPType corresponding to C++ type T is on the host. + * \tparam T The type to identify the FPType for. + * \return The FPType corresponding to the C++ type T. */ template static constexpr FPType get_fp_type() { @@ -1056,8 +1056,8 @@ namespace ccm::support::fp } /** - * @brief A generic class to manipulate C++ floating point formats. - * @tparam T The floating point type to manipulate. + * \brief A generic class to manipulate C++ floating point formats. + * \tparam T The floating point type to manipulate. */ template struct FPBits final : internal::FPRepImpl(), FPBits> { @@ -1084,8 +1084,8 @@ namespace ccm::support::fp } /** - * @brief Converts the stored bits to a floating-point value. - * @return The floating-point value of type T. + * \brief Converts the stored bits to a floating-point value. + * \return The floating-point value of type T. */ constexpr T get_val() const { diff --git a/include/ccmath/internal/support/math_support.hpp b/include/ccmath/internal/support/math_support.hpp index 96919374..ab72511a 100644 --- a/include/ccmath/internal/support/math_support.hpp +++ b/include/ccmath/internal/support/math_support.hpp @@ -193,7 +193,7 @@ namespace ccm::support // TODO(IanP): Review whether these helpers should replace or merge with exact_add and split in double_double.hpp. /** - * @brief Add a + b, such that &hi + &lo approximates a + b. + * \brief Add a + b, such that &hi + &lo approximates a + b. * * Add a + b, such that *hi + *lo approximates a + b. * Assumes |a| >= |b|. @@ -207,10 +207,10 @@ namespace ccm::support * Algorithm Reference: * - https://hal.inria.fr/hal-03798376 * - * @param hi - * @param lo - * @param a - * @param b + * \param hi + * \param lo + * \param a + * \param b */ template , bool> = true> static constexpr void fast_two_sum(T & hi, T & lo, T a, T b) diff --git a/include/ccmath/internal/support/meta_compare.hpp b/include/ccmath/internal/support/meta_compare.hpp index 1dd754e6..c6785ff8 100644 --- a/include/ccmath/internal/support/meta_compare.hpp +++ b/include/ccmath/internal/support/meta_compare.hpp @@ -14,7 +14,7 @@ namespace ccm::support { - /// @cond HIDDEN + /// \cond HIDDEN namespace detail { // A variadic alias template that resolves to its first argument. @@ -38,7 +38,7 @@ namespace ccm::support template struct not_ : std::bool_constant(Pp::value)> {}; - /// @endcond + /// \endcond template inline constexpr bool or_v = or_::value; template inline constexpr bool and_v = and_::value; diff --git a/include/ccmath/internal/support/type_traits.hpp b/include/ccmath/internal/support/type_traits.hpp index 3354788e..428f6008 100644 --- a/include/ccmath/internal/support/type_traits.hpp +++ b/include/ccmath/internal/support/type_traits.hpp @@ -30,7 +30,7 @@ namespace ccm::support::traits /// is_char specialization - /// @cond internal + /// \cond internal template struct internal_is_char : std::false_type {}; template <> struct internal_is_char : std::true_type {}; template <> struct internal_is_char : std::true_type {}; @@ -41,14 +41,14 @@ namespace ccm::support::traits template <> struct internal_is_char : std::true_type {}; template <> struct internal_is_char : std::true_type {}; template <> struct internal_is_char : std::true_type {}; - /// @endcond + /// \endcond template constexpr bool is_char_v = internal_is_char::value; /// is_integral with additional specializations - for internal use only. Prefer std::is_integral. - /// @cond internal + /// \cond internal template struct internal_is_integral_helper : std::false_type {}; template<> struct internal_is_integral_helper : std::true_type {}; template<> struct internal_is_integral_helper : std::true_type {}; @@ -72,14 +72,14 @@ namespace ccm::support::traits template<> struct internal_is_integral_helper<__uint128_t> : std::true_type {}; template<> struct internal_is_integral_helper<__int128_t> : std::true_type {}; #endif - /// @endcond + /// \endcond template struct ccm_is_integral : internal_is_integral_helper>::type {}; template constexpr bool ccm_is_integral_v = ccm_is_integral::value; /// is_floating_point - /// @cond internal + /// \cond internal template struct internal_is_floating_point_helper : std::false_type{}; template <> struct internal_is_floating_point_helper : std::true_type{}; template <> struct internal_is_floating_point_helper : std::true_type{}; @@ -102,7 +102,7 @@ namespace ccm::support::traits #ifdef CCM_TYPES_HAS_FLOAT128 template <> struct internal_is_floating_point_helper : std::true_type{}; #endif - /// @endcond + /// \endcond template struct ccm_is_floating_point : internal_is_floating_point_helper>::type{}; template constexpr bool ccm_is_floating_point_v = ccm_is_floating_point::value; @@ -116,10 +116,10 @@ namespace ccm::support::traits /// is_signed - /// @cond internal + /// \cond internal template ::value> struct internal_is_signed_helper : std::false_type {}; template struct internal_is_signed_helper : std::integral_constant {}; - /// @endcond + /// \endcond template struct ccm_is_signed : internal_is_signed_helper::type {}; template constexpr bool ccm_is_signed_v = ccm_is_signed::value; diff --git a/include/ccmath/internal/types/big_int.hpp b/include/ccmath/internal/types/big_int.hpp index a674cad5..7ccbc5df 100644 --- a/include/ccmath/internal/types/big_int.hpp +++ b/include/ccmath/internal/types/big_int.hpp @@ -42,7 +42,7 @@ namespace ccm::types { /** - * @brief Type trait that maps unsigned integers to their corresponding half-width types. + * \brief Type trait that maps unsigned integers to their corresponding half-width types. * * This struct provides a type alias for the half-width equivalent of the given unsigned integer type. * For example, std::uint32_t maps to std::uint16_t. @@ -64,12 +64,12 @@ namespace ccm::types #endif /** - * @brief Alias for the half-width type of the given unsigned integer type. + * \brief Alias for the half-width type of the given unsigned integer type. */ template using half_width_t = typename half_width::type; /** - * @brief An array of two elements for use in multiword operations. + * \brief An array of two elements for use in multiword operations. * * This struct provides a two-element array, useful for operations that require handling multiword data. */ @@ -79,18 +79,18 @@ namespace ccm::types using UP::UP; /** - * @brief Constructs a DoubleWide with the given low and high values. - * @param lo The low part of the double-wide value. - * @param hi The high part of the double-wide value. + * \brief Constructs a DoubleWide with the given low and high values. + * \param lo The low part of the double-wide value. + * \param hi The high part of the double-wide value. */ constexpr DoubleWide(T lo, T hi) : UP({ lo, hi }) {} }; /** - * @brief Splits an unsigned value into a DoubleWide containing its half-width components. - * @tparam T The type of the input value, which must be an unsigned integer. - * @param value The unsigned integer value to be split. - * @return A DoubleWide object containing the lower and upper half-width parts of the input value. + * \brief Splits an unsigned value into a DoubleWide containing its half-width components. + * \tparam T The type of the input value, which must be an unsigned integer. + * \param value The unsigned integer value to be split. + * \return A DoubleWide object containing the lower and upper half-width parts of the input value. */ template constexpr auto split(T value) { @@ -100,10 +100,10 @@ namespace ccm::types } /** - * @brief Returns the lower half of a DoubleWide value. - * @tparam T The type of the DoubleWide value. - * @param value The DoubleWide value to split. - * @return The lower half of the DoubleWide value. + * \brief Returns the lower half of a DoubleWide value. + * \tparam T The type of the DoubleWide value. + * \param value The DoubleWide value to split. + * \return The lower half of the DoubleWide value. */ template constexpr T lo(const DoubleWide & value) { @@ -111,10 +111,10 @@ namespace ccm::types } /** - * @brief Returns the upper half of a DoubleWide value. - * @tparam T The type of the DoubleWide value. - * @param value The DoubleWide value to split. - * @return The upper half of the DoubleWide value. + * \brief Returns the upper half of a DoubleWide value. + * \tparam T The type of the DoubleWide value. + * \param value The DoubleWide value to split. + * \return The upper half of the DoubleWide value. */ template constexpr T hi(const DoubleWide & value) { @@ -122,10 +122,10 @@ namespace ccm::types } /** - * @brief Returns the lower half of a unsigned value - * @tparam T The type of the input value, which must be an unsigned integer. - * @param value The unsigned integer value to be split. - * @return The lower half of the input value. + * \brief Returns the lower half of a unsigned value + * \tparam T The type of the input value, which must be an unsigned integer. + * \param value The unsigned integer value to be split. + * \return The lower half of the input value. */ template constexpr half_width_t lo(T value) { @@ -133,10 +133,10 @@ namespace ccm::types } /** - * @brief Returns the upper half of a unsigned value - * @tparam T The type of the input value, which must be an unsigned integer. - * @param value The unsigned integer value to be split. - * @return The upper half of the input value. + * \brief Returns the upper half of a unsigned value + * \tparam T The type of the input value, which must be an unsigned integer. + * \param value The unsigned integer value to be split. + * \return The upper half of the input value. */ template constexpr half_width_t hi(T value) { @@ -144,15 +144,15 @@ namespace ccm::types } /** - * @brief Multiplies two words and returns the result as a DoubleWide containing the product. + * \brief Multiplies two words and returns the result as a DoubleWide containing the product. * * This function performs multiplication of two words (unsigned integers) and returns the result * in a DoubleWide object, which stores the product in two parts (lower and upper half-width components). * - * @tparam word The type of the input values, which must be an unsigned integer type. - * @param lhs The left-hand side operand. - * @param rhs The right-hand side operand. - * @return A DoubleWide object containing the lower and upper parts of the product. + * \tparam word The type of the input values, which must be an unsigned integer type. + * \param lhs The left-hand side operand. + * \param rhs The right-hand side operand. + * \return A DoubleWide object containing the lower and upper parts of the product. * * This function uses different multiplication strategies based on the size of the input type: * - For 8-bit and 16-bit types, it performs a straightforward multiplication and splits the result. @@ -219,19 +219,19 @@ namespace ccm::types } /** - * @brief Performs in-place binary operation 'dst op= rhs' with carry propagation. + * \brief Performs in-place binary operation 'dst op= rhs' with carry propagation. * * This function applies the provided binary operation with carry propagation to each element in the 'dst' array, * using elements from the 'rhs' array. It returns the final carry value. * - * @tparam Function The type of the binary operation with carry. - * @tparam word The type of the elements in the arrays. - * @tparam N The size of the 'dst' array. - * @tparam M The size of the 'rhs' array. - * @param op_with_carry The binary operation function that includes carry propagation. - * @param dst The destination array to be modified. - * @param rhs The source array for the operation. - * @return The carry value after the operation completes. + * \tparam Function The type of the binary operation with carry. + * \tparam word The type of the elements in the arrays. + * \tparam N The size of the 'dst' array. + * \tparam M The size of the 'rhs' array. + * \param op_with_carry The binary operation function that includes carry propagation. + * \param dst The destination array to be modified. + * \param rhs The source array for the operation. + * \return The carry value after the operation completes. */ template constexpr word inplace_binop(Function op_with_carry, std::array & dst, const std::array & rhs) @@ -255,17 +255,17 @@ namespace ccm::types } /** - * @brief Performs in-place addition and returns the final carry. + * \brief Performs in-place addition and returns the final carry. * * This function adds elements from the 'rhs' array to the 'dst' array with carry propagation, * using the 'add_with_carry' function. It returns the final carry value. * - * @tparam word The type of the elements in the arrays. - * @tparam N The size of the 'dst' array. - * @tparam M The size of the 'rhs' array. - * @param dst The destination array to be modified by the addition. - * @param rhs The source array providing the values to add. - * @return The carry value after the addition completes. + * \tparam word The type of the elements in the arrays. + * \tparam N The size of the 'dst' array. + * \tparam M The size of the 'rhs' array. + * \param dst The destination array to be modified by the addition. + * \param rhs The source array providing the values to add. + * \return The carry value after the addition completes. */ template constexpr word add_with_carry(std::array & dst, const std::array & rhs) { @@ -273,17 +273,17 @@ namespace ccm::types } /** - * @brief Performs in-place subtraction and returns the final borrow. + * \brief Performs in-place subtraction and returns the final borrow. * * This function subtracts elements from the 'rhs' array from the 'dst' array with borrow propagation. * It uses the 'sub_with_borrow' function to handle the subtraction with borrow. The final borrow value is returned. * - * @tparam word The type of the elements in the arrays. - * @tparam N The size of the 'dst' array. - * @tparam M The size of the 'rhs' array. - * @param dst The destination array to be modified by the subtraction. - * @param rhs The source array providing the values to subtract. - * @return The borrow value after the subtraction completes. + * \tparam word The type of the elements in the arrays. + * \tparam N The size of the 'dst' array. + * \tparam M The size of the 'rhs' array. + * \param dst The destination array to be modified by the subtraction. + * \param rhs The source array providing the values to subtract. + * \return The borrow value after the subtraction completes. */ template constexpr word sub_with_borrow(std::array & dst, const std::array & rhs) { @@ -291,17 +291,17 @@ namespace ccm::types } /** - * @brief Performs in-place multiply-add and returns the final carry. + * \brief Performs in-place multiply-add and returns the final carry. * * This function multiplies 'b' and 'c', adds the result to the 'dst' array with carry propagation, * and returns the final carry value. * - * @tparam word The type of the elements in the arrays. - * @tparam N The size of the 'dst' array. - * @param dst The destination array to be modified by the multiply-add operation. - * @param b The multiplier value. - * @param c The multiplicand value. - * @return The carry value after the multiply-add operation completes. + * \tparam word The type of the elements in the arrays. + * \tparam N The size of the 'dst' array. + * \param dst The destination array to be modified by the multiply-add operation. + * \param b The multiplier value. + * \param c The multiplicand value. + * \return The carry value after the multiply-add operation completes. */ template constexpr word mul_add_with_carry(std::array & dst, word b, word c) { @@ -309,29 +309,29 @@ namespace ccm::types } /** - * @brief An array of two elements used as an accumulator in multiword computations. + * \brief An array of two elements used as an accumulator in multiword computations. * * This struct serves as an accumulator for multiword computations, featuring methods to manage carry propagation and summation. * - * @tparam T The type of the elements in the array. + * \tparam T The type of the elements in the array. */ template struct Accumulator final : std::array { using UP = std::array; /** - * @brief Initializes the Accumulator with zero values. + * \brief Initializes the Accumulator with zero values. */ constexpr Accumulator() : UP({ 0, 0 }) {} /** - * @brief Advances the accumulator with a new carry-in value. + * \brief Advances the accumulator with a new carry-in value. * * Shifts the current values in the accumulator, moves the back value to the front, * and sets the back value to the new carry-in value. * - * @param carry_in The new carry-in value. - * @return The previous front value. + * \param carry_in The new carry-in value. + * \return The previous front value. */ constexpr T advance(T carry_in) { @@ -342,8 +342,8 @@ namespace ccm::types } /** - * @brief Returns the sum (front value) of the accumulator. - * @return The front value of the accumulator. + * \brief Returns the sum (front value) of the accumulator. + * \return The front value of the accumulator. */ constexpr T sum() const { @@ -351,8 +351,8 @@ namespace ccm::types } /** - * @brief Returns the carry (back value) of the accumulator. - * @return The back value of the accumulator. + * \brief Returns the carry (back value) of the accumulator. + * \return The back value of the accumulator. */ constexpr T carry() const { @@ -361,16 +361,16 @@ namespace ccm::types }; /** - * @brief Performs in-place multiplication by a single word and returns the final carry. + * \brief Performs in-place multiplication by a single word and returns the final carry. * * This function multiplies each element in the 'dst' array by the given word 'x', * using an accumulator to manage carry propagation. It returns the final carry value. * - * @tparam word The type of the elements in the array and the multiplier. - * @tparam N The size of the 'dst' array. - * @param dst The array to be modified by the multiplication. - * @param x The word to multiply each element of the 'dst' array by. - * @return The carry value after the multiplication completes. + * \tparam word The type of the elements in the array and the multiplier. + * \tparam N The size of the 'dst' array. + * \param dst The array to be modified by the multiplication. + * \param x The word to multiply each element of the 'dst' array by. + * \return The carry value after the multiplication completes. */ template constexpr word scalar_multiply_with_carry(std::array & dst, word x) { @@ -384,7 +384,7 @@ namespace ccm::types } /** - * @brief Multiplies 'lhs' by 'rhs' and stores the result in 'dst', returning the final carry. + * \brief Multiplies 'lhs' by 'rhs' and stores the result in 'dst', returning the final carry. * * This function multiplies the elements of 'lhs' and 'rhs', storing the result in 'dst' and managing carry propagation. * It is safe to use for signed numbers. @@ -393,12 +393,12 @@ namespace ccm::types * - https://stackoverflow.com/a/20793834 * - https://pages.cs.wisc.edu/%7Emarkhill/cs354/Fall2008/beyond354/int.mult.html * - * @tparam word The type of the elements in the arrays. - * @tparam N The size of the 'dst' array. - * @param dst The array to store the result of the multiplication. - * @param lhs The left-hand side operand array. - * @param rhs The right-hand side operand array. - * @return The carry value after the multiplication completes. + * \tparam word The type of the elements in the arrays. + * \tparam N The size of the 'dst' array. + * \param dst The array to store the result of the multiplication. + * \param lhs The left-hand side operand array. + * \param rhs The right-hand side operand array. + * \return The carry value after the multiplication completes. */ template constexpr word multiply_with_carry(std::array & dst, const std::array & lhs, const std::array & rhs) @@ -420,15 +420,15 @@ namespace ccm::types } /** - * @brief Multiplies 'lhs' by 'rhs' and stores the high part of the result in 'dst'. + * \brief Multiplies 'lhs' by 'rhs' and stores the high part of the result in 'dst'. * * This function performs multiplication of 'lhs' and 'rhs' arrays, accumulating the high part of the product in 'dst'. * - * @tparam word The type of the elements in the arrays. - * @tparam N The size of the 'dst', 'lhs', and 'rhs' arrays. - * @param dst The array to store the high part of the product. - * @param lhs The left-hand side operand array. - * @param rhs The right-hand side operand array. + * \tparam word The type of the elements in the arrays. + * \tparam N The size of the 'dst', 'lhs', and 'rhs' arrays. + * \param dst The array to store the high part of the product. + * \param lhs The left-hand side operand array. + * \param rhs The right-hand side operand array. */ template constexpr void quick_mul_hi(std::array & dst, const std::array & lhs, const std::array & rhs) @@ -457,12 +457,12 @@ namespace ccm::types } /** - * @brief Checks if the value represented by the array is negative. + * \brief Checks if the value represented by the array is negative. * - * @tparam word The type of the elements in the array. - * @tparam N The size of the array. - * @param array The array to check. - * @return True if the value is negative, false otherwise. + * \tparam word The type of the elements in the array. + * \tparam N The size of the array. + * \param array The array to check. + * \return True if the value is negative, false otherwise. */ template constexpr bool is_negative(std::array & array) { @@ -471,7 +471,7 @@ namespace ccm::types } /** - * @brief Internal representation of a multiword shift direction. + * \brief Internal representation of a multiword shift direction. */ enum class Direction : std::uint8_t { @@ -480,17 +480,17 @@ namespace ccm::types }; /** - * @brief Performs a bitwise shift on an array of elements. + * \brief Performs a bitwise shift on an array of elements. * - * @tparam direction The direction of the shift (LEFT or RIGHT). - * @tparam is_signed Whether the elements are signed. - * @tparam word The type of the elements in the array. - * @tparam N The size of the array. - * @param array The array to be shifted. - * @param offset The number of bits to shift. - * @return The shifted array. + * \tparam direction The direction of the shift (LEFT or RIGHT). + * \tparam is_signed Whether the elements are signed. + * \tparam word The type of the elements in the array. + * \tparam N The size of the array. + * \param array The array to be shifted. + * \param offset The number of bits to shift. + * \return The shifted array. * - * @note 'offset' must be less than TOTAL_BITS (sizeof(word) * CHAR_BIT * N). + * \note 'offset' must be less than TOTAL_BITS (sizeof(word) * CHAR_BIT * N). */ template constexpr std::array shift(std::array array, std::size_t offset) @@ -622,15 +622,15 @@ namespace ccm::types constexpr BigInt(const BigInt & other) = default; /** - * @brief Constructs a BigInt from another BigInt with potentially different size and signedness. + * \brief Constructs a BigInt from another BigInt with potentially different size and signedness. * * This constructor initializes a BigInt from another BigInt of potentially different bit width and signedness. * If the source BigInt has more bits, it truncates the extra bits. Otherwise, it extends the value by either * zero or sign extension based on the signedness of the source BigInt. * - * @tparam OtherBits The bit width of the source BigInt. - * @tparam OtherSigned The signedness of the source BigInt. - * @param other The source BigInt to construct from. + * \tparam OtherBits The bit width of the source BigInt. + * \tparam OtherSigned The signedness of the source BigInt. + * \param other The source BigInt to construct from. */ template constexpr BigInt(const BigInt & other) // NOLINT(google-explicit-constructor) @@ -720,9 +720,9 @@ namespace ccm::types } /** - * @brief Constructs a BigInt from a C-style array of words. - * @tparam N The size of the input array, which must match the WORD_COUNT. - * @param nums The input array of WordType values. + * \brief Constructs a BigInt from a C-style array of words. + * \tparam N The size of the input array, which must match the WORD_COUNT. + * \param nums The input array of WordType values. */ template // NOLINTNEXTLINE(google-explicit-constructor) - Cannot be marked explicit. @@ -737,19 +737,19 @@ namespace ccm::types } /** - * @brief Constructs a BigInt from a std::array of words. - * @param words The input std::array of WordType values. + * \brief Constructs a BigInt from a std::array of words. + * \param words The input std::array of WordType values. */ constexpr explicit BigInt(const std::array & words) : val(words) {} /** - * @brief Constructs a BigInt from an integral value. + * \brief Constructs a BigInt from an integral value. * * This constructor initializes the BigInt with the given integral value. The first word is set to the value, * and the remaining words are initialized to zero, with sign extension if needed. * - * @tparam T The type of the integral value. - * @param v The integral value to initialize the BigInt with. + * \tparam T The type of the integral value. + * \param v The integral value to initialize the BigInt with. */ template >> // NOLINTNEXTLINE(google-explicit-constructor) - Cannot be marked explicit. @@ -784,7 +784,7 @@ namespace ccm::types } /** - * @brief Creates a BigInt with the value zero. + * \brief Creates a BigInt with the value zero. */ static constexpr BigInt zero() { @@ -792,7 +792,7 @@ namespace ccm::types } /** - * @brief Creates a BigInt with the value one. + * \brief Creates a BigInt with the value one. */ static constexpr BigInt one() { @@ -800,7 +800,7 @@ namespace ccm::types } /** - * @brief Creates a BigInt with all bits set to one. + * \brief Creates a BigInt with all bits set to one. */ static constexpr BigInt all_ones() { @@ -808,7 +808,7 @@ namespace ccm::types } /** - * @brief Creates a BigInt with the minimum value. + * \brief Creates a BigInt with the minimum value. */ static constexpr BigInt min() { @@ -821,7 +821,7 @@ namespace ccm::types } /** - * @brief Creates a BigInt with the maximum value. + * \brief Creates a BigInt with the maximum value. */ static constexpr BigInt max() { @@ -834,7 +834,7 @@ namespace ccm::types } /** - * @brief Determines if the value of the BigInt is negative. + * \brief Determines if the value of the BigInt is negative. */ [[nodiscard]] constexpr bool is_neg() const { @@ -848,12 +848,12 @@ namespace ccm::types } /** - * @brief Converts the BigInt to another integral type. + * \brief Converts the BigInt to another integral type. * * This operator converts the BigInt to the specified integral type. * - * @tparam T The target integral type. - * @return The BigInt value converted to type T. + * \tparam T The target integral type. + * \return The BigInt value converted to type T. */ template constexpr explicit operator T() const { @@ -861,14 +861,14 @@ namespace ccm::types } /** - * @brief Converts the BigInt to another integral type. + * \brief Converts the BigInt to another integral type. * * This function converts the BigInt to the specified integral type T. * - * @tparam T The target integral type. - * @return The BigInt value converted to type T. + * \tparam T The target integral type. + * \return The BigInt value converted to type T. * - * @note This function is only enabled for integral types excluding bool. + * \note This function is only enabled for integral types excluding bool. */ template constexpr std::enable_if_t && !std::is_same_v, T> to() const { @@ -905,9 +905,9 @@ namespace ccm::types } /** - * @brief Converts the BigInt to a boolean. + * \brief Converts the BigInt to a boolean. * - * @return True if the BigInt is non-zero, false otherwise. + * \return True if the BigInt is non-zero, false otherwise. */ constexpr explicit operator bool() const { @@ -915,9 +915,9 @@ namespace ccm::types } /** - * @brief Checks if the BigInt is zero. + * \brief Checks if the BigInt is zero. * - * @return True if all parts of the BigInt are zero, false otherwise. + * \return True if all parts of the BigInt are zero, false otherwise. */ constexpr bool is_zero() const { @@ -932,9 +932,9 @@ namespace ccm::types } /** - * @brief Adds 'rhs' to this BigInt and stores the result. - * @param rhs The BigInt to add. - * @return The carry value produced by the addition. + * \brief Adds 'rhs' to this BigInt and stores the result. + * \param rhs The BigInt to add. + * \return The carry value produced by the addition. */ constexpr WordType add_overflow(const BigInt & rhs) { @@ -949,13 +949,13 @@ namespace ccm::types } /** - * @brief Adds this BigInt to another and returns the result. + * \brief Adds this BigInt to another and returns the result. * * This operator adds the current BigInt to the given BigInt, using the constexpr version of add_with_carry. * It takes advantage of addition commutativity to modify and return the given BigInt, avoiding additional allocation. * - * @param other The BigInt to add. - * @return The result of the addition. + * \param other The BigInt to add. + * \return The result of the addition. */ constexpr BigInt operator+(BigInt && other) const { @@ -971,9 +971,9 @@ namespace ccm::types } /** - * @brief Subtracts 'rhs' from this BigInt and stores the result in this BigInt. - * @param rhs The BigInt to subtract. - * @return The carry value produced by the subtraction. + * \brief Subtracts 'rhs' from this BigInt and stores the result in this BigInt. + * \param rhs The BigInt to subtract. + * \return The carry value produced by the subtraction. */ constexpr WordType sub_overflow(const BigInt & rhs) { @@ -1006,9 +1006,9 @@ namespace ccm::types } /** - * @brief Multiplies this BigInt by a scalar and stores the result in this BigInt. - * @param x The scalar to multiply with. - * @return The carry value produced by the multiplication. + * \brief Multiplies this BigInt by a scalar and stores the result in this BigInt. + * \param x The scalar to multiply with. + * \return The carry value produced by the multiplication. */ constexpr WordType mul(WordType x) { @@ -1016,10 +1016,10 @@ namespace ccm::types } /** - * @brief Multiplies this BigInt with another and returns the full product. - * @tparam OtherBits The bit width of the other BigInt. - * @param other The BigInt to multiply with. - * @return The full product as a new BigInt. + * \brief Multiplies this BigInt with another and returns the full product. + * \tparam OtherBits The bit width of the other BigInt. + * \param other The BigInt to multiply with. + * \return The full product as a new BigInt. */ template constexpr auto ful_mul(const BigInt & other) const { @@ -1029,7 +1029,7 @@ namespace ccm::types } /** - * @brief Multiplies this BigInt with another and returns the full product tructated. + * \brief Multiplies this BigInt with another and returns the full product tructated. */ constexpr BigInt operator*(const BigInt & other) const { @@ -1037,7 +1037,7 @@ namespace ccm::types } /** - * @brief Approximates the high bits of the full product of two BigInts. + * \brief Approximates the high bits of the full product of two BigInts. * * This function computes an approximation of the high 'Bits' of the full product of two BigInts. * The error is bounded by: 0 <= (a.full_mul(b) >> Bits) - a.quick_mul_hi(b)) <= WORD_COUNT - 1. @@ -1058,8 +1058,8 @@ namespace ccm::types * | 256 | 4 | 16 | 10 | 3 | * | 512 | 8 | 64 | 36 | 7 | * - * @param other The BigInt to multiply with. - * @return The approximate high bits of the product as a new BigInt. + * \param other The BigInt to multiply with. + * \return The approximate high bits of the product as a new BigInt. */ [[nodiscard]] constexpr BigInt quick_mul_hi(const BigInt & other) const { @@ -1069,8 +1069,8 @@ namespace ccm::types } /** - * @brief Computes this BigInt raised to the power of 'expo'. - * @note 0 ^ 0 is equal to 1. + * \brief Computes this BigInt raised to the power of 'expo'. + * \note 0 ^ 0 is equal to 1. */ constexpr void pow_n(std::uint64_t expo) { @@ -1090,14 +1090,14 @@ namespace ccm::types } /** - * @brief Performs in-place signed or unsigned division and returns the remainder. + * \brief Performs in-place signed or unsigned division and returns the remainder. * * This function divides the current BigInt by the given divisor and stores the quotient in the current BigInt. * It returns the remainder if the division is not by zero. For signed numbers, it behaves like C++ signed integer division, * truncating the fractional part. * - * @param divider The BigInt to divide by. - * @return An optional containing the remainder if the division is valid, or std::nullopt if dividing by zero. + * \param divider The BigInt to divide by. + * \return An optional containing the remainder if the division is valid, or std::nullopt if dividing by zero. * Reference used: * - https://stackoverflow.com/a/3602857 */ @@ -1126,7 +1126,7 @@ namespace ccm::types } /** - * @brief Efficiently performs BigInt / (x * 2^e), where x is a half-word-size unsigned integer, and returns the remainder. + * \brief Efficiently performs BigInt / (x * 2^e), where x is a half-word-size unsigned integer, and returns the remainder. * * This function divides the BigInt by (x * 2^e) efficiently, using the following approach: * - Let q = y / (x * 2^e) be the quotient, and r = y % (x * 2^e) be the remainder. @@ -1135,9 +1135,9 @@ namespace ccm::types * - Since the remainder of each division step is < x < 2^(WORD_SIZE / 2), the computation stays within WordType. * - Finally, extra alignment steps are performed for the remaining bits. * - * @param x The half-word-size unsigned integer. - * @param e The exponent for the power of 2. - * @return An optional containing the remainder if the division is valid, or std::nullopt if x is zero. + * \param x The half-word-size unsigned integer. + * \param e The exponent for the power of 2. + * \return An optional containing the remainder if the division is valid, or std::nullopt if x is zero. */ constexpr std::optional div_uint_half_times_pow_2(multiword::half_width_t x, size_t e) { @@ -1589,8 +1589,8 @@ namespace ccm::types { /** - * @brief Selects the appropriate default word type for the given bit width based on the available types. - * @tparam Bits The bit width for which to select the word type. + * \brief Selects the appropriate default word type for the given bit width based on the available types. + * \tparam Bits The bit width for which to select the word type. */ template struct WordTypeSelector : support::traits::type_identity< diff --git a/include/ccmath/internal/types/dyadic_float.hpp b/include/ccmath/internal/types/dyadic_float.hpp index 1e5d04b5..2dcfd8f7 100644 --- a/include/ccmath/internal/types/dyadic_float.hpp +++ b/include/ccmath/internal/types/dyadic_float.hpp @@ -14,19 +14,19 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception /** - * @internal + * \internal * - * @file dyadic_float.hpp - * @defgroup types - * @brief Internal high-precision dyadic floating-point type for CCMath. + * \file dyadic_float.hpp + * \defgroup types + * \brief Internal high-precision dyadic floating-point type for CCMath. * * A high-precision floating-point type in dyadic form, that is a mantissa scaled by a * power of two. CCMath uses it internally for computations that do not fit inside the * standard floating-point types. * - * @see ccmath/internal/support/fp/fp_bits.hpp - * @see ccmath/internal/support/type_traits.hpp - * @see ccmath/internal/types/big_int.hpp + * \see ccmath/internal/support/fp/fp_bits.hpp + * \see ccmath/internal/support/type_traits.hpp + * \see ccmath/internal/types/big_int.hpp */ #pragma once @@ -74,10 +74,10 @@ namespace ccm::types } /** - * @internal - * @ingroup types + * \internal + * \ingroup types * - * @brief A class for high-precision floating point computations using a dyadic format. + * \brief A class for high-precision floating point computations using a dyadic format. * * This class represents high-precision floating-point values in a dyadic format, consisting of three fields: * - sign: A boolean value where false indicates positive and true indicates negative. @@ -85,22 +85,22 @@ namespace ccm::types * - mantissa: An unsigned integer of length Bits. * * The stored value is calculated as: - * @code + * \code * value = (-1)^sign * 2^exponent * (mantissa_as_unsigned_integer) - * @endcode + * \endcode * * The data is considered normalized if, for a non-zero mantissa, the leading bit is 1. * Constructors and most member functions ensure that their outputs are normalized. * To simplify and improve efficiency, many functions assume that the inputs are already normalized. * - * @note Edge Cases: + * \note Edge Cases: * - Zero mantissa: A zero mantissa represents a signed zero (\c +0 or \c -0). * - Large exponents: Extremely large exponents can lead to overflow behavior if converted to a standard * floating-point type, potentially resulting in infinity. * - Small exponents: Very small (negative) exponents can produce underflow or subnormal values when converted. * Depending on rounding mode and whether exceptions are signaled, this can raise \c FE_UNDERFLOW or set \c errno. * - * @tparam Bits The length of the mantissa in bits. + * \tparam Bits The length of the mantissa in bits. */ template struct DyadicFloat { @@ -129,12 +129,12 @@ namespace ccm::types } /** - * @brief Normalizes the mantissa, bringing the leading 1 bit to the most significant bit. + * \brief Normalizes the mantissa, bringing the leading 1 bit to the most significant bit. * * This function shifts the mantissa so that the leading 1 bit is in the most significant bit position. * It adjusts the exponent accordingly. * - * @return A reference to the normalized DyadicFloat. + * \return A reference to the normalized DyadicFloat. */ constexpr DyadicFloat & normalize() { @@ -148,13 +148,13 @@ namespace ccm::types } /** - * @brief Shifts the mantissa left to align exponents. Output might not be normalized. + * \brief Shifts the mantissa left to align exponents. Output might not be normalized. * * This function shifts the mantissa left by the specified number of bits to help align exponents. * The exponent is adjusted accordingly. The result may not be normalized. * - * @param shift_length The number of bits to shift left. - * @return A reference to the DyadicFloat after shifting. + * \param shift_length The number of bits to shift left. + * \return A reference to the DyadicFloat after shifting. */ constexpr DyadicFloat & shift_left(unsigned shift_length) { @@ -171,13 +171,13 @@ namespace ccm::types } /** - * @brief Shifts the mantissa right to align exponents. Output might not be normalized. + * \brief Shifts the mantissa right to align exponents. Output might not be normalized. * * This function shifts the mantissa right by the specified number of bits to help align exponents. * The exponent is adjusted accordingly. The result may not be normalized. * - * @param shift_length The number of bits to shift right. - * @return A reference to the DyadicFloat after shifting. + * \param shift_length The number of bits to shift right. + * \return A reference to the DyadicFloat after shifting. */ constexpr DyadicFloat & shift_right(unsigned shift_length) { @@ -194,9 +194,9 @@ namespace ccm::types } /** - * @brief Returns the unbiased exponent, assuming normalization. + * \brief Returns the unbiased exponent, assuming normalization. * - * @return The unbiased exponent. + * \return The unbiased exponent. */ [[nodiscard]] constexpr int get_unbiased_exponent() const { @@ -347,7 +347,7 @@ namespace ccm::types } /** - * @brief Converts this DyadicFloat to the specified floating-point type \p T. + * \brief Converts this DyadicFloat to the specified floating-point type \p T. * * This function treats the current DyadicFloat (with sign, exponent, and mantissa) * as a normalized number and constructs a floating-point value of type \p T. @@ -362,11 +362,11 @@ namespace ccm::types * resulting in a subnormal value. This may raise FE_UNDERFLOW if \p ShouldSignalExceptions * is set. * - * @tparam T A floating-point type (e.g., float, double) that satisfies + * \tparam T A floating-point type (e.g., float, double) that satisfies * \code std::is_floating_point_v && (support::fp::FPBits::fraction_length < Bits) \endcode. - * @tparam ShouldSignalExceptions If true, overflow and underflow conditions may + * \tparam ShouldSignalExceptions If true, overflow and underflow conditions may * raise floating-point exceptions or set \c errno. - * @return A value of type \p T, which is the rounded result of converting + * \return A value of type \p T, which is the rounded result of converting * this DyadicFloat to \p T. */ @@ -488,20 +488,20 @@ namespace ccm::types } /** - * @brief Converts this normalized DyadicFloat to a floating-point type \p T. + * \brief Converts this normalized DyadicFloat to a floating-point type \p T. * * This function is a thin wrapper around fast_as(), * ensuring that the result is correctly rounded according to the current rounding mode. * It assumes that the internal representation (sign, exponent, mantissa) is already * normalized. * - * @tparam T A floating-point type (e.g., float, double, etc.) satisfying + * \tparam T A floating-point type (e.g., float, double, etc.) satisfying * \code std::is_floating_point_v && (support::fp::FPBits::fraction_length < Bits) \endcode. - * @tparam ShouldSignalExceptions If true, overflow or underflow conditions may + * \tparam ShouldSignalExceptions If true, overflow or underflow conditions may * raise floating-point exceptions (e.g., FE_OVERFLOW, FE_UNDERFLOW) * and set \c errno if required. * - * @return A floating-point value of type \p T that reflects the conversion. + * \return A floating-point value of type \p T that reflects the conversion. */ template (), meaning * it will not raise exceptions or set \c errno on overflow or underflow. * If you need to handle exceptions, use as() instead. * - * @tparam T A floating-point type (e.g., float, double, etc.) satisfying + * \tparam T A floating-point type (e.g., float, double, etc.) satisfying * \code std::is_floating_point_v && (support::fp::FPBits::fraction_length < Bits) \endcode. * - * @return The resulting value of type \p T. + * \return The resulting value of type \p T. */ template && (support::fp::FPBits::fraction_length < Bits), void>> explicit constexpr operator T() const @@ -606,7 +606,7 @@ namespace ccm::types }; /** - * @brief Adds two DyadicFloat values with rounding toward zero, then normalizes + * \brief Adds two DyadicFloat values with rounding toward zero, then normalizes * the result. * * The algorithm: @@ -623,14 +623,14 @@ namespace ccm::types * \f] * which corresponds to up to 2 ULPs of error. * - * @note + * \note * It is assumed that both inputs are already normalized by their constructors * or other functions. If not, the results can lose precision significantly. * - * @tparam Bits The number of bits used in the DyadicFloat. - * @param a First DyadicFloat operand. - * @param b Second DyadicFloat operand. - * @return A DyadicFloat representing the approximate sum of \p a and \p b. + * \tparam Bits The number of bits used in the DyadicFloat. + * \param a First DyadicFloat operand. + * \param b Second DyadicFloat operand. + * \return A DyadicFloat representing the approximate sum of \p a and \p b. */ template constexpr DyadicFloat quick_add(DyadicFloat a, DyadicFloat b) { @@ -688,7 +688,7 @@ namespace ccm::types } /** - * @brief + * \brief * Slightly less accurate but efficient multiplication of two dyadic floats with * rounding toward 0, followed by normalization of the output. * @@ -697,19 +697,19 @@ namespace ccm::types * - result.mantissa = quick_mul_hi(a.mantissa + b.mantissa) * ~ (full product a.mantissa * b.mantissa) >> Bits * - * @note + * \note * The error compared to the exact mathematical product is bounded by: * 2 * errors of quick_mul_hi = 2 * (UInt::WORD_COUNT - 1) in ULPs. * - * @warning + * \warning * It is assumed that both inputs are normalized by their constructors or other functions. * If they are not normalized, this function's results may lose * precision significantly. * - * @tparam Bits The number of bits used in the DyadicFloat. - * @param a First dyadic float. - * @param b Second dyadic float. - * @return A new DyadicFloat representing the approximate product. + * \tparam Bits The number of bits used in the DyadicFloat. + * \param a First dyadic float. + * \param b Second dyadic float. + * \return A new DyadicFloat representing the approximate product. */ template constexpr DyadicFloat quick_mul(DyadicFloat a, DyadicFloat b) { @@ -734,16 +734,16 @@ namespace ccm::types } /** - * @brief Simple polynomial approximation using multiply-add. + * \brief Simple polynomial approximation using multiply-add. * - * This function computes the product of @p a and @p b via quick_mul(), - * then adds @p c to the result using quick_add(). + * This function computes the product of \p a and \p b via quick_mul(), + * then adds \p c to the result using quick_add(). * - * @tparam Bits The number of bits used in the DyadicFloat. - * @param a First dyadic float. - * @param b Second dyadic float. - * @param c The dyadic float to be added to the product of \p a and \p b. - * @return A new DyadicFloat containing the result of \p c + (\p a * \p b). + * \tparam Bits The number of bits used in the DyadicFloat. + * \param a First dyadic float. + * \param b Second dyadic float. + * \param c The dyadic float to be added to the product of \p a and \p b. + * \return A new DyadicFloat containing the result of \p c + (\p a * \p b). */ template constexpr DyadicFloat multiply_add(const DyadicFloat & a, const DyadicFloat & b, const DyadicFloat & c) { @@ -751,17 +751,17 @@ namespace ccm::types } /** - * @brief Simple exponentiation implementation for printing or other use. + * \brief Simple exponentiation implementation for printing or other use. * - * This function computes \f$a^\text{power}\f$ by repeatedly squaring @p a - * (stored as @p cur_power) and multiplying it into @p result when the current - * bit of @p power is set (using quick_mul()). Only positive exponents are + * This function computes \f$a^\text{power}\f$ by repeatedly squaring \p a + * (stored as \p cur_power) and multiplying it into \p result when the current + * bit of \p power is set (using quick_mul()). Only positive exponents are * supported. Use rounded_div for general division. * - * @tparam Bits The number of bits used in the DyadicFloat. - * @param a The base DyadicFloat. - * @param power The positive exponent. - * @return A DyadicFloat representing \f$a^\text{power}\f$. + * \tparam Bits The number of bits used in the DyadicFloat. + * \param a The base DyadicFloat. + * \param power The positive exponent. + * \return A DyadicFloat representing \f$a^\text{power}\f$. */ template constexpr DyadicFloat pow_n(DyadicFloat a, uint32_t power) { @@ -781,17 +781,17 @@ namespace ccm::types } /** - * @brief Multiplies a DyadicFloat by \f$2^{\text{pow\_2}}\f$. + * \brief Multiplies a DyadicFloat by \f$2^{\text{pow\_2}}\f$. * - * This function modifies the exponent of @p a by adding @p pow_2 to effectively - * multiply @p a by \f$2^{\text{pow\_2}}\f$. + * This function modifies the exponent of \p a by adding \p pow_2 to effectively + * multiply \p a by \f$2^{\text{pow\_2}}\f$. * - * @tparam Bits The number of bits used in the DyadicFloat. - * @param a The DyadicFloat to be scaled. - * @param pow_2 The exponent shift. A positive value means multiplying by + * \tparam Bits The number of bits used in the DyadicFloat. + * \param a The DyadicFloat to be scaled. + * \param pow_2 The exponent shift. A positive value means multiplying by * \f$2^{\text{pow\_2}}\f$, while a negative value means dividing by * \f$2^{-\text{pow\_2}}\f$. - * @return The result of \f$a \times 2^{\text{pow\_2}}\f$. + * \return The result of \f$a \times 2^{\text{pow\_2}}\f$. */ template constexpr DyadicFloat mul_pow_2(DyadicFloat a, int32_t pow_2) { diff --git a/include/ccmath/math/basic/fabs.hpp b/include/ccmath/math/basic/fabs.hpp index 7f241934..3158a72c 100644 --- a/include/ccmath/math/basic/fabs.hpp +++ b/include/ccmath/math/basic/fabs.hpp @@ -19,10 +19,10 @@ namespace ccm { /** - * @brief Computes the absolute value of a number. - * @tparam T Numeric type. - * @param num Floating-point or integer value. - * @return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. + * \brief Computes the absolute value of a number. + * \tparam T Numeric type. + * \param num Floating-point or integer value. + * \return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. */ template constexpr auto abs(T num) -> std::enable_if_t && std::is_signed_v, T> { @@ -34,10 +34,10 @@ namespace ccm } /** - * @brief Computes the absolute value of a number. - * @tparam T Numeric type. - * @param num Floating-point or integer value. - * @return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. + * \brief Computes the absolute value of a number. + * \tparam T Numeric type. + * \param num Floating-point or integer value. + * \return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. */ template constexpr auto abs(T num) -> std::enable_if_t && std::is_signed_v, T> { @@ -48,10 +48,10 @@ namespace ccm } /** - * @brief Computes the absolute value of an unsigned value. - * @tparam T Unsigned integer type. - * @param num Unsigned value. - * @return num unchanged. An unsigned value is already non-negative, so its absolute value is itself. + * \brief Computes the absolute value of an unsigned value. + * \tparam T Unsigned integer type. + * \param num Unsigned value. + * \return num unchanged. An unsigned value is already non-negative, so its absolute value is itself. */ template constexpr auto abs(T num) -> std::enable_if_t, T> { @@ -62,10 +62,10 @@ namespace ccm } /** - * @brief Computes the absolute value of a number. - * @tparam T Floating-point type. - * @param num Floating-point value. - * @return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. + * \brief Computes the absolute value of a number. + * \tparam T Floating-point type. + * \param num Floating-point value. + * \return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. */ template constexpr auto fabs(T num) -> std::enable_if_t, T> { @@ -73,10 +73,10 @@ namespace ccm } /** - * @brief Computes the absolute value of a number. - * @tparam Integer Integer type. - * @param num Integer value. - * @return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. + * \brief Computes the absolute value of a number. + * \tparam Integer Integer type. + * \param num Integer value. + * \return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. */ template constexpr auto fabs(Integer num) -> std::enable_if_t, double> { @@ -84,9 +84,9 @@ namespace ccm } /** - * @brief Computes the absolute value of a number. - * @param num Floating-point value. - * @return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. + * \brief Computes the absolute value of a number. + * \param num Floating-point value. + * \return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. */ constexpr float fabsf(float num) { @@ -94,9 +94,9 @@ namespace ccm } /** - * @brief Computes the absolute value of a number. - * @param num Floating-point value. - * @return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. + * \brief Computes the absolute value of a number. + * \param num Floating-point value. + * \return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. */ constexpr long double fabsl(long double num) { @@ -104,9 +104,9 @@ namespace ccm } /** - * @brief Computes the absolute value of a number. - * @param num Integer value. - * @return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. + * \brief Computes the absolute value of a number. + * \param num Integer value. + * \return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. */ constexpr long labs(long num) { @@ -114,9 +114,9 @@ namespace ccm } /** - * @brief Computes the absolute value of a number. - * @param num Integer value. - * @return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. + * \brief Computes the absolute value of a number. + * \param num Integer value. + * \return If successful, returns the absolute value of arg (|arg|). The value returned is exact and does not depend on any rounding modes. */ constexpr long long llabs(long long num) { @@ -124,4 +124,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/math/basic/fdim.hpp b/include/ccmath/math/basic/fdim.hpp index 6681db62..31777ac1 100644 --- a/include/ccmath/math/basic/fdim.hpp +++ b/include/ccmath/math/basic/fdim.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Computes the positive difference of two floating point values (max(0,x−y)) - * @tparam T A floating-point type. - * @param x A floating-point or integer values - * @param y A floating-point or integer values - * @return If successful, returns the positive difference between x and y. + * \brief Computes the positive difference of two floating point values (max(0,x−y)) + * \tparam T A floating-point type. + * \param x A floating-point or integer values + * \param y A floating-point or integer values + * \return If successful, returns the positive difference between x and y. */ template , bool> = true> constexpr T fdim(T x, T y) { @@ -39,12 +39,12 @@ namespace ccm } /** - * @brief Computes the positive difference of two floating point values (max(0,x−y)) - * @tparam T A floating-point type. - * @tparam U A floating-point type. - * @param x A floating-point value. - * @param y A floating-point value. - * @return If successful, returns the positive difference between x and y. + * \brief Computes the positive difference of two floating point values (max(0,x−y)) + * \tparam T A floating-point type. + * \tparam U A floating-point type. + * \param x A floating-point value. + * \param y A floating-point value. + * \return If successful, returns the positive difference between x and y. */ template && std::is_floating_point_v, bool> = true> constexpr auto fdim(T x, U y) { @@ -54,11 +54,11 @@ namespace ccm } /** - * @brief Computes the positive difference of two floating point values (max(0,x−y)) - * @tparam Integer An integral type. - * @param x An integral value. - * @param y An integral value. - * @return If successful, returns the positive difference between x and y. + * \brief Computes the positive difference of two floating point values (max(0,x−y)) + * \tparam Integer An integral type. + * \param x An integral value. + * \param y An integral value. + * \return If successful, returns the positive difference between x and y. */ template , bool> = true> constexpr double fdim(Integer x, Integer y) { @@ -66,10 +66,10 @@ namespace ccm } /** - * @brief Computes the positive difference of two floating point values (max(0,x−y)) - * @param x A floating-point value. - * @param y A floating-point value. - * @return If successful, returns the positive difference between x and y. + * \brief Computes the positive difference of two floating point values (max(0,x−y)) + * \param x A floating-point value. + * \param y A floating-point value. + * \return If successful, returns the positive difference between x and y. */ constexpr float fdimf(float x, float y) { @@ -77,10 +77,10 @@ namespace ccm } /** - * @brief Computes the positive difference of two floating point values (max(0,x−y)) - * @param x A floating-point value. - * @param y A floating-point value. - * @return If successful, returns the positive difference between x and y. + * \brief Computes the positive difference of two floating point values (max(0,x−y)) + * \param x A floating-point value. + * \param y A floating-point value. + * \return If successful, returns the positive difference between x and y. */ constexpr long double fdiml(long double x, long double y) { @@ -88,4 +88,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/math/basic/fmod.hpp b/include/ccmath/math/basic/fmod.hpp index a76422b0..ff667861 100644 --- a/include/ccmath/math/basic/fmod.hpp +++ b/include/ccmath/math/basic/fmod.hpp @@ -21,7 +21,7 @@ namespace ccm { - /// @cond CCMATH_INTERNAL + /// \cond CCMATH_INTERNAL namespace internal::impl { template constexpr T fmod_impl_check(T x, T y) noexcept @@ -90,15 +90,15 @@ namespace ccm return fmod_impl_check(static_cast(x), static_cast(y)); } } // namespace internal::impl - /// @endcond + /// \endcond /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @note Some edge cases where NaN is returned are different from std::fmod due to the standard allowing implementation based returns. - * @tparam T A floating-point type. - * @param x A floating-point value. - * @param y A floating-point value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \note Some edge cases where NaN is returned are different from std::fmod due to the standard allowing implementation based returns. + * \tparam T A floating-point type. + * \param x A floating-point value. + * \param y A floating-point value. + * \return The floating-point remainder of the division operation x/y. */ template , bool> = true> constexpr Real fmod(Real x, Real y) { @@ -106,11 +106,11 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @tparam Integer An integral type. - * @param x An integral value. - * @param y An integral value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \tparam Integer An integral type. + * \param x An integral value. + * \param y An integral value. + * \return The floating-point remainder of the division operation x/y. */ template , bool> = true> constexpr double fmod(Integer x, Integer y) { @@ -118,12 +118,12 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @tparam T A floating-point or integral type. - * @tparam U A floating-point or integral type. - * @param x A floating-point or integral value. - * @param y A floating-point or integral value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \tparam T A floating-point or integral type. + * \tparam U A floating-point or integral type. + * \param x A floating-point or integral value. + * \param y A floating-point or integral value. + * \return The floating-point remainder of the division operation x/y. */ template constexpr auto fmod(T x, T y) { @@ -131,10 +131,10 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @param x A floating-point value. - * @param y A floating-point value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \param x A floating-point value. + * \param y A floating-point value. + * \return The floating-point remainder of the division operation x/y. */ constexpr float fmodf(float x, float y) { @@ -142,10 +142,10 @@ namespace ccm } /** - * @brief Returns the floating-point remainder of the division operation x/y. - * @param x A floating-point value. - * @param y A floating-point value. - * @return The floating-point remainder of the division operation x/y. + * \brief Returns the floating-point remainder of the division operation x/y. + * \param x A floating-point value. + * \param y A floating-point value. + * \return The floating-point remainder of the division operation x/y. */ constexpr long double fmodl(long double x, long double y) { @@ -153,4 +153,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/math/basic/max.hpp b/include/ccmath/math/basic/max.hpp index 65b9e246..5ffc41f3 100644 --- a/include/ccmath/math/basic/max.hpp +++ b/include/ccmath/math/basic/max.hpp @@ -23,11 +23,11 @@ namespace ccm { /** - * @brief Computes the larger of the two values. - * @tparam T Type of the values to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two values. + * \tparam T Type of the values to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr T max(T x, T y) noexcept { @@ -48,12 +48,12 @@ namespace ccm } /** - * @brief Computes the larger of the two values. - * @tparam T Type of left-hand side of the comparison. - * @tparam U Type of right-hand side of the comparison. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return Larger of x and y after converting both values to their common type. + * \brief Computes the larger of the two values. + * \tparam T Type of left-hand side of the comparison. + * \tparam U Type of right-hand side of the comparison. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return Larger of x and y after converting both values to their common type. */ template constexpr auto max(T x, U y) noexcept { @@ -65,11 +65,11 @@ namespace ccm } /** - * @brief Computes the larger of the two floating point values. - * @tparam T Type of the values to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two floating point values. + * \tparam T Type of the values to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr T fmax(T x, T y) noexcept { @@ -77,12 +77,12 @@ namespace ccm } /** - * @brief Computes the larger of the two values. - * @tparam T Type of left-hand side of the comparison. - * @tparam U Type of right-hand side of the comparison. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two values. + * \tparam T Type of left-hand side of the comparison. + * \tparam U Type of right-hand side of the comparison. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr auto fmax(T x, U y) noexcept { @@ -94,10 +94,10 @@ namespace ccm } /** - * @brief Computes the larger of the two floating point values. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two floating point values. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template , bool> = true> constexpr double fmax(Integer x, Integer y) noexcept { @@ -105,10 +105,10 @@ namespace ccm } /** - * @brief Computes the larger of the two floating point values. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two floating point values. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ constexpr float fmaxf(float x, float y) noexcept { @@ -116,10 +116,10 @@ namespace ccm } /** - * @brief Computes the larger of the two floating point values. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the larger of the two floating point values. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the larger of two floating point values. The value returned is exact and does not depend on any rounding modes. */ constexpr long double fmaxl(long double x, long double y) noexcept { @@ -127,4 +127,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/math/basic/min.hpp b/include/ccmath/math/basic/min.hpp index 920b90f1..8b329164 100644 --- a/include/ccmath/math/basic/min.hpp +++ b/include/ccmath/math/basic/min.hpp @@ -22,11 +22,11 @@ namespace ccm { /** - * @brief Computes the smaller of the two values. - * @tparam T Type of the values to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam T Type of the values to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr T min(const T x, const T y) noexcept { @@ -47,12 +47,12 @@ namespace ccm } /** - * @brief Computes the smaller of the two values. - * @tparam T Left-hand type of the left-hand value to compare. - * @tparam U Right-hand type of the right-hand value to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam T Left-hand type of the left-hand value to compare. + * \tparam U Right-hand type of the right-hand value to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr T min(const T x, const U y) noexcept { @@ -64,11 +64,11 @@ namespace ccm } /** - * @brief Computes the smaller of the two values. - * @tparam Real Type of of the values to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam Real Type of of the values to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template , bool> = true> constexpr Real fmin(const Real x, const Real y) noexcept { @@ -76,12 +76,12 @@ namespace ccm } /** - * @brief Computes the smaller of the two values. - * @tparam T Left-hand type of the left-hand value to compare. - * @tparam U Right-hand type of the right-hand value to compare. - * @param x Left-hand side of the comparison. - * @param y Right-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam T Left-hand type of the left-hand value to compare. + * \tparam U Right-hand type of the right-hand value to compare. + * \param x Left-hand side of the comparison. + * \param y Right-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template constexpr auto fmin(const T x, const U y) noexcept { @@ -93,11 +93,11 @@ namespace ccm } /** - * @brief Computes the smaller of the two values. - * @tparam Integer An integral type. - * @param x Right-hand side of the comparison. - * @param y Left-hand side of the comparison. - * @return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. + * \brief Computes the smaller of the two values. + * \tparam Integer An integral type. + * \param x Right-hand side of the comparison. + * \param y Left-hand side of the comparison. + * \return If successful, returns the smaller of two floating point values. The value returned is exact and does not depend on any rounding modes. */ template , bool> = true> constexpr Integer fmin(const Integer x, const Integer y) noexcept { @@ -105,4 +105,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/math/basic/nan.hpp b/include/ccmath/math/basic/nan.hpp index 02a2d47c..6936dee7 100644 --- a/include/ccmath/math/basic/nan.hpp +++ b/include/ccmath/math/basic/nan.hpp @@ -17,9 +17,9 @@ namespace ccm { /** - * @brief not-a-number (NaN) function - * @param arg Narrow character string identifying the contents of a NaN - * @return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. + * \brief not-a-number (NaN) function + * \param arg Narrow character string identifying the contents of a NaN + * \return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. */ constexpr double nan(const char * arg) noexcept { @@ -27,9 +27,9 @@ namespace ccm } /** - * @brief not-a-number (NaN) function - * @param arg Narrow character string identifying the contents of a NaN - * @return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. + * \brief not-a-number (NaN) function + * \param arg Narrow character string identifying the contents of a NaN + * \return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. */ constexpr float nanf(const char * arg) noexcept { @@ -37,10 +37,10 @@ namespace ccm } /** - * @brief not-a-number (NaN) function - * @param arg Narrow character string identifying the contents of a NaN - * @return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. - * @note This function is not yet supported for long double and can only return either 0.0 or a quiet NaN based on if quiet NaNs are supported. + * \brief not-a-number (NaN) function + * \param arg Narrow character string identifying the contents of a NaN + * \return The quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs. + * \note This function is not yet supported for long double and can only return either 0.0 or a quiet NaN based on if quiet NaNs are supported. */ constexpr long double nanl(const char * arg) noexcept { diff --git a/include/ccmath/math/basic/remainder.hpp b/include/ccmath/math/basic/remainder.hpp index d28c1481..7ac2c8c3 100644 --- a/include/ccmath/math/basic/remainder.hpp +++ b/include/ccmath/math/basic/remainder.hpp @@ -17,11 +17,11 @@ namespace ccm { /** - * @brief Returns the remainder of the division of x by y. - * @tparam T Type of the values to compare. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y. + * \brief Returns the remainder of the division of x by y. + * \tparam T Type of the values to compare. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y. */ template , bool> = true> constexpr T remainder(T x, T y) { @@ -41,11 +41,11 @@ namespace ccm } /** - * @brief Returns the remainder of the division of x by y. - * @tparam Integer Type of the values to compare. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y as a double. + * \brief Returns the remainder of the division of x by y. + * \tparam Integer Type of the values to compare. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y as a double. */ template , bool> = true> constexpr double remainder(Integer x, Integer y) { @@ -53,10 +53,10 @@ namespace ccm } /** - * @brief Returns the remainder of the division of x by y. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y. + * \brief Returns the remainder of the division of x by y. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y. */ constexpr float remainderf(float x, float y) { @@ -64,10 +64,10 @@ namespace ccm } /** - * @brief Returns the remainder of the division of x by y. - * @param x Dividend. - * @param y Divisor. - * @return The remainder of the division of x by y. + * \brief Returns the remainder of the division of x by y. + * \param x Dividend. + * \param y Divisor. + * \return The remainder of the division of x by y. */ constexpr long double remainderl(long double x, long double y) { @@ -75,4 +75,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/math/basic/remquo.hpp b/include/ccmath/math/basic/remquo.hpp index 46c6d32a..693cfc03 100644 --- a/include/ccmath/math/basic/remquo.hpp +++ b/include/ccmath/math/basic/remquo.hpp @@ -16,18 +16,18 @@ namespace ccm { /** - * @brief Signed remainder as well as the three last bits of the division operation - * @tparam T The type of the arguments - * @param x Floating-point or integer value - * @param y Floating-point or integer value - * @param quo Pointer to int to store the sign and some bits of x / y - * @return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at + * \brief Signed remainder as well as the three last bits of the division operation + * \tparam T The type of the arguments + * \param x Floating-point or integer value + * \param y Floating-point or integer value + * \param quo Pointer to int to store the sign and some bits of x / y + * \return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at * least three of the least significant bits of x / y * - * @attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with + * \attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with * constexpr and static_assert) * - * @code + * \code * constexpr double get_remainder(double x, double y) * { * int quotient {0}; @@ -41,7 +41,7 @@ namespace ccm * ccm::remquo(x, y, "ient); * return quotient; * } - * @endcode + * \endcode */ template , bool> = true> constexpr T remquo(T x, T y, int * quo) { @@ -57,19 +57,19 @@ namespace ccm } /** - * @brief Signed remainder as well as the three last bits of the division operation - * @tparam Arithmetic1 The type of the first argument - * @tparam Arithmetic2 The type of the second argument - * @param x Floating-point or integer values - * @param y Floating-point or integer values - * @param quo Pointer to int to store the sign and some bits of x / y - * @return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at + * \brief Signed remainder as well as the three last bits of the division operation + * \tparam Arithmetic1 The type of the first argument + * \tparam Arithmetic2 The type of the second argument + * \param x Floating-point or integer values + * \param y Floating-point or integer values + * \param quo Pointer to int to store the sign and some bits of x / y + * \return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at * least three of the least significant bits of x / y * - * @attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with + * \attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with * constexpr and static_assert) * - * @code + * \code * constexpr double get_remainder(double x, double y) * { * int quotient {0}; @@ -83,7 +83,7 @@ namespace ccm * ccm::remquo(x, y, "ient); * return quotient; * } - * @endcode + * \endcode */ template && std::is_arithmetic_v, bool> = true> constexpr std::common_type_t remquo(Arithmetic1 x, Arithmetic2 y, int * quo) @@ -93,17 +93,17 @@ namespace ccm } /** - * @brief Signed remainder as well as the three last bits of the division operation - * @param x Floating-point value - * @param y Floating-point value - * @param quo Pointer to int to store the sign and some bits of x / y - * @return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at + * \brief Signed remainder as well as the three last bits of the division operation + * \param x Floating-point value + * \param y Floating-point value + * \param quo Pointer to int to store the sign and some bits of x / y + * \return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at * least three of the least significant bits of x / y * - * @attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with + * \attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with * constexpr and static_assert) * - * @code + * \code * constexpr double get_remainder(double x, double y) * { * int quotient {0}; @@ -117,7 +117,7 @@ namespace ccm * ccm::remquo(x, y, "ient); * return quotient; * } - * @endcode + * \endcode */ constexpr float remquof(float x, float y, int * quo) { @@ -125,17 +125,17 @@ namespace ccm } /** - * @brief Signed remainder as well as the three last bits of the division operation - * @param x Floating-point value - * @param y Floating-point value - * @param quo Pointer to int to store the sign and some bits of x / y - * @return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at + * \brief Signed remainder as well as the three last bits of the division operation + * \param x Floating-point value + * \param y Floating-point value + * \param quo Pointer to int to store the sign and some bits of x / y + * \return If successful, returns the floating-point remainder of the division x / y as defined in ccm::remainder, and stores, in *quo, the sign and at * least three of the least significant bits of x / y * - * @attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with + * \attention If you want the quotient pointer to work within a constant context you must perform something like as follows: (The below code will work with * constexpr and static_assert) * - * @code + * \code * constexpr double get_remainder(double x, double y) * { * int quotient {0}; @@ -149,7 +149,7 @@ namespace ccm * ccm::remquo(x, y, "ient); * return quotient; * } - * @endcode + * \endcode */ constexpr long double remquol(long double x, long double y, int * quo) { @@ -159,4 +159,4 @@ namespace ccm } } // namespace ccm -/// @ingroup basic +/// \ingroup basic diff --git a/include/ccmath/math/compare/fpclassify.hpp b/include/ccmath/math/compare/fpclassify.hpp index dc55fd5f..e964f1b1 100644 --- a/include/ccmath/math/compare/fpclassify.hpp +++ b/include/ccmath/math/compare/fpclassify.hpp @@ -20,11 +20,11 @@ namespace ccm { /** - * @brief Classify the floating point number - * @attention This function is heavily implementation defined and may not work as expected on unknown compilers - * @tparam T The type of the floating point number - * @param num The number to classify - * @return The classification of the number as an integer + * \brief Classify the floating point number + * \attention This function is heavily implementation defined and may not work as expected on unknown compilers + * \tparam T The type of the floating point number + * \param num The number to classify + * \return The classification of the number as an integer */ template , bool> = true> constexpr int fpclassify(T num) { diff --git a/include/ccmath/math/compare/isfinite.hpp b/include/ccmath/math/compare/isfinite.hpp index 723100d1..f163db11 100644 --- a/include/ccmath/math/compare/isfinite.hpp +++ b/include/ccmath/math/compare/isfinite.hpp @@ -16,10 +16,10 @@ namespace ccm { /** - * @brief Checks if the given number has a finite value. - * @tparam T The type of the number. - * @param num A floating-point or integer value - * @return true if the number has a finite value, false otherwise. + * \brief Checks if the given number has a finite value. + * \tparam T The type of the number. + * \param num A floating-point or integer value + * \return true if the number has a finite value, false otherwise. */ template , bool> = true> constexpr bool isfinite(T num) { @@ -35,9 +35,9 @@ namespace ccm } /** - * @brief Checks if the given number has a finite value. - * @tparam Integer The type of the integer. - * @return true if the number has a finite value, false otherwise. + * \brief Checks if the given number has a finite value. + * \tparam Integer The type of the integer. + * \return true if the number has a finite value, false otherwise. */ template , bool> = true> constexpr bool isfinite(Integer /* x */) { diff --git a/include/ccmath/math/compare/isgreater.hpp b/include/ccmath/math/compare/isgreater.hpp index 71eb684d..794b70dd 100644 --- a/include/ccmath/math/compare/isgreater.hpp +++ b/include/ccmath/math/compare/isgreater.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is greater than the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is greater than the second, false otherwise. + * \brief Checks if the first argument is greater than the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is greater than the second, false otherwise. */ template , bool> = true> constexpr bool isgreater(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is greater than the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is greater than the second, false otherwise. + * \brief Checks if the first argument is greater than the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is greater than the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool isgreater(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/math/compare/isgreaterequal.hpp b/include/ccmath/math/compare/isgreaterequal.hpp index 4fc0942d..60008e0d 100644 --- a/include/ccmath/math/compare/isgreaterequal.hpp +++ b/include/ccmath/math/compare/isgreaterequal.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is greater than or equal to the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is greater than or equal to the second, false otherwise. + * \brief Checks if the first argument is greater than or equal to the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is greater than or equal to the second, false otherwise. */ template , bool> = true> constexpr bool isgreaterequal(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is greater than or equal to the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is greater than or equal to the second, false otherwise. + * \brief Checks if the first argument is greater than or equal to the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is greater than or equal to the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool isgreaterequal(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/math/compare/isinf.hpp b/include/ccmath/math/compare/isinf.hpp index 7cc1d9c8..f1e33bd5 100644 --- a/include/ccmath/math/compare/isinf.hpp +++ b/include/ccmath/math/compare/isinf.hpp @@ -19,10 +19,10 @@ namespace ccm { /** - * @brief Checks if the given number is infinite. - * @tparam T The type of the number to check. - * @param num The number to check. - * @return True if the number is infinite, false otherwise. + * \brief Checks if the given number is infinite. + * \tparam T The type of the number to check. + * \param num The number to check. + * \return True if the number is infinite, false otherwise. */ template , bool> = true> constexpr bool isinf(T num) noexcept { @@ -39,9 +39,9 @@ namespace ccm } /** - * @brief Checks if the given number is infinite. - * @tparam Integer The type of the integer to check. - * @return True if the number is infinite, false otherwise. + * \brief Checks if the given number is infinite. + * \tparam Integer The type of the integer to check. + * \return True if the number is infinite, false otherwise. */ template , bool> = true> constexpr bool isinf(Integer /* num */) noexcept { diff --git a/include/ccmath/math/compare/isless.hpp b/include/ccmath/math/compare/isless.hpp index 1478a63c..50822008 100644 --- a/include/ccmath/math/compare/isless.hpp +++ b/include/ccmath/math/compare/isless.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is less than the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is less than the second, false otherwise. + * \brief Checks if the first argument is less than the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is less than the second, false otherwise. */ template , bool> = true> constexpr bool isless(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is less than the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is less than the second, false otherwise. + * \brief Checks if the first argument is less than the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is less than the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool isless(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/math/compare/islessequal.hpp b/include/ccmath/math/compare/islessequal.hpp index ab9438bb..0a58c978 100644 --- a/include/ccmath/math/compare/islessequal.hpp +++ b/include/ccmath/math/compare/islessequal.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is less than or equal to the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is less than or equal to the second, false otherwise. + * \brief Checks if the first argument is less than or equal to the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is less than or equal to the second, false otherwise. */ template , bool> = true> constexpr bool islessequal(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is less than or equal to the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is less than or equal to the second, false otherwise. + * \brief Checks if the first argument is less than or equal to the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is less than or equal to the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool islessequal(Arithmetic1 x, Arithmetic2 y) noexcept @@ -54,4 +54,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/math/compare/islessgreater.hpp b/include/ccmath/math/compare/islessgreater.hpp index cf389c6e..8511370c 100644 --- a/include/ccmath/math/compare/islessgreater.hpp +++ b/include/ccmath/math/compare/islessgreater.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the first argument is less than the second or greater than the second. - * @tparam T Type of the values to compare. - * @param x A floating-point or integer value. - * @param y A floating-point or integer value. - * @return true if the first argument is less than the second or greater than the second, false otherwise. + * \brief Checks if the first argument is less than the second or greater than the second. + * \tparam T Type of the values to compare. + * \param x A floating-point or integer value. + * \param y A floating-point or integer value. + * \return true if the first argument is less than the second or greater than the second, false otherwise. */ template , bool> = true> constexpr bool islessgreater(T x, T y) noexcept { @@ -36,12 +36,12 @@ namespace ccm } /** - * @brief Checks if the first argument is less than the second or greater than the second. - * @tparam Arithmetic1 Arithmetic type of the left-hand side. - * @tparam Arithmetic2 Arithmetic type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if the first argument is less than the second or greater than the second, false otherwise. + * \brief Checks if the first argument is less than the second or greater than the second. + * \tparam Arithmetic1 Arithmetic type of the left-hand side. + * \tparam Arithmetic2 Arithmetic type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if the first argument is less than the second or greater than the second, false otherwise. */ template && std::is_arithmetic_v, bool> = true> constexpr bool islessgreater(Arithmetic1 x, Arithmetic2 y) noexcept @@ -51,4 +51,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/math/compare/isnan.hpp b/include/ccmath/math/compare/isnan.hpp index 7f99e37c..5f8c17a7 100644 --- a/include/ccmath/math/compare/isnan.hpp +++ b/include/ccmath/math/compare/isnan.hpp @@ -18,10 +18,10 @@ namespace ccm { /** - * @brief Check if the given number is NaN. - * @tparam T The type of the number to check. - * @param num The number to check. - * @return True if the number is NaN, false otherwise. + * \brief Check if the given number is NaN. + * \tparam T The type of the number to check. + * \param num The number to check. + * \return True if the number is NaN, false otherwise. */ template , bool> = true> constexpr bool isnan(T num) noexcept { @@ -38,9 +38,9 @@ namespace ccm } /** - * @brief Check if the given number is NaN. - * @tparam Integer The type of the number to check. - * @return False, as integers can never be NaN. + * \brief Check if the given number is NaN. + * \tparam Integer The type of the number to check. + * \return False, as integers can never be NaN. */ template , bool> = true> constexpr bool isnan(Integer /* num */) { @@ -48,4 +48,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/math/compare/isnormal.hpp b/include/ccmath/math/compare/isnormal.hpp index ded9d3bf..63f07afb 100644 --- a/include/ccmath/math/compare/isnormal.hpp +++ b/include/ccmath/math/compare/isnormal.hpp @@ -18,10 +18,10 @@ namespace ccm { /** - * @brief Checks if the given number has a normal value. - * @tparam T The type of the number. - * @param num A floating-point or integer value - * @return true if the number has a normal value, false otherwise. + * \brief Checks if the given number has a normal value. + * \tparam T The type of the number. + * \param num A floating-point or integer value + * \return true if the number has a normal value, false otherwise. */ template , bool> = true> constexpr bool isnormal(T num) noexcept { @@ -35,10 +35,10 @@ namespace ccm } /** - * @brief Checks if the given number has a normal value. - * @tparam Integer The type of the integer. - * @param num A integer value to check. - * @return true if the number has a normal value, false otherwise. + * \brief Checks if the given number has a normal value. + * \tparam Integer The type of the integer. + * \param num A integer value to check. + * \return true if the number has a normal value, false otherwise. */ template , bool> = true> constexpr bool isnormal(Integer num) noexcept { diff --git a/include/ccmath/math/compare/isunordered.hpp b/include/ccmath/math/compare/isunordered.hpp index 463d30b1..da56b91f 100644 --- a/include/ccmath/math/compare/isunordered.hpp +++ b/include/ccmath/math/compare/isunordered.hpp @@ -18,11 +18,11 @@ namespace ccm { /** - * @brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. - * @tparam T The type of the number. - * @param x A floating-point or integer value - * @param y A floating-point or integer value - * @return true if either x or y is NaN, false otherwise. + * \brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. + * \tparam T The type of the number. + * \param x A floating-point or integer value + * \param y A floating-point or integer value + * \return true if either x or y is NaN, false otherwise. */ template , bool> = true> constexpr bool isunordered(T x, T y) noexcept { @@ -36,9 +36,9 @@ namespace ccm } /** - * @brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. - * @tparam Integer The type of the integer. - * @return false, as all integers are ordered. + * \brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. + * \tparam Integer The type of the integer. + * \return false, as all integers are ordered. */ template , bool> = true> constexpr bool isunordered(Integer /* x */, Integer /* y */) noexcept @@ -47,12 +47,12 @@ namespace ccm } /** - * @brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. - * @tparam T Type of the left-hand side. - * @tparam U Type of the right-hand side. - * @param x Value of the left-hand side of the comparison. - * @param y Value of the right-hand side of the comparison. - * @return true if either x or y is NaN, false otherwise. + * \brief Checks if the given number is unordered, that is, one or both are NaN and thus cannot be meaningfully compared with each other. + * \tparam T Type of the left-hand side. + * \tparam U Type of the right-hand side. + * \param x Value of the left-hand side of the comparison. + * \param y Value of the right-hand side of the comparison. + * \return true if either x or y is NaN, false otherwise. */ template constexpr bool isunordered(T x, U y) noexcept { @@ -61,4 +61,4 @@ namespace ccm } } // namespace ccm -/// @ingroup compare +/// \ingroup compare diff --git a/include/ccmath/math/compare/signbit.hpp b/include/ccmath/math/compare/signbit.hpp index 1c1faa5e..2a2eb67e 100644 --- a/include/ccmath/math/compare/signbit.hpp +++ b/include/ccmath/math/compare/signbit.hpp @@ -18,16 +18,16 @@ namespace ccm { /** - * @brief Detects the sign bit of zeroes, infinities, and NaNs. - * @tparam T A floating-point type. - * @param num A floating-point number. - * @return true if \p x is negative, false otherwise. + * \brief Detects the sign bit of zeroes, infinities, and NaNs. + * \tparam T A floating-point type. + * \param num A floating-point number. + * \return true if \p x is negative, false otherwise. * - * @note This function has multiple implementations based on the compiler and the version of the compiler used. + * \note This function has multiple implementations based on the compiler and the version of the compiler used. * With nearly all implementations, this function is fully constexpr and will return * the same values as std::signbit along with being static_assert-able. * - * @warning ccm::signbit may fail + * \warning ccm::signbit may fail * to compile if you are not using the cmake build for ccmath or do not have access to __builtin_bit_cast. */ template , bool> = true> constexpr bool signbit(T num) noexcept @@ -49,12 +49,12 @@ namespace ccm } /** - * @brief Detects the sign bit of a number. - * @tparam Integer An integral type. - * @param num An integral number. - * @return true if \p x is negative, false otherwise. + * \brief Detects the sign bit of a number. + * \tparam Integer An integral type. + * \param num An integral number. + * \return true if \p x is negative, false otherwise. * - * @note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. + * \note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. */ template && std::is_signed_v, bool> = true> constexpr bool signbit(Integer num) noexcept @@ -64,11 +64,11 @@ namespace ccm } /** - * @brief Detects the sign bit of a number. - * @tparam Integer An integral type. - * @return false as an unsigned number can't be negative. + * \brief Detects the sign bit of a number. + * \tparam Integer An integral type. + * \return false as an unsigned number can't be negative. * - * @note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. + * \note This function is constexpr and will return the same values as std::signbit along with being static_assert-able. */ template && !std::is_signed_v, bool> = true> constexpr bool signbit(Integer /* num */) noexcept diff --git a/include/ccmath/math/expo/exp.hpp b/include/ccmath/math/expo/exp.hpp index ffd2f702..d1132cc4 100644 --- a/include/ccmath/math/expo/exp.hpp +++ b/include/ccmath/math/expo/exp.hpp @@ -23,10 +23,10 @@ CCM_DISABLE_MSVC_WARNING(4702) // 4702: unreachable code namespace ccm { /** - * @brief Computes e raised to the given power - * @tparam T floating-point or integer type - * @param num floating-point or integer value - * @return If no errors occur, the base-e exponential of num (e^num) is returned. + * \brief Computes e raised to the given power + * \tparam T floating-point or integer type + * \param num floating-point or integer value + * \return If no errors occur, the base-e exponential of num (e^num) is returned. */ template , bool> = true> constexpr T exp(T num) { @@ -45,10 +45,10 @@ namespace ccm } /** - * @brief Computes e raised to the given power - * @tparam Integer integer type - * @param num integer value - * @return If no errors occur, the base-e exponential of num (e^num) is returned as double. + * \brief Computes e raised to the given power + * \tparam Integer integer type + * \param num integer value + * \return If no errors occur, the base-e exponential of num (e^num) is returned as double. */ template , bool> = true> constexpr double exp(Integer num) { @@ -56,9 +56,9 @@ namespace ccm } /** - * @brief Computes e raised to the given power - * @param num floating-point value - * @return If no errors occur, the base-e exponential of num (e^num) is returned as float. + * \brief Computes e raised to the given power + * \param num floating-point value + * \return If no errors occur, the base-e exponential of num (e^num) is returned as float. */ constexpr float expf(float num) { @@ -66,9 +66,9 @@ namespace ccm } /** - * @brief Computes e raised to the given power - * @param num floating-point value - * @return If no errors occur, the base-e exponential of num (e^num) is returned as double. + * \brief Computes e raised to the given power + * \param num floating-point value + * \return If no errors occur, the base-e exponential of num (e^num) is returned as double. */ constexpr long double expl(long double num) { diff --git a/include/ccmath/math/expo/exp2.hpp b/include/ccmath/math/expo/exp2.hpp index 395e6d13..7a6f2a1a 100644 --- a/include/ccmath/math/expo/exp2.hpp +++ b/include/ccmath/math/expo/exp2.hpp @@ -26,10 +26,10 @@ CCM_DISABLE_MSVC_WARNING(4702) // 4702: unreachable code namespace ccm { /** - * @brief Returns 2 raised to the given power (2^x) - * @tparam T Floating-point or integer type - * @param num Floating-point or integer value - * @return If no errors occur, the base-2 exponential of num (2^num) is returned. + * \brief Returns 2 raised to the given power (2^x) + * \tparam T Floating-point or integer type + * \param num Floating-point or integer value + * \return If no errors occur, the base-2 exponential of num (2^num) is returned. */ template , bool> = true> constexpr T exp2(T num) { @@ -48,10 +48,10 @@ namespace ccm } /** - * @brief Returns 2 raised to the given power (2^x) - * @tparam Integer Integer type - * @param num Integer value - * @return If no errors occur, the base-2 exponential of num (2^num) is returned as a double. + * \brief Returns 2 raised to the given power (2^x) + * \tparam Integer Integer type + * \param num Integer value + * \return If no errors occur, the base-2 exponential of num (2^num) is returned as a double. */ template , bool> = true> constexpr double exp2(Integer num) { @@ -59,9 +59,9 @@ namespace ccm } /** - * @brief Returns 2 raised to the given power (2^x) - * @param num Floating-point value - * @return If no errors occur, the base-2 exponential of num (2^num) is returned as a float. + * \brief Returns 2 raised to the given power (2^x) + * \param num Floating-point value + * \return If no errors occur, the base-2 exponential of num (2^num) is returned as a float. */ constexpr float exp2f(float num) { @@ -69,9 +69,9 @@ namespace ccm } /** - * @brief Returns 2 raised to the given power (2^x) - * @param num Floating-point value - * @return If no errors occur, the base-2 exponential of num (2^num) is returned as a double. + * \brief Returns 2 raised to the given power (2^x) + * \param num Floating-point value + * \return If no errors occur, the base-2 exponential of num (2^num) is returned as a double. */ constexpr long double exp2l(long double num) { diff --git a/include/ccmath/math/expo/expm1.hpp b/include/ccmath/math/expo/expm1.hpp index b0ccaf4a..ac16fd2a 100644 --- a/include/ccmath/math/expo/expm1.hpp +++ b/include/ccmath/math/expo/expm1.hpp @@ -25,10 +25,10 @@ CCM_DISABLE_MSVC_WARNING(4702) namespace ccm { /** - * @brief Computes exp(num) - 1 with improved accuracy near zero. - * @tparam T Floating-point type. - * @param num Floating-point value. - * @return exp(num) - 1. + * \brief Computes exp(num) - 1 with improved accuracy near zero. + * \tparam T Floating-point type. + * \param num Floating-point value. + * \return exp(num) - 1. */ template , bool> = true> constexpr T expm1(T num) { @@ -47,10 +47,10 @@ namespace ccm } /** - * @brief Computes exp(num) - 1 after promoting an integer input to double. - * @tparam Integer Integral type. - * @param num Integer value. - * @return exp(num) - 1 as double. + * \brief Computes exp(num) - 1 after promoting an integer input to double. + * \tparam Integer Integral type. + * \param num Integer value. + * \return exp(num) - 1 as double. */ template , bool> = true> constexpr double expm1(Integer num) { @@ -58,9 +58,9 @@ namespace ccm } /** - * @brief Computes exp(num) - 1 for float. - * @param num Floating-point value. - * @return exp(num) - 1 as float. + * \brief Computes exp(num) - 1 for float. + * \param num Floating-point value. + * \return exp(num) - 1 as float. */ constexpr float expm1f(float num) { @@ -68,9 +68,9 @@ namespace ccm } /** - * @brief Computes exp(num) - 1 for long double. - * @param num Floating-point value. - * @return exp(num) - 1 as long double. + * \brief Computes exp(num) - 1 for long double. + * \param num Floating-point value. + * \return exp(num) - 1 as long double. */ constexpr long double expm1l(long double num) { diff --git a/include/ccmath/math/expo/log.hpp b/include/ccmath/math/expo/log.hpp index f463c32c..5cac7c7d 100644 --- a/include/ccmath/math/expo/log.hpp +++ b/include/ccmath/math/expo/log.hpp @@ -26,10 +26,10 @@ CCM_DISABLE_MSVC_WARNING(4702) namespace ccm { /** - * @brief Computes the natural (base e) logarithm (lnx) of a number. - * @tparam T The type of the number. - * @param num A floating-point or integer value to find the natural logarithm of. - * @return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. + * \brief Computes the natural (base e) logarithm (lnx) of a number. + * \tparam T The type of the number. + * \param num A floating-point or integer value to find the natural logarithm of. + * \return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. */ template , bool> = true> constexpr T log(const T num) noexcept { @@ -93,10 +93,10 @@ namespace ccm } /** - * @brief Computes the natural (base e) logarithm (lnx) of a number. - * @tparam Integer The type of the integer. - * @param num An integer value to find the natural logarithm of. - * @return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. + * \brief Computes the natural (base e) logarithm (lnx) of a number. + * \tparam Integer The type of the integer. + * \param num An integer value to find the natural logarithm of. + * \return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. */ template , bool> = true> constexpr double log(const Integer num) noexcept { @@ -104,9 +104,9 @@ namespace ccm } /** - * @brief Computes the natural (base e) logarithm (lnx) of a number. - * @param num A floating-point value to find the natural logarithm of. - * @return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. + * \brief Computes the natural (base e) logarithm (lnx) of a number. + * \param num A floating-point value to find the natural logarithm of. + * \return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. */ constexpr float logf(const float num) noexcept { @@ -114,9 +114,9 @@ namespace ccm } /** - * @brief Computes the natural (base e) logarithm (lnx) of a number. - * @param num A floating-point value to find the natural logarithm of. - * @return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. + * \brief Computes the natural (base e) logarithm (lnx) of a number. + * \param num A floating-point value to find the natural logarithm of. + * \return If no errors occur, the natural (base-e) logarithm of num (ln(num) or loge(num)) is returned. */ constexpr long double logl(long double num) noexcept { diff --git a/include/ccmath/math/expo/log10.hpp b/include/ccmath/math/expo/log10.hpp index 25d01958..46ba9770 100644 --- a/include/ccmath/math/expo/log10.hpp +++ b/include/ccmath/math/expo/log10.hpp @@ -31,10 +31,10 @@ CCM_DISABLE_MSVC_WARNING(4702) namespace ccm { /** - * @brief Computes the base-10 logarithm of a floating-point value. - * @tparam T Floating-point type. - * @param num Floating-point value. - * @return Base-10 logarithm of num. Returns -inf for zero and NaN for negative inputs. + * \brief Computes the base-10 logarithm of a floating-point value. + * \tparam T Floating-point type. + * \param num Floating-point value. + * \return Base-10 logarithm of num. Returns -inf for zero and NaN for negative inputs. */ template , bool> = true> constexpr T log10(T num) { @@ -89,10 +89,10 @@ namespace ccm } /** - * @brief Computes base-10 logarithm after promoting an integer input to double. - * @tparam Integer Integral type. - * @param num Integer value. - * @return Base-10 logarithm of num as double. + * \brief Computes base-10 logarithm after promoting an integer input to double. + * \tparam Integer Integral type. + * \param num Integer value. + * \return Base-10 logarithm of num as double. */ template , bool> = true> constexpr double log10(Integer num) { @@ -100,9 +100,9 @@ namespace ccm } /** - * @brief Computes the base-10 logarithm of a float. - * @param num Floating-point value. - * @return Base-10 logarithm as float. + * \brief Computes the base-10 logarithm of a float. + * \param num Floating-point value. + * \return Base-10 logarithm as float. */ constexpr float log10f(float num) { @@ -110,9 +110,9 @@ namespace ccm } /** - * @brief Computes the base-10 logarithm of a long double. - * @param num Floating-point value. - * @return Base-10 logarithm as long double. + * \brief Computes the base-10 logarithm of a long double. + * \param num Floating-point value. + * \return Base-10 logarithm as long double. */ constexpr long double log10l(long double num) { diff --git a/include/ccmath/math/expo/log1p.hpp b/include/ccmath/math/expo/log1p.hpp index 9fec1092..b5042794 100644 --- a/include/ccmath/math/expo/log1p.hpp +++ b/include/ccmath/math/expo/log1p.hpp @@ -30,10 +30,10 @@ CCM_DISABLE_MSVC_WARNING(4702) namespace ccm { /** - * @brief Computes log(1 + num) with improved accuracy near zero. - * @tparam T Floating-point type. - * @param num Floating-point value. - * @return Natural logarithm of 1 + num. Returns -inf for num == -1 and NaN for num < -1. + * \brief Computes log(1 + num) with improved accuracy near zero. + * \tparam T Floating-point type. + * \param num Floating-point value. + * \return Natural logarithm of 1 + num. Returns -inf for num == -1 and NaN for num < -1. */ template , bool> = true> constexpr T log1p(T num) { @@ -85,10 +85,10 @@ namespace ccm } /** - * @brief Computes log(1 + num) after promoting an integer input to double. - * @tparam Integer Integral type. - * @param num Integer value. - * @return Natural logarithm of 1 + num as double. + * \brief Computes log(1 + num) after promoting an integer input to double. + * \tparam Integer Integral type. + * \param num Integer value. + * \return Natural logarithm of 1 + num as double. */ template , bool> = true> constexpr double log1p(Integer num) { @@ -96,9 +96,9 @@ namespace ccm } /** - * @brief Computes log(1 + num) for float. - * @param num Floating-point value. - * @return Natural logarithm of 1 + num as float. + * \brief Computes log(1 + num) for float. + * \param num Floating-point value. + * \return Natural logarithm of 1 + num as float. */ constexpr float log1pf(float num) { @@ -106,9 +106,9 @@ namespace ccm } /** - * @brief Computes log(1 + num) for long double. - * @param num Floating-point value. - * @return Natural logarithm of 1 + num as long double. + * \brief Computes log(1 + num) for long double. + * \param num Floating-point value. + * \return Natural logarithm of 1 + num as long double. */ constexpr long double log1pl(long double num) { diff --git a/include/ccmath/math/expo/log2.hpp b/include/ccmath/math/expo/log2.hpp index 888986de..dfc45ba8 100644 --- a/include/ccmath/math/expo/log2.hpp +++ b/include/ccmath/math/expo/log2.hpp @@ -31,10 +31,10 @@ CCM_DISABLE_MSVC_WARNING(4702) namespace ccm { /** - * @brief Returns the base 2 logarithm of a number. - * @tparam T The type of the number. - * @param num The number to calculate the base 2 logarithm of. - * @return The base 2 logarithm of the number. + * \brief Returns the base 2 logarithm of a number. + * \tparam T The type of the number. + * \param num The number to calculate the base 2 logarithm of. + * \return The base 2 logarithm of the number. */ template , bool> = true> constexpr T log2(T num) noexcept { @@ -101,10 +101,10 @@ namespace ccm } /** - * @brief Returns the base 2 logarithm of a number. - * @tparam Integer The type of the integer. - * @param num The number to calculate the base 2 logarithm of. - * @return The base 2 logarithm of the number as a double. + * \brief Returns the base 2 logarithm of a number. + * \tparam Integer The type of the integer. + * \param num The number to calculate the base 2 logarithm of. + * \return The base 2 logarithm of the number as a double. */ template , bool> = true> constexpr double log2(Integer num) noexcept { @@ -112,9 +112,9 @@ namespace ccm } /** - * @brief Returns the base 2 logarithm of a number. - * @param num The number to calculate the base 2 logarithm of. - * @return The base 2 logarithm of the number as a float. + * \brief Returns the base 2 logarithm of a number. + * \param num The number to calculate the base 2 logarithm of. + * \return The base 2 logarithm of the number as a float. */ constexpr float log2f(float num) { @@ -122,9 +122,9 @@ namespace ccm } /** - * @brief Returns the base 2 logarithm of a number. - * @param num The number to calculate the base 2 logarithm of. - * @return The base 2 logarithm of the number as a double. + * \brief Returns the base 2 logarithm of a number. + * \param num The number to calculate the base 2 logarithm of. + * \return The base 2 logarithm of the number as a double. */ constexpr long double log2l(long double num) { diff --git a/include/ccmath/math/fmanip/copysign.hpp b/include/ccmath/math/fmanip/copysign.hpp index d56f1a59..a04e5007 100644 --- a/include/ccmath/math/fmanip/copysign.hpp +++ b/include/ccmath/math/fmanip/copysign.hpp @@ -20,11 +20,11 @@ namespace ccm { /** - * @brief Copies the sign of a floating point or integer value. - * @tparam T Type of the floating-point or integer value. - * @param mag A floating-point or integer value - * @param sgn A floating-point or integer value - * @return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. + * \brief Copies the sign of a floating point or integer value. + * \tparam T Type of the floating-point or integer value. + * \param mag A floating-point or integer value + * \param sgn A floating-point or integer value + * \return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. */ template , bool> = true> constexpr T copysign(T mag, T sgn) { @@ -53,11 +53,11 @@ namespace ccm } /** - * @brief Copies the sign of an integer value. - * @tparam Integer Type of the integer value. - * @param mag A integer value - * @param sgn A integer value - * @return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. + * \brief Copies the sign of an integer value. + * \tparam Integer Type of the integer value. + * \param mag A integer value + * \param sgn A integer value + * \return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. */ template , bool> = true> constexpr double copysign(Integer mag, Integer sgn) { @@ -65,10 +65,10 @@ namespace ccm } /** - * @brief Copies the sign of a floating point value. - * @param mag A floating-point. - * @param sgn A floating-point. - * @return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. + * \brief Copies the sign of a floating point value. + * \param mag A floating-point. + * \param sgn A floating-point. + * \return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. */ constexpr float copysignf(float mag, float sgn) { @@ -76,10 +76,10 @@ namespace ccm } /** - * @brief Copies the sign of a floating point value. - * @param mag A floating-point. - * @param sgn A floating-point. - * @return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. + * \brief Copies the sign of a floating point value. + * \param mag A floating-point. + * \param sgn A floating-point. + * \return If no errors occur, the floating point value with the magnitude of mag and the sign of sgn is returned. */ constexpr long double copysignl(long double mag, long double sgn) { diff --git a/include/ccmath/math/fmanip/frexp.hpp b/include/ccmath/math/fmanip/frexp.hpp index 5ec74f64..62169337 100644 --- a/include/ccmath/math/fmanip/frexp.hpp +++ b/include/ccmath/math/fmanip/frexp.hpp @@ -20,11 +20,11 @@ namespace ccm { /** - * @brief Decomposes a floating-point value into a normalized fraction and a base-2 exponent. - * @tparam T Floating-point type. - * @param x Floating-point value to decompose. - * @param exp Pointer that receives the extracted exponent. - * @return Normalized fraction in the range [-1, -0.5) or [0.5, 1), or zero when x is zero. + * \brief Decomposes a floating-point value into a normalized fraction and a base-2 exponent. + * \tparam T Floating-point type. + * \param x Floating-point value to decompose. + * \param exp Pointer that receives the extracted exponent. + * \return Normalized fraction in the range [-1, -0.5) or [0.5, 1), or zero when x is zero. */ template , bool> = true> constexpr T frexp(T x, int * exp) { @@ -47,10 +47,10 @@ namespace ccm } /** - * @brief Decomposes a float into a normalized fraction and a base-2 exponent. - * @param x Floating-point value to decompose. - * @param exp Pointer that receives the extracted exponent. - * @return Normalized fraction for x. + * \brief Decomposes a float into a normalized fraction and a base-2 exponent. + * \param x Floating-point value to decompose. + * \param exp Pointer that receives the extracted exponent. + * \return Normalized fraction for x. */ constexpr float frexpf(float x, int * exp) { @@ -63,10 +63,10 @@ namespace ccm } /** - * @brief Decomposes a long double into a normalized fraction and a base-2 exponent. - * @param x Floating-point value to decompose. - * @param exp Pointer that receives the extracted exponent. - * @return Normalized fraction for x. + * \brief Decomposes a long double into a normalized fraction and a base-2 exponent. + * \param x Floating-point value to decompose. + * \param exp Pointer that receives the extracted exponent. + * \return Normalized fraction for x. */ constexpr long double frexpl(long double x, int * exp) { diff --git a/include/ccmath/math/fmanip/ilogb.hpp b/include/ccmath/math/fmanip/ilogb.hpp index 232a1c0d..dc68ee1a 100644 --- a/include/ccmath/math/fmanip/ilogb.hpp +++ b/include/ccmath/math/fmanip/ilogb.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Extracts the unbiased integer exponent of a floating-point value. - * @tparam T Floating-point type. - * @param num Floating-point value. - * @return Unbiased base-2 exponent as int (or implementation-defined special values for zero/NaN). + * \brief Extracts the unbiased integer exponent of a floating-point value. + * \tparam T Floating-point type. + * \param num Floating-point value. + * \return Unbiased base-2 exponent as int (or implementation-defined special values for zero/NaN). */ template , bool> = true> constexpr int ilogb(T num) noexcept { @@ -41,9 +41,9 @@ namespace ccm } /** - * @brief Extracts the unbiased integer exponent of a float. - * @param num Floating-point value. - * @return Unbiased base-2 exponent as int. + * \brief Extracts the unbiased integer exponent of a float. + * \param num Floating-point value. + * \return Unbiased base-2 exponent as int. */ constexpr int ilogbf(float num) noexcept { @@ -51,9 +51,9 @@ namespace ccm } /** - * @brief Extracts the unbiased integer exponent of a long double. - * @param num Floating-point value. - * @return Unbiased base-2 exponent as int. + * \brief Extracts the unbiased integer exponent of a long double. + * \param num Floating-point value. + * \return Unbiased base-2 exponent as int. */ constexpr int ilogbl(long double num) noexcept { diff --git a/include/ccmath/math/fmanip/ldexp.hpp b/include/ccmath/math/fmanip/ldexp.hpp index e90382db..e6bf5fb7 100644 --- a/include/ccmath/math/fmanip/ldexp.hpp +++ b/include/ccmath/math/fmanip/ldexp.hpp @@ -9,9 +9,9 @@ */ /** - * @file ldexp.hpp - * @defgroup fmanip Floating-Point Manipulation - * @brief Provides functions for scaling floating-point (and integer) values by a power of two. + * \file ldexp.hpp + * \defgroup fmanip Floating-Point Manipulation + * \brief Provides functions for scaling floating-point (and integer) values by a power of two. * * This header defines a family of ldexp-like functions, including \c ldexp for * generic floating-point types, integer overloads, and specialized variants for @@ -19,10 +19,10 @@ * while handling overflow, underflow, and special values (NaN, ±∞, etc.) as per * the rules of floating-point arithmetic so long as errno has not been disabled in cmake. * - * @author + * \author * Ian Pike * - * @copyright + * \copyright * Copyright (c) Ian Pike * Copyright (c) CCMath contributors * Licensed under the Apache-2.0 License WITH LLVM-exception. @@ -40,12 +40,12 @@ #include "ccmath/internal/support/is_constant_evaluated.hpp" /** - * @brief global ccm namespace + * \brief global ccm namespace */ namespace ccm { /** - * @brief Scales a floating-point \p num by \f$2^\text{exp}\f$. + * \brief Scales a floating-point \p num by \f$2^\text{exp}\f$. * * Overflow returns ±HUGE_VAL (or its float and long double forms), underflow returns the * correctly rounded result, possibly a subnormal or zero. ±0, ±∞, and NaN pass through @@ -53,11 +53,11 @@ namespace ccm * errno was disabled in cmake, \c errno may be set to \c ERANGE and \c FE_OVERFLOW or * \c FE_UNDERFLOW raised, depending on the platform. * - * @tparam T Floating-point type. - * @param num Value to scale. - * @param exp Power of two to scale by. - * @return \f$\text{num} \times 2^\text{exp}\f$. - * @attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. + * \tparam T Floating-point type. + * \param num Value to scale. + * \param exp Power of two to scale by. + * \return \f$\text{num} \times 2^\text{exp}\f$. + * \attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. */ template , bool> = true> constexpr T ldexp(T num, int exp) { @@ -76,16 +76,16 @@ namespace ccm } /** - * @brief Scales an integer \p num by \f$2^\text{exp}\f$, converting it to \c double first. + * \brief Scales an integer \p num by \f$2^\text{exp}\f$, converting it to \c double first. * * Equivalent to \c ldexp(static_cast(num), exp), so it shares the * floating-point overload's behavior after the conversion. Overflow returns ±HUGE_VAL. * - * @tparam Integer Integer type. - * @param num Value to scale, converted to \c double. - * @param exp Power of two to scale by. - * @return \f$\text{num} \times 2^\text{exp}\f$ as a \c double. - * @attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. + * \tparam Integer Integer type. + * \param num Value to scale, converted to \c double. + * \param exp Power of two to scale by. + * \return \f$\text{num} \times 2^\text{exp}\f$ as a \c double. + * \attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. */ template , bool> = true> constexpr double ldexp(Integer num, int exp) { @@ -93,14 +93,14 @@ namespace ccm } /** - * @brief Scales a \c float \p num by \f$2^\text{exp}\f$. Equivalent to \c ldexp(num, exp). + * \brief Scales a \c float \p num by \f$2^\text{exp}\f$. Equivalent to \c ldexp(num, exp). * * Overflow returns ±HUGE_VALF, underflow a subnormal or zero. * - * @param num Value to scale. - * @param exp Power of two to scale by. - * @return \f$\text{num} \times 2^\text{exp}\f$ as a \c float. - * @attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. + * \param num Value to scale. + * \param exp Power of two to scale by. + * \return \f$\text{num} \times 2^\text{exp}\f$ as a \c float. + * \attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. */ constexpr float ldexpf(float num, int exp) noexcept { @@ -108,17 +108,17 @@ namespace ccm } /** - * @brief Scales a \c long double \p num by \f$2^\text{exp}\f$ using native long double support. + * \brief Scales a \c long double \p num by \f$2^\text{exp}\f$ using native long double support. * * Overflow returns ±HUGE_VALL, underflow a subnormal or zero. ±0, ±∞, and NaN pass through * unchanged, and \p num is returned as-is when \p exp is 0. On a range error, and unless errno * was disabled in cmake, \c errno may be set to \c ERANGE and \c FE_OVERFLOW or \c FE_UNDERFLOW * raised, depending on the platform. * - * @param num Value to scale. - * @param exp Power of two to scale by. - * @return \f$\text{num} \times 2^\text{exp}\f$ as a \c long double. - * @attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. + * \param num Value to scale. + * \param exp Power of two to scale by. + * \return \f$\text{num} \times 2^\text{exp}\f$ as a \c long double. + * \attention At compile time errno may or may not be set, depending on the compiler. Assume it is not. */ constexpr long double ldexpl(long double num, int exp) noexcept { diff --git a/include/ccmath/math/fmanip/logb.hpp b/include/ccmath/math/fmanip/logb.hpp index 6b23c1c0..3bd2faf2 100644 --- a/include/ccmath/math/fmanip/logb.hpp +++ b/include/ccmath/math/fmanip/logb.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Extracts the unbiased exponent of a floating-point value as a floating-point result. - * @tparam T Floating-point type. - * @param num Floating-point value. - * @return Unbiased exponent of num in the return type T. + * \brief Extracts the unbiased exponent of a floating-point value as a floating-point result. + * \tparam T Floating-point type. + * \param num Floating-point value. + * \return Unbiased exponent of num in the return type T. */ template , bool> = true> constexpr T logb(T num) noexcept { @@ -41,9 +41,9 @@ namespace ccm } /** - * @brief Extracts the unbiased exponent of a float. - * @param num Floating-point value. - * @return Unbiased exponent as float. + * \brief Extracts the unbiased exponent of a float. + * \param num Floating-point value. + * \return Unbiased exponent as float. */ constexpr float logbf(float num) noexcept { @@ -51,9 +51,9 @@ namespace ccm } /** - * @brief Extracts the unbiased exponent of a long double. - * @param num Floating-point value. - * @return Unbiased exponent as long double. + * \brief Extracts the unbiased exponent of a long double. + * \param num Floating-point value. + * \return Unbiased exponent as long double. */ constexpr long double logbl(long double num) noexcept { diff --git a/include/ccmath/math/fmanip/modf.hpp b/include/ccmath/math/fmanip/modf.hpp index c3686cf7..343a5de7 100644 --- a/include/ccmath/math/fmanip/modf.hpp +++ b/include/ccmath/math/fmanip/modf.hpp @@ -20,11 +20,11 @@ namespace ccm { /** - * @brief Decomposes a floating-point value into fractional and integral parts. - * @tparam T Floating-point type. - * @param x Floating-point value to split. - * @param iptr Pointer that receives the integral part. - * @return Fractional part of x, with the same sign as x. + * \brief Decomposes a floating-point value into fractional and integral parts. + * \tparam T Floating-point type. + * \param x Floating-point value to split. + * \param iptr Pointer that receives the integral part. + * \return Fractional part of x, with the same sign as x. */ template , bool> = true> constexpr T modf(T x, T * iptr) noexcept { @@ -53,10 +53,10 @@ namespace ccm } /** - * @brief Decomposes a float into fractional and integral parts. - * @param x Floating-point value to split. - * @param iptr Pointer that receives the integral part. - * @return Fractional part of x. + * \brief Decomposes a float into fractional and integral parts. + * \param x Floating-point value to split. + * \param iptr Pointer that receives the integral part. + * \return Fractional part of x. */ constexpr float modff(float x, float * iptr) noexcept { @@ -64,10 +64,10 @@ namespace ccm } /** - * @brief Decomposes a long double into fractional and integral parts. - * @param x Floating-point value to split. - * @param iptr Pointer that receives the integral part. - * @return Fractional part of x. + * \brief Decomposes a long double into fractional and integral parts. + * \param x Floating-point value to split. + * \param iptr Pointer that receives the integral part. + * \return Fractional part of x. */ constexpr long double modfl(long double x, long double * iptr) noexcept { diff --git a/include/ccmath/math/fmanip/nextafter.hpp b/include/ccmath/math/fmanip/nextafter.hpp index 394ed8fa..62005912 100644 --- a/include/ccmath/math/fmanip/nextafter.hpp +++ b/include/ccmath/math/fmanip/nextafter.hpp @@ -20,11 +20,11 @@ namespace ccm { /** - * @brief Returns the next representable floating-point value from from toward to. - * @tparam T Floating-point type. - * @param from Starting value. - * @param to Direction target. - * @return Next representable value after from in the direction of to. + * \brief Returns the next representable floating-point value from from toward to. + * \tparam T Floating-point type. + * \param from Starting value. + * \param to Direction target. + * \return Next representable value after from in the direction of to. */ template , bool> = true> constexpr T nextafter(T from, T to) noexcept { @@ -41,12 +41,12 @@ namespace ccm } /** - * @brief Returns the next representable value from from toward to after common-type conversion. - * @tparam Arithmetic1 Arithmetic type of from. - * @tparam Arithmetic2 Arithmetic type of to. - * @param from Starting value. - * @param to Direction target. - * @return Next representable value in the promoted common type. + * \brief Returns the next representable value from from toward to after common-type conversion. + * \tparam Arithmetic1 Arithmetic type of from. + * \tparam Arithmetic2 Arithmetic type of to. + * \param from Starting value. + * \param to Direction target. + * \return Next representable value in the promoted common type. */ template && std::is_arithmetic_v, bool> = true> constexpr auto nextafter(Arithmetic1 from, Arithmetic2 to) noexcept @@ -55,10 +55,10 @@ namespace ccm } /** - * @brief Returns the next representable float from from toward to. - * @param from Starting value. - * @param to Direction target. - * @return Next representable float value. + * \brief Returns the next representable float from from toward to. + * \param from Starting value. + * \param to Direction target. + * \return Next representable float value. */ constexpr float nextafterf(float from, float to) noexcept { @@ -66,10 +66,10 @@ namespace ccm } /** - * @brief Returns the next representable long double from from toward to. - * @param from Starting value. - * @param to Direction target. - * @return Next representable long double value. + * \brief Returns the next representable long double from from toward to. + * \param from Starting value. + * \param to Direction target. + * \return Next representable long double value. */ constexpr long double nextafterl(long double from, long double to) noexcept { diff --git a/include/ccmath/math/fmanip/nexttoward.hpp b/include/ccmath/math/fmanip/nexttoward.hpp index c4cedc34..9972ff82 100644 --- a/include/ccmath/math/fmanip/nexttoward.hpp +++ b/include/ccmath/math/fmanip/nexttoward.hpp @@ -20,11 +20,11 @@ namespace ccm { /** - * @brief Returns the next representable value from from toward to using long double direction precision. - * @tparam T Floating-point type for the return value and first argument. - * @param from Starting value. - * @param to Direction target as long double. - * @return Next representable value after from toward to. + * \brief Returns the next representable value from from toward to using long double direction precision. + * \tparam T Floating-point type for the return value and first argument. + * \param from Starting value. + * \param to Direction target as long double. + * \return Next representable value after from toward to. */ template , bool> = true> constexpr T nexttoward(T from, long double to) noexcept { @@ -41,11 +41,11 @@ namespace ccm } /** - * @brief Integer overload for stepping toward a long double target. - * @tparam Integer Integral type. - * @param from Starting integer value. - * @param to Direction target as long double. - * @return Next representable double value after converting from to floating-point. + * \brief Integer overload for stepping toward a long double target. + * \tparam Integer Integral type. + * \param from Starting integer value. + * \param to Direction target as long double. + * \return Next representable double value after converting from to floating-point. */ template , bool> = true> constexpr double nexttoward(Integer from, long double to) noexcept { @@ -53,10 +53,10 @@ namespace ccm } /** - * @brief Returns the next representable float from from toward to. - * @param from Starting value. - * @param to Direction target as long double. - * @return Next representable float value. + * \brief Returns the next representable float from from toward to. + * \param from Starting value. + * \param to Direction target as long double. + * \return Next representable float value. */ constexpr float nexttowardf(float from, long double to) noexcept { @@ -64,10 +64,10 @@ namespace ccm } /** - * @brief Returns the next representable long double from from toward to. - * @param from Starting value. - * @param to Direction target as long double. - * @return Next representable long double value. + * \brief Returns the next representable long double from from toward to. + * \param from Starting value. + * \param to Direction target as long double. + * \return Next representable long double value. */ constexpr long double nexttowardl(long double from, long double to) noexcept { diff --git a/include/ccmath/math/fmanip/scalbn.hpp b/include/ccmath/math/fmanip/scalbn.hpp index b18f93c6..55034b28 100644 --- a/include/ccmath/math/fmanip/scalbn.hpp +++ b/include/ccmath/math/fmanip/scalbn.hpp @@ -25,11 +25,11 @@ CCM_DISABLE_MSVC_WARNING(4702) // 4702: unreachable code namespace ccm { /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam T Floating-point or integer type. - * @param num Floating-point or integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam T Floating-point or integer type. + * \param num Floating-point or integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. */ template , bool> = true> constexpr T scalbn(T num, int exp) noexcept { @@ -60,11 +60,11 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam T Floating-point or integer type. - * @param num Floating-point or integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam T Floating-point or integer type. + * \param num Floating-point or integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned. */ template , bool> = true> constexpr T scalbn(T num, long exp) noexcept { @@ -95,11 +95,11 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam Integer Integer type. - * @param num Integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam Integer Integer type. + * \param num Integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. */ template , bool> = true> constexpr double scalbn(Integer num, int exp) noexcept { @@ -107,11 +107,11 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @tparam Integer Integer type. - * @param num Integer value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \tparam Integer Integer type. + * \param num Integer value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a double. */ template , bool> = true> constexpr double scalbn(Integer num, long exp) noexcept { @@ -129,10 +129,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. */ constexpr float scalbnf(float num, int exp) noexcept { @@ -140,10 +140,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a float. */ constexpr float scalbnf(float num, long exp) noexcept { @@ -151,10 +151,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. */ constexpr long double scalbnl(long double num, int exp) noexcept { @@ -162,10 +162,10 @@ namespace ccm } /** - * @brief Multiplies a number by FLT_RADIX raised to a power - * @param num Floating-point value. - * @param exp Integer value. - * @return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. + * \brief Multiplies a number by FLT_RADIX raised to a power + * \param num Floating-point value. + * \param exp Integer value. + * \return If no errors occur, num multiplied by FLT_RADIX to the power of exp (num×FLT_RADIX^exp) is returned as a long double. */ constexpr long double scalbnl(long double num, long exp) noexcept { diff --git a/include/ccmath/math/misc/gamma.hpp b/include/ccmath/math/misc/gamma.hpp index d66401eb..50ced193 100644 --- a/include/ccmath/math/misc/gamma.hpp +++ b/include/ccmath/math/misc/gamma.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Computes the gamma function using the standard std::tgamma entry point. - * @tparam T floating-point or integer type - * @param num floating-point or integer value - * @return If no errors occur, the gamma function value of num is returned. + * \brief Computes the gamma function using the standard std::tgamma entry point. + * \tparam T floating-point or integer type + * \param num floating-point or integer value + * \return If no errors occur, the gamma function value of num is returned. */ template , bool> = true> constexpr T tgamma(T num) { @@ -54,10 +54,10 @@ namespace ccm } /** - * @brief Computes the gamma function after promoting an integer input to double. - * @tparam Integer Integral type. - * @param num Integer value. - * @return Gamma function value of num as double. + * \brief Computes the gamma function after promoting an integer input to double. + * \tparam Integer Integral type. + * \param num Integer value. + * \return Gamma function value of num as double. */ template , bool> = true> constexpr double tgamma(Integer num) { @@ -75,9 +75,9 @@ namespace ccm } /** - * @brief Computes the gamma function for float. - * @param num Floating-point value. - * @return Gamma function value of num as float. + * \brief Computes the gamma function for float. + * \param num Floating-point value. + * \return Gamma function value of num as float. */ constexpr float tgammaf(float num) { @@ -85,9 +85,9 @@ namespace ccm } /** - * @brief Computes the gamma function for long double. - * @param num Floating-point value. - * @return Gamma function value of num as long double. + * \brief Computes the gamma function for long double. + * \param num Floating-point value. + * \return Gamma function value of num as long double. */ constexpr long double tgammal(long double num) { diff --git a/include/ccmath/math/misc/lerp.hpp b/include/ccmath/math/misc/lerp.hpp index f888845a..5fc61c2c 100644 --- a/include/ccmath/math/misc/lerp.hpp +++ b/include/ccmath/math/misc/lerp.hpp @@ -16,12 +16,12 @@ namespace ccm { /** - * @brief Performs linear interpolation between a and b using t. - * @tparam T Arithmetic type. - * @param a Start value. - * @param b End value. - * @param t Interpolation factor. - * @return Interpolated value equivalent to a + t * (b - a) with stability handling for edge cases. + * \brief Performs linear interpolation between a and b using t. + * \tparam T Arithmetic type. + * \param a Start value. + * \param b End value. + * \param t Interpolation factor. + * \return Interpolated value equivalent to a + t * (b - a) with stability handling for edge cases. */ template constexpr T lerp(T a, T b, T t) noexcept { @@ -50,14 +50,14 @@ namespace ccm } /** - * @brief Performs linear interpolation after promoting arguments to a common arithmetic type. - * @tparam T Arithmetic type of a. - * @tparam U Arithmetic type of b. - * @tparam V Arithmetic type of t. - * @param a Start value. - * @param b End value. - * @param t Interpolation factor. - * @return Interpolated value in the common type of T, U, and V. + * \brief Performs linear interpolation after promoting arguments to a common arithmetic type. + * \tparam T Arithmetic type of a. + * \tparam U Arithmetic type of b. + * \tparam V Arithmetic type of t. + * \param a Start value. + * \param b End value. + * \param t Interpolation factor. + * \return Interpolated value in the common type of T, U, and V. */ template constexpr std::enable_if_t && std::is_arithmetic_v && std::is_arithmetic_v, std::common_type_t> @@ -69,13 +69,13 @@ namespace ccm } /** - * @brief Deprecated fallback implementation of linear interpolation. - * @tparam T Arithmetic type. - * @param a Start value. - * @param b End value. - * @param t Interpolation factor. - * @return Interpolated value from the previous implementation. - * @deprecated Use ccm::lerp instead. + * \brief Deprecated fallback implementation of linear interpolation. + * \tparam T Arithmetic type. + * \param a Start value. + * \param b End value. + * \param t Interpolation factor. + * \return Interpolated value from the previous implementation. + * \deprecated Use ccm::lerp instead. */ template [[maybe_unused]] [[deprecated( diff --git a/include/ccmath/math/misc/lgamma.hpp b/include/ccmath/math/misc/lgamma.hpp index 27b509cd..c556bcd6 100644 --- a/include/ccmath/math/misc/lgamma.hpp +++ b/include/ccmath/math/misc/lgamma.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Computes the natural logarithm of the absolute value of the gamma function. - * @tparam T floating-point or integer type - * @param num floating-point or integer value - * @return If no errors occur, the natural logarithm of the absolute value of the gamma function at num is returned. + * \brief Computes the natural logarithm of the absolute value of the gamma function. + * \tparam T floating-point or integer type + * \param num floating-point or integer value + * \return If no errors occur, the natural logarithm of the absolute value of the gamma function at num is returned. */ template , bool> = true> constexpr T lgamma(T num) { @@ -48,10 +48,10 @@ namespace ccm } /** - * @brief Computes log-gamma after promoting an integer input to double. - * @tparam Integer Integral type. - * @param num Integer value. - * @return Natural logarithm of |gamma(num)| as double. + * \brief Computes log-gamma after promoting an integer input to double. + * \tparam Integer Integral type. + * \param num Integer value. + * \return Natural logarithm of |gamma(num)| as double. */ template , bool> = true> constexpr double lgamma(Integer num) { @@ -59,9 +59,9 @@ namespace ccm } /** - * @brief Computes log-gamma for float. - * @param num Floating-point value. - * @return Natural logarithm of |gamma(num)| as float. + * \brief Computes log-gamma for float. + * \param num Floating-point value. + * \return Natural logarithm of |gamma(num)| as float. */ constexpr float lgammaf(float num) { @@ -69,9 +69,9 @@ namespace ccm } /** - * @brief Computes log-gamma for long double. - * @param num Floating-point value. - * @return Natural logarithm of |gamma(num)| as long double. + * \brief Computes log-gamma for long double. + * \param num Floating-point value. + * \return Natural logarithm of |gamma(num)| as long double. */ constexpr long double lgammal(long double num) { diff --git a/include/ccmath/math/nearest/ceil.hpp b/include/ccmath/math/nearest/ceil.hpp index d904202b..6d8f1cc8 100644 --- a/include/ccmath/math/nearest/ceil.hpp +++ b/include/ccmath/math/nearest/ceil.hpp @@ -23,10 +23,10 @@ namespace ccm { /** - * @brief Computes the smallest integer value not less than num. - * @tparam T The type of the number. - * @param num A floating-point or integer value. - * @return The smallest integer value not less than num. + * \brief Computes the smallest integer value not less than num. + * \tparam T The type of the number. + * \param num A floating-point or integer value. + * \return The smallest integer value not less than num. */ template , bool> = true> constexpr T ceil(T num) noexcept { @@ -60,10 +60,10 @@ namespace ccm } /** - * @brief Returns the ceiling of an integer input after conversion to double. - * @tparam Integer Integral type. - * @param num Integer value. - * @return num converted to double. + * \brief Returns the ceiling of an integer input after conversion to double. + * \tparam Integer Integral type. + * \param num Integer value. + * \return num converted to double. */ template , bool> = true> constexpr double ceil(Integer num) noexcept { @@ -71,9 +71,9 @@ namespace ccm } /** - * @brief Computes the ceiling of a float value. - * @param num Floating-point value. - * @return Smallest integer value not less than num, as float. + * \brief Computes the ceiling of a float value. + * \param num Floating-point value. + * \return Smallest integer value not less than num, as float. */ constexpr float ceilf(float num) noexcept { @@ -81,9 +81,9 @@ namespace ccm } /** - * @brief Computes the ceiling of a double value. - * @param num Floating-point value. - * @return Smallest integer value not less than num, as double. + * \brief Computes the ceiling of a double value. + * \param num Floating-point value. + * \return Smallest integer value not less than num, as double. */ constexpr long double ceill(long double num) noexcept { @@ -91,4 +91,4 @@ namespace ccm } } // namespace ccm -/// @ingroup nearest +/// \ingroup nearest diff --git a/include/ccmath/math/nearest/floor.hpp b/include/ccmath/math/nearest/floor.hpp index 5519df2f..4fe46925 100644 --- a/include/ccmath/math/nearest/floor.hpp +++ b/include/ccmath/math/nearest/floor.hpp @@ -22,10 +22,10 @@ namespace ccm { /** - * @brief Computes the largest integer value not greater than num. - * @tparam T The type of the number. - * @param num A floating-point or integer value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \tparam T The type of the number. + * \param num A floating-point or integer value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ template , bool> = true> constexpr T floor(T num) noexcept { @@ -59,9 +59,9 @@ namespace ccm } /** - * @brief Computes the largest integer value not greater than num. - * @param num A integer value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \param num A integer value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ template , bool> = true> constexpr double floor(Integer num) noexcept { @@ -69,9 +69,9 @@ namespace ccm } /** - * @brief Computes the largest integer value not greater than num. - * @param num A floating-point value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \param num A floating-point value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ constexpr float floorf(float num) noexcept { @@ -79,9 +79,9 @@ namespace ccm } /** - * @brief Computes the largest integer value not greater than num. - * @param num A floating-point value. - * @return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. + * \brief Computes the largest integer value not greater than num. + * \param num A floating-point value. + * \return If no errors occur, the largest integer value not greater than num, that is ⌊num⌋, is returned. */ constexpr long double floorl(long double num) noexcept { @@ -89,4 +89,4 @@ namespace ccm } } // namespace ccm -/// @ingroup nearest +/// \ingroup nearest diff --git a/include/ccmath/math/nearest/nearbyint.hpp b/include/ccmath/math/nearest/nearbyint.hpp index f9976b23..204d7ee8 100644 --- a/include/ccmath/math/nearest/nearbyint.hpp +++ b/include/ccmath/math/nearest/nearbyint.hpp @@ -25,10 +25,10 @@ namespace ccm { /** - * @brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. - * @tparam T The type of the number. - * @param num A floating-point value. - * @return If no errors occur, the rounded floating point value. Otherwise, returns the input floating point value unmodified. + * \brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. + * \tparam T The type of the number. + * \param num A floating-point value. + * \return If no errors occur, the rounded floating point value. Otherwise, returns the input floating point value unmodified. */ template , bool> = true> constexpr T nearbyint(T num) noexcept { @@ -42,10 +42,10 @@ namespace ccm } /** - * @brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. - * @tparam Integer The type of the number. - * @param num An integral value. - * @return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. + * \brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. + * \tparam Integer The type of the number. + * \param num An integral value. + * \return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. */ template , bool> = true> constexpr double nearbyint(Integer num) noexcept { @@ -53,9 +53,9 @@ namespace ccm } /** - * @brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. - * @param num A float value. - * @return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. + * \brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. + * \param num A float value. + * \return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. */ constexpr float nearbyintf(float num) noexcept { @@ -63,9 +63,9 @@ namespace ccm } /** - * @brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. - * @param num A long double value. - * @return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. + * \brief The nearest integer value to num, according to the rounding mode FE_TONEAREST, is returned. + * \param num A long double value. + * \return If no errors occur, the rounded floating point value. Otherwise, returns the input integer value unmodified. */ constexpr long double nearbyintl(long double num) noexcept { diff --git a/include/ccmath/math/nearest/rint.hpp b/include/ccmath/math/nearest/rint.hpp index 2a2d755b..cd008861 100644 --- a/include/ccmath/math/nearest/rint.hpp +++ b/include/ccmath/math/nearest/rint.hpp @@ -25,10 +25,10 @@ namespace ccm { /** - * @brief Rounds num to an integer using the current rounding mode. - * @tparam T The type of the number. - * @param num A floating-point or integer value. - * @return The rounded value. + * \brief Rounds num to an integer using the current rounding mode. + * \tparam T The type of the number. + * \param num A floating-point or integer value. + * \return The rounded value. */ template , bool> = true> constexpr T rint(T num) noexcept { @@ -42,10 +42,10 @@ namespace ccm } /** - * @brief Returns the rounded value of an integer input after conversion to double. - * @tparam Integer Integral type. - * @param num Integer value. - * @return num converted to double. + * \brief Returns the rounded value of an integer input after conversion to double. + * \tparam Integer Integral type. + * \param num Integer value. + * \return num converted to double. */ template , bool> = true> constexpr double rint(Integer num) noexcept { @@ -53,9 +53,9 @@ namespace ccm } /** - * @brief Rounds a float to an integer value using the current rounding mode. - * @param num Floating-point value. - * @return Rounded value as float. + * \brief Rounds a float to an integer value using the current rounding mode. + * \param num Floating-point value. + * \return Rounded value as float. */ constexpr float rintf(float num) noexcept { @@ -63,9 +63,9 @@ namespace ccm } /** - * @brief Rounds a long double to an integer value using the current rounding mode. - * @param num Floating-point value. - * @return Rounded value as long double. + * \brief Rounds a long double to an integer value using the current rounding mode. + * \param num Floating-point value. + * \return Rounded value as long double. */ constexpr long double rintl(long double num) noexcept { @@ -73,4 +73,4 @@ namespace ccm } } // namespace ccm -/// @ingroup nearest +/// \ingroup nearest diff --git a/include/ccmath/math/nearest/round.hpp b/include/ccmath/math/nearest/round.hpp index dfc24e8a..848e555b 100644 --- a/include/ccmath/math/nearest/round.hpp +++ b/include/ccmath/math/nearest/round.hpp @@ -22,10 +22,10 @@ namespace ccm { /** - * @brief Rounds num to the nearest integer, with halfway cases away from zero. - * @tparam T The type of the number. - * @param num A floating-point or integer value. - * @return The rounded value. + * \brief Rounds num to the nearest integer, with halfway cases away from zero. + * \tparam T The type of the number. + * \param num A floating-point or integer value. + * \return The rounded value. */ template , bool> = true> constexpr T round(T num) noexcept { @@ -55,10 +55,10 @@ namespace ccm } /** - * @brief Returns the rounded value of an integer input after conversion to double. - * @tparam Integer Integral type. - * @param num Integer value. - * @return num converted to double. + * \brief Returns the rounded value of an integer input after conversion to double. + * \tparam Integer Integral type. + * \param num Integer value. + * \return num converted to double. */ template , bool> = true> constexpr double round(Integer num) noexcept { @@ -66,9 +66,9 @@ namespace ccm } /** - * @brief Rounds a float to the nearest integer value, halfway cases away from zero. - * @param num Floating-point value. - * @return Rounded value as float. + * \brief Rounds a float to the nearest integer value, halfway cases away from zero. + * \param num Floating-point value. + * \return Rounded value as float. */ constexpr float roundf(float num) noexcept { @@ -76,9 +76,9 @@ namespace ccm } /** - * @brief Rounds a double to the nearest integer value, halfway cases away from zero. - * @param num Floating-point value. - * @return Rounded value as double. + * \brief Rounds a double to the nearest integer value, halfway cases away from zero. + * \param num Floating-point value. + * \return Rounded value as double. */ constexpr long double roundl(long double num) noexcept { @@ -86,4 +86,4 @@ namespace ccm } } // namespace ccm -/// @ingroup nearest +/// \ingroup nearest diff --git a/include/ccmath/math/nearest/trunc.hpp b/include/ccmath/math/nearest/trunc.hpp index a0a4dd4f..5a921eff 100644 --- a/include/ccmath/math/nearest/trunc.hpp +++ b/include/ccmath/math/nearest/trunc.hpp @@ -19,10 +19,10 @@ namespace ccm { /** - * @brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. - * @tparam T The type of the input. - * @param num The value to truncate. - * @return Returns a truncated value. + * \brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. + * \tparam T The type of the input. + * \param num The value to truncate. + * \return Returns a truncated value. */ template , bool> = true> constexpr T trunc(T num) noexcept { @@ -79,10 +79,10 @@ namespace ccm } /** - * @brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. - * @tparam Integer The type of the input. - * @param num The value to truncate. - * @return Returns a truncated value. + * \brief Returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. + * \tparam Integer The type of the input. + * \param num The value to truncate. + * \return Returns a truncated value. */ template , bool> = true> constexpr double trunc(Integer num) noexcept { @@ -90,9 +90,9 @@ namespace ccm } /** - * @brief Specialization for float that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. - * @param num The float to truncate. - * @return Returns a truncated float. + * \brief Specialization for float that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to x. + * \param num The float to truncate. + * \return Returns a truncated float. */ constexpr float truncf(float num) noexcept { @@ -100,10 +100,10 @@ namespace ccm } /** - * @brief Specialization for long double that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to + * \brief Specialization for long double that returns the integral value nearest to x with the magnitude of the integral value always less than or equal to * x. - * @param num The long double to truncate. - * @return Returns a truncated long double. + * \param num The long double to truncate. + * \return Returns a truncated long double. */ constexpr long double truncl(long double num) noexcept { diff --git a/include/ccmath/math/numbers.hpp b/include/ccmath/math/numbers.hpp index 77347de4..a65dc36e 100644 --- a/include/ccmath/math/numbers.hpp +++ b/include/ccmath/math/numbers.hpp @@ -13,7 +13,7 @@ #include /* - * @brief This namespace contains a set of constants that are useful for mathematical operations. + * \brief This namespace contains a set of constants that are useful for mathematical operations. */ namespace ccm::numbers { diff --git a/include/ccmath/math/power/cbrt.hpp b/include/ccmath/math/power/cbrt.hpp index 50f68521..72b4f772 100644 --- a/include/ccmath/math/power/cbrt.hpp +++ b/include/ccmath/math/power/cbrt.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Computes the cube root of a floating-point value. - * @tparam T Floating-point type. - * @param num Floating-point value. - * @return Cube root of num. + * \brief Computes the cube root of a floating-point value. + * \tparam T Floating-point type. + * \param num Floating-point value. + * \return Cube root of num. */ template , bool> = true> constexpr T cbrt(T num) noexcept { @@ -41,9 +41,9 @@ namespace ccm } /** - * @brief Computes the cube root of a float. - * @param num Floating-point value. - * @return Cube root of num as float. + * \brief Computes the cube root of a float. + * \param num Floating-point value. + * \return Cube root of num as float. */ constexpr float cbrtf(float num) noexcept { @@ -51,9 +51,9 @@ namespace ccm } /** - * @brief Computes the cube root of a long double. - * @param num Floating-point value. - * @return Cube root of num as long double. + * \brief Computes the cube root of a long double. + * \param num Floating-point value. + * \return Cube root of num as long double. */ constexpr long double cbrtl(long double num) noexcept { @@ -61,4 +61,4 @@ namespace ccm } } // namespace ccm -/// @ingroup power +/// \ingroup power diff --git a/include/ccmath/math/power/hypot.hpp b/include/ccmath/math/power/hypot.hpp index b539184a..9aa100b1 100644 --- a/include/ccmath/math/power/hypot.hpp +++ b/include/ccmath/math/power/hypot.hpp @@ -20,11 +20,11 @@ namespace ccm { /** - * @brief Computes the length of the hypotenuse from two coordinates. - * @tparam T Floating-point type. - * @param x First value. - * @param y Second value. - * @return sqrt(x*x + y*y) computed with scaling behavior suitable for floating-point range. + * \brief Computes the length of the hypotenuse from two coordinates. + * \tparam T Floating-point type. + * \param x First value. + * \param y Second value. + * \return sqrt(x*x + y*y) computed with scaling behavior suitable for floating-point range. */ template , bool> = true> constexpr T hypot(T x, T y) noexcept { @@ -42,12 +42,12 @@ namespace ccm } /** - * @brief Computes the length of the three-dimensional hypotenuse. - * @tparam T Floating-point type. - * @param x First value. - * @param y Second value. - * @param z Third value. - * @return sqrt(x*x + y*y + z*z) computed with the same scaling behavior as the 2-argument overload. + * \brief Computes the length of the three-dimensional hypotenuse. + * \tparam T Floating-point type. + * \param x First value. + * \param y Second value. + * \param z Third value. + * \return sqrt(x*x + y*y + z*z) computed with the same scaling behavior as the 2-argument overload. */ constexpr float hypot(float x, float y, float z) noexcept { @@ -75,10 +75,10 @@ namespace ccm } /** - * @brief Computes the hypotenuse for float values. - * @param x First value. - * @param y Second value. - * @return Hypotenuse length as float. + * \brief Computes the hypotenuse for float values. + * \param x First value. + * \param y Second value. + * \return Hypotenuse length as float. */ constexpr float hypotf(float x, float y) noexcept { @@ -86,10 +86,10 @@ namespace ccm } /** - * @brief Computes the hypotenuse for long double values. - * @param x First value. - * @param y Second value. - * @return Hypotenuse length as long double. + * \brief Computes the hypotenuse for long double values. + * \param x First value. + * \param y Second value. + * \return Hypotenuse length as long double. */ constexpr long double hypotl(long double x, long double y) noexcept { @@ -97,4 +97,4 @@ namespace ccm } } // namespace ccm -/// @ingroup power +/// \ingroup power diff --git a/include/ccmath/math/power/pow.hpp b/include/ccmath/math/power/pow.hpp index ff7d7851..0f5161e5 100644 --- a/include/ccmath/math/power/pow.hpp +++ b/include/ccmath/math/power/pow.hpp @@ -37,11 +37,11 @@ namespace ccm::detail namespace ccm { /** - * @brief Raises a floating-point base to a floating-point exponent. - * @tparam T Floating-point type. - * @param base Base value. - * @param exp Exponent value. - * @return base raised to exp. + * \brief Raises a floating-point base to a floating-point exponent. + * \tparam T Floating-point type. + * \param base Base value. + * \param exp Exponent value. + * \return base raised to exp. */ template , bool> = true> constexpr T pow(T base, T exp) { @@ -76,12 +76,12 @@ namespace ccm } /** - * @brief Raises arithmetic inputs to a power after applying the [c.math]/3 promotion rule. - * @tparam Arithmetic1 Arithmetic type of the base. - * @tparam Arithmetic2 Arithmetic type of the exponent. - * @param base Base value. - * @param exp Exponent value. - * @return base raised to exp in the promoted floating-point type. + * \brief Raises arithmetic inputs to a power after applying the [c.math]/3 promotion rule. + * \tparam Arithmetic1 Arithmetic type of the base. + * \tparam Arithmetic2 Arithmetic type of the exponent. + * \param base Base value. + * \param exp Exponent value. + * \return base raised to exp in the promoted floating-point type. */ template , bool> = true> constexpr T sqrt(T num) { @@ -42,10 +42,10 @@ namespace ccm } /** - * @brief Calculates the square root of a number. - * @tparam Integer Integer type. - * @param num Integer number. - * @return If no errors occur, square root of num (√num), is returned. + * \brief Calculates the square root of a number. + * \tparam Integer Integer type. + * \param num Integer number. + * \return If no errors occur, square root of num (√num), is returned. */ template , bool> = true> constexpr double sqrt(Integer num) { @@ -53,9 +53,9 @@ namespace ccm } /** - * @brief Calculates the square root of a number. - * @param num Floating-point number. - * @return If no errors occur, square root of num (√num), is returned. + * \brief Calculates the square root of a number. + * \param num Floating-point number. + * \return If no errors occur, square root of num (√num), is returned. */ constexpr float sqrtf(float num) { @@ -63,9 +63,9 @@ namespace ccm } /** - * @brief Calculates the square root of a number. - * @param num Floating-point number. - * @return If no errors occur, square root of num (√num), is returned. + * \brief Calculates the square root of a number. + * \param num Floating-point number. + * \return If no errors occur, square root of num (√num), is returned. */ constexpr long double sqrtl(long double num) { @@ -73,4 +73,4 @@ namespace ccm } } // namespace ccm -/// @ingroup power +/// \ingroup power diff --git a/include/ccmath/math/trig/acos.hpp b/include/ccmath/math/trig/acos.hpp index 7948119a..95893e88 100644 --- a/include/ccmath/math/trig/acos.hpp +++ b/include/ccmath/math/trig/acos.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Computes the principal value of the inverse cosine in radians. - * @tparam T Floating-point type. - * @param num Floating-point value, typically in [-1, 1]. - * @return Inverse cosine of num in radians. + * \brief Computes the principal value of the inverse cosine in radians. + * \tparam T Floating-point type. + * \param num Floating-point value, typically in [-1, 1]. + * \return Inverse cosine of num in radians. */ template , bool> = true> constexpr T acos(T num) { @@ -49,10 +49,10 @@ namespace ccm } /** - * @brief Computes inverse cosine of an integer input after promotion to double. - * @tparam Integer Integral type. - * @param num Input value. - * @return Inverse cosine in radians as double. + * \brief Computes inverse cosine of an integer input after promotion to double. + * \tparam Integer Integral type. + * \param num Input value. + * \return Inverse cosine in radians as double. */ template , bool> = true> constexpr double acos(Integer num) { @@ -60,9 +60,9 @@ namespace ccm } /** - * @brief Computes inverse cosine for float. - * @param num Input value. - * @return Inverse cosine in radians as float. + * \brief Computes inverse cosine for float. + * \param num Input value. + * \return Inverse cosine in radians as float. */ constexpr float acosf(float num) { @@ -70,9 +70,9 @@ namespace ccm } /** - * @brief Computes inverse cosine for long double. - * @param num Input value. - * @return Inverse cosine in radians as long double. + * \brief Computes inverse cosine for long double. + * \param num Input value. + * \return Inverse cosine in radians as long double. */ constexpr long double acosl(long double num) { @@ -80,4 +80,4 @@ namespace ccm } } // namespace ccm -/// @ingroup trig +/// \ingroup trig diff --git a/include/ccmath/math/trig/asin.hpp b/include/ccmath/math/trig/asin.hpp index 91fb36f4..9c793caf 100644 --- a/include/ccmath/math/trig/asin.hpp +++ b/include/ccmath/math/trig/asin.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Computes the principal value of the inverse sine in radians. - * @tparam T Floating-point type. - * @param num Floating-point value, typically in [-1, 1]. - * @return Inverse sine of num in radians. + * \brief Computes the principal value of the inverse sine in radians. + * \tparam T Floating-point type. + * \param num Floating-point value, typically in [-1, 1]. + * \return Inverse sine of num in radians. */ template , bool> = true> constexpr T asin(T num) { @@ -49,10 +49,10 @@ namespace ccm } /** - * @brief Computes inverse sine of an integer input after promotion to double. - * @tparam Integer Integral type. - * @param num Input value. - * @return Inverse sine in radians as double. + * \brief Computes inverse sine of an integer input after promotion to double. + * \tparam Integer Integral type. + * \param num Input value. + * \return Inverse sine in radians as double. */ template , bool> = true> constexpr double asin(Integer num) { @@ -60,9 +60,9 @@ namespace ccm } /** - * @brief Computes inverse sine for float. - * @param num Input value. - * @return Inverse sine in radians as float. + * \brief Computes inverse sine for float. + * \param num Input value. + * \return Inverse sine in radians as float. */ constexpr float asinf(float num) { @@ -70,9 +70,9 @@ namespace ccm } /** - * @brief Computes inverse sine for long double. - * @param num Input value. - * @return Inverse sine in radians as long double. + * \brief Computes inverse sine for long double. + * \param num Input value. + * \return Inverse sine in radians as long double. */ constexpr long double asinl(long double num) { @@ -80,4 +80,4 @@ namespace ccm } } // namespace ccm -/// @ingroup trig +/// \ingroup trig diff --git a/include/ccmath/math/trig/atan.hpp b/include/ccmath/math/trig/atan.hpp index a06a56df..848f7347 100644 --- a/include/ccmath/math/trig/atan.hpp +++ b/include/ccmath/math/trig/atan.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Computes the principal value of the inverse tangent in radians. - * @tparam T Floating-point type. - * @param num Floating-point value. - * @return Inverse tangent of num in radians. + * \brief Computes the principal value of the inverse tangent in radians. + * \tparam T Floating-point type. + * \param num Floating-point value. + * \return Inverse tangent of num in radians. */ template , bool> = true> constexpr T atan(T num) { @@ -49,10 +49,10 @@ namespace ccm } /** - * @brief Computes inverse tangent of an integer input after promotion to double. - * @tparam Integer Integral type. - * @param num Input value. - * @return Inverse tangent in radians as double. + * \brief Computes inverse tangent of an integer input after promotion to double. + * \tparam Integer Integral type. + * \param num Input value. + * \return Inverse tangent in radians as double. */ template , bool> = true> constexpr double atan(Integer num) { @@ -60,9 +60,9 @@ namespace ccm } /** - * @brief Computes inverse tangent for float. - * @param num Input value. - * @return Inverse tangent in radians as float. + * \brief Computes inverse tangent for float. + * \param num Input value. + * \return Inverse tangent in radians as float. */ constexpr float atanf(float num) { @@ -70,9 +70,9 @@ namespace ccm } /** - * @brief Computes inverse tangent for long double. - * @param num Input value. - * @return Inverse tangent in radians as long double. + * \brief Computes inverse tangent for long double. + * \param num Input value. + * \return Inverse tangent in radians as long double. */ constexpr long double atanl(long double num) { @@ -80,4 +80,4 @@ namespace ccm } } // namespace ccm -/// @ingroup trig +/// \ingroup trig diff --git a/include/ccmath/math/trig/atan2.hpp b/include/ccmath/math/trig/atan2.hpp index 4e5fc3ea..51ea729e 100644 --- a/include/ccmath/math/trig/atan2.hpp +++ b/include/ccmath/math/trig/atan2.hpp @@ -20,11 +20,11 @@ namespace ccm { /** - * @brief Computes the principal value of the arc tangent of y/x, using signs to determine quadrant. - * @tparam T Floating-point type. - * @param y Numerator component. - * @param x Denominator component. - * @return Angle in radians in the correct quadrant. + * \brief Computes the principal value of the arc tangent of y/x, using signs to determine quadrant. + * \tparam T Floating-point type. + * \param y Numerator component. + * \param x Denominator component. + * \return Angle in radians in the correct quadrant. */ template , bool> = true> constexpr T atan2(T y, T x) { @@ -50,10 +50,10 @@ namespace ccm } /** - * @brief Computes two-argument arc tangent for float inputs. - * @param y Numerator component. - * @param x Denominator component. - * @return Angle in radians as float. + * \brief Computes two-argument arc tangent for float inputs. + * \param y Numerator component. + * \param x Denominator component. + * \return Angle in radians as float. */ constexpr float atan2f(float y, float x) { @@ -61,10 +61,10 @@ namespace ccm } /** - * @brief Computes two-argument arc tangent for long double inputs. - * @param y Numerator component. - * @param x Denominator component. - * @return Angle in radians as long double. + * \brief Computes two-argument arc tangent for long double inputs. + * \param y Numerator component. + * \param x Denominator component. + * \return Angle in radians as long double. */ constexpr long double atan2l(long double y, long double x) { @@ -72,4 +72,4 @@ namespace ccm } } // namespace ccm -/// @ingroup trig +/// \ingroup trig diff --git a/include/ccmath/math/trig/cos.hpp b/include/ccmath/math/trig/cos.hpp index a2ece0f1..1167c6a1 100644 --- a/include/ccmath/math/trig/cos.hpp +++ b/include/ccmath/math/trig/cos.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Computes the cosine of an angle in radians. - * @tparam T Floating-point type. - * @param num Angle in radians. - * @return Cosine of num. + * \brief Computes the cosine of an angle in radians. + * \tparam T Floating-point type. + * \param num Angle in radians. + * \return Cosine of num. */ template , bool> = true> constexpr T cos(T num) { @@ -41,10 +41,10 @@ namespace ccm } /** - * @brief Computes the cosine of an integral angle value after promotion to double. - * @tparam Integer Integral type. - * @param num Angle in radians. - * @return Cosine of num as double. + * \brief Computes the cosine of an integral angle value after promotion to double. + * \tparam Integer Integral type. + * \param num Angle in radians. + * \return Cosine of num as double. */ template , bool> = true> constexpr double cos(Integer num) { @@ -52,9 +52,9 @@ namespace ccm } /** - * @brief Computes the cosine of a float angle in radians. - * @param num Angle in radians. - * @return Cosine as float. + * \brief Computes the cosine of a float angle in radians. + * \param num Angle in radians. + * \return Cosine as float. */ constexpr float cosf(float num) { @@ -62,9 +62,9 @@ namespace ccm } /** - * @brief Computes the cosine of a long double angle in radians. - * @param num Angle in radians. - * @return Cosine as long double. + * \brief Computes the cosine of a long double angle in radians. + * \param num Angle in radians. + * \return Cosine as long double. */ constexpr long double cosl(long double num) { @@ -72,4 +72,4 @@ namespace ccm } } // namespace ccm -/// @ingroup trig +/// \ingroup trig diff --git a/include/ccmath/math/trig/sin.hpp b/include/ccmath/math/trig/sin.hpp index d6373699..4e82b516 100644 --- a/include/ccmath/math/trig/sin.hpp +++ b/include/ccmath/math/trig/sin.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Computes the sine of an angle in radians. - * @tparam T Floating-point type. - * @param num Angle in radians. - * @return Sine of num. + * \brief Computes the sine of an angle in radians. + * \tparam T Floating-point type. + * \param num Angle in radians. + * \return Sine of num. */ template , bool> = true> constexpr T sin(T num) { @@ -41,10 +41,10 @@ namespace ccm } /** - * @brief Computes the sine of an integral angle value after promotion to double. - * @tparam Integer Integral type. - * @param num Angle in radians. - * @return Sine of num as double. + * \brief Computes the sine of an integral angle value after promotion to double. + * \tparam Integer Integral type. + * \param num Angle in radians. + * \return Sine of num as double. */ template , bool> = true> constexpr double sin(Integer num) { @@ -52,9 +52,9 @@ namespace ccm } /** - * @brief Computes the sine of a float angle in radians. - * @param num Angle in radians. - * @return Sine as float. + * \brief Computes the sine of a float angle in radians. + * \param num Angle in radians. + * \return Sine as float. */ constexpr float sinf(float num) { @@ -62,9 +62,9 @@ namespace ccm } /** - * @brief Computes the sine of a long double angle in radians. - * @param num Angle in radians. - * @return Sine as long double. + * \brief Computes the sine of a long double angle in radians. + * \param num Angle in radians. + * \return Sine as long double. */ constexpr long double sinl(long double num) { @@ -72,4 +72,4 @@ namespace ccm } } // namespace ccm -/// @ingroup trig +/// \ingroup trig diff --git a/include/ccmath/math/trig/tan.hpp b/include/ccmath/math/trig/tan.hpp index e80d5f29..c68f0738 100644 --- a/include/ccmath/math/trig/tan.hpp +++ b/include/ccmath/math/trig/tan.hpp @@ -20,10 +20,10 @@ namespace ccm { /** - * @brief Computes the tangent of an angle in radians. - * @tparam T Floating-point type. - * @param num Angle in radians. - * @return Tangent of num. + * \brief Computes the tangent of an angle in radians. + * \tparam T Floating-point type. + * \param num Angle in radians. + * \return Tangent of num. */ template , bool> = true> constexpr T tan(T num) { @@ -41,10 +41,10 @@ namespace ccm } /** - * @brief Computes the tangent of an integral angle value after promotion to double. - * @tparam Integer Integral type. - * @param num Angle in radians. - * @return Tangent of num as double. + * \brief Computes the tangent of an integral angle value after promotion to double. + * \tparam Integer Integral type. + * \param num Angle in radians. + * \return Tangent of num as double. */ template , bool> = true> constexpr double tan(Integer num) { @@ -52,9 +52,9 @@ namespace ccm } /** - * @brief Computes the tangent of a float angle in radians. - * @param num Angle in radians. - * @return Tangent as float. + * \brief Computes the tangent of a float angle in radians. + * \param num Angle in radians. + * \return Tangent as float. */ constexpr float tanf(float num) { @@ -62,9 +62,9 @@ namespace ccm } /** - * @brief Computes the tangent of a long double angle in radians. - * @param num Angle in radians. - * @return Tangent as long double. + * \brief Computes the tangent of a long double angle in radians. + * \param num Angle in radians. + * \return Tangent as long double. */ constexpr long double tanl(long double num) { @@ -72,4 +72,4 @@ namespace ccm } } // namespace ccm -/// @ingroup trig +/// \ingroup trig From a0ed4678d203936d5b0999e597e72efc5a2734bd Mon Sep 17 00:00:00 2001 From: ianpike Date: Mon, 24 Aug 2026 15:46:16 -0400 Subject: [PATCH 2/6] Minor clean up and improvements to docs --- CONTRIBUTING.md | 112 +++++++++++++++++---------------------------- CONVENTIONS.md | 79 ++++++++++++++------------------ docs/ULP_STATUS.md | 80 +++++++++++--------------------- 3 files changed, 102 insertions(+), 169 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 28f089f3..86437bfc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,25 +11,23 @@ Apache-2.0 WITH LLVM-exception. ## Project layout -A quick map of the repository: - -- `include/ccmath/` is the header-only library. Each function sits under its family - (`math/power/`, `math/trig/`, and so on), and the internals, including the - `builtin`, `gen`, and `rt` kernels, sit under `include/ccmath/internal/`. +- `include/ccmath/` is the header-only library. Each function sits under its family (`math/power/`, `math/trig/` and so on). The internals, including the + `builtin`, + `gen` and `rt` kernels, sit under `include/ccmath/internal/`. - `tests/` holds the test suites, with the ULP and conformance harnesses under `tests/shared/utils` and the MPFR oracles under `tests/shared/oracle`. -- `docs/` has the longer guides, and `cmake/`, `CMakeLists.txt`, and `CMakePresets.json` +- `docs/` has the longer guides. `cmake/`, `CMakeLists.txt` and `CMakePresets.json` drive the build. ## Core tenets -1. Always follow the C and C++ standard requirements for ``. Match the specified semantics, domain and range - handling, special values, and error reporting (errno and the floating-point exception flags). +1. Always follow the C and C++ standard requirements for ``. Match the specified semantics, domain and range handling, special values and error reporting + (errno and the floating-point exception flags). 2. Aim for a correctly rounded result in all four rounding modes, with documented compromises up to 4 ULP or fewer modes allowed to ship sooner. See [Accuracy and rounding goals](#accuracy-and-rounding-goals). 3. Prefer constexpr evaluation where the standard allows it (`gen` kernels, `static_assert` smoke). 4. Keep runtime performance in the same ballpark as the platform libm on the cases it covers. -5. Follow the existing dispatch layout (`builtin` / `gen` / `rt`, or impl-direct where the family already does). +5. Follow the existing dispatch layout (`builtin` / `gen` / `rt` or impl-direct where the family already does that). 6. Prefer portable generic kernels over platform forks when both satisfy the standard. 7. Mirror supported compiler behavior where the standard leaves details unspecified (for example `fpclassify` payload bits). @@ -42,31 +40,24 @@ A quick map of the repository: ## Accuracy and rounding goals The end goal for every function is a correctly rounded result, bit-for-bit the -infinitely precise value rounded to the destination type, in all four IEEE -rounding modes (`FE_TONEAREST`, `FE_DOWNWARD`, `FE_UPWARD`, `FE_TOWARDZERO`). That -is the bar the library is held to. +infinitely precise value rounded to the destination type, in all four IEEE rounding modes (`FE_TONEAREST`, `FE_DOWNWARD`, `FE_UPWARD`, `FE_TOWARDZERO`). We accept documented compromises that ship in-contract functionality sooner: - A function that is not yet correctly rounded may ship with a stated, tested error bound of no more than 4 ULP. The ULP suites under `tests/shared/utils` - check against the platform libm, and an MPFR oracle checks against the correctly + check against the platform libm and an MPFR oracle checks against the correctly rounded value where one is targeted. - A function may support fewer than the four rounding modes. Shipping `FE_TONEAREST` first, with the directed modes to follow, is fine. -A compromise only counts if it is written down. State the current ULP bound and -the supported rounding modes at the function, say what is missing, and leave a -`TODO:` plus a tracking issue so the gap stays visible. An undocumented one -is a bug. A documented one is a known limitation we can close later. +State the current ULP bound and the supported rounding modes at the function, say what is missing and leave a `TODO:` plus a tracking issue so the gap stays +visible. An undocumented compromise is a bug. A documented one is a known limitation we can close later. -Accuracy and standards conformance are the top priority. Performance is the next -priority after that. Once a function is correct it should stay in the same ballpark -as the platform libm where it is implemented, and the usual shape is a fast common -case backed by an accurate fallback rather than one slow implementation. When the -two genuinely conflict, correctness wins, but reach for a layered design before -trading away speed. +Accuracy and standards conformance come first and performance second. Once a function is correct it should stay in the same ballpark as the platform libm where +it is implemented. The usual shape is that the common case stays quick and we fall back to the accurate version. Reach for a layered design before trading away +speed. ## Build from the command line @@ -89,9 +80,9 @@ cmake --build --preset=build-ninja-gcc-debug ctest --preset=test-ninja-gcc-debug --output-on-failure ``` -Other configure presets are listed in `CMakePresets.json` (`ninja-clang-debug`, -`ninja-clang-release`, and similar). Pass `-DCMAKE_CXX_STANDARD=17` or `20` on the -configure line when you need a specific standard. +Other configure presets are in `CMakePresets.json` (`ninja-clang-debug`, +`ninja-clang-release` and similar). Names vary so read that file before assuming one exists. Pass `-DCMAKE_CXX_STANDARD=17` or `20` on the configure line when +you need a specific standard. ### Windows (Visual Studio 2022) @@ -104,8 +95,6 @@ cmake --build --preset=build-vs22-debug ctest --preset=test-vs22-debug --output-on-failure ``` -Preset names vary. Read `CMakePresets.json` before assuming a name exists locally. - ## First PR Fork the repo, then branch off `main`: @@ -118,9 +107,8 @@ git checkout -b ``` Build and test with the presets above. Implementation work stays under -`include/ccmath/`, follows the patterns already present in the function family you -touch, and does not add `` includes. When the change is ready, open a PR -against `main` as described in [Opening a pull request](#opening-a-pull-request). +`include/ccmath/`, follows the patterns already present in the function family you touch and does not add `` includes. When the change is ready, see +[Opening a pull request](#opening-a-pull-request). ## Issue and pull request workflow @@ -138,36 +126,28 @@ Releases are annotated tags `vMAJOR.MINOR.PATCH`, with release candidates as ### Filing an issue -Bug reports use the form under `.github/ISSUE_TEMPLATE`. For a numeric defect, -give the exact function, the affected evaluation (constexpr, runtime, SIMD, or -deterministic mode), the scalar type, and the exact input, expected, and actual +Bug reports use the form under `.github/ISSUE_TEMPLATE`. For a numeric defect, give the exact function, the affected evaluation (constexpr, runtime, SIMD or +deterministic mode), the scalar type and the exact input, expected and actual values. Hex float literals such as `0x1.0p+2` avoid precision loss. State the -active rounding mode and the source of truth for the expected result (MPFR, the -C++ standard, or a reference libm). +active rounding mode and the source of truth for the expected result (MPFR, the C++ standard or a reference libm). ### Agree on the approach first -Hard numeric work gets a design review on the issue before you implement it. For a -correctly-rounded function, or work on accuracy and ULP, rounding modes, or range -reduction, comment on the issue with your intended approach and the exact inputs you -plan to validate against, and wait for a maintainer to sign off before opening a -non-draft PR. A draft PR holding only the acceptance tests and a validation plan is a -good way to start that conversation. The point is to catch a wrong method in a short -comment rather than in a finished kernel, so you do not pour effort into an approach -that has to be redone. Likewise, hold off on implementing a new feature until a -maintainer approves the request. +Hard numeric work gets a design review on the issue before you implement it. For a correctly-rounded function or work on accuracy and ULP, rounding modes or +range +reduction, comment on the issue with your intended approach and the exact inputs you plan to validate against, then wait for a maintainer to sign off before +opening a +non-draft PR. A draft PR holding only the acceptance tests and a validation plan is a good way to start that conversation. Catching a wrong method in a short +comment is far cheaper than catching it in a finished kernel. Likewise, hold off on implementing a new feature until a maintainer approves the request. ### Opening a pull request PRs target `main` unless the fix is specific to a release branch. Keep the change minimal and aligned with the function family you touch. Use a one-line imperative -subject with no trailing period. Open the PR from a topic branch, since a PR from -your fork's `main`, `master`, or `develop` is closed automatically. +subject with no trailing period. Open the PR from a topic branch, since a PR from your fork's `main`, `master` or `develop` is closed automatically. -Before you request review, read your own diff once outside the editor, make sure -the warning-as-error build and the test presets are green, and write a short -summary of what changed and why. Small focused PRs get reviewed faster and more -carefully than large ones, so split unrelated work and leave drive-by refactors +Before you request review, read your own diff once outside the editor, make sure the warning-as-error build and the test presets are green and write a short +summary of what changed and why. Small focused PRs get reviewed faster and more carefully than large ones so split unrelated work and leave drive-by refactors to their own change. Once review starts, answer every comment, even if only to say it is done. When a reviewer misreads the code, prefer making the code or a why comment clearer over explaining only in the thread, since the next reader @@ -175,39 +155,31 @@ sees the code and not the discussion. ### Cite your sources -Most numeric work builds on existing research, so share what you drew on. In the -issue or PR, name the algorithm and the reference behind it, whether that is a paper, -a worked derivation, or a reference implementation you studied for its behavior. Link -any analysis or proof artifact too, a Sollya script, a Gappa proof, or the MPFR -comparison you validated against. A reviewer can check a method far faster when its -source is named than when they have to reconstruct it from the code, and a future -maintainer can follow the reasoning rather than guess at it. +Most numeric work builds on existing research so share what you drew on. In the +issue or PR, name the algorithm and the reference behind it, whether that is a paper, a worked derivation or a reference implementation you studied for its +behavior. Link any analysis or proof artifact too, a Sollya script, a Gappa proof or the MPFR +comparison you validated against. A reviewer can check a method far faster when its source is named than when they have to reconstruct it from the code. -Also, if any code is adapted from another source rather than written from scratch, name -that source in a comment on the code itself, not only in the PR. Only adapt from a source -whose license is compatible with Apache-2.0 WITH LLVM-exception. +Also, if any code is adapted from another source, name that source in a comment on the code itself, not only in the PR. Only adapt from a source whose license +is compatible with Apache-2.0 WITH LLVM-exception. ### Testing math changes -Tests go in the same change as the code. A few specifics matter for math -kernels and are easy to get wrong: +Tests go in the same change as the code. A few specifics for math kernels are easy to get wrong: -- Exercise the code you changed. A public call such as `ccm::pow` can resolve to - a compiler builtin at runtime, so a plain runtime test may never reach the +- Exercise the code you changed. A public call such as `ccm::pow` can resolve to a compiler builtin at runtime so a plain runtime test may never reach the ccmath kernel. Drive the kernel through a `constexpr` context (a `static_assert`) or by calling the generic kernel directly (`ccm::gen::*_gen`). -- Validate numeric changes against an oracle. Use MPFR, Sollya, or Gappa and note - the source of truth rather than eyeballing a value or trusting a system libm at +- Validate numeric changes against an oracle. Use MPFR, Sollya or Gappa and name the source of truth instead of eyeballing a value or trusting a system libm at a boundary. The MPFR oracle harnesses under `tests/shared/oracle` are the pattern to follow. -- Test boundaries, not a single point. Cover overflow, underflow, subnormals, and +- Test boundaries, not a single point. Cover overflow, underflow, subnormals and signed zero, along with the worst-case inputs for the function, not just one representative value. - Cover every type the function is instantiated for, `float` and `double` at a minimum. - For exception or errno behavior, use the fenv fixture at - `tests/shared/utils/fenv_fixture.hpp`. The ULP and conformance suites live under - `tests/shared/utils`. + `tests/shared/utils/fenv_fixture.hpp`. ## More detail diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 36a6803a..03598ac7 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -1,8 +1,7 @@ # CCMath conventions -The code-level companion to [CONTRIBUTING.md](CONTRIBUTING.md), which has the tenets, -accuracy policy, and PR workflow. These are the patterns you will see across the -headers, and the ones easy to get wrong. +The code-level companion to [CONTRIBUTING.md](CONTRIBUTING.md), which has the tenets, accuracy policy and PR workflow. These are the patterns across the headers +and the ones easiest to make mistakes with. ## Project layout @@ -24,15 +23,14 @@ graph LR Public headers live under `math/`, one per function by family. Everything else is private under `internal/`. Families: `basic`, `compare`, `expo`, `fmanip`, `hyper`, `misc`, `nearest`, `power`, `special`, `trig`, matching -[cppreference ``](https://en.cppreference.com/w/cpp/header/cmath). The key part -is the three-kernel split at the bottom: nearly every function has a `builtin`, a -`gen`, and an `rt` kernel, and which runs depends on where you call it from. +[cppreference ``](https://en.cppreference.com/w/cpp/header/cmath). The kernel split at the bottom matters the most. Also, nearly every function has a +`builtin`, a `gen` and an +`rt` kernel. ## Dispatch -The public header owns the choice, and you should not add layers between it and the -kernels. Every public `ccm` function is `constexpr` and routes on one question: is -this a constant expression? +The public header owns the choice of what kernel we call internally. Do not add layers between it and the kernels. Every public `ccm` function is `constexpr` +and routes based on if an expression is a constant expression or not. ```mermaid flowchart TD @@ -43,9 +41,8 @@ flowchart TD B -- "runtime" --> F["ccm::rt::*_rt"] ``` -At compile time, use the constexpr builtin if one exists (constant evaluation rounds -to nearest, so it is correct), otherwise the generic kernel. At runtime, always `rt`, -since a builtin lowers to libm and we trust it only under `FE_TONEAREST`. That is also +At compile time, use the constexpr builtin if one exists and you can validate that it will use the correct rounding mode, otherwise use the generic kernel. At +runtime, always use `rt`, since a builtin lowers to libm and we trust it only under `FE_TONEAREST`. That is also why each non-generic runtime kernel sits in its own `*_rt.hpp` and guards the rounding mode. `include/ccmath/math/power/pow.hpp` is the shape to copy: @@ -68,28 +65,24 @@ constexpr T pow(T base, T exp) ## Standards conformance -CCMath is a drop-in ``: observable behavior matches what the C and C++ -standards specify, so swapping `std::` for `ccm::` changes no result. That is why the +CCMath is a drop-in ``: observable behavior matches what the C and C++ standards specify so swapping `std::` for `ccm::` changes no result. That is why +the edge cases get the same care as ordinary inputs. -The arithmetic overloads apply the [c.math]/3 promotion rule, promoting mixed inputs -to the common floating type and integers to `double`, so `ccm::pow(2, 3.0)` matches -the standard call (`pow.hpp` keeps this in `detail::cmath_pow_result_t`). Special -values follow IEEE 754 and Annex F: NaN propagation, the standard-pinned sign of zero, +The arithmetic overloads apply the [c.math]/3 promotion rule, promoting mixed inputs to the common floating type and integers to `double` so `ccm::pow(2, 3.0)` +matches +the standard call (`pow.hpp` keeps this in `detail::cmath_pow_result_t`). Special values follow IEEE 754 and Annex F: NaN propagation, the standard-pinned sign +of zero and the infinities. Where the standard leaves a result implementation-defined (some -`fmod` NaN cases, the `fpclassify` payload bits), we match the supported compilers -rather than invent one. +`fmod` NaN cases, the `fpclassify` payload bits), we match the supported compilers instead of inventing one. -Errors follow the C `math_errhandling` model, `errno` plus a floating-point exception -flag, so existing error checks keep working (mechanics under +Errors follow the C `math_errhandling` model: `errno` plus a floating-point exception flag. Existing error checks keep working (mechanics under [Errors and rounding](#errors-and-rounding)). Recent C++ revisions also made `` -usable in constant expressions, which is what CCMath already does, so there is no -separate constexpr API. +usable in constant expressions. CCMath already does that so there is no separate constexpr API. ## Namespaces -The public API is `ccm`, names matching ``. The three dispatch layers each get -a namespace, and the rest is internal support. +The public API is `ccm`, names matching ``. Each dispatch layer gets a namespace and the rest is internal support. | Namespace | Role | Public | |--------------------------------------------------------------|-----------------------------------------------------------|--------| @@ -105,34 +98,32 @@ If it is not in `ccm` proper, it is not API and can change in any commit. ## Naming and macros Names follow `` and the surrounding code. Functions are snake_case (`pow`, -`pow_gen`), types PascalCase (`FPBits`, `NormalizedFloat`), and aliases snake_case +`pow_gen`), types PascalCase (`FPBits`, `NormalizedFloat`) and aliases snake_case with a `_t` suffix (`fp_bits_t`, `half_width_t`). Template parameters are `T` for the primary type, descriptive PascalCase otherwise (`Integer`, `Real`). -Macros use `CCMATH_` for public, versioning, and compiler config, and `CCM_` for -internal use and the `CCM_CONFIG_*` flags. No other prefixes. Leave a `TODO:` only -when a gap genuinely cannot be closed in the change. +Macros use `CCMATH_` for public, versioning and compiler config. `CCM_` is for internal use and the `CCM_CONFIG_*` flags. No other prefixes. Leave a `TODO:` +only when a gap genuinely cannot be closed in the change. ## Support utilities Check `ccm::support` before hand-rolling anything low-level. `FPBits` (`fp_bits_t`) -takes a float apart into sign, exponent, and mantissa, and builds specials like -`quiet_nan()`, so a raw `bit_cast` is rarely what you want. Use +takes a float apart into sign, exponent and mantissa and builds specials like +`quiet_nan()`. A raw `bit_cast` is rarely what you want. Use `ccm::support::is_constant_evaluated()` for the compile-time branch, not the `std::` one, since C++17 is the floor. Fused multiply-add and the error-free transforms on it live in `ccm::support::multiply_add`. ## Errors and rounding -CCMath never throws. A domain, pole, or range error sets `errno` and raises the +CCMath never throws. A domain, pole or range error sets `errno` and raises the matching floating-point exception flag through the `ccm::support::fenv` helpers (`set_errno_if_required`, `raise_except_if_required`), which are config-guarded and stay quiet during constant evaluation. Report errors that way, not with a C++ exception. -Kernels honor all four IEEE rounding modes at runtime, so read the active mode and -adjust the bit work or the final rounding around it. Never call `fesetround` inside a -kernel, and do not use `#pragma STDC FENV_ACCESS`. The accuracy bar and the +Kernels honor all four IEEE rounding modes at runtime so read the active mode and +adjust the bit work or the final rounding around it. Never call `fesetround` inside a kernel and do not use `#pragma STDC FENV_ACCESS`. The accuracy bar and the documented-compromise policy are in [CONTRIBUTING.md](CONTRIBUTING.md#accuracy-and-rounding-goals). @@ -141,28 +132,26 @@ documented-compromise policy are in Each header opens with the SPDX license block (Apache-2.0 WITH LLVM-exception) and `#pragma once`. Project headers come first, as quoted includes from the include root (`"ccmath/..."`), then standard headers in angle brackets. No `` -under `include/`: CCMath is the `` here, so use the internal `builtin`, `gen`, +under `include/`: CCMath is the `` here so use the internal `builtin`, `gen` and `rt` kernels. ## C++ usage -C++17 is the minimum, so gate any newer feature on the standard it needs, not on what +C++17 is the minimum so gate any newer feature on the standard it needs, not on what a given compiler accepts. Casts are C++-style only (`static_cast`, `reinterpret_cast`, `const_cast`, `bit_cast`), never the C form. Otherwise it is ordinary modern C++: the -`_v` and `_t` aliases, `enum class`, `using` over `typedef`, and brace initialization. +`_v` and `_t` aliases, `enum class`, `using` over `typedef` and brace initialization. -Two ccmath specifics. `[[nodiscard]]` goes on internal helpers and accessors, not the -public entry points, which mirror the unmarked `` signatures. Compiler and +`[[nodiscard]]` goes on internal helpers and accessors, not the public entry points, which mirror the unmarked `` signatures. Compiler and platform checks go through the `internal/predef` wrappers (`has_builtin`, `has_attribute`, `likely`, `unlikely`, `assume`), not raw `__GNUC__` or `_MSC_VER`. Everything builds clean under `-Werror` with aggressive warnings. ## Comments -Public entry points get Doxygen: `\brief`, `\param` or `\tparam`, and `\return`. -Commands take the backslash form throughout. Doxygen accepts `@brief` as a synonym and -warns about neither, so nothing in the toolchain catches a mixed file. Keeping one form is -a review matter, and the tree is currently uniform. +Public entry points get Doxygen: `\brief`, `\param` or `\tparam` and `\return`. Use the backslash form throughout. Doxygen treats `@brief` as a synonym and +warns about neither so nothing in the toolchain catches a mixed file. Keeping one form is a review matter. + Implementation comments are for the why, not the what: the constraint, the tradeoff, the reason a builtin is or is not trusted. `pow.hpp` is a good model. diff --git a/docs/ULP_STATUS.md b/docs/ULP_STATUS.md index 23d8df31..c4618574 100644 --- a/docs/ULP_STATUS.md +++ b/docs/ULP_STATUS.md @@ -16,52 +16,31 @@ Every function falls into one of five classes. | Not a rounding function | Returns a bool, an int, or a classification, so ULP does not apply. The comparison family is here. | | Not implemented | The header exists but there is no implementation yet. The hyperbolic and special-function families are here. | -A few notes on the numbers in the tables below. - -These numbers are for ccmath's own generic kernels, not for whatever the public function lowers to -at runtime. On a clang or gcc build the public functions hand the runtime round-to-nearest case to -a compiler builtin, which is the system libm and is often more accurate than the figures here. We -measure the generic kernel on purpose, because it is ccmath's own code and it is what runs at -compile time, in the directed rounding modes, in deterministic mode, and anywhere a builtin is not -available. So treat these as the portable worst case ccmath is responsible for, not as what a clang -or gcc runtime build delivers in round-to-nearest. - -Max ULP is the largest error observed between the kernel result and the correctly rounded value -over the measured corpus. A value of 0 means every result was the nearest representable value. The -reference is MPFR evaluated at high precision and rounded once to the target type, so it is the -true correctly rounded answer and not another library's result. - -The accuracy families, which are Exponential, Power, Trigonometric, and Miscellaneous, break each -function into its three type variants: the float f-suffix variant (expf, powf, sinf), the plain double -variant (exp, pow, sin), and the long double variant (expl, powl, sinl). The other families are exact -or not implemented, which holds for every type, so they stay one row each. - -Only binary32 is measured so far. Every binary32 number comes from an exhaustive sweep over all bit -patterns, which makes its max a proven worst case in round-to-nearest. binary64 is a larger job and is -measured next, and long double after that, so both show up as pending until then. - -Each variant row names the exact kernel it runs in the Tested kernel column. The gen kernels are -templates, so the same symbol instantiates at each type, for example ccm::gen::pow_gen and -ccm::gen::pow_gen. The asin, acos, atan, tgamma, and lgamma kernels come as a separate float -and double function with no dedicated long double kernel, so their long double variant uses the double -kernel. These are ccmath's own generic kernels under --impl=gen, the implementation the public function -falls back to in the directed modes, at compile time, and in deterministic mode. The same harness can -point at the public path or the system libm with --impl=public or --impl=libm, but those are not what -this page reports. - -The numbers are measured in round-to-nearest, the default mode. Which rounding modes each function -handles at runtime is tracked separately in ROUNDING_STATUS.md. - -To refresh these tables, run the sweep and then the generator. +The numbers measure ccmath's generic kernels (--impl=gen) in round-to-nearest, not the public function. On clang and gcc the public function hands runtime +round-to-nearest to a compiler builtin, the system libm, which is often more accurate than the figures here. The generic kernel is what runs at compile time, in +the directed modes, in deterministic mode and anywhere no builtin is available. These are the portable worst case. The harness can also measure --impl=public or +--impl=libm, but this page does not report those. + +Max ULP is the largest error observed between the kernel result and the correctly rounded value over the measured corpus. 0 means every result was the nearest +representable value. The reference is MPFR at high precision, rounded once to the target type. That is the true answer and not another library's result. + +The Exponential, Power, Trigonometric and Miscellaneous families split each function into its float, double and long double variant (expf, exp, expl). The rest +are exact or not implemented at every type so they stay one row each. + +Only binary32 is measured. Its sweep is exhaustive over all bit patterns so the max is a proven worst case. binary64 and long double are pending. + +The Tested kernel column names the symbol that runs. Generic kernels are templates so one symbol instantiates at each type (ccm::gen::pow_gen, ccm::gen:: +pow_gen). asin, acos, atan, tgamma and lgamma have separate float and double functions with no long double kernel so their long double variant uses the +double one. + +To refresh the tables, run the sweep and then the generator. ``` tools/measure_ulp.sh --exhaustive-float python3 tools/ulp_status.py ``` -The function classes and the list of measured functions live in tools/ulp_status_registry.json. -A function with no completed campaign summary shows up as pending, so the tables never claim a -number that was not actually measured. +Function classes and the measured-function list live in tools/ulp_status_registry.json. A function with no completed campaign summary shows up as pending. ## Accuracy by function @@ -255,18 +234,12 @@ number that was not actually measured. ## Scope and caveats -This pass measures binary32. binary64 is the next job, and long double after that, so both show up as -pending. The accuracy families list all three variants so the gaps are explicit rather than implied. - -The atan2, hypot, and lerp functions take more than one argument, so they wait on a binary and -ternary sweep and are marked pending. pow is measured separately, and its detailed campaign is in -the appendix below. +atan2, hypot and lerp take more than one argument so they wait on a binary and ternary sweep and are marked pending. pow is measured separately, with its +campaign in the appendix. -Near a zero or a pole, ULP error is governed by conditioning rather than by rounding, because a -tiny absolute error sits across many representable values when the result itself is near zero or -very large. Functions with poles or zeros in range, such as tan near its poles and lgamma near its -zeros at 1 and 2, can show a large max and average that reflect how close the corpus landed to -those spots rather than the kernel's typical accuracy. +Near a zero or a pole, conditioning governs ULP error, not rounding, because a tiny absolute error spans many representable values when the result is near zero +or very large. Functions with poles or zeros in range, such as tan at its poles and lgamma at its zeros at 1 and 2, can show a large max and average that +reflect where the corpus landed, not the kernel's typical accuracy. ## Appendix: pow campaign detail @@ -280,9 +253,8 @@ same in all four IEEE rounding modes on the corpora below. | MPFR hard failures | Cases that exceed the campaign 4 ULP ceiling, or disagree with MPFR on NaN, infinity, or signed zero. Within-ceiling results that miss the 0.5 ULP correctly-rounded target are tracked separately and are not counted here. | | CORE-MATH bit mismatches | Cases where ccm bits differ from the CORE-MATH cr_* reference in the active rounding mode. This is not a ULP threshold. Cases where a higher-precision cross-check shows ccm is correct and the CORE-MATH oracle is wrong are excluded. | -Per-case logs with base, exponent, actual, and expected bit patterns live under -[tests/rigorous/oracle_logs/README.md](../tests/rigorous/oracle_logs/README.md). Re-run the -rigorous oracle ctest targets to refresh them. +Per-case logs (base, exponent, actual and expected bit patterns) live under +[tests/rigorous/oracle_logs/README.md](../tests/rigorous/oracle_logs/README.md). Re-run the rigorous oracle ctest targets to refresh them. | Function | Configuration | MPFR cases | MPFR Max ULP | MPFR hard failures | CORE-MATH cases | CORE-MATH Max ULP | CORE-MATH bit mismatches | Notes | |-----------|---------------------------------------------|------------|--------------|--------------------|-----------------|-------------------|--------------------------|-----------------------------------------------------------------------------------| From 9191bbb082b0270f41a8eee1f54349fcb5b1faab Mon Sep 17 00:00:00 2001 From: ianpike Date: Mon, 24 Aug 2026 15:46:40 -0400 Subject: [PATCH 3/6] Formatting --- examples/item/hypot_distance.run.xml | 7 +++++-- examples/item/unit_circle.run.xml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/item/hypot_distance.run.xml b/examples/item/hypot_distance.run.xml index d5df0946..6550a2a4 100644 --- a/examples/item/hypot_distance.run.xml +++ b/examples/item/hypot_distance.run.xml @@ -1,7 +1,10 @@ - + - + \ No newline at end of file diff --git a/examples/item/unit_circle.run.xml b/examples/item/unit_circle.run.xml index 468d7886..43b08984 100644 --- a/examples/item/unit_circle.run.xml +++ b/examples/item/unit_circle.run.xml @@ -1,7 +1,10 @@ - + - + \ No newline at end of file From 345c296abc28a6d8f5a8ea0e8ba04c026664764d Mon Sep 17 00:00:00 2001 From: ianpike Date: Mon, 24 Aug 2026 15:53:17 -0400 Subject: [PATCH 4/6] Remove some reqs --- .clang-format | 2 -- 1 file changed, 2 deletions(-) diff --git a/.clang-format b/.clang-format index 25eea8a6..9056568b 100644 --- a/.clang-format +++ b/.clang-format @@ -21,7 +21,6 @@ AlwaysBreakBeforeMultilineStrings: true AlwaysBreakTemplateDeclarations: MultiLine BasedOnStyle: LLVM BinPackArguments: false -BinPackParameters: false BraceWrapping: AfterCaseLabel: true AfterClass: true @@ -45,7 +44,6 @@ BreakAfterAttributes: Never BreakBeforeBraces: Custom ColumnLimit: 160 CompactNamespaces: false -Cpp11BracedListStyle: false DerivePointerAlignment: false FixNamespaceComments: true IncludeBlocks: Regroup From 90cf592cbf58b0f725c6c229213051f9a07834d6 Mon Sep 17 00:00:00 2001 From: ianpike Date: Mon, 31 Aug 2026 00:24:03 -0400 Subject: [PATCH 5/6] Push work --- cmake/config/BuildManifest.cmake | 4 ++-- meson_options.txt | 4 ++-- premake5.lua | 4 ++-- tests/conformance/fenv_disabled_test.cpp | 9 ++++----- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cmake/config/BuildManifest.cmake b/cmake/config/BuildManifest.cmake index 874cf195..3dae20ba 100644 --- a/cmake/config/BuildManifest.cmake +++ b/cmake/config/BuildManifest.cmake @@ -40,7 +40,7 @@ set(CCMATH_LIBRARY_MANIFEST_OPTION_disable_fenv_CMAKE_INVERT FALSE) set(CCMATH_LIBRARY_MANIFEST_OPTION_disable_fenv_MESON_OPTION disable_fenv) set(CCMATH_LIBRARY_MANIFEST_OPTION_disable_fenv_DEFINE CCM_CONFIG_DISABLE_FENV) set(CCMATH_LIBRARY_MANIFEST_OPTION_disable_fenv_DESCRIPTION - "Completely disable the host floating-point environment: drop every and include, assume round-to-nearest at runtime, and signal no fp-exceptions (auto-enabled when no host fenv header exists)") + "Disable explicit ccmath host-fenv access: drop every and include, assume round-to-nearest for ccmath routing, and perform no explicit ccmath fp-exception signaling (ordinary arithmetic may still set hardware flags)") set(CCMATH_LIBRARY_MANIFEST_OPTION_freestanding_CMAKE_VAR CCMATH_FREESTANDING) set(CCMATH_LIBRARY_MANIFEST_OPTION_freestanding_CMAKE_DEFAULT OFF) @@ -64,7 +64,7 @@ set(CCMATH_LIBRARY_MANIFEST_OPTION_deterministic_CMAKE_INVERT FALSE) set(CCMATH_LIBRARY_MANIFEST_OPTION_deterministic_MESON_OPTION deterministic) set(CCMATH_LIBRARY_MANIFEST_OPTION_deterministic_DEFINE CCM_CONFIG_DETERMINISTIC) set(CCMATH_LIBRARY_MANIFEST_OPTION_deterministic_DESCRIPTION - "Produce bit-identical cross-hardware math: route transcendentals through the generic kernels (no libm), force the correctly-rounded FMA path, disable runtime SIMD, and evaluate long double in double precision (GCC/Clang)") + "Select deterministic source routing: use generic transcendental kernels instead of libm, force the correctly-rounded FMA path, disable runtime SIMD, and evaluate long double in double precision (GCC/Clang); this option alone does not guarantee cross-hardware bit identity") function(ccmath_manifest_declare_library_options) foreach (_ccmath_manifest_key IN LISTS CCMATH_LIBRARY_MANIFEST_OPTION_KEYS) diff --git a/meson_options.txt b/meson_options.txt index 82eda77f..22a40682 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,7 +3,7 @@ option('enable_runtime_simd', type: 'boolean', value: true, description: 'Enable SIMD optimization for runtime evaluation (does not affect compile-time)') option('disable_errno', type: 'boolean', value: false, description: 'Disable the use of errno in ccmath during runtime (may lead to faster evaluations but is non-standard)') -option('disable_fenv', type: 'boolean', value: false, description: 'Completely disable the host floating-point environment: drop every and include, assume round-to-nearest at runtime, and signal no fp-exceptions (auto-enabled when no host fenv header exists)') +option('disable_fenv', type : 'boolean', value : false, description : 'Disable explicit ccmath host-fenv access: drop every and include, assume round-to-nearest for ccmath routing, and perform no explicit ccmath fp-exception signaling (ordinary arithmetic may still set hardware flags)') option('freestanding', type: 'boolean', value: false, description: 'Build for a freestanding C++ environment: restrict to freestanding-conformant headers, dropping the test-only path in the runtime SIMD layer and the MSVC system-math path (auto-enabled when __STDC_HOSTED__ is 0)') option('disable_reduced_precision_powl', type: 'boolean', value: false, description: 'Return quiet NaN from powl on non-binary80 long double instead of the default reduced-precision double fallback') -option('deterministic', type: 'boolean', value: false, description: 'Produce bit-identical cross-hardware math: route transcendentals through the generic kernels (no libm), force the correctly-rounded FMA path, disable runtime SIMD, and evaluate long double in double precision (GCC/Clang)') +option('deterministic', type : 'boolean', value : false, description : 'Select deterministic source routing: use generic transcendental kernels instead of libm, force the correctly-rounded FMA path, disable runtime SIMD, and evaluate long double in double precision (GCC/Clang); this option alone does not guarantee cross-hardware bit identity') diff --git a/premake5.lua b/premake5.lua index 19c0fe3d..8d3a8bb8 100644 --- a/premake5.lua +++ b/premake5.lua @@ -30,7 +30,7 @@ newoption { newoption { trigger = "ccmath-disable-fenv", - description = "Completely disable the host floating-point environment: drop every and include, assume round-to-nearest at runtime, and signal no fp-exceptions (auto-enabled when no host fenv header exists)", + description = "Disable explicit ccmath host-fenv access: drop every and include, assume round-to-nearest for ccmath routing, and perform no explicit ccmath fp-exception signaling (ordinary arithmetic may still set hardware flags)", allowed = { { "true", "Enable" }, { "false", "Disable" } }, default = "false", } @@ -51,7 +51,7 @@ newoption { newoption { trigger = "ccmath-deterministic", - description = "Produce bit-identical cross-hardware math: route transcendentals through the generic kernels (no libm), force the correctly-rounded FMA path, disable runtime SIMD, and evaluate long double in double precision (GCC/Clang)", + description = "Select deterministic source routing: use generic transcendental kernels instead of libm, force the correctly-rounded FMA path, disable runtime SIMD, and evaluate long double in double precision (GCC/Clang); this option alone does not guarantee cross-hardware bit identity", allowed = { { "true", "Enable" }, { "false", "Disable" } }, default = "false", } diff --git a/tests/conformance/fenv_disabled_test.cpp b/tests/conformance/fenv_disabled_test.cpp index a06bd5d0..1826de77 100644 --- a/tests/conformance/fenv_disabled_test.cpp +++ b/tests/conformance/fenv_disabled_test.cpp @@ -11,8 +11,8 @@ // Built with CCM_CONFIG_DISABLE_FENV so that host_fenv.hpp resolves to its no-fenv tier, the same // state a host with no and no (such as the PS5 toolchain) ends up in. The suite // confirms that the headers compile without the host fenv and that the documented fallback contract -// holds: runtime rounding pinned to round-to-nearest, fp-exception signaling reduced to a no-op, and -// errno handling still compilable. +// holds: runtime routing pinned to round-to-nearest, explicit ccmath exception signaling disabled, +// and errno handling still compilable. Ordinary arithmetic may still set hardware flags. #include "ccmath/internal/support/fenv/fenv_support.hpp" #include "ccmath/internal/support/fenv/host_fenv.hpp" @@ -42,10 +42,9 @@ TEST(CcmathFenvDisabledTests, RoundingModeIsPinnedToNearest) EXPECT_FALSE(fenv::rounding_mode_is_round_to_zero()); } -TEST(CcmathFenvDisabledTests, ExceptionSignalingIsNoOp) +TEST(CcmathFenvDisabledTests, ExplicitExceptionSignalingIsNoOp) { - // The fp-exception entry points still exist and compile, but they do nothing, and the error - // handling mask does not carry the exception bit when the host fenv is unavailable. + // The explicit ccmath entry points do nothing when the host fenv is unavailable. EXPECT_EQ(fenv::raise_except_if_required(FE_OVERFLOW | FE_INVALID), 0); EXPECT_EQ(fenv::set_except_if_required(FE_INEXACT), 0); EXPECT_EQ(fenv::ccm_math_err_handling() & fenv::get_mode(fenv::ccm_math_err_mode::eErrnoExcept), 0); From 135335a43a5118a93b8c75460f58109617c0ed70 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 31 Aug 2026 12:59:45 +0000 Subject: [PATCH 6/6] ci: apply clang-format --- benchmarks/shared/inputs.hpp | 2 +- benchmarks/src/math/power/sqrt.bench.cpp | 4 +- examples/src/decibel_gain.cpp | 2 +- examples/src/hypot_distance.cpp | 4 +- examples/src/rounding_edge_cases.cpp | 2 +- examples/src/signed_magnitude.cpp | 6 +- examples/src/unit_circle.cpp | 6 +- fuzzing/shared/harness.hpp | 2 +- include/ccmath/ext/clamp.hpp | 4 +- .../ccmath/internal/math/common/misc/lerp.hpp | 4 +- .../math/common/nearest/nearbyint.hpp | 2 +- .../generic/func/fmanip/nextafter_gen.hpp | 3 +- .../math/generic/func/misc/lerp_gen.hpp | 4 +- .../generic/func/power/pow_impl/pow_impl.hpp | 73 +- .../func/power/pow_impl/pow_simd_impl.hpp | 16 +- .../generic/func/power/pow_impl/powf_data.hpp | 642 +++++++++--------- .../generic/func/power/pow_impl/powf_impl.hpp | 53 +- .../func/power/pow_impl/powf_simd_impl.hpp | 7 +- .../func/power/pow_impl/powl_ld80_kernel.hpp | 8 +- .../func/power/pow_impl/powl_ld80_tables.hpp | 10 +- .../math/generic/func/power/powl_gen.hpp | 10 +- .../math/generic/func/power/sqrt_gen.hpp | 4 +- .../ccmath/internal/math/runtime/pp/flags.hpp | 7 +- .../ccmath/internal/math/runtime/pp/simd.hpp | 9 +- .../internal/math/runtime/pp/vec_ext.hpp | 10 +- .../ccmath/internal/math/runtime/pp/where.hpp | 4 +- .../math/runtime/simd/func/impl/sse2/pow.hpp | 8 +- .../math/runtime/simd/func/impl/sse4/pow.hpp | 8 +- .../math/runtime/simd/instructions/avx2.hpp | 48 +- .../math/runtime/simd/instructions/neon.hpp | 6 +- .../math/runtime/simd/instructions/scalar.hpp | 4 +- .../math/runtime/simd/instructions/sse2.hpp | 24 +- .../math/runtime/simd/instructions/sse4.hpp | 24 +- .../internal/math/runtime/simd/pack.hpp | 4 +- .../math/runtime/simd/vector_size.hpp | 4 +- include/ccmath/internal/support/bits.hpp | 7 +- .../support/common_math_constants.hpp | 537 ++++++++------- include/ccmath/internal/support/fp/fma.hpp | 12 +- .../ccmath/internal/support/helpers/exp10.hpp | 14 +- include/ccmath/internal/types/big_int.hpp | 18 +- .../ccmath/internal/types/double_double.hpp | 10 +- .../ccmath/internal/types/dyadic_float.hpp | 6 +- include/ccmath/internal/types/number_pair.hpp | 2 +- .../ccmath/internal/types/triple_double.hpp | 6 +- .../math/basic/impl/nan_double_impl.hpp | 4 +- .../ccmath/math/basic/impl/nan_float_impl.hpp | 4 +- .../math/basic/impl/nan_ldouble_impl.hpp | 4 +- include/ccmath/math/expo/impl/exp2_data.hpp | 12 +- include/ccmath/math/expo/impl/exp_data.hpp | 12 +- include/ccmath/math/expo/impl/log2_data.hpp | 179 ++--- include/ccmath/math/expo/impl/log_data.hpp | 290 ++++---- include/ccmath/math/misc/impl/gamma_data.hpp | 10 +- include/ccmath/math/misc/lerp.hpp | 4 +- include/ccmath/math/nearest/nearbyint.hpp | 2 +- include/ccmath/math/nearest/rint.hpp | 2 +- include/ccmath/math/power/hypot.hpp | 4 +- include/ccmath/math/power/pow.hpp | 6 +- .../ccmath/math/trig/impl/inv_trig_data.hpp | 14 +- .../math/trig/impl/sincos_double_data.hpp | 27 +- .../math/trig/impl/sincos_float_data.hpp | 20 +- .../math/trig/impl/sincos_payne_hanek.hpp | 4 +- .../common/accuracy/unary_mpfr_runner.hpp | 10 +- showcase/common/backend_traits.hpp | 8 +- showcase/common/ccmath_paths.hpp | 24 +- tests/conformance/fenv_disabled_test.cpp | 2 +- tests/conformance/pow_errno_fenv_test.cpp | 14 +- tests/conformance/pow_path_config_test.cpp | 4 +- tests/conformance/powl_platform_test.cpp | 4 +- .../conformance/rounding_conformance_test.cpp | 23 +- tests/conformance/worst_case_ulp_test.cpp | 10 +- .../proofs/math/power/pow_accuracy_probe.cpp | 4 +- tests/shared/oracle/big_int_gmp.cpp | 94 +-- .../shared/oracle/coremath_oracle_harness.hpp | 35 +- tests/shared/oracle/coremath_pow_cases.hpp | 7 +- tests/shared/oracle/coremath_pow_common.hpp | 25 +- tests/shared/oracle/cross_libm_common.hpp | 16 +- tests/shared/oracle/cross_libm_pow.cpp | 8 +- tests/shared/oracle/mpfr_fma_common.hpp | 26 +- tests/shared/oracle/mpfr_oracle_harness.hpp | 88 +-- tests/shared/oracle/mpfr_pow_common.hpp | 16 +- tests/shared/oracle/mpfr_powl.cpp | 57 +- tests/shared/oracle/mpfr_unary.cpp | 51 +- tests/shared/oracle/mpfr_unary_common.hpp | 178 ++--- .../shared/oracle/oracle_campaign_common.hpp | 49 +- tests/shared/oracle/pow_adversarial_modes.hpp | 84 +-- .../shared/oracle/pow_adversarial_search.cpp | 12 +- tests/shared/oracle/pow_cases.hpp | 66 +- .../shared/oracle/powf_exhaustive_domains.hpp | 20 +- .../oracle/powl_platform_characterization.cpp | 4 +- .../oracle/runners/coremath_pow_runner.hpp | 25 +- .../shared/oracle/runners/mpfr_pow_runner.hpp | 29 +- tests/shared/utils/conformance_suite.hpp | 4 +- tests/shared/utils/fenv_fixture.hpp | 2 +- tests/shared/utils/math_samples.hpp | 316 +++++++-- tests/shared/utils/pow_path_dispatch.hpp | 28 +- tests/shared/utils/ulp_distance.hpp | 12 +- tests/shared/utils/worst_case_samples.hpp | 187 +++-- tests/src/math/basic/abs_test.cpp | 216 +++--- tests/src/math/basic/fdim_test.cpp | 158 ++--- .../math/basic/fma_correct_rounding_test.cpp | 86 +-- tests/src/math/basic/fmod_test.cpp | 8 +- tests/src/math/basic/nan_test.cpp | 2 +- tests/src/math/basic/remainder_test.cpp | 17 +- tests/src/math/basic/remquo_test.cpp | 8 +- tests/src/math/expo/exp2_test.cpp | 38 +- tests/src/math/expo/exp_test.cpp | 10 +- tests/src/math/expo/log10_test.cpp | 10 +- tests/src/math/expo/log2_test.cpp | 4 +- tests/src/math/expo/log_test.cpp | 16 +- tests/src/math/internal/simd/pp_simd_test.cpp | 4 +- .../internal/support/math_support_test.cpp | 46 +- .../src/math/internal/types/big_int_test.cpp | 74 +- .../internal/types/normalized_float_test.cpp | 6 +- tests/src/math/misc/lgamma_test.cpp | 2 +- .../src/math/nearest/ceil_round_rint_test.cpp | 32 +- tests/src/math/nearest/floor_test.cpp | 40 +- tests/src/math/nearest/nearbyint_test.cpp | 206 +++--- tests/src/math/nearest/trunc_test.cpp | 121 ++-- .../math/power/pow_correct_rounding_test.cpp | 36 +- .../src/math/power/pow_deterministic_test.cpp | 4 +- tests/src/math/power/pow_simd_test.cpp | 48 +- tests/src/math/power/pow_test.cpp | 7 +- .../math/power/power_ulp_accuracy_test.cpp | 59 +- tests/src/math/power/powf_simd_test.cpp | 10 +- .../math/power/powl_format_detection_test.cpp | 2 +- tests/src/math/power/powl_ld64_alias_test.cpp | 4 +- tools/asmlab/golden/poly_estrin/kernel.hpp | 2 +- tools/asmlab/golden/poly_horner/kernel.hpp | 2 +- 128 files changed, 2640 insertions(+), 2418 deletions(-) diff --git a/benchmarks/shared/inputs.hpp b/benchmarks/shared/inputs.hpp index ff0fda63..142b4422 100644 --- a/benchmarks/shared/inputs.hpp +++ b/benchmarks/shared/inputs.hpp @@ -10,7 +10,7 @@ namespace ccm::bench { struct Randomizer { - explicit Randomizer(std::uint_fast32_t seed = 937162211) : m_gen{ seed } {} + explicit Randomizer(std::uint_fast32_t seed = 937162211) : m_gen{seed} {} std::vector integers(std::int64_t count, int min = std::numeric_limits::min(), int max = std::numeric_limits::max()) { diff --git a/benchmarks/src/math/power/sqrt.bench.cpp b/benchmarks/src/math/power/sqrt.bench.cpp index be00db56..4710ac8f 100644 --- a/benchmarks/src/math/power/sqrt.bench.cpp +++ b/benchmarks/src/math/power/sqrt.bench.cpp @@ -12,8 +12,8 @@ namespace } } // namespace -CCMATH_BENCH_UNARY_COMPARE_PATHS( - power, sqrt, return std::sqrt(static_cast(x)), return ccm::sqrt(static_cast(x)), return sqrt_rt(static_cast(x))) +CCMATH_BENCH_UNARY_COMPARE_PATHS(power, sqrt, return std::sqrt(static_cast(x)), return ccm::sqrt(static_cast(x)), + return sqrt_rt(static_cast(x))) CCMATH_BENCH_UNARY_PROFILE_PATHS(power, sqrt, positive_finite_general, 4.0, return std::sqrt(x), return ccm::sqrt(x), return sqrt_rt(x)) diff --git a/examples/src/decibel_gain.cpp b/examples/src/decibel_gain.cpp index 5102ca77..5357ca96 100644 --- a/examples/src/decibel_gain.cpp +++ b/examples/src/decibel_gain.cpp @@ -26,7 +26,7 @@ int main() { ccm::examples::banner("decibel conversion"); - double const ratios[] = { 1.0, 2.0, 10.0, 100.0 }; + double const ratios[] = {1.0, 2.0, 10.0, 100.0}; ccm::examples::table_header("power ratio", "dB (10 log10)"); diff --git a/examples/src/hypot_distance.cpp b/examples/src/hypot_distance.cpp index a62ffa6e..2201cc6e 100644 --- a/examples/src/hypot_distance.cpp +++ b/examples/src/hypot_distance.cpp @@ -18,8 +18,8 @@ namespace double z; }; - Vec3 const kSensor{ 12.0, -4.5, 1.25 }; - Vec3 const kTarget{ 27.0, 18.0, 6.0 }; + Vec3 const kSensor{12.0, -4.5, 1.25}; + Vec3 const kTarget{27.0, 18.0, 6.0}; double planar_distance(Vec3 const & a, Vec3 const & b) { diff --git a/examples/src/rounding_edge_cases.cpp b/examples/src/rounding_edge_cases.cpp index 6b0696b1..d2298e2f 100644 --- a/examples/src/rounding_edge_cases.cpp +++ b/examples/src/rounding_edge_cases.cpp @@ -16,7 +16,7 @@ namespace double x; }; - constexpr Sample kSamples[] = { { 2.5 }, { 3.5 }, { -2.5 }, { 1e8 + 0.5 } }; + constexpr Sample kSamples[] = {{2.5}, {3.5}, {-2.5}, {1e8 + 0.5}}; } // namespace int main() diff --git a/examples/src/signed_magnitude.cpp b/examples/src/signed_magnitude.cpp index 688e7ad4..f96205c3 100644 --- a/examples/src/signed_magnitude.cpp +++ b/examples/src/signed_magnitude.cpp @@ -18,9 +18,9 @@ namespace }; constexpr Pair kCases[] = { - { 3.0, -1.0 }, - { -4.0, -4.0 }, - { 0.0, -0.0 }, + {3.0, -1.0}, + {-4.0, -4.0}, + {0.0, -0.0}, }; } // namespace diff --git a/examples/src/unit_circle.cpp b/examples/src/unit_circle.cpp index 180a9aff..b53bca97 100644 --- a/examples/src/unit_circle.cpp +++ b/examples/src/unit_circle.cpp @@ -20,7 +20,11 @@ namespace }; constexpr AngleCase kAngles[] = { - { 0.0, 0.0 }, { 30.0, kPi / 6.0 }, { 45.0, kPi / 4.0 }, { 60.0, kPi / 3.0 }, { 90.0, kPi / 2.0 }, + {0.0, 0.0}, + {30.0, kPi / 6.0}, + {45.0, kPi / 4.0}, + {60.0, kPi / 3.0}, + {90.0, kPi / 2.0}, }; } // namespace diff --git a/fuzzing/shared/harness.hpp b/fuzzing/shared/harness.hpp index 93389b7c..53d28937 100644 --- a/fuzzing/shared/harness.hpp +++ b/fuzzing/shared/harness.hpp @@ -74,7 +74,7 @@ namespace ccm::fuzz } using uint_type = typename fp_bits_t::storage_type; - constexpr uint_type sign_mask = uint_type{ 1 } << (sizeof(uint_type) * 8 - 1); + constexpr uint_type sign_mask = uint_type{1} << (sizeof(uint_type) * 8 - 1); auto ordered_bits = [=](fp_bits_t bits) { uint_type const raw = bits.uintval(); diff --git a/include/ccmath/ext/clamp.hpp b/include/ccmath/ext/clamp.hpp index b3e5f3f3..1c077a36 100644 --- a/include/ccmath/ext/clamp.hpp +++ b/include/ccmath/ext/clamp.hpp @@ -25,7 +25,7 @@ namespace ccm::ext * \param hi Maximum value. * \return The clamped value. */ - template constexpr T clamp(T v, T lo = T{ 0 }, T hi = T{ 1 }) + template constexpr T clamp(T v, T lo = T{0}, T hi = T{1}) { return ccm::min(ccm::max(v, lo), hi); } @@ -41,7 +41,7 @@ namespace ccm::ext * \return The clamped value. */ template - constexpr std::common_type_t clamp(TVal v, TLow lo = TLow{ 0 }, THigh hi = THigh{ 1 }) + constexpr std::common_type_t clamp(TVal v, TLow lo = TLow{0}, THigh hi = THigh{1}) { return ccm::min(ccm::max(v, lo), hi); } diff --git a/include/ccmath/internal/math/common/misc/lerp.hpp b/include/ccmath/internal/math/common/misc/lerp.hpp index 478e6de0..865d6e6c 100644 --- a/include/ccmath/internal/math/common/misc/lerp.hpp +++ b/include/ccmath/internal/math/common/misc/lerp.hpp @@ -22,8 +22,8 @@ namespace ccm } template - constexpr std::enable_if_t && std::is_arithmetic_v && std::is_arithmetic_v, std::common_type_t> - lerp(T a, U b, V t) noexcept + constexpr std::enable_if_t && std::is_arithmetic_v && std::is_arithmetic_v, std::common_type_t> lerp(T a, U b, + V t) noexcept { using result_type = std::common_type_t; static_assert(!(std::is_same_v && std::is_same_v && std::is_same_v)); diff --git a/include/ccmath/internal/math/common/nearest/nearbyint.hpp b/include/ccmath/internal/math/common/nearest/nearbyint.hpp index 90a7a8a1..6139013d 100644 --- a/include/ccmath/internal/math/common/nearest/nearbyint.hpp +++ b/include/ccmath/internal/math/common/nearest/nearbyint.hpp @@ -35,7 +35,7 @@ namespace ccm return ccm::support::fp::directional_round(num, ccm::support::fenv::get_rounding_mode()); } - constexpr auto rounding_mode{ ccm::support::fenv::get_rounding_mode() }; + constexpr auto rounding_mode{ccm::support::fenv::get_rounding_mode()}; return ccm::support::fp::directional_round(num, rounding_mode); } diff --git a/include/ccmath/internal/math/generic/func/fmanip/nextafter_gen.hpp b/include/ccmath/internal/math/generic/func/fmanip/nextafter_gen.hpp index 5356b28c..21987ec9 100644 --- a/include/ccmath/internal/math/generic/func/fmanip/nextafter_gen.hpp +++ b/include/ccmath/internal/math/generic/func/fmanip/nextafter_gen.hpp @@ -17,8 +17,7 @@ namespace ccm::gen { - template && std::is_floating_point_v && (sizeof(TFrom) <= sizeof(TTo)), bool> = true> [[nodiscard]] constexpr TFrom nextafter_gen(TFrom from, TTo to) noexcept { diff --git a/include/ccmath/internal/math/generic/func/misc/lerp_gen.hpp b/include/ccmath/internal/math/generic/func/misc/lerp_gen.hpp index 4e2c2f5b..2a273bd3 100644 --- a/include/ccmath/internal/math/generic/func/misc/lerp_gen.hpp +++ b/include/ccmath/internal/math/generic/func/misc/lerp_gen.hpp @@ -23,8 +23,8 @@ namespace ccm } template - constexpr std::enable_if_t && std::is_arithmetic_v && std::is_arithmetic_v, std::common_type_t> - lerp(T a, U b, V t) noexcept + constexpr std::enable_if_t && std::is_arithmetic_v && std::is_arithmetic_v, std::common_type_t> lerp(T a, U b, + V t) noexcept { using result_type = std::common_type_t; static_assert(!(std::is_same_v && std::is_same_v && std::is_same_v)); diff --git a/include/ccmath/internal/math/generic/func/power/pow_impl/pow_impl.hpp b/include/ccmath/internal/math/generic/func/power/pow_impl/pow_impl.hpp index b9d58e40..1e5fb31a 100644 --- a/include/ccmath/internal/math/generic/func/power/pow_impl/pow_impl.hpp +++ b/include/ccmath/internal/math/generic/func/power/pow_impl/pow_impl.hpp @@ -81,37 +81,50 @@ namespace ccm::gen::impl // Generated by Sollya with: // P = fpminimax(log2(1 + x)/x, 6, [|D...|], [-2^-8, 2^-7]) inline constexpr std::array POW_LOG2_COEFFS = { - 0x1.71547652b82fep0, -0x1.71547652b82e7p-1, 0x1.ec709dc3b1fd5p-2, -0x1.7154766124215p-2, - 0x1.2776bd90259d8p-2, -0x1.ec586c6f3d311p-3, 0x1.9c4775eccf524p-3, + 0x1.71547652b82fep0, + -0x1.71547652b82e7p-1, + 0x1.ec709dc3b1fd5p-2, + -0x1.7154766124215p-2, + 0x1.2776bd90259d8p-2, + -0x1.ec586c6f3d311p-3, + 0x1.9c4775eccf524p-3, }; // Generated by Sollya with: // P = fpminimax(2^(x/64), 5, [|1, D...|], [-2^-1, 2^-1]) inline constexpr std::array POW_EXP2_COEFFS = { - 0x1p0, 0x1.62e42fefa39efp-7, 0x1.ebfbdff82a23ap-15, 0x1.c6b08d7076268p-23, 0x1.3b2ad33f8b48bp-31, 0x1.5d870c4d84445p-40, + 0x1p0, + 0x1.62e42fefa39efp-7, + 0x1.ebfbdff82a23ap-15, + 0x1.c6b08d7076268p-23, + 0x1.3b2ad33f8b48bp-31, + 0x1.5d870c4d84445p-40, }; // Degree-5 double-double minimax for log2(1 + x)/x on the twice-reduced range. // P = fpminimax(log2(1 + x)/x, 5, [|DD...|], [-0x1.3ffcp-15, 0x1.3e3dp-15]) // dirtyinfnorm(log2(1 + x)/x - P) = 0x1.8be5...p-96 inline constexpr std::array POW_DD_LOG2P_COEFFS = { - DoubleDouble{ 0x1.71547652b82fep0, 0x1.777d0ffda25ep-56 }, DoubleDouble{ -0x1.71547652b82fep-1, -0x1.777d101cf0a84p-57 }, - DoubleDouble{ 0x1.ec709dc3a03fdp-2, 0x1.ce04b5140d867p-56 }, DoubleDouble{ -0x1.71547652b82fbp-2, 0x1.137b47e635be5p-56 }, - DoubleDouble{ 0x1.2776c516a92a2p-2, -0x1.b5a30b3bdb318p-58 }, DoubleDouble{ -0x1.ec70af1929ca6p-3, 0x1.2d2fbd081e657p-57 }, + DoubleDouble{0x1.71547652b82fep0, 0x1.777d0ffda25ep-56}, + DoubleDouble{-0x1.71547652b82fep-1, -0x1.777d101cf0a84p-57}, + DoubleDouble{0x1.ec709dc3a03fdp-2, 0x1.ce04b5140d867p-56}, + DoubleDouble{-0x1.71547652b82fbp-2, 0x1.137b47e635be5p-56}, + DoubleDouble{0x1.2776c516a92a2p-2, -0x1.b5a30b3bdb318p-58}, + DoubleDouble{-0x1.ec70af1929ca6p-3, 0x1.2d2fbd081e657p-57}, }; // Degree-9 double-double minimax for 2^(x/64), dirtyinfnorm ~ 2^-106. inline constexpr std::array POW_DD_EXP2_COEFFS = { - DoubleDouble{ 0x1p0, 0 }, - DoubleDouble{ 0x1.62e42fefa39efp-7, 0x1.abc9e3b398024p-62 }, - DoubleDouble{ 0x1.ebfbdff82c58fp-15, -0x1.5e43a5429bddbp-69 }, - DoubleDouble{ 0x1.c6b08d704a0cp-23, -0x1.d33162491268fp-77 }, - DoubleDouble{ 0x1.3b2ab6fba4e77p-31, 0x1.4fb32d240a14ep-86 }, - DoubleDouble{ 0x1.5d87fe78a6731p-40, 0x1.e84e916be83ep-97 }, - DoubleDouble{ 0x1.430912f86bfb8p-49, -0x1.9a447bfddc5e6p-103 }, - DoubleDouble{ 0x1.ffcbfc588ded9p-59, -0x1.31a55719de47fp-113 }, - DoubleDouble{ 0x1.62c034beb8339p-68, -0x1.0ba57164eb36bp-122 }, - DoubleDouble{ 0x1.b5251ff97bee1p-78, -0x1.8483eabd9642dp-132 }, + DoubleDouble{0x1p0, 0}, + DoubleDouble{0x1.62e42fefa39efp-7, 0x1.abc9e3b398024p-62}, + DoubleDouble{0x1.ebfbdff82c58fp-15, -0x1.5e43a5429bddbp-69}, + DoubleDouble{0x1.c6b08d704a0cp-23, -0x1.d33162491268fp-77}, + DoubleDouble{0x1.3b2ab6fba4e77p-31, 0x1.4fb32d240a14ep-86}, + DoubleDouble{0x1.5d87fe78a6731p-40, 0x1.e84e916be83ep-97}, + DoubleDouble{0x1.430912f86bfb8p-49, -0x1.9a447bfddc5e6p-103}, + DoubleDouble{0x1.ffcbfc588ded9p-59, -0x1.31a55719de47fp-113}, + DoubleDouble{0x1.62c034beb8339p-68, -0x1.0ba57164eb36bp-122}, + DoubleDouble{0x1.b5251ff97bee1p-78, -0x1.8483eabd9642dp-132}, }; // Exact-as-possible integer powers via double-double exponentiation by squaring. @@ -127,7 +140,7 @@ namespace ccm::gen::impl { const double hi = a * b; const double lo = ccm::types::exact_fma(a, b, -hi); - return DoubleDouble{ hi, lo }; + return DoubleDouble{hi, lo}; } constexpr DoubleDouble mul(const DoubleDouble & a, const DoubleDouble & b) noexcept @@ -140,7 +153,7 @@ namespace ccm::gen::impl constexpr DoubleDouble ipow(DoubleDouble factor, std::uint64_t e) noexcept { - DoubleDouble result{ 1.0, 0.0 }; + DoubleDouble result{1.0, 0.0}; while (e > 0U) { if ((e & 1U) != 0U) @@ -158,7 +171,7 @@ namespace ccm::gen::impl constexpr DoubleDouble ipow(double base, std::uint64_t e) noexcept { - return ipow(DoubleDouble{ base, 0.0 }, e); + return ipow(DoubleDouble{base, 0.0}, e); } // sqrt(x) refined to a double-double via one Newton correction on a correctly @@ -245,15 +258,15 @@ namespace ccm::gen::impl constexpr ScaledPow load_scaled(const DoubleDouble & base) noexcept { const int e = static_cast(support::fp::FPBits(base.hi).get_biased_exponent()) - support::fp::FPBits::exponent_bias; - return ScaledPow{ DoubleDouble{ support::helpers::internal_ldexp(base.hi, -e), support::helpers::internal_ldexp(base.lo, -e) }, - static_cast(e) }; + return ScaledPow{DoubleDouble{support::helpers::internal_ldexp(base.hi, -e), support::helpers::internal_ldexp(base.lo, -e)}, + static_cast(e)}; } // base^e with the same exact-FMA products as ipow, accumulated as a ScaledPow so the // mantissa is renormalized to [1, 2) after every step and no limb leaves the normal range. constexpr ScaledPow ipow_scaled(ScaledPow factor, std::uint64_t e) noexcept { - ScaledPow result{ DoubleDouble{ 1.0, 0.0 }, 0 }; + ScaledPow result{DoubleDouble{1.0, 0.0}, 0}; while (e > 0U) { if ((e & 1U) != 0U) @@ -275,7 +288,7 @@ namespace ccm::gen::impl constexpr ScaledPow ipow_scaled(double base, std::uint64_t e) noexcept { - return ipow_scaled(load_scaled(DoubleDouble{ base, 0.0 }), e); + return ipow_scaled(load_scaled(DoubleDouble{base, 0.0}), e); } constexpr ScaledPow ipow_scaled(const DoubleDouble & base, std::uint64_t e) noexcept @@ -396,7 +409,7 @@ namespace ccm::gen::impl const DoubleDouble t1 = two_prod(chh.lo, x); const DoubleDouble t2 = two_prod(cross, x); const DoubleDouble t3 = two_prod(clsq, x); - const std::array terms = { t0.hi, t0.lo, t1.hi, t1.lo, t2.hi, t2.lo, t3.hi, t3.lo, -1.0 }; + const std::array terms = {t0.hi, t0.lo, t1.hi, t1.lo, t2.hi, t2.lo, t3.hi, t3.lo, -1.0}; return exact_sign_of_sum(terms.data(), static_cast(terms.size())); } @@ -471,8 +484,8 @@ namespace ccm::gen::impl // normal final value collapses with a single binary64 addition, correctly rounded in // every mode. A subnormal value (only reachable through the 2^-512 underflow scale) is // instead rounded straight onto the subnormal grid to avoid a double rounding. - constexpr double - pow_double_double(unsigned idx_x, double dx, double e_x, double y6, std::uint64_t sign, double scale) noexcept // NOLINT(bugprone-exception-escape) + constexpr double pow_double_double(unsigned idx_x, double dx, double e_x, double y6, std::uint64_t sign, + double scale) noexcept // NOLINT(bugprone-exception-escape) { using FPBits_t = support::fp::FPBits; @@ -503,9 +516,9 @@ namespace ccm::gen::impl // Lower-order parts of (e_x - log2(r1)) and -log2(r2). LOG2_R2_DD is stored {lo, hi}. const auto & lr = LOG2_R_TD.at(static_cast(idx_x)); - const DoubleDouble log2_x_mid{ lr.mid, lr.lo }; + const DoubleDouble log2_x_mid{lr.mid, lr.lo}; const auto & lr2 = LOG2_R2_DD.at(static_cast(idx2)); - const DoubleDouble log2_r2_dd{ lr2.lo, lr2.hi }; + const DoubleDouble log2_r2_dd{lr2.lo, lr2.hi}; const DoubleDouble log2_x_m = ccm::types::add(log2_r2_dd, log2_x_mid); const DoubleDouble log2_x_low = @@ -550,7 +563,7 @@ namespace ccm::gen::impl const std::uint64_t exp2_hm_hi_i = static_cast(exp2_hi_i + exp2_mid_hi_i) + sign; const std::uint64_t exp2_hm_lo_i = idx_y != 0 ? static_cast(exp2_hi_i + exp2_mid_lo_i) + sign : sign; - const DoubleDouble exp2_hm{ FPBits_t(exp2_hm_hi_i).get_val(), FPBits_t(exp2_hm_lo_i).get_val() }; + const DoubleDouble exp2_hm{FPBits_t(exp2_hm_hi_i).get_val(), FPBits_t(exp2_hm_lo_i).get_val()}; const DoubleDouble pp = ::ccm::support::polyeval(lo6, POW_DD_EXP2_COEFFS[0], @@ -647,7 +660,7 @@ namespace ccm::gen::impl const double m_x = FPBits_t(x_mantissa | FPBits_t(1.0).uintval()).get_val(); double dx = 0.0; - DoubleDouble dx_c0{ 0.0, 0.0 }; + DoubleDouble dx_c0{0.0, 0.0}; if (support::is_constant_evaluated()) { diff --git a/include/ccmath/internal/math/generic/func/power/pow_impl/pow_simd_impl.hpp b/include/ccmath/internal/math/generic/func/power/pow_impl/pow_simd_impl.hpp index e9cf3cb8..f7b88477 100644 --- a/include/ccmath/internal/math/generic/func/power/pow_impl/pow_simd_impl.hpp +++ b/include/ccmath/internal/math/generic/func/power/pow_impl/pow_simd_impl.hpp @@ -43,7 +43,7 @@ namespace ccm::gen::impl using DVec = pp::basic_simd; const DVec hi = a + b; const DVec t = hi - a; - return { hi, b - t }; + return {hi, b - t}; } // types::add(DoubleDouble, DoubleDouble). Assumption: |a.hi| >= |b.hi|. @@ -61,7 +61,7 @@ namespace ccm::gen::impl const DVec t1 = c * a; const DVec t2 = a - t1; const DVec hi = t1 + t2; - return { hi, a - hi }; + return {hi, a - hi}; } // Dekker's product, mirroring types::exact_mult. @@ -74,7 +74,7 @@ namespace ccm::gen::impl const DVec t1 = (as.hi * bs.hi) - hi; const DVec t2 = (as.hi * bs.lo) + t1; const DVec t3 = (as.lo * bs.hi) + t2; - return { hi, (as.lo * bs.lo) + t3 }; + return {hi, (as.lo * bs.lo) + t3}; } // types::quick_mult(double, DoubleDouble). @@ -109,13 +109,13 @@ namespace ccm::gen::impl template CCM_ALWAYS_INLINE VDD v_select(pp::basic_simd_mask<8, Abi> const & mask, VDD const & a, VDD const & b) noexcept { - return { pp::simd_select(mask, a.hi, b.hi), pp::simd_select(mask, a.lo, b.lo) }; + return {pp::simd_select(mask, a.hi, b.hi), pp::simd_select(mask, a.lo, b.lo)}; } template CCM_ALWAYS_INLINE VDD v_broadcast(types::DoubleDouble const & c) noexcept { using DVec = pp::basic_simd; - return { DVec(c.hi), DVec(c.lo) }; + return {DVec(c.hi), DVec(c.lo)}; } } // namespace simd_detail @@ -230,10 +230,10 @@ namespace ccm::gen::impl const VDD log2_1p = sd::v_quick_mult(dx2_dd, p_dd); // Lower-order parts of (e_x - log2(r1)) and -log2(r2). LOG2_R2_DD is stored {lo, hi}. - const VDD log2_x_mid{ lr_mid, lr_lo }; + const VDD log2_x_mid{lr_mid, lr_lo}; const DVec lr2_lo([&](auto i) { return LOG2_R2_DD[static_cast(idx2_i[i])].lo; }); const DVec lr2_hi([&](auto i) { return LOG2_R2_DD[static_cast(idx2_i[i])].hi; }); - const VDD log2_r2_dd{ lr2_lo, lr2_hi }; + const VDD log2_r2_dd{lr2_lo, lr2_hi}; const VDD log2_x_m = sd::v_add(log2_r2_dd, log2_x_mid); // The two Fast2Sum orderings the scalar resolves with larger_exponent branches. @@ -261,7 +261,7 @@ namespace ccm::gen::impl const DVec exp2_hm_hi = pp::simd_bit_cast(exp2_hi_i + mid_hi_i); const DVec exp2_hm_lo = pp::simd_bit_cast(pp::simd_select(idx_y != I64(0), exp2_hi_i + mid_lo_i, I64(0))); - const VDD exp2_hm{ exp2_hm_hi, exp2_hm_lo }; + const VDD exp2_hm{exp2_hm_hi, exp2_hm_lo}; VDD exp2_poly = sd::v_broadcast(POW_DD_EXP2_COEFFS[9]); exp2_poly = sd::v_multiply_add(lo6, exp2_poly, sd::v_broadcast(POW_DD_EXP2_COEFFS[8])); diff --git a/include/ccmath/internal/math/generic/func/power/pow_impl/powf_data.hpp b/include/ccmath/internal/math/generic/func/power/pow_impl/powf_data.hpp index 088d9892..ef06660a 100644 --- a/include/ccmath/internal/math/generic/func/power/pow_impl/powf_data.hpp +++ b/include/ccmath/internal/math/generic/func/power/pow_impl/powf_data.hpp @@ -36,134 +36,134 @@ namespace ccm::gen::impl::internal::impl // print("{", d, ",", c, ", ", b, "},"); // }; static constexpr std::array LOG2_R_TD = { - TripleDouble{ 0.0, 0.0, 0.0 }, - TripleDouble{ 0x1.84a2c615b70adp-79, -0x1.177c23362928cp-25, 0x1.72c8p-7 }, - TripleDouble{ -0x1.f27b820fd03eap-76, -0x1.179e0caa9c9abp-22, 0x1.744p-6 }, - TripleDouble{ -0x1.f27ef487c8f34p-77, -0x1.c6cea541f5b7p-23, 0x1.184cp-5 }, - TripleDouble{ -0x1.e3f80fbc71454p-76, -0x1.66c4d4e554434p-22, 0x1.773ap-5 }, - TripleDouble{ -0x1.9f8ef14d5f6eep-79, -0x1.70700a00fdd55p-24, 0x1.d6ecp-5 }, - TripleDouble{ 0x1.452bbce7398c1p-77, 0x1.53002a4e86631p-23, 0x1.1bb3p-4 }, - TripleDouble{ -0x1.990555535afdp-81, 0x1.fcd15f101c142p-25, 0x1.4c56p-4 }, - TripleDouble{ 0x1.447e30ad393eep-78, 0x1.25b3eed319cedp-22, 0x1.7d6p-4 }, - TripleDouble{ 0x1.b7759da88a2dap-76, -0x1.4195120d8486fp-22, 0x1.960dp-4 }, - TripleDouble{ 0x1.cee7766ece702p-78, 0x1.45b878e27d0d9p-23, 0x1.c7b5p-4 }, - TripleDouble{ -0x1.a55c745ecdc2fp-77, 0x1.770744593a4cbp-22, 0x1.f9c9p-4 }, - TripleDouble{ 0x1.f7ec992caa67fp-77, 0x1.c673032495d24p-22, 0x1.097ep-3 }, - TripleDouble{ -0x1.433638c6ece3ep-77, -0x1.1eaa65b49696ep-22, 0x1.22dbp-3 }, - TripleDouble{ 0x1.58f27b6518824p-76, 0x1.b2866f2850b22p-22, 0x1.3c6f8p-3 }, - TripleDouble{ -0x1.86bdcfdfd4a4cp-79, 0x1.8ee37cd2ea9d3p-25, 0x1.494f8p-3 }, - TripleDouble{ -0x1.ff7044a68a7fap-80, 0x1.7e86f9c2154fbp-24, 0x1.633a8p-3 }, - TripleDouble{ -0x1.aa21694561327p-81, 0x1.8e3cfc25f0ce6p-26, 0x1.7046p-3 }, - TripleDouble{ -0x1.d209f2d4239c6p-87, 0x1.57f7a64ccd537p-28, 0x1.8a898p-3 }, - TripleDouble{ -0x1.a55e97e60e632p-76, -0x1.a761c09fbd2aep-22, 0x1.97c2p-3 }, - TripleDouble{ 0x1.261179225541ep-76, 0x1.24bea9a2c66f3p-22, 0x1.b26p-3 }, - TripleDouble{ -0x1.08fa30510fca9p-82, -0x1.60002ccfe43f5p-25, 0x1.bfc68p-3 }, - TripleDouble{ -0x1.63ec8d56242f9p-76, 0x1.69f220e97f22cp-22, 0x1.dac2p-3 }, - TripleDouble{ 0x1.8bcdaf0534365p-76, -0x1.6164f64c210ep-22, 0x1.e858p-3 }, - TripleDouble{ 0x1.1003282896056p-78, -0x1.0c1678ae89767p-24, 0x1.01d9cp-2 }, - TripleDouble{ 0x1.01bcc7025fa92p-78, -0x1.f26a05c813d57p-22, 0x1.08bdp-2 }, - TripleDouble{ -0x1.fe8a8648e9ebcp-80, 0x1.4d8fc561c8d44p-24, 0x1.169cp-2 }, - TripleDouble{ 0x1.08dfb23650c75p-79, -0x1.362ad8f7ca2dp-22, 0x1.1d984p-2 }, - TripleDouble{ -0x1.f8d5a89861a5ep-79, 0x1.2b13cd6c4d042p-22, 0x1.249ccp-2 }, - TripleDouble{ -0x1.a1c872983511ep-76, -0x1.1c8f11979a5dbp-22, 0x1.32cp-2 }, - TripleDouble{ 0x1.e8e21bff3336bp-77, 0x1.c2ab3edefe569p-23, 0x1.39de8p-2 }, - TripleDouble{ 0x1.fd1994fb2c4a1p-80, 0x1.7c3eca28e69cap-26, 0x1.4106p-2 }, - TripleDouble{ 0x1.6b94b51cf76b1p-80, -0x1.34c4e99e1c6c6p-24, 0x1.4f6fcp-2 }, - TripleDouble{ -0x1.31d55da1d0f66p-76, -0x1.194a871b63619p-22, 0x1.56b24p-2 }, - TripleDouble{ -0x1.378b22691e28bp-77, 0x1.e3dd5c1c885aep-23, 0x1.5dfdcp-2 }, - TripleDouble{ 0x1.99e302970e411p-83, -0x1.6ccf3b1129b7cp-23, 0x1.6552cp-2 }, - TripleDouble{ 0x1.20164a049664dp-82, -0x1.2f346e2bf924bp-23, 0x1.6cb1p-2 }, - TripleDouble{ -0x1.d14aac4d864c3p-77, -0x1.fa61aaa59c1d8p-23, 0x1.7b8ap-2 }, - TripleDouble{ 0x1.496ab4e4b293fp-79, 0x1.90c11fd32a3abp-22, 0x1.8304cp-2 }, - TripleDouble{ -0x1.d209f2d4239c6p-86, 0x1.57f7a64ccd537p-27, 0x1.8a898p-2 }, - TripleDouble{ 0x1.eae3326327babp-81, 0x1.249ba76fee235p-27, 0x1.9218p-2 }, - TripleDouble{ 0x1.fa05bddfded8cp-77, -0x1.aad2729b21ae5p-23, 0x1.99b08p-2 }, - TripleDouble{ -0x1.624140d175ba2p-77, 0x1.71810a5e1818p-22, 0x1.a8ff8p-2 }, - TripleDouble{ 0x1.f1c5160c515c1p-81, -0x1.6172fe015e13cp-27, 0x1.b0b68p-2 }, - TripleDouble{ -0x1.86a6204eec8cp-79, 0x1.5ec6c1bfbf89ap-24, 0x1.b877cp-2 }, - TripleDouble{ 0x1.718f761dd3915p-78, 0x1.678bf6cdedf51p-24, 0x1.c0438p-2 }, - TripleDouble{ -0x1.d4ee66c3700e4p-76, 0x1.c2d45fe43895ep-22, 0x1.c819cp-2 }, - TripleDouble{ -0x1.7d14533586306p-77, -0x1.9ee52ed49d71dp-22, 0x1.cffbp-2 }, - TripleDouble{ 0x1.5ce9fb5a7bb5bp-81, 0x1.5786af187a96bp-27, 0x1.d7e6cp-2 }, - TripleDouble{ -0x1.ae6face57ad3bp-77, 0x1.3ab0dc56138c9p-23, 0x1.dfdd8p-2 }, - TripleDouble{ 0x1.5ac93b443d55fp-78, 0x1.fe538ab34efb5p-22, 0x1.e7df4p-2 }, - TripleDouble{ 0x1.f1753e0ae1e8fp-76, -0x1.e4fee07aa4b68p-22, 0x1.efec8p-2 }, - TripleDouble{ 0x1.cdfd4c297069bp-76, -0x1.172f32fe67287p-22, 0x1.f804cp-2 }, - TripleDouble{ 0x1.97a0e8f3ba742p-79, -0x1.9a83ff9ab9cc8p-22, 0x1.00144p-1 }, - TripleDouble{ -0x1.800450f5b2357p-78, -0x1.68cb06cece193p-22, 0x1.042bep-1 }, - TripleDouble{ -0x1.a839041241fe7p-78, 0x1.8cd71ddf82e2p-22, 0x1.08494p-1 }, - TripleDouble{ 0x1.ed0b8eeccca86p-78, 0x1.5e18ab2df3ae6p-22, 0x1.0c6cap-1 }, - TripleDouble{ 0x1.3dd41df9689b3p-79, 0x1.5dee4d9d8a273p-25, 0x1.1096p-1 }, - TripleDouble{ -0x1.990555535afdp-82, 0x1.fcd15f101c142p-26, 0x1.14c56p-1 }, - TripleDouble{ -0x1.1773d02c9055cp-77, -0x1.2474b0f992ba1p-23, 0x1.18faep-1 }, - TripleDouble{ -0x1.4aeef330c53c1p-78, 0x1.4b5a92a606047p-24, 0x1.1d368p-1 }, - TripleDouble{ 0x1.8e6ff749ebacbp-77, 0x1.16186fcf54bbdp-22, 0x1.21786p-1 }, - TripleDouble{ 0x1.c09d761c548ebp-84, 0x1.18efabeb7d722p-27, 0x1.25c0ap-1 }, - TripleDouble{ 0x1.aaa73a428e1e4p-78, -0x1.e5fc7d238691dp-24, 0x1.2a0f4p-1 }, - TripleDouble{ -0x1.af2f3d8b63fbap-79, 0x1.f5809faf6283cp-22, 0x1.2e644p-1 }, - TripleDouble{ -0x1.af2f3d8b63fbap-79, 0x1.f5809faf6283cp-22, 0x1.2e644p-1 }, - TripleDouble{ 0x1.78de359f2bb88p-77, 0x1.c6e1dcd0cb449p-22, 0x1.32bfep-1 }, - TripleDouble{ -0x1.415ae1a715618p-76, 0x1.76e0e8f74b4d5p-22, 0x1.37222p-1 }, - TripleDouble{ -0x1.4991b5375621fp-79, -0x1.cb82c89692d99p-24, 0x1.3b8b2p-1 }, - TripleDouble{ -0x1.827d37deb2236p-76, -0x1.63161c5432aebp-22, 0x1.3ffaep-1 }, - TripleDouble{ 0x1.9576edac01c78p-77, 0x1.458104c41b901p-22, 0x1.44716p-1 }, - TripleDouble{ 0x1.9576edac01c78p-77, 0x1.458104c41b901p-22, 0x1.44716p-1 }, - TripleDouble{ -0x1.05a27b81e2219p-77, -0x1.cd9d0cde578d5p-22, 0x1.48efp-1 }, - TripleDouble{ 0x1.237616778b4bap-82, 0x1.b9884591add87p-26, 0x1.4d738p-1 }, - TripleDouble{ 0x1.3b7d7e5d148bbp-76, 0x1.c6042978605ffp-22, 0x1.51ff2p-1 }, - TripleDouble{ -0x1.cc3f936a5977cp-79, -0x1.fc4c96b37dcf6p-22, 0x1.56922p-1 }, - TripleDouble{ 0x1.20164a049664dp-83, -0x1.2f346e2bf924bp-24, 0x1.5b2c4p-1 }, - TripleDouble{ 0x1.20164a049664dp-83, -0x1.2f346e2bf924bp-24, 0x1.5b2c4p-1 }, - TripleDouble{ -0x1.a212919a92f7ap-77, 0x1.c4e4fbb68a4d1p-22, 0x1.5fcdcp-1 }, - TripleDouble{ -0x1.b64b03f7230ddp-77, -0x1.9d499bd9b3226p-23, 0x1.6476ep-1 }, - TripleDouble{ -0x1.1ec6379e6e3b9p-77, -0x1.f89b355ede26fp-23, 0x1.69278p-1 }, - TripleDouble{ -0x1.1ec6379e6e3b9p-77, -0x1.f89b355ede26fp-23, 0x1.69278p-1 }, - TripleDouble{ -0x1.4ba44c03bfbbdp-78, 0x1.53c7e319f6e92p-24, 0x1.6ddfcp-1 }, - TripleDouble{ -0x1.c36fc650d030fp-77, -0x1.b291f070528c7p-22, 0x1.729fep-1 }, - TripleDouble{ -0x1.69e5693a7f067p-80, 0x1.2967a451a7b48p-25, 0x1.7767cp-1 }, - TripleDouble{ -0x1.69e5693a7f067p-80, 0x1.2967a451a7b48p-25, 0x1.7767cp-1 }, - TripleDouble{ 0x1.6598aae91499ap-76, 0x1.244fcff690fcep-22, 0x1.7c37ap-1 }, - TripleDouble{ 0x1.99d61ec432837p-77, 0x1.46fd97f5dc572p-23, 0x1.810fap-1 }, - TripleDouble{ 0x1.99d61ec432837p-77, 0x1.46fd97f5dc572p-23, 0x1.810fap-1 }, - TripleDouble{ 0x1.855c42078f81bp-76, -0x1.f3a7352663e5p-22, 0x1.85efep-1 }, - TripleDouble{ -0x1.59408e815107p-77, 0x1.b3cda690370b5p-23, 0x1.8ad84p-1 }, - TripleDouble{ -0x1.59408e815107p-77, 0x1.b3cda690370b5p-23, 0x1.8ad84p-1 }, - TripleDouble{ 0x1.33b318085e50ap-78, 0x1.3226b211bf1d9p-23, 0x1.8fc92p-1 }, - TripleDouble{ 0x1.343fe7c9cb4aep-79, 0x1.d24b136c101eep-23, 0x1.94c28p-1 }, - TripleDouble{ 0x1.343fe7c9cb4aep-79, 0x1.d24b136c101eep-23, 0x1.94c28p-1 }, - TripleDouble{ -0x1.d19522e56fe6p-76, 0x1.7c40c7907e82ap-22, 0x1.99c48p-1 }, - TripleDouble{ -0x1.23b9d8ea55c3ep-77, -0x1.e81781d97ee91p-22, 0x1.9ecf6p-1 }, - TripleDouble{ -0x1.23b9d8ea55c3ep-77, -0x1.e81781d97ee91p-22, 0x1.9ecf6p-1 }, - TripleDouble{ 0x1.829440c24aeb6p-78, -0x1.6a77813f94e01p-22, 0x1.a3e3p-1 }, - TripleDouble{ -0x1.624140d175ba2p-76, -0x1.1cfdeb43cfdp-22, 0x1.a8ffap-1 }, - TripleDouble{ -0x1.624140d175ba2p-76, -0x1.1cfdeb43cfdp-22, 0x1.a8ffap-1 }, - TripleDouble{ 0x1.afa6f024fb045p-77, -0x1.f983f74d3138fp-23, 0x1.ae256p-1 }, - TripleDouble{ -0x1.603ad3a5d326dp-78, -0x1.e278ae1a1f51fp-23, 0x1.b3546p-1 }, - TripleDouble{ -0x1.603ad3a5d326dp-78, -0x1.e278ae1a1f51fp-23, 0x1.b3546p-1 }, - TripleDouble{ -0x1.0c1e0e5855d6ap-77, -0x1.97552b7b5ea45p-23, 0x1.b88ccp-1 }, - TripleDouble{ -0x1.0c1e0e5855d6ap-77, -0x1.97552b7b5ea45p-23, 0x1.b88ccp-1 }, - TripleDouble{ 0x1.c817ad56baa16p-78, -0x1.19b4f3c72c4f8p-24, 0x1.bdceap-1 }, - TripleDouble{ 0x1.44c47ac1bf62bp-77, 0x1.f7402d26f1a12p-23, 0x1.c31a2p-1 }, - TripleDouble{ 0x1.44c47ac1bf62bp-77, 0x1.f7402d26f1a12p-23, 0x1.c31a2p-1 }, - TripleDouble{ -0x1.69b9465eae1e6p-78, -0x1.2056d5dd31d96p-23, 0x1.c86f8p-1 }, - TripleDouble{ -0x1.69b9465eae1e6p-78, -0x1.2056d5dd31d96p-23, 0x1.c86f8p-1 }, - TripleDouble{ -0x1.24a6d9d1d1904p-79, -0x1.6e46335aae723p-24, 0x1.cdcecp-1 }, - TripleDouble{ -0x1.3826144575ac4p-76, -0x1.beb244c59f331p-22, 0x1.d3382p-1 }, - TripleDouble{ -0x1.3826144575ac4p-76, -0x1.beb244c59f331p-22, 0x1.d3382p-1 }, - TripleDouble{ 0x1.dbc96b3b12b25p-81, 0x1.16c071e93fd97p-27, 0x1.d8abap-1 }, - TripleDouble{ 0x1.dbc96b3b12b25p-81, 0x1.16c071e93fd97p-27, 0x1.d8abap-1 }, - TripleDouble{ 0x1.68a8ccdbd1f33p-77, 0x1.d8175819530c2p-22, 0x1.de298p-1 }, - TripleDouble{ 0x1.68a8ccdbd1f33p-77, 0x1.d8175819530c2p-22, 0x1.de298p-1 }, - TripleDouble{ 0x1.e586711df5ea1p-79, 0x1.51bd552842c1cp-23, 0x1.e3b2p-1 }, - TripleDouble{ 0x1.e586711df5ea1p-79, 0x1.51bd552842c1cp-23, 0x1.e3b2p-1 }, - TripleDouble{ -0x1.bc25adf042483p-79, 0x1.914e204f19d94p-22, 0x1.e9452p-1 }, - TripleDouble{ -0x1.bc25adf042483p-79, 0x1.914e204f19d94p-22, 0x1.e9452p-1 }, - TripleDouble{ 0x1.d7d82b65c5686p-76, 0x1.c55d997da24fdp-22, 0x1.eee32p-1 }, - TripleDouble{ 0x1.d7d82b65c5686p-76, 0x1.c55d997da24fdp-22, 0x1.eee32p-1 }, - TripleDouble{ -0x1.3f108c0857ca3p-77, -0x1.685c2d2298a6ep-22, 0x1.f48c4p-1 }, - TripleDouble{ -0x1.3f108c0857ca3p-77, -0x1.685c2d2298a6ep-22, 0x1.f48c4p-1 }, - TripleDouble{ -0x1.bd800bca7a221p-78, 0x1.7a4887bd74039p-22, 0x1.fa406p-1 }, - TripleDouble{ 0.0, 0.0, 1.0 }, + TripleDouble{0.0, 0.0, 0.0}, + TripleDouble{0x1.84a2c615b70adp-79, -0x1.177c23362928cp-25, 0x1.72c8p-7}, + TripleDouble{-0x1.f27b820fd03eap-76, -0x1.179e0caa9c9abp-22, 0x1.744p-6}, + TripleDouble{-0x1.f27ef487c8f34p-77, -0x1.c6cea541f5b7p-23, 0x1.184cp-5}, + TripleDouble{-0x1.e3f80fbc71454p-76, -0x1.66c4d4e554434p-22, 0x1.773ap-5}, + TripleDouble{-0x1.9f8ef14d5f6eep-79, -0x1.70700a00fdd55p-24, 0x1.d6ecp-5}, + TripleDouble{0x1.452bbce7398c1p-77, 0x1.53002a4e86631p-23, 0x1.1bb3p-4}, + TripleDouble{-0x1.990555535afdp-81, 0x1.fcd15f101c142p-25, 0x1.4c56p-4}, + TripleDouble{0x1.447e30ad393eep-78, 0x1.25b3eed319cedp-22, 0x1.7d6p-4}, + TripleDouble{0x1.b7759da88a2dap-76, -0x1.4195120d8486fp-22, 0x1.960dp-4}, + TripleDouble{0x1.cee7766ece702p-78, 0x1.45b878e27d0d9p-23, 0x1.c7b5p-4}, + TripleDouble{-0x1.a55c745ecdc2fp-77, 0x1.770744593a4cbp-22, 0x1.f9c9p-4}, + TripleDouble{0x1.f7ec992caa67fp-77, 0x1.c673032495d24p-22, 0x1.097ep-3}, + TripleDouble{-0x1.433638c6ece3ep-77, -0x1.1eaa65b49696ep-22, 0x1.22dbp-3}, + TripleDouble{0x1.58f27b6518824p-76, 0x1.b2866f2850b22p-22, 0x1.3c6f8p-3}, + TripleDouble{-0x1.86bdcfdfd4a4cp-79, 0x1.8ee37cd2ea9d3p-25, 0x1.494f8p-3}, + TripleDouble{-0x1.ff7044a68a7fap-80, 0x1.7e86f9c2154fbp-24, 0x1.633a8p-3}, + TripleDouble{-0x1.aa21694561327p-81, 0x1.8e3cfc25f0ce6p-26, 0x1.7046p-3}, + TripleDouble{-0x1.d209f2d4239c6p-87, 0x1.57f7a64ccd537p-28, 0x1.8a898p-3}, + TripleDouble{-0x1.a55e97e60e632p-76, -0x1.a761c09fbd2aep-22, 0x1.97c2p-3}, + TripleDouble{0x1.261179225541ep-76, 0x1.24bea9a2c66f3p-22, 0x1.b26p-3}, + TripleDouble{-0x1.08fa30510fca9p-82, -0x1.60002ccfe43f5p-25, 0x1.bfc68p-3}, + TripleDouble{-0x1.63ec8d56242f9p-76, 0x1.69f220e97f22cp-22, 0x1.dac2p-3}, + TripleDouble{0x1.8bcdaf0534365p-76, -0x1.6164f64c210ep-22, 0x1.e858p-3}, + TripleDouble{0x1.1003282896056p-78, -0x1.0c1678ae89767p-24, 0x1.01d9cp-2}, + TripleDouble{0x1.01bcc7025fa92p-78, -0x1.f26a05c813d57p-22, 0x1.08bdp-2}, + TripleDouble{-0x1.fe8a8648e9ebcp-80, 0x1.4d8fc561c8d44p-24, 0x1.169cp-2}, + TripleDouble{0x1.08dfb23650c75p-79, -0x1.362ad8f7ca2dp-22, 0x1.1d984p-2}, + TripleDouble{-0x1.f8d5a89861a5ep-79, 0x1.2b13cd6c4d042p-22, 0x1.249ccp-2}, + TripleDouble{-0x1.a1c872983511ep-76, -0x1.1c8f11979a5dbp-22, 0x1.32cp-2}, + TripleDouble{0x1.e8e21bff3336bp-77, 0x1.c2ab3edefe569p-23, 0x1.39de8p-2}, + TripleDouble{0x1.fd1994fb2c4a1p-80, 0x1.7c3eca28e69cap-26, 0x1.4106p-2}, + TripleDouble{0x1.6b94b51cf76b1p-80, -0x1.34c4e99e1c6c6p-24, 0x1.4f6fcp-2}, + TripleDouble{-0x1.31d55da1d0f66p-76, -0x1.194a871b63619p-22, 0x1.56b24p-2}, + TripleDouble{-0x1.378b22691e28bp-77, 0x1.e3dd5c1c885aep-23, 0x1.5dfdcp-2}, + TripleDouble{0x1.99e302970e411p-83, -0x1.6ccf3b1129b7cp-23, 0x1.6552cp-2}, + TripleDouble{0x1.20164a049664dp-82, -0x1.2f346e2bf924bp-23, 0x1.6cb1p-2}, + TripleDouble{-0x1.d14aac4d864c3p-77, -0x1.fa61aaa59c1d8p-23, 0x1.7b8ap-2}, + TripleDouble{0x1.496ab4e4b293fp-79, 0x1.90c11fd32a3abp-22, 0x1.8304cp-2}, + TripleDouble{-0x1.d209f2d4239c6p-86, 0x1.57f7a64ccd537p-27, 0x1.8a898p-2}, + TripleDouble{0x1.eae3326327babp-81, 0x1.249ba76fee235p-27, 0x1.9218p-2}, + TripleDouble{0x1.fa05bddfded8cp-77, -0x1.aad2729b21ae5p-23, 0x1.99b08p-2}, + TripleDouble{-0x1.624140d175ba2p-77, 0x1.71810a5e1818p-22, 0x1.a8ff8p-2}, + TripleDouble{0x1.f1c5160c515c1p-81, -0x1.6172fe015e13cp-27, 0x1.b0b68p-2}, + TripleDouble{-0x1.86a6204eec8cp-79, 0x1.5ec6c1bfbf89ap-24, 0x1.b877cp-2}, + TripleDouble{0x1.718f761dd3915p-78, 0x1.678bf6cdedf51p-24, 0x1.c0438p-2}, + TripleDouble{-0x1.d4ee66c3700e4p-76, 0x1.c2d45fe43895ep-22, 0x1.c819cp-2}, + TripleDouble{-0x1.7d14533586306p-77, -0x1.9ee52ed49d71dp-22, 0x1.cffbp-2}, + TripleDouble{0x1.5ce9fb5a7bb5bp-81, 0x1.5786af187a96bp-27, 0x1.d7e6cp-2}, + TripleDouble{-0x1.ae6face57ad3bp-77, 0x1.3ab0dc56138c9p-23, 0x1.dfdd8p-2}, + TripleDouble{0x1.5ac93b443d55fp-78, 0x1.fe538ab34efb5p-22, 0x1.e7df4p-2}, + TripleDouble{0x1.f1753e0ae1e8fp-76, -0x1.e4fee07aa4b68p-22, 0x1.efec8p-2}, + TripleDouble{0x1.cdfd4c297069bp-76, -0x1.172f32fe67287p-22, 0x1.f804cp-2}, + TripleDouble{0x1.97a0e8f3ba742p-79, -0x1.9a83ff9ab9cc8p-22, 0x1.00144p-1}, + TripleDouble{-0x1.800450f5b2357p-78, -0x1.68cb06cece193p-22, 0x1.042bep-1}, + TripleDouble{-0x1.a839041241fe7p-78, 0x1.8cd71ddf82e2p-22, 0x1.08494p-1}, + TripleDouble{0x1.ed0b8eeccca86p-78, 0x1.5e18ab2df3ae6p-22, 0x1.0c6cap-1}, + TripleDouble{0x1.3dd41df9689b3p-79, 0x1.5dee4d9d8a273p-25, 0x1.1096p-1}, + TripleDouble{-0x1.990555535afdp-82, 0x1.fcd15f101c142p-26, 0x1.14c56p-1}, + TripleDouble{-0x1.1773d02c9055cp-77, -0x1.2474b0f992ba1p-23, 0x1.18faep-1}, + TripleDouble{-0x1.4aeef330c53c1p-78, 0x1.4b5a92a606047p-24, 0x1.1d368p-1}, + TripleDouble{0x1.8e6ff749ebacbp-77, 0x1.16186fcf54bbdp-22, 0x1.21786p-1}, + TripleDouble{0x1.c09d761c548ebp-84, 0x1.18efabeb7d722p-27, 0x1.25c0ap-1}, + TripleDouble{0x1.aaa73a428e1e4p-78, -0x1.e5fc7d238691dp-24, 0x1.2a0f4p-1}, + TripleDouble{-0x1.af2f3d8b63fbap-79, 0x1.f5809faf6283cp-22, 0x1.2e644p-1}, + TripleDouble{-0x1.af2f3d8b63fbap-79, 0x1.f5809faf6283cp-22, 0x1.2e644p-1}, + TripleDouble{0x1.78de359f2bb88p-77, 0x1.c6e1dcd0cb449p-22, 0x1.32bfep-1}, + TripleDouble{-0x1.415ae1a715618p-76, 0x1.76e0e8f74b4d5p-22, 0x1.37222p-1}, + TripleDouble{-0x1.4991b5375621fp-79, -0x1.cb82c89692d99p-24, 0x1.3b8b2p-1}, + TripleDouble{-0x1.827d37deb2236p-76, -0x1.63161c5432aebp-22, 0x1.3ffaep-1}, + TripleDouble{0x1.9576edac01c78p-77, 0x1.458104c41b901p-22, 0x1.44716p-1}, + TripleDouble{0x1.9576edac01c78p-77, 0x1.458104c41b901p-22, 0x1.44716p-1}, + TripleDouble{-0x1.05a27b81e2219p-77, -0x1.cd9d0cde578d5p-22, 0x1.48efp-1}, + TripleDouble{0x1.237616778b4bap-82, 0x1.b9884591add87p-26, 0x1.4d738p-1}, + TripleDouble{0x1.3b7d7e5d148bbp-76, 0x1.c6042978605ffp-22, 0x1.51ff2p-1}, + TripleDouble{-0x1.cc3f936a5977cp-79, -0x1.fc4c96b37dcf6p-22, 0x1.56922p-1}, + TripleDouble{0x1.20164a049664dp-83, -0x1.2f346e2bf924bp-24, 0x1.5b2c4p-1}, + TripleDouble{0x1.20164a049664dp-83, -0x1.2f346e2bf924bp-24, 0x1.5b2c4p-1}, + TripleDouble{-0x1.a212919a92f7ap-77, 0x1.c4e4fbb68a4d1p-22, 0x1.5fcdcp-1}, + TripleDouble{-0x1.b64b03f7230ddp-77, -0x1.9d499bd9b3226p-23, 0x1.6476ep-1}, + TripleDouble{-0x1.1ec6379e6e3b9p-77, -0x1.f89b355ede26fp-23, 0x1.69278p-1}, + TripleDouble{-0x1.1ec6379e6e3b9p-77, -0x1.f89b355ede26fp-23, 0x1.69278p-1}, + TripleDouble{-0x1.4ba44c03bfbbdp-78, 0x1.53c7e319f6e92p-24, 0x1.6ddfcp-1}, + TripleDouble{-0x1.c36fc650d030fp-77, -0x1.b291f070528c7p-22, 0x1.729fep-1}, + TripleDouble{-0x1.69e5693a7f067p-80, 0x1.2967a451a7b48p-25, 0x1.7767cp-1}, + TripleDouble{-0x1.69e5693a7f067p-80, 0x1.2967a451a7b48p-25, 0x1.7767cp-1}, + TripleDouble{0x1.6598aae91499ap-76, 0x1.244fcff690fcep-22, 0x1.7c37ap-1}, + TripleDouble{0x1.99d61ec432837p-77, 0x1.46fd97f5dc572p-23, 0x1.810fap-1}, + TripleDouble{0x1.99d61ec432837p-77, 0x1.46fd97f5dc572p-23, 0x1.810fap-1}, + TripleDouble{0x1.855c42078f81bp-76, -0x1.f3a7352663e5p-22, 0x1.85efep-1}, + TripleDouble{-0x1.59408e815107p-77, 0x1.b3cda690370b5p-23, 0x1.8ad84p-1}, + TripleDouble{-0x1.59408e815107p-77, 0x1.b3cda690370b5p-23, 0x1.8ad84p-1}, + TripleDouble{0x1.33b318085e50ap-78, 0x1.3226b211bf1d9p-23, 0x1.8fc92p-1}, + TripleDouble{0x1.343fe7c9cb4aep-79, 0x1.d24b136c101eep-23, 0x1.94c28p-1}, + TripleDouble{0x1.343fe7c9cb4aep-79, 0x1.d24b136c101eep-23, 0x1.94c28p-1}, + TripleDouble{-0x1.d19522e56fe6p-76, 0x1.7c40c7907e82ap-22, 0x1.99c48p-1}, + TripleDouble{-0x1.23b9d8ea55c3ep-77, -0x1.e81781d97ee91p-22, 0x1.9ecf6p-1}, + TripleDouble{-0x1.23b9d8ea55c3ep-77, -0x1.e81781d97ee91p-22, 0x1.9ecf6p-1}, + TripleDouble{0x1.829440c24aeb6p-78, -0x1.6a77813f94e01p-22, 0x1.a3e3p-1}, + TripleDouble{-0x1.624140d175ba2p-76, -0x1.1cfdeb43cfdp-22, 0x1.a8ffap-1}, + TripleDouble{-0x1.624140d175ba2p-76, -0x1.1cfdeb43cfdp-22, 0x1.a8ffap-1}, + TripleDouble{0x1.afa6f024fb045p-77, -0x1.f983f74d3138fp-23, 0x1.ae256p-1}, + TripleDouble{-0x1.603ad3a5d326dp-78, -0x1.e278ae1a1f51fp-23, 0x1.b3546p-1}, + TripleDouble{-0x1.603ad3a5d326dp-78, -0x1.e278ae1a1f51fp-23, 0x1.b3546p-1}, + TripleDouble{-0x1.0c1e0e5855d6ap-77, -0x1.97552b7b5ea45p-23, 0x1.b88ccp-1}, + TripleDouble{-0x1.0c1e0e5855d6ap-77, -0x1.97552b7b5ea45p-23, 0x1.b88ccp-1}, + TripleDouble{0x1.c817ad56baa16p-78, -0x1.19b4f3c72c4f8p-24, 0x1.bdceap-1}, + TripleDouble{0x1.44c47ac1bf62bp-77, 0x1.f7402d26f1a12p-23, 0x1.c31a2p-1}, + TripleDouble{0x1.44c47ac1bf62bp-77, 0x1.f7402d26f1a12p-23, 0x1.c31a2p-1}, + TripleDouble{-0x1.69b9465eae1e6p-78, -0x1.2056d5dd31d96p-23, 0x1.c86f8p-1}, + TripleDouble{-0x1.69b9465eae1e6p-78, -0x1.2056d5dd31d96p-23, 0x1.c86f8p-1}, + TripleDouble{-0x1.24a6d9d1d1904p-79, -0x1.6e46335aae723p-24, 0x1.cdcecp-1}, + TripleDouble{-0x1.3826144575ac4p-76, -0x1.beb244c59f331p-22, 0x1.d3382p-1}, + TripleDouble{-0x1.3826144575ac4p-76, -0x1.beb244c59f331p-22, 0x1.d3382p-1}, + TripleDouble{0x1.dbc96b3b12b25p-81, 0x1.16c071e93fd97p-27, 0x1.d8abap-1}, + TripleDouble{0x1.dbc96b3b12b25p-81, 0x1.16c071e93fd97p-27, 0x1.d8abap-1}, + TripleDouble{0x1.68a8ccdbd1f33p-77, 0x1.d8175819530c2p-22, 0x1.de298p-1}, + TripleDouble{0x1.68a8ccdbd1f33p-77, 0x1.d8175819530c2p-22, 0x1.de298p-1}, + TripleDouble{0x1.e586711df5ea1p-79, 0x1.51bd552842c1cp-23, 0x1.e3b2p-1}, + TripleDouble{0x1.e586711df5ea1p-79, 0x1.51bd552842c1cp-23, 0x1.e3b2p-1}, + TripleDouble{-0x1.bc25adf042483p-79, 0x1.914e204f19d94p-22, 0x1.e9452p-1}, + TripleDouble{-0x1.bc25adf042483p-79, 0x1.914e204f19d94p-22, 0x1.e9452p-1}, + TripleDouble{0x1.d7d82b65c5686p-76, 0x1.c55d997da24fdp-22, 0x1.eee32p-1}, + TripleDouble{0x1.d7d82b65c5686p-76, 0x1.c55d997da24fdp-22, 0x1.eee32p-1}, + TripleDouble{-0x1.3f108c0857ca3p-77, -0x1.685c2d2298a6ep-22, 0x1.f48c4p-1}, + TripleDouble{-0x1.3f108c0857ca3p-77, -0x1.685c2d2298a6ep-22, 0x1.f48c4p-1}, + TripleDouble{-0x1.bd800bca7a221p-78, 0x1.7a4887bd74039p-22, 0x1.fa406p-1}, + TripleDouble{0.0, 0.0, 1.0}, }; // Look up table for the second range reduction step: @@ -176,199 +176,199 @@ namespace ccm::gen::impl::internal::impl // print("{", c, ", ", b, "},"); // }; static constexpr std::array LOG2_R2_DD = { - DoubleDouble{ 0x1.ff25180953e64p-62, -0x1.720c2ab2312a9p-8 }, - DoubleDouble{ -0x1.15ffd79560d8fp-62, -0x1.6c4c92b1478ffp-8 }, - DoubleDouble{ 0x1.b8d6d6f2e3579p-62, -0x1.668ce3c873549p-8 }, - DoubleDouble{ -0x1.5bfc3f0d5ef71p-62, -0x1.60cd1df6fde91p-8 }, - DoubleDouble{ -0x1.d1f7a8777984ap-64, -0x1.5b0d413c30b5ep-8 }, - DoubleDouble{ 0x1.8e858515b8343p-66, -0x1.554d4d97551abp-8 }, - DoubleDouble{ 0x1.e165c4014c1f2p-62, -0x1.4f8d4307b46ecp-8 }, - DoubleDouble{ 0x1.0f84b2cc14c7ep-63, -0x1.49cd218c9800bp-8 }, - DoubleDouble{ 0x1.de618ed0db9a6p-62, -0x1.440ce9254916cp-8 }, - DoubleDouble{ -0x1.f6b8587e64f22p-62, -0x1.3e4c99d110ee7p-8 }, - DoubleDouble{ -0x1.7f793c84cfa63p-64, -0x1.388c338f38bdp-8 }, - DoubleDouble{ -0x1.7d7ecf6258c9ap-65, -0x1.32cbb65f09aeep-8 }, - DoubleDouble{ -0x1.810bc5ac188f5p-62, -0x1.2d0b223fcce81p-8 }, - DoubleDouble{ -0x1.950035fc5b67cp-62, -0x1.274a7730cb841p-8 }, - DoubleDouble{ 0x1.4f47f3048cdadp-62, -0x1.2189b5314e95dp-8 }, - DoubleDouble{ 0x1.269519861e298p-68, -0x1.1bc8dc409f279p-8 }, - DoubleDouble{ -0x1.5c2b0a46a7e2fp-62, -0x1.1607ec5e063b3p-8 }, - DoubleDouble{ 0x1.5001ac8f0bda8p-63, -0x1.1046e588cccap-8 }, - DoubleDouble{ 0x1.106f246af5d41p-62, -0x1.0a85c7c03bc4ap-8 }, - DoubleDouble{ 0x1.82a00583b34bap-66, -0x1.0354423e3c666p-8 }, - DoubleDouble{ 0x1.b6f37deb3137p-65, -0x1.fb25e19f11aecp-9 }, - DoubleDouble{ -0x1.44a2140444811p-63, -0x1.efa310d6550ecp-9 }, - DoubleDouble{ 0x1.f5e68a763133fp-63, -0x1.e4201220d4858p-9 }, - DoubleDouble{ 0x1.692083115f0b9p-63, -0x1.d89ce57d219a6p-9 }, - DoubleDouble{ 0x1.144bb17b9ac9cp-63, -0x1.cd198ae9cdc3dp-9 }, - DoubleDouble{ 0x1.ee7f086d32c05p-63, -0x1.c19602656a671p-9 }, - DoubleDouble{ -0x1.d4f1167538dbep-63, -0x1.b6124bee88d82p-9 }, - DoubleDouble{ 0x1.7df8d226c67ep-63, -0x1.aa8e6783ba5a2p-9 }, - DoubleDouble{ 0x1.60545d61b9512p-63, -0x1.9f0a5523901ebp-9 }, - DoubleDouble{ 0x1.54c99c291702p-63, -0x1.938614cc9b468p-9 }, - DoubleDouble{ -0x1.a7e678d7280dep-64, -0x1.8801a67d6ce1p-9 }, - DoubleDouble{ -0x1.6d419bbeb223ap-64, -0x1.7c7d0a3495ec9p-9 }, - DoubleDouble{ 0x1.ce2b9892e27e9p-64, -0x1.70f83ff0a7565p-9 }, - DoubleDouble{ -0x1.a4db4eff7bd61p-63, -0x1.657347b031fa2p-9 }, - DoubleDouble{ 0x1.5bb04682fab82p-63, -0x1.59ee2171c6a2fp-9 }, - DoubleDouble{ -0x1.78b8bfe6a3adep-64, -0x1.4e68cd33f60a3p-9 }, - DoubleDouble{ 0x1.574c3ce9b89b1p-63, -0x1.42e34af550d87p-9 }, - DoubleDouble{ 0x1.08fb216647b7bp-63, -0x1.375d9ab467a4dp-9 }, - DoubleDouble{ 0x1.ed5a50e7b919cp-66, -0x1.2bd7bc6fcaf56p-9 }, - DoubleDouble{ 0x1.91ad7a23f86fep-63, -0x1.2051b0260b3fp-9 }, - DoubleDouble{ 0x1.3ab2c932b8b0ap-64, -0x1.14cb75d5b8e54p-9 }, - DoubleDouble{ -0x1.c63bcdf120f7ap-63, -0x1.09450d7d643a9p-9 }, - DoubleDouble{ 0x1.8af8c4ab4e82dp-64, -0x1.fb7cee373b008p-10 }, - DoubleDouble{ 0x1.a52c2ca9d8b9bp-65, -0x1.e46f655de9cc6p-10 }, - DoubleDouble{ -0x1.460b177a58742p-64, -0x1.cd61806bf5166p-10 }, - DoubleDouble{ 0x1.611089de8d12ap-66, -0x1.b6533f5e7cf9bp-10 }, - DoubleDouble{ -0x1.4209853cee70cp-69, -0x1.9f44a232a16eep-10 }, - DoubleDouble{ 0x1.964e032541a28p-64, -0x1.8835a8e5824c3p-10 }, - DoubleDouble{ -0x1.fa9f94392637bp-66, -0x1.712653743f454p-10 }, - DoubleDouble{ -0x1.3293693721a53p-64, -0x1.5a16a1dbf7eb6p-10 }, - DoubleDouble{ -0x1.6e2af03c83c6ep-68, -0x1.43069419cbad5p-10 }, - DoubleDouble{ -0x1.b5f05b9d5bd29p-65, -0x1.2bf62a2ad9d74p-10 }, - DoubleDouble{ 0x1.3db883c072f72p-64, -0x1.14e5640c4193p-10 }, - DoubleDouble{ -0x1.a675a1c045304p-68, -0x1.fba8837643cf6p-11 }, - DoubleDouble{ 0x1.3b9c2aeb00068p-66, -0x1.cd85866933743p-11 }, - DoubleDouble{ -0x1.2911a381901ebp-66, -0x1.9f61d0eb8f98bp-11 }, - DoubleDouble{ -0x1.5ea75a74def03p-68, -0x1.713d62f7957c3p-11 }, - DoubleDouble{ -0x1.305b92f93ffep-67, -0x1.43183c878218dp-11 }, - DoubleDouble{ 0x1.b7c8c8dd40d35p-68, -0x1.14f25d959223ap-11 }, - DoubleDouble{ 0x1.dc915d58a62f6p-66, -0x1.cd978c3804191p-12 }, - DoubleDouble{ 0x1.c7bc3fe53cd94p-66, -0x1.7148ec2a1bfc9p-12 }, - DoubleDouble{ -0x1.427ce595cc53cp-67, -0x1.14f8daf5e3bcfp-12 }, - DoubleDouble{ -0x1.d523885ac824cp-67, -0x1.714eb11fa5363p-13 }, - DoubleDouble{ -0x1.945957f63330ap-69, -0x1.715193b17d35dp-14 }, - DoubleDouble{ 0, 0 }, - DoubleDouble{ -0x1.88fb2ea8bf9eap-70, 0x1.7157590356aeep-14 }, - DoubleDouble{ -0x1.5aeaee345d04ep-68, 0x1.715a3bc3593d5p-13 }, - DoubleDouble{ -0x1.7fce430230132p-66, 0x1.1505d6ee104c5p-12 }, - DoubleDouble{ -0x1.9a480f204ff09p-70, 0x1.716001718cb2bp-12 }, - DoubleDouble{ -0x1.00e7233f2d8bdp-68, 0x1.cdbb9d77ae5a8p-12 }, - DoubleDouble{ 0x1.09d379fa18c5dp-67, 0x1.150c5586012b8p-11 }, - DoubleDouble{ 0x1.b6b9d90a104d3p-65, 0x1.433b951d0b231p-11 }, - DoubleDouble{ 0x1.4d9a3ea651885p-65, 0x1.716b8d86bc285p-11 }, - DoubleDouble{ -0x1.7590b3a76f0f9p-67, 0x1.9f9c3ec8db94fp-11 }, - DoubleDouble{ 0x1.f183ca5b21bfep-65, 0x1.cdcda8e93107fp-11 }, - DoubleDouble{ -0x1.a7e3465ba127p-66, 0x1.fbffcbed8465fp-11 }, - DoubleDouble{ -0x1.7821f738d1221p-64, 0x1.151953edceec6p-10 }, - DoubleDouble{ 0x1.3bb4c0fb95359p-65, 0x1.2c331e5ca2e7dp-10 }, - DoubleDouble{ 0x1.236028e962f8p-64, 0x1.434d4546227fcp-10 }, - DoubleDouble{ 0x1.aaaa64d30f184p-66, 0x1.5a67c8ad32315p-10 }, - DoubleDouble{ -0x1.a821b7cc57a7ap-64, 0x1.7182a894b69c6p-10 }, - DoubleDouble{ -0x1.13d9d78aace21p-64, 0x1.889de4ff94838p-10 }, - DoubleDouble{ -0x1.2f249a6b923ap-64, 0x1.9fb97df0b0cc2p-10 }, - DoubleDouble{ -0x1.d47dc3664be7ap-68, 0x1.b6d5736af07e6p-10 }, - DoubleDouble{ 0x1.bd1522c6418fbp-64, 0x1.cdf1c57138c53p-10 }, - DoubleDouble{ -0x1.bacdbb22d2163p-64, 0x1.e50e74066eee6p-10 }, - DoubleDouble{ -0x1.ca7604812d77bp-64, 0x1.fc2b7f2d786a5p-10 }, - DoubleDouble{ -0x1.2b6832f8830bfp-63, 0x1.09a473749d663p-9 }, - DoubleDouble{ 0x1.4e712033d0457p-65, 0x1.1533559e4de55p-9 }, - DoubleDouble{ -0x1.473dd044017b5p-66, 0x1.20c26615409f1p-9 }, - DoubleDouble{ -0x1.e033bcac726d3p-63, 0x1.2c51a4dae8915p-9 }, - DoubleDouble{ -0x1.4a47a2b18a0fap-63, 0x1.37e111f0b8cb5p-9 }, - DoubleDouble{ 0x1.6f3615771c17bp-66, 0x1.4370ad58246ddp-9 }, - DoubleDouble{ 0x1.c0ee6c32d6236p-65, 0x1.4f0077129eabp-9 }, - DoubleDouble{ 0x1.fa94c99761b8fp-64, 0x1.5a906f219ac67p-9 }, - DoubleDouble{ -0x1.979e6b473fbf8p-64, 0x1.662095868c153p-9 }, - DoubleDouble{ 0x1.30edde8d24c7bp-64, 0x1.71b0ea42e5fdap-9 }, - DoubleDouble{ -0x1.d01594fe1421cp-64, 0x1.7d416d581bf7cp-9 }, - DoubleDouble{ 0x1.50bf7b995b49ap-63, 0x1.88d21ec7a18cdp-9 }, - DoubleDouble{ -0x1.28ea2bcec5018p-63, 0x1.9462fe92ea57cp-9 }, - DoubleDouble{ 0x1.ed6add489c30bp-65, 0x1.9ff40cbb6a04bp-9 }, - DoubleDouble{ 0x1.201d5c3bbeb69p-64, 0x1.ab85494294517p-9 }, - DoubleDouble{ -0x1.a05d0d4461ea9p-64, 0x1.b716b429dd0d3p-9 }, - DoubleDouble{ -0x1.7c974c8a392fdp-63, 0x1.c2a84d72b8189p-9 }, - DoubleDouble{ -0x1.f068238451bdep-64, 0x1.ce3a151e9965bp-9 }, - DoubleDouble{ -0x1.5e4d95c6259c3p-66, 0x1.d9cc0b2ef4f83p-9 }, - DoubleDouble{ -0x1.1fc262efaad6cp-63, 0x1.e55e2fa53ee53p-9 }, - DoubleDouble{ 0x1.49eee7abc7716p-63, 0x1.f0f08282eb533p-9 }, - DoubleDouble{ -0x1.903de284d2782p-65, 0x1.fc8303c96e7a6p-9 }, - DoubleDouble{ -0x1.ec564845134cbp-63, 0x1.040ad9bd1e522p-8 }, - DoubleDouble{ -0x1.7692b7791cf1fp-66, 0x1.0861eadabc3dcp-8 }, - DoubleDouble{ -0x1.37829afb11c1p-62, 0x1.0e2b6b51e4f7ep-8 }, - DoubleDouble{ 0x1.6706b91c3b0bap-62, 0x1.13f5030033459p-8 }, - DoubleDouble{ -0x1.7558ccd710756p-62, 0x1.19beb1e6616c9p-8 }, - DoubleDouble{ 0x1.79f72a5bbe9dep-62, 0x1.1f88780529bb1p-8 }, - DoubleDouble{ -0x1.e1297c110b25p-62, 0x1.2552555d46886p-8 }, - DoubleDouble{ 0x1.29930d567ca26p-62, 0x1.2b1c49ef72343p-8 }, - DoubleDouble{ 0x1.a08cbd7592a17p-65, 0x1.30e655bc67275p-8 }, - DoubleDouble{ 0x1.e4f9d4ac5db83p-62, 0x1.36b078c4dfd31p-8 }, - DoubleDouble{ -0x1.ed1b0aafd30c2p-62, 0x1.3c7ab30996b1cp-8 }, - DoubleDouble{ 0x1.e78f0aa014b32p-62, 0x1.4245048b46462p-8 }, - DoubleDouble{ 0x1.8594548038a0fp-69, 0x1.480f6d4aa91c2p-8 }, - DoubleDouble{ 0x1.3df498168a333p-63, 0x1.4dd9ed4879c82p-8 }, - DoubleDouble{ 0x1.b1c502544f82ap-62, 0x1.53a4848572e77p-8 }, - DoubleDouble{ -0x1.dc50552fe0da9p-63, 0x1.596f33024f203p-8 }, - DoubleDouble{ -0x1.671d85c357d5ep-62, 0x1.5f39f8bfc9212p-8 }, - DoubleDouble{ 0x1.1c670cabccefap-64, 0x1.6504d5be9ba1ep-8 }, - DoubleDouble{ -0x1.9983a9e98f318p-62, 0x1.6acfc9ff8162fp-8 }, - DoubleDouble{ 0x1.ae1a26af3eebep-62, 0x1.709ad583352d6p-8 }, - DoubleDouble{ 0x1.655eb510bfda3p-62, 0x1.7665f84a71d35p-8 }, - DoubleDouble{ -0x1.e287bc0192e15p-64, 0x1.7c313255f22f8p-8 }, - DoubleDouble{ 0x1.cc4944139ccbfp-63, 0x1.81fc83a671257p-8 }, - DoubleDouble{ 0x1.4e09b4cb8645bp-62, 0x1.87c7ec3ca9a19p-8 }, - DoubleDouble{ -0x1.5becc991e3a5fp-64, 0x1.8d936c1956991p-8 }, - DoubleDouble{ -0x1.ddfa3f1e15ba8p-62, 0x1.935f033d3309ep-8 }, - DoubleDouble{ -0x1.b7b06ea3fb362p-62, 0x1.992ab1a8f9facp-8 }, - DoubleDouble{ 0x1.32d614904e46cp-62, 0x1.9ef6775d667b4p-8 }, - DoubleDouble{ -0x1.7186892b5bfaep-64, 0x1.a4c2545b33a3ep-8 }, - DoubleDouble{ -0x1.d4de10b28dfd8p-62, 0x1.aa8e48a31c95cp-8 }, - DoubleDouble{ 0x1.4bb4b3bdc8175p-62, 0x1.b05a5435dc7adp-8 }, - DoubleDouble{ 0x1.9cedbd1d7fba5p-62, 0x1.b62677142e86p-8 }, - DoubleDouble{ -0x1.0ed3379beaffdp-66, 0x1.bbf2b13ecdf2fp-8 }, - DoubleDouble{ 0x1.6e86a125567a6p-62, 0x1.c1bf02b67606p-8 }, - DoubleDouble{ -0x1.35038e0c0a52cp-62, 0x1.c6184f1b326d9p-8 }, - DoubleDouble{ 0x1.05ef8bf5adf5ep-67, 0x1.cbe4c95b6c5abp-8 }, - DoubleDouble{ -0x1.b7338b99a6b26p-65, 0x1.d1b15aeab217cp-8 }, - DoubleDouble{ 0x1.9e901c30c427ep-63, 0x1.d77e03c9bf0a4p-8 }, - DoubleDouble{ -0x1.1f28a9c0b3d47p-62, 0x1.dd4ac3f94ea0ap-8 }, - DoubleDouble{ -0x1.140ef760d3b63p-62, 0x1.e3179b7a1c52p-8 }, - DoubleDouble{ -0x1.ab65b1037f517p-63, 0x1.e8e48a4ce39e7p-8 }, - DoubleDouble{ -0x1.76940c457ce6dp-63, 0x1.eeb19072600edp-8 }, - DoubleDouble{ 0x1.da3ae65a605cfp-64, 0x1.f47eadeb4d34dp-8 }, - DoubleDouble{ 0x1.b15d0bce2ede6p-62, 0x1.fa4be2b866abp-8 }, - DoubleDouble{ 0x1.e02aa1fa9dc57p-61, 0x1.000c976d340a6p-7 }, - DoubleDouble{ 0x1.6be971a5565b9p-62, 0x1.02f34929068f3p-7 }, - DoubleDouble{ -0x1.8a9319a6ed164p-64, 0x1.05da069008be7p-7 }, - DoubleDouble{ 0x1.825079f1e0ec5p-62, 0x1.08c0cfa298771p-7 }, - DoubleDouble{ 0x1.60d5749321466p-63, 0x1.0ba7a461139c8p-7 }, - DoubleDouble{ -0x1.5b8f4c479e2ep-61, 0x1.0e8e84cbd8169p-7 }, - DoubleDouble{ -0x1.e3e1248004e29p-62, 0x1.117570e343d17p-7 }, - DoubleDouble{ 0x1.9ac06487c375p-63, 0x1.145c68a7b4bddp-7 }, - DoubleDouble{ 0x1.f657ea5c03ea4p-62, 0x1.17436c1988d0dp-7 }, - DoubleDouble{ -0x1.5a965659a05e2p-61, 0x1.1a2a7b391e04p-7 }, - DoubleDouble{ -0x1.21ce9b9bfc512p-61, 0x1.1d119606d2554p-7 }, - DoubleDouble{ -0x1.30fda247ad0e1p-61, 0x1.1ff8bc8303c7p-7 }, - DoubleDouble{ -0x1.382c78a45cdeap-62, 0x1.22dfeeae10601p-7 }, - DoubleDouble{ 0x1.46ae4a64073d4p-61, 0x1.250d5bf952374p-7 }, - DoubleDouble{ -0x1.dcad2cec3b84bp-62, 0x1.27f4a29740a2fp-7 }, - DoubleDouble{ -0x1.413fbeb0b0635p-61, 0x1.2adbf4e50cdf9p-7 }, - DoubleDouble{ 0x1.f28e6a48bcb9p-61, 0x1.2dc352e315049p-7 }, - DoubleDouble{ -0x1.96f286e1eb086p-61, 0x1.30aabc91b72ep-7 }, - DoubleDouble{ -0x1.f88c04206dfa1p-61, 0x1.339231f1517c1p-7 }, - DoubleDouble{ -0x1.11ea20e195841p-61, 0x1.3679b30242139p-7 }, - DoubleDouble{ -0x1.d6e71452b674ap-63, 0x1.39613fc4e71dcp-7 }, - DoubleDouble{ -0x1.57c578233b1b3p-61, 0x1.3c48d8399ec85p-7 }, - DoubleDouble{ -0x1.ec430f03b76ep-63, 0x1.3f307c60c7455p-7 }, - DoubleDouble{ 0x1.e00dd1902ffb9p-61, 0x1.42182c3abecb5p-7 }, - DoubleDouble{ -0x1.f22bcd96afe38p-61, 0x1.44ffe7c7e3957p-7 }, - DoubleDouble{ 0x1.08fd90f841d3p-61, 0x1.47e7af0893e2fp-7 }, - DoubleDouble{ 0x1.09594c5552bccp-62, 0x1.4acf81fd2df7ep-7 }, - DoubleDouble{ -0x1.01a8a652e5602p-61, 0x1.4db760a6101c9p-7 }, - DoubleDouble{ -0x1.826168febb3dp-64, 0x1.509f4b03989dcp-7 }, - DoubleDouble{ -0x1.7eb21a35021e3p-62, 0x1.5387411625cccp-7 }, - DoubleDouble{ -0x1.66cbc818e175p-61, 0x1.566f42de15ff4p-7 }, - DoubleDouble{ 0x1.9b784dd6cebdap-64, 0x1.5957505bc78f6p-7 }, - DoubleDouble{ 0x1.2b121ab482456p-61, 0x1.5b8562298c65bp-7 }, - DoubleDouble{ -0x1.5d29869dd8233p-62, 0x1.5e6d842633702p-7 }, - DoubleDouble{ -0x1.572a1b6cd63cfp-61, 0x1.6155b1d99f672p-7 }, - DoubleDouble{ -0x1.a1f355360e877p-62, 0x1.643deb442eb59p-7 }, - DoubleDouble{ -0x1.b6f1cd2e1c03fp-61, 0x1.672630663fcadp-7 }, - DoubleDouble{ -0x1.2aaa11ccddcaep-61, 0x1.6a0e8140311aap-7 }, - DoubleDouble{ 0x1.3d979ddf4746cp-61, 0x1.6cf6ddd2611d4p-7 }, - DoubleDouble{ -0x1.dc930484501f8p-63, 0x1.6fdf461d2e4f8p-7 }, + DoubleDouble{0x1.ff25180953e64p-62, -0x1.720c2ab2312a9p-8}, + DoubleDouble{-0x1.15ffd79560d8fp-62, -0x1.6c4c92b1478ffp-8}, + DoubleDouble{0x1.b8d6d6f2e3579p-62, -0x1.668ce3c873549p-8}, + DoubleDouble{-0x1.5bfc3f0d5ef71p-62, -0x1.60cd1df6fde91p-8}, + DoubleDouble{-0x1.d1f7a8777984ap-64, -0x1.5b0d413c30b5ep-8}, + DoubleDouble{0x1.8e858515b8343p-66, -0x1.554d4d97551abp-8}, + DoubleDouble{0x1.e165c4014c1f2p-62, -0x1.4f8d4307b46ecp-8}, + DoubleDouble{0x1.0f84b2cc14c7ep-63, -0x1.49cd218c9800bp-8}, + DoubleDouble{0x1.de618ed0db9a6p-62, -0x1.440ce9254916cp-8}, + DoubleDouble{-0x1.f6b8587e64f22p-62, -0x1.3e4c99d110ee7p-8}, + DoubleDouble{-0x1.7f793c84cfa63p-64, -0x1.388c338f38bdp-8}, + DoubleDouble{-0x1.7d7ecf6258c9ap-65, -0x1.32cbb65f09aeep-8}, + DoubleDouble{-0x1.810bc5ac188f5p-62, -0x1.2d0b223fcce81p-8}, + DoubleDouble{-0x1.950035fc5b67cp-62, -0x1.274a7730cb841p-8}, + DoubleDouble{0x1.4f47f3048cdadp-62, -0x1.2189b5314e95dp-8}, + DoubleDouble{0x1.269519861e298p-68, -0x1.1bc8dc409f279p-8}, + DoubleDouble{-0x1.5c2b0a46a7e2fp-62, -0x1.1607ec5e063b3p-8}, + DoubleDouble{0x1.5001ac8f0bda8p-63, -0x1.1046e588cccap-8}, + DoubleDouble{0x1.106f246af5d41p-62, -0x1.0a85c7c03bc4ap-8}, + DoubleDouble{0x1.82a00583b34bap-66, -0x1.0354423e3c666p-8}, + DoubleDouble{0x1.b6f37deb3137p-65, -0x1.fb25e19f11aecp-9}, + DoubleDouble{-0x1.44a2140444811p-63, -0x1.efa310d6550ecp-9}, + DoubleDouble{0x1.f5e68a763133fp-63, -0x1.e4201220d4858p-9}, + DoubleDouble{0x1.692083115f0b9p-63, -0x1.d89ce57d219a6p-9}, + DoubleDouble{0x1.144bb17b9ac9cp-63, -0x1.cd198ae9cdc3dp-9}, + DoubleDouble{0x1.ee7f086d32c05p-63, -0x1.c19602656a671p-9}, + DoubleDouble{-0x1.d4f1167538dbep-63, -0x1.b6124bee88d82p-9}, + DoubleDouble{0x1.7df8d226c67ep-63, -0x1.aa8e6783ba5a2p-9}, + DoubleDouble{0x1.60545d61b9512p-63, -0x1.9f0a5523901ebp-9}, + DoubleDouble{0x1.54c99c291702p-63, -0x1.938614cc9b468p-9}, + DoubleDouble{-0x1.a7e678d7280dep-64, -0x1.8801a67d6ce1p-9}, + DoubleDouble{-0x1.6d419bbeb223ap-64, -0x1.7c7d0a3495ec9p-9}, + DoubleDouble{0x1.ce2b9892e27e9p-64, -0x1.70f83ff0a7565p-9}, + DoubleDouble{-0x1.a4db4eff7bd61p-63, -0x1.657347b031fa2p-9}, + DoubleDouble{0x1.5bb04682fab82p-63, -0x1.59ee2171c6a2fp-9}, + DoubleDouble{-0x1.78b8bfe6a3adep-64, -0x1.4e68cd33f60a3p-9}, + DoubleDouble{0x1.574c3ce9b89b1p-63, -0x1.42e34af550d87p-9}, + DoubleDouble{0x1.08fb216647b7bp-63, -0x1.375d9ab467a4dp-9}, + DoubleDouble{0x1.ed5a50e7b919cp-66, -0x1.2bd7bc6fcaf56p-9}, + DoubleDouble{0x1.91ad7a23f86fep-63, -0x1.2051b0260b3fp-9}, + DoubleDouble{0x1.3ab2c932b8b0ap-64, -0x1.14cb75d5b8e54p-9}, + DoubleDouble{-0x1.c63bcdf120f7ap-63, -0x1.09450d7d643a9p-9}, + DoubleDouble{0x1.8af8c4ab4e82dp-64, -0x1.fb7cee373b008p-10}, + DoubleDouble{0x1.a52c2ca9d8b9bp-65, -0x1.e46f655de9cc6p-10}, + DoubleDouble{-0x1.460b177a58742p-64, -0x1.cd61806bf5166p-10}, + DoubleDouble{0x1.611089de8d12ap-66, -0x1.b6533f5e7cf9bp-10}, + DoubleDouble{-0x1.4209853cee70cp-69, -0x1.9f44a232a16eep-10}, + DoubleDouble{0x1.964e032541a28p-64, -0x1.8835a8e5824c3p-10}, + DoubleDouble{-0x1.fa9f94392637bp-66, -0x1.712653743f454p-10}, + DoubleDouble{-0x1.3293693721a53p-64, -0x1.5a16a1dbf7eb6p-10}, + DoubleDouble{-0x1.6e2af03c83c6ep-68, -0x1.43069419cbad5p-10}, + DoubleDouble{-0x1.b5f05b9d5bd29p-65, -0x1.2bf62a2ad9d74p-10}, + DoubleDouble{0x1.3db883c072f72p-64, -0x1.14e5640c4193p-10}, + DoubleDouble{-0x1.a675a1c045304p-68, -0x1.fba8837643cf6p-11}, + DoubleDouble{0x1.3b9c2aeb00068p-66, -0x1.cd85866933743p-11}, + DoubleDouble{-0x1.2911a381901ebp-66, -0x1.9f61d0eb8f98bp-11}, + DoubleDouble{-0x1.5ea75a74def03p-68, -0x1.713d62f7957c3p-11}, + DoubleDouble{-0x1.305b92f93ffep-67, -0x1.43183c878218dp-11}, + DoubleDouble{0x1.b7c8c8dd40d35p-68, -0x1.14f25d959223ap-11}, + DoubleDouble{0x1.dc915d58a62f6p-66, -0x1.cd978c3804191p-12}, + DoubleDouble{0x1.c7bc3fe53cd94p-66, -0x1.7148ec2a1bfc9p-12}, + DoubleDouble{-0x1.427ce595cc53cp-67, -0x1.14f8daf5e3bcfp-12}, + DoubleDouble{-0x1.d523885ac824cp-67, -0x1.714eb11fa5363p-13}, + DoubleDouble{-0x1.945957f63330ap-69, -0x1.715193b17d35dp-14}, + DoubleDouble{0, 0}, + DoubleDouble{-0x1.88fb2ea8bf9eap-70, 0x1.7157590356aeep-14}, + DoubleDouble{-0x1.5aeaee345d04ep-68, 0x1.715a3bc3593d5p-13}, + DoubleDouble{-0x1.7fce430230132p-66, 0x1.1505d6ee104c5p-12}, + DoubleDouble{-0x1.9a480f204ff09p-70, 0x1.716001718cb2bp-12}, + DoubleDouble{-0x1.00e7233f2d8bdp-68, 0x1.cdbb9d77ae5a8p-12}, + DoubleDouble{0x1.09d379fa18c5dp-67, 0x1.150c5586012b8p-11}, + DoubleDouble{0x1.b6b9d90a104d3p-65, 0x1.433b951d0b231p-11}, + DoubleDouble{0x1.4d9a3ea651885p-65, 0x1.716b8d86bc285p-11}, + DoubleDouble{-0x1.7590b3a76f0f9p-67, 0x1.9f9c3ec8db94fp-11}, + DoubleDouble{0x1.f183ca5b21bfep-65, 0x1.cdcda8e93107fp-11}, + DoubleDouble{-0x1.a7e3465ba127p-66, 0x1.fbffcbed8465fp-11}, + DoubleDouble{-0x1.7821f738d1221p-64, 0x1.151953edceec6p-10}, + DoubleDouble{0x1.3bb4c0fb95359p-65, 0x1.2c331e5ca2e7dp-10}, + DoubleDouble{0x1.236028e962f8p-64, 0x1.434d4546227fcp-10}, + DoubleDouble{0x1.aaaa64d30f184p-66, 0x1.5a67c8ad32315p-10}, + DoubleDouble{-0x1.a821b7cc57a7ap-64, 0x1.7182a894b69c6p-10}, + DoubleDouble{-0x1.13d9d78aace21p-64, 0x1.889de4ff94838p-10}, + DoubleDouble{-0x1.2f249a6b923ap-64, 0x1.9fb97df0b0cc2p-10}, + DoubleDouble{-0x1.d47dc3664be7ap-68, 0x1.b6d5736af07e6p-10}, + DoubleDouble{0x1.bd1522c6418fbp-64, 0x1.cdf1c57138c53p-10}, + DoubleDouble{-0x1.bacdbb22d2163p-64, 0x1.e50e74066eee6p-10}, + DoubleDouble{-0x1.ca7604812d77bp-64, 0x1.fc2b7f2d786a5p-10}, + DoubleDouble{-0x1.2b6832f8830bfp-63, 0x1.09a473749d663p-9}, + DoubleDouble{0x1.4e712033d0457p-65, 0x1.1533559e4de55p-9}, + DoubleDouble{-0x1.473dd044017b5p-66, 0x1.20c26615409f1p-9}, + DoubleDouble{-0x1.e033bcac726d3p-63, 0x1.2c51a4dae8915p-9}, + DoubleDouble{-0x1.4a47a2b18a0fap-63, 0x1.37e111f0b8cb5p-9}, + DoubleDouble{0x1.6f3615771c17bp-66, 0x1.4370ad58246ddp-9}, + DoubleDouble{0x1.c0ee6c32d6236p-65, 0x1.4f0077129eabp-9}, + DoubleDouble{0x1.fa94c99761b8fp-64, 0x1.5a906f219ac67p-9}, + DoubleDouble{-0x1.979e6b473fbf8p-64, 0x1.662095868c153p-9}, + DoubleDouble{0x1.30edde8d24c7bp-64, 0x1.71b0ea42e5fdap-9}, + DoubleDouble{-0x1.d01594fe1421cp-64, 0x1.7d416d581bf7cp-9}, + DoubleDouble{0x1.50bf7b995b49ap-63, 0x1.88d21ec7a18cdp-9}, + DoubleDouble{-0x1.28ea2bcec5018p-63, 0x1.9462fe92ea57cp-9}, + DoubleDouble{0x1.ed6add489c30bp-65, 0x1.9ff40cbb6a04bp-9}, + DoubleDouble{0x1.201d5c3bbeb69p-64, 0x1.ab85494294517p-9}, + DoubleDouble{-0x1.a05d0d4461ea9p-64, 0x1.b716b429dd0d3p-9}, + DoubleDouble{-0x1.7c974c8a392fdp-63, 0x1.c2a84d72b8189p-9}, + DoubleDouble{-0x1.f068238451bdep-64, 0x1.ce3a151e9965bp-9}, + DoubleDouble{-0x1.5e4d95c6259c3p-66, 0x1.d9cc0b2ef4f83p-9}, + DoubleDouble{-0x1.1fc262efaad6cp-63, 0x1.e55e2fa53ee53p-9}, + DoubleDouble{0x1.49eee7abc7716p-63, 0x1.f0f08282eb533p-9}, + DoubleDouble{-0x1.903de284d2782p-65, 0x1.fc8303c96e7a6p-9}, + DoubleDouble{-0x1.ec564845134cbp-63, 0x1.040ad9bd1e522p-8}, + DoubleDouble{-0x1.7692b7791cf1fp-66, 0x1.0861eadabc3dcp-8}, + DoubleDouble{-0x1.37829afb11c1p-62, 0x1.0e2b6b51e4f7ep-8}, + DoubleDouble{0x1.6706b91c3b0bap-62, 0x1.13f5030033459p-8}, + DoubleDouble{-0x1.7558ccd710756p-62, 0x1.19beb1e6616c9p-8}, + DoubleDouble{0x1.79f72a5bbe9dep-62, 0x1.1f88780529bb1p-8}, + DoubleDouble{-0x1.e1297c110b25p-62, 0x1.2552555d46886p-8}, + DoubleDouble{0x1.29930d567ca26p-62, 0x1.2b1c49ef72343p-8}, + DoubleDouble{0x1.a08cbd7592a17p-65, 0x1.30e655bc67275p-8}, + DoubleDouble{0x1.e4f9d4ac5db83p-62, 0x1.36b078c4dfd31p-8}, + DoubleDouble{-0x1.ed1b0aafd30c2p-62, 0x1.3c7ab30996b1cp-8}, + DoubleDouble{0x1.e78f0aa014b32p-62, 0x1.4245048b46462p-8}, + DoubleDouble{0x1.8594548038a0fp-69, 0x1.480f6d4aa91c2p-8}, + DoubleDouble{0x1.3df498168a333p-63, 0x1.4dd9ed4879c82p-8}, + DoubleDouble{0x1.b1c502544f82ap-62, 0x1.53a4848572e77p-8}, + DoubleDouble{-0x1.dc50552fe0da9p-63, 0x1.596f33024f203p-8}, + DoubleDouble{-0x1.671d85c357d5ep-62, 0x1.5f39f8bfc9212p-8}, + DoubleDouble{0x1.1c670cabccefap-64, 0x1.6504d5be9ba1ep-8}, + DoubleDouble{-0x1.9983a9e98f318p-62, 0x1.6acfc9ff8162fp-8}, + DoubleDouble{0x1.ae1a26af3eebep-62, 0x1.709ad583352d6p-8}, + DoubleDouble{0x1.655eb510bfda3p-62, 0x1.7665f84a71d35p-8}, + DoubleDouble{-0x1.e287bc0192e15p-64, 0x1.7c313255f22f8p-8}, + DoubleDouble{0x1.cc4944139ccbfp-63, 0x1.81fc83a671257p-8}, + DoubleDouble{0x1.4e09b4cb8645bp-62, 0x1.87c7ec3ca9a19p-8}, + DoubleDouble{-0x1.5becc991e3a5fp-64, 0x1.8d936c1956991p-8}, + DoubleDouble{-0x1.ddfa3f1e15ba8p-62, 0x1.935f033d3309ep-8}, + DoubleDouble{-0x1.b7b06ea3fb362p-62, 0x1.992ab1a8f9facp-8}, + DoubleDouble{0x1.32d614904e46cp-62, 0x1.9ef6775d667b4p-8}, + DoubleDouble{-0x1.7186892b5bfaep-64, 0x1.a4c2545b33a3ep-8}, + DoubleDouble{-0x1.d4de10b28dfd8p-62, 0x1.aa8e48a31c95cp-8}, + DoubleDouble{0x1.4bb4b3bdc8175p-62, 0x1.b05a5435dc7adp-8}, + DoubleDouble{0x1.9cedbd1d7fba5p-62, 0x1.b62677142e86p-8}, + DoubleDouble{-0x1.0ed3379beaffdp-66, 0x1.bbf2b13ecdf2fp-8}, + DoubleDouble{0x1.6e86a125567a6p-62, 0x1.c1bf02b67606p-8}, + DoubleDouble{-0x1.35038e0c0a52cp-62, 0x1.c6184f1b326d9p-8}, + DoubleDouble{0x1.05ef8bf5adf5ep-67, 0x1.cbe4c95b6c5abp-8}, + DoubleDouble{-0x1.b7338b99a6b26p-65, 0x1.d1b15aeab217cp-8}, + DoubleDouble{0x1.9e901c30c427ep-63, 0x1.d77e03c9bf0a4p-8}, + DoubleDouble{-0x1.1f28a9c0b3d47p-62, 0x1.dd4ac3f94ea0ap-8}, + DoubleDouble{-0x1.140ef760d3b63p-62, 0x1.e3179b7a1c52p-8}, + DoubleDouble{-0x1.ab65b1037f517p-63, 0x1.e8e48a4ce39e7p-8}, + DoubleDouble{-0x1.76940c457ce6dp-63, 0x1.eeb19072600edp-8}, + DoubleDouble{0x1.da3ae65a605cfp-64, 0x1.f47eadeb4d34dp-8}, + DoubleDouble{0x1.b15d0bce2ede6p-62, 0x1.fa4be2b866abp-8}, + DoubleDouble{0x1.e02aa1fa9dc57p-61, 0x1.000c976d340a6p-7}, + DoubleDouble{0x1.6be971a5565b9p-62, 0x1.02f34929068f3p-7}, + DoubleDouble{-0x1.8a9319a6ed164p-64, 0x1.05da069008be7p-7}, + DoubleDouble{0x1.825079f1e0ec5p-62, 0x1.08c0cfa298771p-7}, + DoubleDouble{0x1.60d5749321466p-63, 0x1.0ba7a461139c8p-7}, + DoubleDouble{-0x1.5b8f4c479e2ep-61, 0x1.0e8e84cbd8169p-7}, + DoubleDouble{-0x1.e3e1248004e29p-62, 0x1.117570e343d17p-7}, + DoubleDouble{0x1.9ac06487c375p-63, 0x1.145c68a7b4bddp-7}, + DoubleDouble{0x1.f657ea5c03ea4p-62, 0x1.17436c1988d0dp-7}, + DoubleDouble{-0x1.5a965659a05e2p-61, 0x1.1a2a7b391e04p-7}, + DoubleDouble{-0x1.21ce9b9bfc512p-61, 0x1.1d119606d2554p-7}, + DoubleDouble{-0x1.30fda247ad0e1p-61, 0x1.1ff8bc8303c7p-7}, + DoubleDouble{-0x1.382c78a45cdeap-62, 0x1.22dfeeae10601p-7}, + DoubleDouble{0x1.46ae4a64073d4p-61, 0x1.250d5bf952374p-7}, + DoubleDouble{-0x1.dcad2cec3b84bp-62, 0x1.27f4a29740a2fp-7}, + DoubleDouble{-0x1.413fbeb0b0635p-61, 0x1.2adbf4e50cdf9p-7}, + DoubleDouble{0x1.f28e6a48bcb9p-61, 0x1.2dc352e315049p-7}, + DoubleDouble{-0x1.96f286e1eb086p-61, 0x1.30aabc91b72ep-7}, + DoubleDouble{-0x1.f88c04206dfa1p-61, 0x1.339231f1517c1p-7}, + DoubleDouble{-0x1.11ea20e195841p-61, 0x1.3679b30242139p-7}, + DoubleDouble{-0x1.d6e71452b674ap-63, 0x1.39613fc4e71dcp-7}, + DoubleDouble{-0x1.57c578233b1b3p-61, 0x1.3c48d8399ec85p-7}, + DoubleDouble{-0x1.ec430f03b76ep-63, 0x1.3f307c60c7455p-7}, + DoubleDouble{0x1.e00dd1902ffb9p-61, 0x1.42182c3abecb5p-7}, + DoubleDouble{-0x1.f22bcd96afe38p-61, 0x1.44ffe7c7e3957p-7}, + DoubleDouble{0x1.08fd90f841d3p-61, 0x1.47e7af0893e2fp-7}, + DoubleDouble{0x1.09594c5552bccp-62, 0x1.4acf81fd2df7ep-7}, + DoubleDouble{-0x1.01a8a652e5602p-61, 0x1.4db760a6101c9p-7}, + DoubleDouble{-0x1.826168febb3dp-64, 0x1.509f4b03989dcp-7}, + DoubleDouble{-0x1.7eb21a35021e3p-62, 0x1.5387411625cccp-7}, + DoubleDouble{-0x1.66cbc818e175p-61, 0x1.566f42de15ff4p-7}, + DoubleDouble{0x1.9b784dd6cebdap-64, 0x1.5957505bc78f6p-7}, + DoubleDouble{0x1.2b121ab482456p-61, 0x1.5b8562298c65bp-7}, + DoubleDouble{-0x1.5d29869dd8233p-62, 0x1.5e6d842633702p-7}, + DoubleDouble{-0x1.572a1b6cd63cfp-61, 0x1.6155b1d99f672p-7}, + DoubleDouble{-0x1.a1f355360e877p-62, 0x1.643deb442eb59p-7}, + DoubleDouble{-0x1.b6f1cd2e1c03fp-61, 0x1.672630663fcadp-7}, + DoubleDouble{-0x1.2aaa11ccddcaep-61, 0x1.6a0e8140311aap-7}, + DoubleDouble{0x1.3d979ddf4746cp-61, 0x1.6cf6ddd2611d4p-7}, + DoubleDouble{-0x1.dc930484501f8p-63, 0x1.6fdf461d2e4f8p-7}, }; } // namespace ccm::gen::impl::internal::impl diff --git a/include/ccmath/internal/math/generic/func/power/pow_impl/powf_impl.hpp b/include/ccmath/internal/math/generic/func/power/pow_impl/powf_impl.hpp index 0801ce6a..cb06c1c8 100644 --- a/include/ccmath/internal/math/generic/func/power/pow_impl/powf_impl.hpp +++ b/include/ccmath/internal/math/generic/func/power/pow_impl/powf_impl.hpp @@ -89,29 +89,32 @@ namespace ccm::gen::impl // dirtyinfnorm(log2(1 + x)/x - P, [-0x1.3ffcp-15, 0x1.3e3dp-15]) = 0x1.8be5...p-96 // - The coefficients for the polynomial are stored in the array COEFFS. constexpr std::array COEFFS = { - DoubleDouble{ 0x1.71547652b82fep0, 0x1.777d0ffda25ep-56 }, DoubleDouble{ -0x1.71547652b82fep-1, -0x1.777d101cf0a84p-57 }, - DoubleDouble{ 0x1.ec709dc3a03fdp-2, 0x1.ce04b5140d867p-56 }, DoubleDouble{ -0x1.71547652b82fbp-2, 0x1.137b47e635be5p-56 }, - DoubleDouble{ 0x1.2776c516a92a2p-2, -0x1.b5a30b3bdb318p-58 }, DoubleDouble{ -0x1.ec70af1929ca6p-3, 0x1.2d2fbd081e657p-57 }, + DoubleDouble{0x1.71547652b82fep0, 0x1.777d0ffda25ep-56}, + DoubleDouble{-0x1.71547652b82fep-1, -0x1.777d101cf0a84p-57}, + DoubleDouble{0x1.ec709dc3a03fdp-2, 0x1.ce04b5140d867p-56}, + DoubleDouble{-0x1.71547652b82fbp-2, 0x1.137b47e635be5p-56}, + DoubleDouble{0x1.2776c516a92a2p-2, -0x1.b5a30b3bdb318p-58}, + DoubleDouble{-0x1.ec70af1929ca6p-3, 0x1.2d2fbd081e657p-57}, }; - const DoubleDouble dx_dd({ dx2, 0.0 }); + const DoubleDouble dx_dd({dx2, 0.0}); const DoubleDouble p = ::ccm::support::polyeval(dx_dd, COEFFS[0], COEFFS[1], COEFFS[2], COEFFS[3], COEFFS[4], COEFFS[5]); // log2(1 + dx2) ~ dx2 * P(dx2) const DoubleDouble log2_x_lo = quick_mult(dx2, p); // Lower parts of (e_x - log2(r1)) of the first range reduction constant - const DoubleDouble log2_x_mid({ LOG2_R_TD.at(static_cast(idx_x)).mid, LOG2_R_TD.at(static_cast(idx_x)).lo }); + const DoubleDouble log2_x_mid({LOG2_R_TD.at(static_cast(idx_x)).mid, LOG2_R_TD.at(static_cast(idx_x)).lo}); // -log2(r2) + lower part of (e_x - log2(r1)) - const DoubleDouble log2_r2_dd({ LOG2_R2_DD.at(static_cast(idx2)).lo, LOG2_R2_DD.at(static_cast(idx2)).hi }); + const DoubleDouble log2_r2_dd({LOG2_R2_DD.at(static_cast(idx2)).lo, LOG2_R2_DD.at(static_cast(idx2)).hi}); const DoubleDouble log2_x_m = add(log2_r2_dd, log2_x_mid); // log2(1 + dx2) - log2(r2) + lower part of (e_x - log2(r1)) // Since we don't know which one has larger exponent to apply Fast2Sum // algorithm, we need to check them before calling double-double addition. const DoubleDouble log2_x = larger_exponent(log2_x_m.hi, log2_x_lo.hi) ? add(log2_x_m, log2_x_lo) : add(log2_x_lo, log2_x_m); - const DoubleDouble lo6_hi_dd({ lo6_hi, 0.0 }); + const DoubleDouble lo6_hi_dd({lo6_hi, 0.0}); // 2^6 * y * (log2(1 + dx2) - log2(r2) + lower part of (e_x - log2(r1))) const DoubleDouble prod = quick_mult(y6, log2_x); @@ -119,16 +122,16 @@ namespace ccm::gen::impl // 2^6 * (y * log2(x) - (hi + mid)) = 2^6 * lo DoubleDouble const lo6 = larger_exponent(prod.hi, lo6_hi) ? add(prod, lo6_hi_dd) : add(lo6_hi_dd, prod); constexpr std::array EXP2_COEFFS = { - DoubleDouble{ 0x1p0, 0 }, - DoubleDouble{ 0x1.62e42fefa39efp-7, 0x1.abc9e3b398024p-62 }, - DoubleDouble{ 0x1.ebfbdff82c58fp-15, -0x1.5e43a5429bddbp-69 }, - DoubleDouble{ 0x1.c6b08d704a0cp-23, -0x1.d33162491268fp-77 }, - DoubleDouble{ 0x1.3b2ab6fba4e77p-31, 0x1.4fb32d240a14ep-86 }, - DoubleDouble{ 0x1.5d87fe78a6731p-40, 0x1.e84e916be83ep-97 }, - DoubleDouble{ 0x1.430912f86bfb8p-49, -0x1.9a447bfddc5e6p-103 }, - DoubleDouble{ 0x1.ffcbfc588ded9p-59, -0x1.31a55719de47fp-113 }, - DoubleDouble{ 0x1.62c034beb8339p-68, -0x1.0ba57164eb36bp-122 }, - DoubleDouble{ 0x1.b5251ff97bee1p-78, -0x1.8483eabd9642dp-132 }, + DoubleDouble{0x1p0, 0}, + DoubleDouble{0x1.62e42fefa39efp-7, 0x1.abc9e3b398024p-62}, + DoubleDouble{0x1.ebfbdff82c58fp-15, -0x1.5e43a5429bddbp-69}, + DoubleDouble{0x1.c6b08d704a0cp-23, -0x1.d33162491268fp-77}, + DoubleDouble{0x1.3b2ab6fba4e77p-31, 0x1.4fb32d240a14ep-86}, + DoubleDouble{0x1.5d87fe78a6731p-40, 0x1.e84e916be83ep-97}, + DoubleDouble{0x1.430912f86bfb8p-49, -0x1.9a447bfddc5e6p-103}, + DoubleDouble{0x1.ffcbfc588ded9p-59, -0x1.31a55719de47fp-113}, + DoubleDouble{0x1.62c034beb8339p-68, -0x1.0ba57164eb36bp-122}, + DoubleDouble{0x1.b5251ff97bee1p-78, -0x1.8483eabd9642dp-132}, }; DoubleDouble const pp = ::ccm::support::polyeval(lo6, @@ -164,13 +167,8 @@ namespace ccm::gen::impl return ccm::support::bit_cast(r_bits); } - constexpr std::optional handle_exceptional_cases(float & x, - float & y, - support::fp::FPBits & xbits, - support::fp::FPBits & ybits, - const std::uint32_t & x_u, - int & exponent, - std::uint64_t & sign) + constexpr std::optional handle_exceptional_cases(float & x, float & y, support::fp::FPBits & xbits, support::fp::FPBits & ybits, + const std::uint32_t & x_u, int & exponent, std::uint64_t & sign) { using FloatBits = support::fp::FPBits; @@ -395,8 +393,8 @@ namespace ccm::gen::impl // > P = fpminimax(log2(1 + x)/x, 5, [|D...|], [-2^-8, 2^-7]); // > dirtyinfnorm(log2(1 + x)/x - P, [-2^-8, 2^-7]); // 0x1.653...p-52 - constexpr std::array COEFFS = { 0x1.71547652b82fep0, -0x1.71547652b7a07p-1, 0x1.ec709dc458db1p-2, - -0x1.715479c2266c9p-2, 0x1.2776ae1ddf8fp-2, -0x1.e7b2178870157p-3 }; + constexpr std::array COEFFS = { + 0x1.71547652b82fep0, -0x1.71547652b7a07p-1, 0x1.ec709dc458db1p-2, -0x1.715479c2266c9p-2, 0x1.2776ae1ddf8fp-2, -0x1.e7b2178870157p-3}; const double dx2 = dx * dx; // Exact const double c0 = support::multiply_add(dx, COEFFS[1], COEFFS[0]); @@ -472,8 +470,7 @@ namespace ccm::gen::impl // > dirtyinfnorm(2^(x/64) - P, [-0.5, 0.5]); // 0x1.a2b77e618f5c4c176fd11b7659016cde5de83cb72p-60 constexpr std::array EXP2_COEFFS = { - 0x1p0, 0x1.62e42fefa39efp-7, 0x1.ebfbdff82a23ap-15, 0x1.c6b08d7076268p-23, 0x1.3b2ad33f8b48bp-31, 0x1.5d870c4d84445p-40 - }; + 0x1p0, 0x1.62e42fefa39efp-7, 0x1.ebfbdff82a23ap-15, 0x1.c6b08d7076268p-23, 0x1.3b2ad33f8b48bp-31, 0x1.5d870c4d84445p-40}; const double lo6_sqr = lo6 * lo6; const double d0 = support::multiply_add(lo6, EXP2_COEFFS[1], EXP2_COEFFS[0]); diff --git a/include/ccmath/internal/math/generic/func/power/pow_impl/powf_simd_impl.hpp b/include/ccmath/internal/math/generic/func/power/pow_impl/powf_simd_impl.hpp index 253821cb..d7f3efb1 100644 --- a/include/ccmath/internal/math/generic/func/power/pow_impl/powf_simd_impl.hpp +++ b/include/ccmath/internal/math/generic/func/power/pow_impl/powf_simd_impl.hpp @@ -34,13 +34,12 @@ namespace ccm::gen::impl namespace simd_detail { // log2(1 + dx)/dx degree-5 approximation, identical to the scalar powf kernel. - inline constexpr std::array kLog2Coeffs = { 0x1.71547652b82fep0, -0x1.71547652b7a07p-1, 0x1.ec709dc458db1p-2, - -0x1.715479c2266c9p-2, 0x1.2776ae1ddf8fp-2, -0x1.e7b2178870157p-3 }; + inline constexpr std::array kLog2Coeffs = { + 0x1.71547652b82fep0, -0x1.71547652b7a07p-1, 0x1.ec709dc458db1p-2, -0x1.715479c2266c9p-2, 0x1.2776ae1ddf8fp-2, -0x1.e7b2178870157p-3}; // 2^(x/64) degree-5 approximation, identical to the scalar powf kernel. inline constexpr std::array kExp2Coeffs = { - 0x1p0, 0x1.62e42fefa39efp-7, 0x1.ebfbdff82a23ap-15, 0x1.c6b08d7076268p-23, 0x1.3b2ad33f8b48bp-31, 0x1.5d870c4d84445p-40 - }; + 0x1p0, 0x1.62e42fefa39efp-7, 0x1.ebfbdff82a23ap-15, 0x1.c6b08d7076268p-23, 0x1.3b2ad33f8b48bp-31, 0x1.5d870c4d84445p-40}; template [[nodiscard]] CCM_ALWAYS_INLINE pp::basic_simd v_nearest_integer(pp::basic_simd const & x) noexcept { diff --git a/include/ccmath/internal/math/generic/func/power/pow_impl/powl_ld80_kernel.hpp b/include/ccmath/internal/math/generic/func/power/pow_impl/powl_ld80_kernel.hpp index 52a12cfd..7c04a08e 100644 --- a/include/ccmath/internal/math/generic/func/power/pow_impl/powl_ld80_kernel.hpp +++ b/include/ccmath/internal/math/generic/func/power/pow_impl/powl_ld80_kernel.hpp @@ -43,7 +43,7 @@ namespace ccm::gen::internal::impl::bit80 constexpr LongDoublePair exact_add(long double a, long double b) noexcept { - LongDoublePair r{ 0.0L, 0.0L }; + LongDoublePair r{0.0L, 0.0L}; r.hi = a + b; const long double t = r.hi - a; r.lo = b - t; @@ -56,12 +56,12 @@ namespace ccm::gen::internal::impl::bit80 constexpr long double split_c = 0x1.0p33L + 1.0L; const long double t1 = split_c * a; const long double t2 = a - t1; - return LongDoublePair{ t1 + t2, a - (t1 + t2) }; + return LongDoublePair{t1 + t2, a - (t1 + t2)}; } constexpr LongDoublePair exact_mult(long double a, long double b) noexcept { - LongDoublePair r{ 0.0L, 0.0L }; + LongDoublePair r{0.0L, 0.0L}; const LongDoublePair as = split(a); const LongDoublePair bs = split(b); r.hi = a * b; @@ -119,7 +119,7 @@ namespace ccm::gen::internal::impl::bit80 const long double m_x = FPBits_t::create_value(types::Sign::POS, FPBits_t::exponent_bias, m_sig | FPBits_t::EXPLICIT_BIT_MASK).get_val(); long double dx = 0.0L; - LongDoublePair dx_c0{ 0.0L, 0.0L }; + LongDoublePair dx_c0{0.0L, 0.0L}; const typename FPBits_t::storage_type frac_mask_high = FPBits_t::fraction_mask & ~((static_cast(1) << (FPBits_t::fraction_length - 7)) - 1); diff --git a/include/ccmath/internal/math/generic/func/power/pow_impl/powl_ld80_tables.hpp b/include/ccmath/internal/math/generic/func/power/pow_impl/powl_ld80_tables.hpp index f44abc89..1223e0b4 100644 --- a/include/ccmath/internal/math/generic/func/power/pow_impl/powl_ld80_tables.hpp +++ b/include/ccmath/internal/math/generic/func/power/pow_impl/powl_ld80_tables.hpp @@ -25,8 +25,14 @@ namespace ccm::gen::impl::internal::impl::powl_ld80_tables { inline constexpr std::array POW_LOG2_COEFFS = { - 0x1.71547652b82fe178p0L, -0x1.71547652b82fe144p-1L, 0x1.ec709dc3a03558dep-2L, -0x1.71547652b7385bf8p-2L, - 0x1.2776c51d878b842ep-2L, -0x1.ec70a8a71c0b750ap-3L, 0x1.a60c087e7df298fap-3L, -0x1.6987a26ef5e05516p-3L, + 0x1.71547652b82fe178p0L, + -0x1.71547652b82fe144p-1L, + 0x1.ec709dc3a03558dep-2L, + -0x1.71547652b7385bf8p-2L, + 0x1.2776c51d878b842ep-2L, + -0x1.ec70a8a71c0b750ap-3L, + 0x1.a60c087e7df298fap-3L, + -0x1.6987a26ef5e05516p-3L, }; inline constexpr std::array POW_EXP2_COEFFS = { diff --git a/include/ccmath/internal/math/generic/func/power/powl_gen.hpp b/include/ccmath/internal/math/generic/func/power/powl_gen.hpp index 92eb47c5..8c9f3799 100644 --- a/include/ccmath/internal/math/generic/func/power/powl_gen.hpp +++ b/include/ccmath/internal/math/generic/func/power/powl_gen.hpp @@ -177,7 +177,7 @@ namespace ccm::gen #endif } - inline constexpr std::int64_t kBoundedExponentMax = (std::int64_t{ 1 } << 62) - 1; + inline constexpr std::int64_t kBoundedExponentMax = (std::int64_t{1} << 62) - 1; constexpr bool try_extract_int64(const PowlFPBits_t & bits, std::int64_t & out) noexcept { @@ -290,11 +290,11 @@ namespace ccm::gen // produce inf - inf = NaN, so propagate a clean infinity instead. if (ccm::isinf(hi) || ccm::isnan(hi)) { - return Pair{ hi, 0.0L }; + return Pair{hi, 0.0L}; } if (abs_ld(a.hi) >= kSplitSafe || abs_ld(b.hi) >= kSplitSafe) { - return Pair{ hi, 0.0L }; + return Pair{hi, 0.0L}; } Pair p = bit80::powl_ld80_detail::exact_mult(a.hi, b.hi); p.lo += a.hi * b.lo + a.lo * b.hi; @@ -304,8 +304,8 @@ namespace ccm::gen // base^e for e > 0, accumulated as a double-double. constexpr Pair ipow(long double base, std::uint64_t e) noexcept { - Pair result{ 1.0L, 0.0L }; - Pair factor{ base, 0.0L }; + Pair result{1.0L, 0.0L}; + Pair factor{base, 0.0L}; while (e > 0U) { if ((e & 1U) != 0U) diff --git a/include/ccmath/internal/math/generic/func/power/sqrt_gen.hpp b/include/ccmath/internal/math/generic/func/power/sqrt_gen.hpp index d58197ac..93e7da7e 100644 --- a/include/ccmath/internal/math/generic/func/power/sqrt_gen.hpp +++ b/include/ccmath/internal/math/generic/func/power/sqrt_gen.hpp @@ -133,7 +133,7 @@ namespace ccm::gen } // We perform one more iteration to ensure that the result is correctly rounded. - bool round_bit{ false }; + bool round_bit{false}; r <<= 2; if (const storage_type tmp = (y << 2) + 1; r >= tmp) { @@ -217,7 +217,7 @@ namespace ccm::gen } // We perform one more iteration to ensure that the result is correctly rounded. - bool round_bit{ false }; + bool round_bit{false}; r <<= 2; diff --git a/include/ccmath/internal/math/runtime/pp/flags.hpp b/include/ccmath/internal/math/runtime/pp/flags.hpp index ed6bdf2d..89169282 100644 --- a/include/ccmath/internal/math/runtime/pp/flags.hpp +++ b/include/ccmath/internal/math/runtime/pp/flags.hpp @@ -52,10 +52,9 @@ namespace ccm::pp // NOLINTBEGIN(readability-avoid-nested-conditional-operator) template struct flags_align_request> - : std::integral_constant::value) != 0) - ? (std::size_t{ 0 } + ... + overalign_value::value) - : ((std::is_same_v || ...) ? std::size_t{ 1 } : std::size_t{ 0 })> + : std::integral_constant::value) != 0) + ? (std::size_t{0} + ... + overalign_value::value) + : ((std::is_same_v || ...) ? std::size_t{1} : std::size_t{0})> {}; // NOLINTEND(readability-avoid-nested-conditional-operator) diff --git a/include/ccmath/internal/math/runtime/pp/simd.hpp b/include/ccmath/internal/math/runtime/pp/simd.hpp index 30533c32..a21cf2ec 100644 --- a/include/ccmath/internal/math/runtime/pp/simd.hpp +++ b/include/ccmath/internal/math/runtime/pp/simd.hpp @@ -49,10 +49,9 @@ namespace ccm::pp CCM_ALWAYS_INLINE basic_simd(T value) : data_(Traits::broadcast(value)) {} // NOLINT(google-explicit-constructor) // Generator: gen(integral_constant) supplies lane i. - template && - std::is_convertible_v()(std::integral_constant{})), T>, - int> = 0> + template && + std::is_convertible_v()(std::integral_constant{})), T>, + int> = 0> CCM_ALWAYS_INLINE explicit basic_simd(G && gen) // NOLINT(cppcoreguidelines-missing-std-forward) { detail::unroll_ic([&](auto i) { Traits::set(data_, i, static_cast(gen(i))); }); @@ -104,7 +103,7 @@ namespace ccm::pp } CCM_ALWAYS_INLINE detail::SimdReference operator[](detail::SimdSizeType i) { - return { &data_, i }; + return {&data_, i}; } CCM_ALWAYS_INLINE static basic_simd from_member(member_type const & m) diff --git a/include/ccmath/internal/math/runtime/pp/vec_ext.hpp b/include/ccmath/internal/math/runtime/pp/vec_ext.hpp index 72de825b..3142e05e 100644 --- a/include/ccmath/internal/math/runtime/pp/vec_ext.hpp +++ b/include/ccmath/internal/math/runtime/pp/vec_ext.hpp @@ -162,7 +162,7 @@ namespace ccm::pp CCM_ALWAYS_INLINE static MaskMember mbroadcast(bool b) { MaskMember r; - MaskInt const v = b ? static_cast(-1) : MaskInt{ 0 }; + MaskInt const v = b ? static_cast(-1) : MaskInt{0}; detail::unroll([&](auto i) { r[i] = v; }); return r; } @@ -172,7 +172,7 @@ namespace ccm::pp } CCM_ALWAYS_INLINE static void mset(MaskMember & m, detail::SimdSizeType i, bool b) { - m[i] = b ? static_cast(-1) : MaskInt{ 0 }; + m[i] = b ? static_cast(-1) : MaskInt{0}; } CCM_ALWAYS_INLINE static MaskMember mand(MaskMember a, MaskMember b) { @@ -462,7 +462,7 @@ namespace ccm::pp CCM_ALWAYS_INLINE static MaskMember NAME(SimdMember a, SimdMember b) \ { \ MaskMember r; \ - detail::unroll([&](auto i) { r[i] = (a[i] OP b[i]) ? static_cast(-1) : MaskInt{ 0 }; }); \ + detail::unroll([&](auto i) { r[i] = (a[i] OP b[i]) ? static_cast(-1) : MaskInt{0}; }); \ return r; \ } CCM_PP_ARRAY_CMP(eq, ==) @@ -476,7 +476,7 @@ namespace ccm::pp CCM_ALWAYS_INLINE static MaskMember mbroadcast(bool b) { MaskMember r; - MaskInt const v = b ? static_cast(-1) : MaskInt{ 0 }; + MaskInt const v = b ? static_cast(-1) : MaskInt{0}; detail::unroll([&](auto i) { r[i] = v; }); return r; } @@ -486,7 +486,7 @@ namespace ccm::pp } CCM_ALWAYS_INLINE static void mset(MaskMember & m, detail::SimdSizeType i, bool b) { - m[i] = b ? static_cast(-1) : MaskInt{ 0 }; + m[i] = b ? static_cast(-1) : MaskInt{0}; } CCM_ALWAYS_INLINE static MaskMember mand(MaskMember a, MaskMember b) { diff --git a/include/ccmath/internal/math/runtime/pp/where.hpp b/include/ccmath/internal/math/runtime/pp/where.hpp index 75cef8a7..8f52bcff 100644 --- a/include/ccmath/internal/math/runtime/pp/where.hpp +++ b/include/ccmath/internal/math/runtime/pp/where.hpp @@ -120,13 +120,13 @@ namespace ccm::pp CCM_ALWAYS_INLINE where_expression, basic_simd> where(basic_simd_mask const & mask, basic_simd & value) { - return { mask, value }; + return {mask, value}; } template CCM_ALWAYS_INLINE const_where_expression, basic_simd> where(basic_simd_mask const & mask, basic_simd const & value) { - return { mask, value }; + return {mask, value}; } } // namespace ccm::pp diff --git a/include/ccmath/internal/math/runtime/simd/func/impl/sse2/pow.hpp b/include/ccmath/internal/math/runtime/simd/func/impl/sse2/pow.hpp index e0113228..0b5e8a2c 100644 --- a/include/ccmath/internal/math/runtime/simd/func/impl/sse2/pow.hpp +++ b/include/ccmath/internal/math/runtime/simd/func/impl/sse2/pow.hpp @@ -30,9 +30,9 @@ namespace ccm::intrin // The cmake performs a test validating if the compiler supports SVML. // As far as I'm aware, this is the only reliable way to check. #ifdef CCMATH_HAS_SIMD_SVML - return { _mm_pow_ps(a.get(), b.get()) }; + return {_mm_pow_ps(a.get(), b.get())}; #else - return { gen::pow_gen(a.convert(), b.convert()) }; + return {gen::pow_gen(a.convert(), b.convert())}; #endif } @@ -41,9 +41,9 @@ namespace ccm::intrin // The cmake performs a test validating if the compiler supports SVML. // As far as I'm aware, this is the only reliable way to check. #ifdef CCMATH_HAS_SIMD_SVML - return { _mm_pow_pd(a.get(), b.get()) }; + return {_mm_pow_pd(a.get(), b.get())}; #else - return { gen::pow_gen(a.convert(), b.convert()) }; + return {gen::pow_gen(a.convert(), b.convert())}; #endif } } // namespace ccm::intrin diff --git a/include/ccmath/internal/math/runtime/simd/func/impl/sse4/pow.hpp b/include/ccmath/internal/math/runtime/simd/func/impl/sse4/pow.hpp index 8ba53ca3..93172a1a 100644 --- a/include/ccmath/internal/math/runtime/simd/func/impl/sse4/pow.hpp +++ b/include/ccmath/internal/math/runtime/simd/func/impl/sse4/pow.hpp @@ -30,9 +30,9 @@ namespace ccm::intrin // The cmake performs a test validating if the compiler supports SVML. // As far as I'm aware, this is the only reliable way to check. #ifdef CCMATH_HAS_SIMD_SVML - return { _mm_pow_ps(a.get(), b.get()) }; + return {_mm_pow_ps(a.get(), b.get())}; #else - return { gen::pow_gen(a.convert(), b.convert()) }; + return {gen::pow_gen(a.convert(), b.convert())}; #endif } @@ -41,9 +41,9 @@ namespace ccm::intrin // The cmake performs a test validating if the compiler supports SVML. // As far as I'm aware, this is the only reliable way to check. #ifdef CCMATH_HAS_SIMD_SVML - return { _mm_pow_pd(a.get(), b.get()) }; + return {_mm_pow_pd(a.get(), b.get())}; #else - return { gen::pow_gen(a.convert(), b.convert()) }; + return {gen::pow_gen(a.convert(), b.convert())}; #endif } } // namespace ccm::intrin diff --git a/include/ccmath/internal/math/runtime/simd/instructions/avx2.hpp b/include/ccmath/internal/math/runtime/simd/instructions/avx2.hpp index fa9b10a9..aedb652d 100644 --- a/include/ccmath/internal/math/runtime/simd/instructions/avx2.hpp +++ b/include/ccmath/internal/math/runtime/simd/instructions/avx2.hpp @@ -46,15 +46,15 @@ namespace ccm::intrin } CCM_ALWAYS_INLINE simd_mask operator||(simd_mask const & other) const { - return { _mm256_or_ps(m_value, other.m_value) }; + return {_mm256_or_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd_mask operator&&(simd_mask const & other) const { - return { _mm256_and_ps(m_value, other.m_value) }; + return {_mm256_and_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd_mask operator!() const { - return { _mm256_andnot_ps(m_value, simd_mask(true).get()) }; + return {_mm256_andnot_ps(m_value, simd_mask(true).get())}; } private: @@ -101,23 +101,23 @@ namespace ccm::intrin CCM_ALWAYS_INLINE constexpr simd(__m256 const & value_in) : m_value(value_in) {} // NOLINT CCM_ALWAYS_INLINE simd operator*(simd const & other) const { - return { _mm256_mul_ps(m_value, other.m_value) }; + return {_mm256_mul_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator/(simd const & other) const { - return { _mm256_div_ps(m_value, other.m_value) }; + return {_mm256_div_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator+(simd const & other) const { - return { _mm256_add_ps(m_value, other.m_value) }; + return {_mm256_add_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator-(simd const & other) const { - return { _mm256_sub_ps(m_value, other.m_value) }; + return {_mm256_sub_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE CCM_GPU_HOST_DEVICE simd operator-() const { - return { _mm256_sub_ps(_mm256_set1_ps(0.0F), m_value) }; + return {_mm256_sub_ps(_mm256_set1_ps(0.0F), m_value)}; } CCM_ALWAYS_INLINE void copy_from(float const * ptr, element_aligned_tag /*unused*/) { @@ -137,11 +137,11 @@ namespace ccm::intrin } CCM_ALWAYS_INLINE simd_mask operator<(simd const & other) const { - return { _mm256_cmp_ps(m_value, other.m_value, _CMP_LT_OS) }; + return {_mm256_cmp_ps(m_value, other.m_value, _CMP_LT_OS)}; } CCM_ALWAYS_INLINE simd_mask operator==(simd const & other) const { - return { _mm256_cmp_ps(m_value, other.m_value, _CMP_EQ_OS) }; + return {_mm256_cmp_ps(m_value, other.m_value, _CMP_EQ_OS)}; } private: @@ -150,7 +150,7 @@ namespace ccm::intrin CCM_ALWAYS_INLINE simd choose(simd_mask const & a, simd const & b, simd const & c) { - return { _mm256_blendv_ps(c.get(), b.get(), a.get()) }; + return {_mm256_blendv_ps(c.get(), b.get(), a.get())}; } template <> struct simd_mask @@ -171,15 +171,15 @@ namespace ccm::intrin } CCM_ALWAYS_INLINE simd_mask operator||(simd_mask const & other) const { - return { _mm256_or_pd(m_value, other.m_value) }; + return {_mm256_or_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd_mask operator&&(simd_mask const & other) const { - return { _mm256_and_pd(m_value, other.m_value) }; + return {_mm256_and_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd_mask operator!() const { - return { _mm256_andnot_pd(m_value, simd_mask(true).get()) }; + return {_mm256_andnot_pd(m_value, simd_mask(true).get())}; } private: @@ -229,23 +229,23 @@ namespace ccm::intrin CCM_ALWAYS_INLINE constexpr simd(__m256d const & value_in) : m_value(value_in) {} // NOLINT CCM_ALWAYS_INLINE simd operator*(simd const & other) const { - return { _mm256_mul_pd(m_value, other.m_value) }; + return {_mm256_mul_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator/(simd const & other) const { - return { _mm256_div_pd(m_value, other.m_value) }; + return {_mm256_div_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator+(simd const & other) const { - return { _mm256_add_pd(m_value, other.m_value) }; + return {_mm256_add_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator-(simd const & other) const { - return { _mm256_sub_pd(m_value, other.m_value) }; + return {_mm256_sub_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE CCM_GPU_HOST_DEVICE simd operator-() const { - return { _mm256_sub_pd(_mm256_set1_pd(0.0), m_value) }; + return {_mm256_sub_pd(_mm256_set1_pd(0.0), m_value)}; } CCM_ALWAYS_INLINE void copy_from(double const * ptr, element_aligned_tag /*unused*/) { @@ -265,21 +265,21 @@ namespace ccm::intrin } CCM_ALWAYS_INLINE simd_mask operator<(simd const & other) const { - return { _mm256_cmp_pd(m_value, other.m_value, _CMP_LT_OS) }; + return {_mm256_cmp_pd(m_value, other.m_value, _CMP_LT_OS)}; } CCM_ALWAYS_INLINE simd_mask operator==(simd const & other) const { - return { _mm256_cmp_pd(m_value, other.m_value, _CMP_EQ_OS) }; + return {_mm256_cmp_pd(m_value, other.m_value, _CMP_EQ_OS)}; } private: __m256d m_value; }; - CCM_ALWAYS_INLINE simd - choose(simd_mask const & a, simd const & b, simd const & c) + CCM_ALWAYS_INLINE simd choose(simd_mask const & a, simd const & b, + simd const & c) { - return { _mm256_blendv_pd(c.get(), b.get(), a.get()) }; + return {_mm256_blendv_pd(c.get(), b.get(), a.get())}; } } // namespace ccm::intrin diff --git a/include/ccmath/internal/math/runtime/simd/instructions/neon.hpp b/include/ccmath/internal/math/runtime/simd/instructions/neon.hpp index e764ba8e..30bdeb9b 100644 --- a/include/ccmath/internal/math/runtime/simd/instructions/neon.hpp +++ b/include/ccmath/internal/math/runtime/simd/instructions/neon.hpp @@ -84,7 +84,7 @@ namespace ccm::intrin CCM_ALWAYS_INLINE simd(float value) : m_value(vdupq_n_f32(value)) {} CCM_ALWAYS_INLINE simd(float a, float b, float c, float d) { - std::array values = { a, b, c, d }; + std::array values = {a, b, c, d}; m_value = vld1q_f32(values.data()); } CCM_ALWAYS_INLINE simd(storage_type const & value) @@ -280,8 +280,8 @@ namespace ccm::intrin float64x2_t m_value; }; - CCM_ALWAYS_INLINE simd - choose(simd_mask const & a, simd const & b, simd const & c) + CCM_ALWAYS_INLINE simd choose(simd_mask const & a, simd const & b, + simd const & c) { return simd(vreinterpretq_f64_u64(vbslq_u64(a.get(), vreinterpretq_u64_f64(b.get()), vreinterpretq_u64_f64(c.get())))); } diff --git a/include/ccmath/internal/math/runtime/simd/instructions/scalar.hpp b/include/ccmath/internal/math/runtime/simd/instructions/scalar.hpp index 9dca3c5b..0e4dbc43 100644 --- a/include/ccmath/internal/math/runtime/simd/instructions/scalar.hpp +++ b/include/ccmath/internal/math/runtime/simd/instructions/scalar.hpp @@ -190,8 +190,8 @@ namespace ccm::intrin }; template - CCM_ALWAYS_INLINE CCM_GPU_HOST_DEVICE simd - choose(simd_mask const & a, simd const & b, simd const & c) + CCM_ALWAYS_INLINE CCM_GPU_HOST_DEVICE simd choose(simd_mask const & a, simd const & b, + simd const & c) { return simd(choose(a.get(), b.get(), c.get())); } diff --git a/include/ccmath/internal/math/runtime/simd/instructions/sse2.hpp b/include/ccmath/internal/math/runtime/simd/instructions/sse2.hpp index 4063b063..5effdb4e 100644 --- a/include/ccmath/internal/math/runtime/simd/instructions/sse2.hpp +++ b/include/ccmath/internal/math/runtime/simd/instructions/sse2.hpp @@ -100,23 +100,23 @@ namespace ccm::intrin CCM_ALWAYS_INLINE constexpr simd(__m128 const & value_in) : m_value(value_in) {} // NOLINT(google-explicit-constructor) CCM_ALWAYS_INLINE simd operator*(simd const & other) const { - return { _mm_mul_ps(m_value, other.m_value) }; + return {_mm_mul_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator/(simd const & other) const { - return { _mm_div_ps(m_value, other.m_value) }; + return {_mm_div_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator+(simd const & other) const { - return { _mm_add_ps(m_value, other.m_value) }; + return {_mm_add_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator-(simd const & other) const { - return { _mm_sub_ps(m_value, other.m_value) }; + return {_mm_sub_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator-() const { - return { _mm_sub_ps(_mm_set1_ps(0.0F), m_value) }; + return {_mm_sub_ps(_mm_set1_ps(0.0F), m_value)}; } CCM_ALWAYS_INLINE void copy_from(float const * ptr, element_aligned_tag /*unused*/) { @@ -227,23 +227,23 @@ namespace ccm::intrin CCM_ALWAYS_INLINE constexpr simd(__m128d const & value_in) : m_value(value_in) {} // NOLINT(google-explicit-constructor) CCM_ALWAYS_INLINE simd operator*(simd const & other) const { - return { _mm_mul_pd(m_value, other.m_value) }; + return {_mm_mul_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator/(simd const & other) const { - return { _mm_div_pd(m_value, other.m_value) }; + return {_mm_div_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator+(simd const & other) const { - return { _mm_add_pd(m_value, other.m_value) }; + return {_mm_add_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator-(simd const & other) const { - return { _mm_sub_pd(m_value, other.m_value) }; + return {_mm_sub_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator-() const { - return { _mm_sub_pd(_mm_set1_pd(0.0), m_value) }; + return {_mm_sub_pd(_mm_set1_pd(0.0), m_value)}; } CCM_ALWAYS_INLINE void copy_from(double const * ptr, element_aligned_tag /*unused*/) { @@ -275,8 +275,8 @@ namespace ccm::intrin __m128d m_value; }; - CCM_ALWAYS_INLINE simd - choose(simd_mask const & a, simd const & b, simd const & c) + CCM_ALWAYS_INLINE simd choose(simd_mask const & a, simd const & b, + simd const & c) { // NOLINTNEXTLINE(modernize-return-braced-init-list) return simd(_mm_add_pd(_mm_and_pd(a.get(), b.get()), _mm_andnot_pd(a.get(), c.get()))); diff --git a/include/ccmath/internal/math/runtime/simd/instructions/sse4.hpp b/include/ccmath/internal/math/runtime/simd/instructions/sse4.hpp index 6a0c635f..f2fb3fae 100644 --- a/include/ccmath/internal/math/runtime/simd/instructions/sse4.hpp +++ b/include/ccmath/internal/math/runtime/simd/instructions/sse4.hpp @@ -101,23 +101,23 @@ namespace ccm::intrin CCM_ALWAYS_INLINE constexpr simd(__m128 const & value_in) : m_value(value_in) {} CCM_ALWAYS_INLINE simd operator*(simd const & other) const { - return { _mm_mul_ps(m_value, other.m_value) }; + return {_mm_mul_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator/(simd const & other) const { - return { _mm_div_ps(m_value, other.m_value) }; + return {_mm_div_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator+(simd const & other) const { - return { _mm_add_ps(m_value, other.m_value) }; + return {_mm_add_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator-(simd const & other) const { - return { _mm_sub_ps(m_value, other.m_value) }; + return {_mm_sub_ps(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator-() const { - return { _mm_sub_ps(_mm_set1_ps(0.0F), m_value) }; + return {_mm_sub_ps(_mm_set1_ps(0.0F), m_value)}; } CCM_ALWAYS_INLINE void copy_from(float const * ptr, element_aligned_tag /*unused*/) { @@ -228,23 +228,23 @@ namespace ccm::intrin CCM_ALWAYS_INLINE constexpr simd(__m128d const & value_in) : m_value(value_in) {} CCM_ALWAYS_INLINE simd operator*(simd const & other) const { - return { _mm_mul_pd(m_value, other.m_value) }; + return {_mm_mul_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator/(simd const & other) const { - return { _mm_div_pd(m_value, other.m_value) }; + return {_mm_div_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator+(simd const & other) const { - return { _mm_add_pd(m_value, other.m_value) }; + return {_mm_add_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator-(simd const & other) const { - return { _mm_sub_pd(m_value, other.m_value) }; + return {_mm_sub_pd(m_value, other.m_value)}; } CCM_ALWAYS_INLINE simd operator-() const { - return { _mm_sub_pd(_mm_set1_pd(0.0), m_value) }; + return {_mm_sub_pd(_mm_set1_pd(0.0), m_value)}; } CCM_ALWAYS_INLINE void copy_from(double const * ptr, element_aligned_tag /*unused*/) { @@ -276,8 +276,8 @@ namespace ccm::intrin __m128d m_value; }; - CCM_ALWAYS_INLINE simd - choose(simd_mask const & a, simd const & b, simd const & c) + CCM_ALWAYS_INLINE simd choose(simd_mask const & a, simd const & b, + simd const & c) { // NOLINTNEXTLINE(modernize-return-braced-init-list) return simd(_mm_add_pd(_mm_and_pd(a.get(), b.get()), _mm_andnot_pd(a.get(), c.get()))); diff --git a/include/ccmath/internal/math/runtime/simd/pack.hpp b/include/ccmath/internal/math/runtime/simd/pack.hpp index 1727bec1..d78f8cfd 100644 --- a/include/ccmath/internal/math/runtime/simd/pack.hpp +++ b/include/ccmath/internal/math/runtime/simd/pack.hpp @@ -279,8 +279,8 @@ namespace ccm::intrin }; template - CCM_ALWAYS_INLINE CCM_GPU_HOST_DEVICE simd> - choose(simd_mask> const & a, simd> const & b, simd> const & c) + CCM_ALWAYS_INLINE CCM_GPU_HOST_DEVICE simd> choose(simd_mask> const & a, simd> const & b, + simd> const & c) { simd> result; CCM_SIMD_VECTORIZE for (int i = 0; i < a.size(); ++i) diff --git a/include/ccmath/internal/math/runtime/simd/vector_size.hpp b/include/ccmath/internal/math/runtime/simd/vector_size.hpp index f64ca010..88c70429 100644 --- a/include/ccmath/internal/math/runtime/simd/vector_size.hpp +++ b/include/ccmath/internal/math/runtime/simd/vector_size.hpp @@ -232,8 +232,8 @@ namespace ccm::intrin }; template - CCM_ALWAYS_INLINE CCM_GPU_HOST_DEVICE simd> - choose(simd_mask> const & a, simd> const & b, simd> const & c) + CCM_ALWAYS_INLINE CCM_GPU_HOST_DEVICE simd> choose(simd_mask> const & a, + simd> const & b, simd> const & c) { simd> result; CCM_SIMD_VECTORIZE for (int i = 0; i < a.size(); ++i) diff --git a/include/ccmath/internal/support/bits.hpp b/include/ccmath/internal/support/bits.hpp index d7c6f042..8c71e2e3 100644 --- a/include/ccmath/internal/support/bits.hpp +++ b/include/ccmath/internal/support/bits.hpp @@ -80,9 +80,8 @@ namespace ccm::support } // namespace detail template - constexpr std::enable_if_t && std::is_trivially_copyable_v && - std::is_trivially_copyable_v, - To> + constexpr std::enable_if_t< + sizeof(To) == sizeof(From) && std::is_trivially_constructible_v && std::is_trivially_copyable_v && std::is_trivially_copyable_v, To> bit_cast(const From & from) { #ifdef __clang__ @@ -402,7 +401,7 @@ namespace ccm::support if constexpr (sizeof(T) >= sizeof(unsigned)) { - return T{ 1 } << n; + return T{1} << n; } else { const unsigned extra = std::numeric_limits::digits - std::numeric_limits::digits; diff --git a/include/ccmath/internal/support/common_math_constants.hpp b/include/ccmath/internal/support/common_math_constants.hpp index c6122cc1..17230180 100644 --- a/include/ccmath/internal/support/common_math_constants.hpp +++ b/include/ccmath/internal/support/common_math_constants.hpp @@ -46,8 +46,7 @@ namespace ccm::support::constants 0x1.15b1e5f75270dp-1, 0x1.1485f0e0acd3bp-1, 0x1.135c81135c811p-1, 0x1.12358e75d3033p-1, 0x1.1111111111111p-1, 0x1.0fef010fef011p-1, 0x1.0ecf56be69c90p-1, 0x1.0db20a88f4696p-1, 0x1.0c9714fbcda3bp-1, 0x1.0b7e6ec259dc8p-1, 0x1.0a6810a6810a7p-1, 0x1.0953f39010954p-1, 0x1.0842108421084p-1, 0x1.073260a47f7c6p-1, 0x1.0624dd2f1a9fcp-1, 0x1.05197f7d73404p-1, 0x1.0410410410410p-1, 0x1.03091b51f5e1ap-1, - 0x1.0204081020408p-1, 0x1.0101010101010p-1 - }; + 0x1.0204081020408p-1, 0x1.0101010101010p-1}; // Lookup table for log(f) = log(1 + n*2^(-7)) where n = 0..127. constexpr std::array LOG_F = { @@ -72,8 +71,7 @@ namespace ccm::support::constants 0x1.393e0d3562a19p-1, 0x1.3b68449fffc22p-1, 0x1.3d9026a7156fap-1, 0x1.3fb5b84d16f42p-1, 0x1.41d8fe84672aep-1, 0x1.43f9fe2f9ce67p-1, 0x1.4618bc21c5ec2p-1, 0x1.48353d1ea88dfp-1, 0x1.4a4f85db03ebbp-1, 0x1.4c679afccee39p-1, 0x1.4e7d811b75bb0p-1, 0x1.50913cc01686bp-1, 0x1.52a2d265bc5aap-1, 0x1.54b2467999497p-1, 0x1.56bf9d5b3f399p-1, 0x1.58cadb5cd7989p-1, 0x1.5ad404c359f2cp-1, 0x1.5cdb1dc6c1764p-1, - 0x1.5ee02a9241675p-1, 0x1.60e32f44788d8p-1 - }; + 0x1.5ee02a9241675p-1, 0x1.60e32f44788d8p-1}; // Range reduction constants for logarithms, adapted from LLVM-libc // (libc/src/__support/math/common_constants.h). The algorithm is described at @@ -94,8 +92,7 @@ namespace ccm::support::constants 0x1.3ep-1, 0x1.3cp-1, 0x1.3ap-1, 0x1.3ap-1, 0x1.38p-1, 0x1.36p-1, 0x1.34p-1, 0x1.34p-1, 0x1.32p-1, 0x1.3p-1, 0x1.3p-1, 0x1.2ep-1, 0x1.2cp-1, 0x1.2cp-1, 0x1.2ap-1, 0x1.28p-1, 0x1.28p-1, 0x1.26p-1, 0x1.24p-1, 0x1.24p-1, 0x1.22p-1, 0x1.2p-1, 0x1.2p-1, 0x1.1ep-1, 0x1.1cp-1, 0x1.1cp-1, 0x1.1ap-1, 0x1.1ap-1, 0x1.18p-1, 0x1.16p-1, 0x1.16p-1, 0x1.14p-1, 0x1.14p-1, 0x1.12p-1, 0x1.1p-1, 0x1.1p-1, 0x1.0ep-1, 0x1.0ep-1, 0x1.0cp-1, - 0x1.0cp-1, 0x1.0ap-1, 0x1.0ap-1, 0x1.08p-1, 0x1.08p-1, 0x1.06p-1, 0x1.06p-1, 0x1.04p-1, 0x1.04p-1, 0x1.02p-1, 0x1.0p-1 - }; + 0x1.0cp-1, 0x1.0ap-1, 0x1.0ap-1, 0x1.08p-1, 0x1.08p-1, 0x1.06p-1, 0x1.06p-1, 0x1.04p-1, 0x1.04p-1, 0x1.02p-1, 0x1.0p-1}; alignas(64) constexpr std::array RD = { 0x1p0, 0x1.fcp-1, 0x1.f8p-1, 0x1.f4p-1, 0x1.fp-1, 0x1.ecp-1, 0x1.e8p-1, 0x1.e4p-1, 0x1.ep-1, 0x1.dep-1, 0x1.dap-1, 0x1.d6p-1, 0x1.d4p-1, @@ -107,8 +104,7 @@ namespace ccm::support::constants 0x1.3ep-1, 0x1.3cp-1, 0x1.3ap-1, 0x1.3ap-1, 0x1.38p-1, 0x1.36p-1, 0x1.34p-1, 0x1.34p-1, 0x1.32p-1, 0x1.3p-1, 0x1.3p-1, 0x1.2ep-1, 0x1.2cp-1, 0x1.2cp-1, 0x1.2ap-1, 0x1.28p-1, 0x1.28p-1, 0x1.26p-1, 0x1.24p-1, 0x1.24p-1, 0x1.22p-1, 0x1.2p-1, 0x1.2p-1, 0x1.1ep-1, 0x1.1cp-1, 0x1.1cp-1, 0x1.1ap-1, 0x1.1ap-1, 0x1.18p-1, 0x1.16p-1, 0x1.16p-1, 0x1.14p-1, 0x1.14p-1, 0x1.12p-1, 0x1.1p-1, 0x1.1p-1, 0x1.0ep-1, 0x1.0ep-1, 0x1.0cp-1, - 0x1.0cp-1, 0x1.0ap-1, 0x1.0ap-1, 0x1.08p-1, 0x1.08p-1, 0x1.06p-1, 0x1.06p-1, 0x1.04p-1, 0x1.04p-1, 0x1.02p-1, 0x1.0p-1 - }; + 0x1.0cp-1, 0x1.0ap-1, 0x1.0ap-1, 0x1.08p-1, 0x1.08p-1, 0x1.06p-1, 0x1.06p-1, 0x1.04p-1, 0x1.04p-1, 0x1.02p-1, 0x1.0p-1}; // Compensated constants for exact logarithm range reduction when FMA is not // available. @@ -150,8 +146,7 @@ namespace ccm::support::constants 0x1.38ae2171976e7p-1, 0x1.3c6080c36bfb5p-1, 0x1.3c6080c36bfb5p-1, 0x1.4019c2125ca93p-1, 0x1.43d9ff2f923c5p-1, 0x1.43d9ff2f923c5p-1, 0x1.47a1527e8a2d3p-1, 0x1.47a1527e8a2d3p-1, 0x1.4b6fd6f970c1fp-1, 0x1.4b6fd6f970c1fp-1, 0x1.4f45a835a4e19p-1, 0x1.4f45a835a4e19p-1, 0x1.5322e26867857p-1, 0x1.5322e26867857p-1, 0x1.5707a26bb8c66p-1, 0x1.5707a26bb8c66p-1, 0x1.5af405c3649ep-1, 0x1.5af405c3649ep-1, - 0x1.5ee82aa24192p-1, 0x0.000000000000p0 - }; + 0x1.5ee82aa24192p-1, 0x0.000000000000p0}; alignas(64) constexpr std::array LOG2_R = { 0x0.0000000000000p+0, 0x1.72c7ba20f7327p-7, 0x1.743ee861f3556p-6, 0x1.184b8e4c56af8p-5, 0x1.77394c9d958d5p-5, 0x1.d6ebd1f1febfep-5, @@ -175,13 +170,12 @@ namespace ccm::support::constants 0x1.c31a27dd00b4ap-1, 0x1.c86f7b7ea4a89p-1, 0x1.c86f7b7ea4a89p-1, 0x1.cdcebd2373995p-1, 0x1.d338120a6dd9dp-1, 0x1.d338120a6dd9dp-1, 0x1.d8aba045b01c8p-1, 0x1.d8aba045b01c8p-1, 0x1.de298ec0bac0dp-1, 0x1.de298ec0bac0dp-1, 0x1.e3b20546f554ap-1, 0x1.e3b20546f554ap-1, 0x1.e9452c8a71028p-1, 0x1.e9452c8a71028p-1, 0x1.eee32e2aeccbfp-1, 0x1.eee32e2aeccbfp-1, 0x1.f48c34bd1e96fp-1, 0x1.f48c34bd1e96fp-1, - 0x1.fa406bd2443dfp-1, 0x1.0000000000000p0 - }; + 0x1.fa406bd2443dfp-1, 0x1.0000000000000p0}; // Minimax polynomial for (log(1 + x) - x)/x^2, generated by sollya with: // > P = fpminimax((log(1 + x) - x)/x^2, 5, [|D...|], [-2^-8, 2^-7]); - constexpr std::array LOG_COEFFS = { -0x1.fffffffffffffp-2, 0x1.5555555554a9bp-2, -0x1.0000000094567p-2, - 0x1.99999dcc9823cp-3, -0x1.55550ac2e537ap-3, 0x1.21a02c4e624d7p-3 }; + constexpr std::array LOG_COEFFS = { + -0x1.fffffffffffffp-2, 0x1.5555555554a9bp-2, -0x1.0000000094567p-2, 0x1.99999dcc9823cp-3, -0x1.55550ac2e537ap-3, 0x1.21a02c4e624d7p-3}; // Generated by Sollya with: // for i from 0 to 127 do { @@ -192,134 +186,134 @@ namespace ccm::support::constants // }; // We replace LOG_R[0] with log10(1.0) == 0.0 alignas(64) constexpr std::array, 128> LOG_R_DD = { - types::NumberPair{ 0.0, 0.0 }, - types::NumberPair{ -0x1.0c76b999d2be8p-46, 0x1.010157589p-7 }, - types::NumberPair{ -0x1.3dc5b06e2f7d2p-45, 0x1.0205658938p-6 }, - types::NumberPair{ -0x1.aa0ba325a0c34p-45, 0x1.8492528c9p-6 }, - types::NumberPair{ 0x1.111c05cf1d753p-47, 0x1.0415d89e74p-5 }, - types::NumberPair{ -0x1.c167375bdfd28p-45, 0x1.466aed42ep-5 }, - types::NumberPair{ -0x1.97995d05a267dp-46, 0x1.894aa149fcp-5 }, - types::NumberPair{ -0x1.a68f247d82807p-46, 0x1.ccb73cdddcp-5 }, - types::NumberPair{ -0x1.7e5dd7009902cp-46, 0x1.08598b59e4p-4 }, - types::NumberPair{ -0x1.5325d560d9e9bp-45, 0x1.1973bd1466p-4 }, - types::NumberPair{ 0x1.cc85ea5db4ed7p-45, 0x1.3bdf5a7d1ep-4 }, - types::NumberPair{ -0x1.c69063c5d1d1ep-45, 0x1.5e95a4d97ap-4 }, - types::NumberPair{ 0x1.c1e8da99ded32p-49, 0x1.700d30aeacp-4 }, - types::NumberPair{ 0x1.3115c3abd47dap-45, 0x1.9335e5d594p-4 }, - types::NumberPair{ -0x1.390802bf768e5p-46, 0x1.b6ac88dad6p-4 }, - types::NumberPair{ 0x1.646d1c65aacd3p-45, 0x1.c885801bc4p-4 }, - types::NumberPair{ -0x1.dc068afe645ep-45, 0x1.ec739830a2p-4 }, - types::NumberPair{ -0x1.534d64fa10afdp-45, 0x1.fe89139dbep-4 }, - types::NumberPair{ 0x1.1ef78ce2d07f2p-45, 0x1.1178e8227ep-3 }, - types::NumberPair{ 0x1.ca78e44389934p-45, 0x1.1aa2b7e23fp-3 }, - types::NumberPair{ 0x1.39d6ccb81b4a1p-47, 0x1.2d1610c868p-3 }, - types::NumberPair{ 0x1.62fa8234b7289p-51, 0x1.365fcb0159p-3 }, - types::NumberPair{ 0x1.5837954fdb678p-45, 0x1.4913d8333bp-3 }, - types::NumberPair{ 0x1.633e8e5697dc7p-45, 0x1.527e5e4a1bp-3 }, - types::NumberPair{ 0x1.9cf8b2c3c2e78p-46, 0x1.6574ebe8c1p-3 }, - types::NumberPair{ -0x1.5118de59c21e1p-45, 0x1.6f0128b757p-3 }, - types::NumberPair{ 0x1.e0ddb9a631e83p-46, 0x1.823c16551ap-3 }, - types::NumberPair{ -0x1.73d54aae92cd1p-47, 0x1.8beafeb39p-3 }, - types::NumberPair{ 0x1.7f22858a0ff6fp-47, 0x1.95a5adcf7p-3 }, - types::NumberPair{ -0x1.8724350562169p-45, 0x1.a93ed3c8aep-3 }, - types::NumberPair{ -0x1.c358d4eace1aap-47, 0x1.b31d8575bdp-3 }, - types::NumberPair{ -0x1.d4bc4595412b6p-45, 0x1.bd087383bep-3 }, - types::NumberPair{ -0x1.84a7e75b6f6e4p-47, 0x1.d1037f2656p-3 }, - types::NumberPair{ -0x1.aff2af715b035p-45, 0x1.db13db0d49p-3 }, - types::NumberPair{ 0x1.212276041f43p-51, 0x1.e530effe71p-3 }, - types::NumberPair{ -0x1.a211565bb8e11p-51, 0x1.ef5ade4ddp-3 }, - types::NumberPair{ 0x1.bcbecca0cdf3p-46, 0x1.f991c6cb3bp-3 }, - types::NumberPair{ 0x1.89cdb16ed4e91p-48, 0x1.07138604d58p-2 }, - types::NumberPair{ 0x1.7188b163ceae9p-45, 0x1.0c42d67616p-2 }, - types::NumberPair{ -0x1.c210e63a5f01cp-45, 0x1.1178e8227e8p-2 }, - types::NumberPair{ 0x1.b9acdf7a51681p-45, 0x1.16b5ccbacf8p-2 }, - types::NumberPair{ 0x1.ca6ed5147bdb7p-45, 0x1.1bf99635a68p-2 }, - types::NumberPair{ 0x1.c93c1df5bb3b6p-45, 0x1.269621134d8p-2 }, - types::NumberPair{ 0x1.a9cfa4a5004f4p-45, 0x1.2bef07cdc9p-2 }, - types::NumberPair{ -0x1.8e27ad3213cb8p-45, 0x1.314f1e1d36p-2 }, - types::NumberPair{ 0x1.16ecdb0f177c8p-46, 0x1.36b6776be1p-2 }, - types::NumberPair{ 0x1.83b54b606bd5cp-46, 0x1.3c25277333p-2 }, - types::NumberPair{ 0x1.8e436ec90e09dp-47, 0x1.419b423d5e8p-2 }, - types::NumberPair{ -0x1.f27ce0967d675p-45, 0x1.4718dc271c8p-2 }, - types::NumberPair{ -0x1.e20891b0ad8a4p-45, 0x1.4c9e09e173p-2 }, - types::NumberPair{ 0x1.ebe708164c759p-45, 0x1.522ae0738ap-2 }, - types::NumberPair{ 0x1.fadedee5d40efp-46, 0x1.57bf753c8dp-2 }, - types::NumberPair{ -0x1.a0b2a08a465dcp-47, 0x1.5d5bddf596p-2 }, - types::NumberPair{ -0x1.db623e731aep-45, 0x1.630030b3abp-2 }, - types::NumberPair{ 0x1.0a0d32756ebap-45, 0x1.68ac83e9c68p-2 }, - types::NumberPair{ 0x1.721657c222d87p-46, 0x1.6e60ee6af18p-2 }, - types::NumberPair{ 0x1.d8b0949dc60b3p-45, 0x1.741d876c678p-2 }, - types::NumberPair{ 0x1.9ec7d2efd1778p-45, 0x1.79e26687cf8p-2 }, - types::NumberPair{ -0x1.72090c812566ap-45, 0x1.7fafa3bd818p-2 }, - types::NumberPair{ 0x1.fd56f3333778ap-45, 0x1.85855776dc8p-2 }, - types::NumberPair{ -0x1.05ae1e5e7047p-45, 0x1.8b639a88b3p-2 }, - types::NumberPair{ -0x1.766b52ee6307dp-46, 0x1.914a8635bf8p-2 }, - types::NumberPair{ -0x1.52313a502d9fp-46, 0x1.973a3431358p-2 }, - types::NumberPair{ -0x1.6279e10d0c0bp-45, 0x1.9d32bea15fp-2 }, - types::NumberPair{ 0x1.3c6457f9d79f5p-45, 0x1.a33440224f8p-2 }, - types::NumberPair{ 0x1.3c6457f9d79f5p-45, 0x1.a33440224f8p-2 }, - types::NumberPair{ 0x1.e36f2bea77a5dp-46, 0x1.a93ed3c8ad8p-2 }, - types::NumberPair{ -0x1.17cc552774458p-45, 0x1.af5295248dp-2 }, - types::NumberPair{ 0x1.095252d841995p-46, 0x1.b56fa044628p-2 }, - types::NumberPair{ 0x1.7d85bf40a666dp-45, 0x1.bb9611b80ep-2 }, - types::NumberPair{ 0x1.cec807fe8e18p-45, 0x1.c1c60693fap-2 }, - types::NumberPair{ 0x1.cec807fe8e18p-45, 0x1.c1c60693fap-2 }, - types::NumberPair{ -0x1.9b6ddc15249aep-45, 0x1.c7ff9c74558p-2 }, - types::NumberPair{ -0x1.797c33ec7a6bp-47, 0x1.ce42f180648p-2 }, - types::NumberPair{ 0x1.35bafe9a767a8p-45, 0x1.d490246def8p-2 }, - types::NumberPair{ -0x1.ea42d60dc616ap-46, 0x1.dae75484c98p-2 }, - types::NumberPair{ -0x1.326b207322938p-46, 0x1.e148a1a2728p-2 }, - types::NumberPair{ -0x1.326b207322938p-46, 0x1.e148a1a2728p-2 }, - types::NumberPair{ -0x1.465505372bd08p-45, 0x1.e7b42c3ddbp-2 }, - types::NumberPair{ 0x1.f27f45a470251p-45, 0x1.ee2a156b41p-2 }, - types::NumberPair{ 0x1.2cde56f014a8bp-46, 0x1.f4aa7ee0318p-2 }, - types::NumberPair{ 0x1.2cde56f014a8bp-46, 0x1.f4aa7ee0318p-2 }, - types::NumberPair{ 0x1.085fa3c164935p-47, 0x1.fb358af7a48p-2 }, - types::NumberPair{ -0x1.53ba3b1727b1cp-47, 0x1.00e5ae5b208p-1 }, - types::NumberPair{ -0x1.4c45fe79539ep-47, 0x1.04360be7604p-1 }, - types::NumberPair{ -0x1.4c45fe79539ep-47, 0x1.04360be7604p-1 }, - types::NumberPair{ 0x1.6812241edf5fdp-45, 0x1.078bf0533c4p-1 }, - types::NumberPair{ 0x1.f486b887e7e27p-46, 0x1.0ae76e2d054p-1 }, - types::NumberPair{ 0x1.f486b887e7e27p-46, 0x1.0ae76e2d054p-1 }, - types::NumberPair{ 0x1.c299807801742p-46, 0x1.0e4898611ccp-1 }, - types::NumberPair{ -0x1.58647bb9ddcb2p-45, 0x1.11af823c75cp-1 }, - types::NumberPair{ -0x1.58647bb9ddcb2p-45, 0x1.11af823c75cp-1 }, - types::NumberPair{ -0x1.edd97a293ae49p-45, 0x1.151c3f6f298p-1 }, - types::NumberPair{ 0x1.4cc4ef8ab465p-46, 0x1.188ee40f23cp-1 }, - types::NumberPair{ 0x1.4cc4ef8ab465p-46, 0x1.188ee40f23cp-1 }, - types::NumberPair{ 0x1.cacdeed70e667p-51, 0x1.1c07849ae6p-1 }, - types::NumberPair{ -0x1.a7242c9fe81d3p-45, 0x1.1f8635fc618p-1 }, - types::NumberPair{ -0x1.a7242c9fe81d3p-45, 0x1.1f8635fc618p-1 }, - types::NumberPair{ 0x1.2fc066e48667bp-46, 0x1.230b0d8bebcp-1 }, - types::NumberPair{ -0x1.b61f10522625p-47, 0x1.269621134dcp-1 }, - types::NumberPair{ -0x1.b61f10522625p-47, 0x1.269621134dcp-1 }, - types::NumberPair{ 0x1.06d2be797882dp-45, 0x1.2a2786d0ecp-1 }, - types::NumberPair{ -0x1.7a6e507b9dc11p-46, 0x1.2dbf557b0ep-1 }, - types::NumberPair{ -0x1.7a6e507b9dc11p-46, 0x1.2dbf557b0ep-1 }, - types::NumberPair{ -0x1.74e93c5a0ed9cp-45, 0x1.315da443408p-1 }, - types::NumberPair{ -0x1.74e93c5a0ed9cp-45, 0x1.315da443408p-1 }, - types::NumberPair{ 0x1.0b83f9527e6acp-46, 0x1.35028ad9d8cp-1 }, - types::NumberPair{ -0x1.18b7abb5569a4p-45, 0x1.38ae2171978p-1 }, - types::NumberPair{ -0x1.18b7abb5569a4p-45, 0x1.38ae2171978p-1 }, - types::NumberPair{ -0x1.2b7367cfe13c2p-47, 0x1.3c6080c36cp-1 }, - types::NumberPair{ -0x1.2b7367cfe13c2p-47, 0x1.3c6080c36cp-1 }, - types::NumberPair{ -0x1.6ce7930f0c74cp-45, 0x1.4019c2125ccp-1 }, - types::NumberPair{ -0x1.d984f481051f7p-48, 0x1.43d9ff2f924p-1 }, - types::NumberPair{ -0x1.d984f481051f7p-48, 0x1.43d9ff2f924p-1 }, - types::NumberPair{ -0x1.2cb6af94d60aap-45, 0x1.47a1527e8a4p-1 }, - types::NumberPair{ -0x1.2cb6af94d60aap-45, 0x1.47a1527e8a4p-1 }, - types::NumberPair{ 0x1.f7115ed4c541cp-49, 0x1.4b6fd6f970cp-1 }, - types::NumberPair{ 0x1.f7115ed4c541cp-49, 0x1.4b6fd6f970cp-1 }, - types::NumberPair{ -0x1.e6c516d93b8fbp-45, 0x1.4f45a835a5p-1 }, - types::NumberPair{ -0x1.e6c516d93b8fbp-45, 0x1.4f45a835a5p-1 }, - types::NumberPair{ 0x1.5ccc45d257531p-47, 0x1.5322e268678p-1 }, - types::NumberPair{ 0x1.5ccc45d257531p-47, 0x1.5322e268678p-1 }, - types::NumberPair{ 0x1.9980bff3303ddp-47, 0x1.5707a26bb8cp-1 }, - types::NumberPair{ 0x1.9980bff3303ddp-47, 0x1.5707a26bb8cp-1 }, - types::NumberPair{ 0x1.dfa63ac10c9fbp-45, 0x1.5af405c3648p-1 }, - types::NumberPair{ 0x1.dfa63ac10c9fbp-45, 0x1.5af405c3648p-1 }, - types::NumberPair{ 0x1.202380cda46bep-45, 0x1.5ee82aa2418p-1 }, - types::NumberPair{ 0.0, 0.0 }, + types::NumberPair{0.0, 0.0}, + types::NumberPair{-0x1.0c76b999d2be8p-46, 0x1.010157589p-7}, + types::NumberPair{-0x1.3dc5b06e2f7d2p-45, 0x1.0205658938p-6}, + types::NumberPair{-0x1.aa0ba325a0c34p-45, 0x1.8492528c9p-6}, + types::NumberPair{0x1.111c05cf1d753p-47, 0x1.0415d89e74p-5}, + types::NumberPair{-0x1.c167375bdfd28p-45, 0x1.466aed42ep-5}, + types::NumberPair{-0x1.97995d05a267dp-46, 0x1.894aa149fcp-5}, + types::NumberPair{-0x1.a68f247d82807p-46, 0x1.ccb73cdddcp-5}, + types::NumberPair{-0x1.7e5dd7009902cp-46, 0x1.08598b59e4p-4}, + types::NumberPair{-0x1.5325d560d9e9bp-45, 0x1.1973bd1466p-4}, + types::NumberPair{0x1.cc85ea5db4ed7p-45, 0x1.3bdf5a7d1ep-4}, + types::NumberPair{-0x1.c69063c5d1d1ep-45, 0x1.5e95a4d97ap-4}, + types::NumberPair{0x1.c1e8da99ded32p-49, 0x1.700d30aeacp-4}, + types::NumberPair{0x1.3115c3abd47dap-45, 0x1.9335e5d594p-4}, + types::NumberPair{-0x1.390802bf768e5p-46, 0x1.b6ac88dad6p-4}, + types::NumberPair{0x1.646d1c65aacd3p-45, 0x1.c885801bc4p-4}, + types::NumberPair{-0x1.dc068afe645ep-45, 0x1.ec739830a2p-4}, + types::NumberPair{-0x1.534d64fa10afdp-45, 0x1.fe89139dbep-4}, + types::NumberPair{0x1.1ef78ce2d07f2p-45, 0x1.1178e8227ep-3}, + types::NumberPair{0x1.ca78e44389934p-45, 0x1.1aa2b7e23fp-3}, + types::NumberPair{0x1.39d6ccb81b4a1p-47, 0x1.2d1610c868p-3}, + types::NumberPair{0x1.62fa8234b7289p-51, 0x1.365fcb0159p-3}, + types::NumberPair{0x1.5837954fdb678p-45, 0x1.4913d8333bp-3}, + types::NumberPair{0x1.633e8e5697dc7p-45, 0x1.527e5e4a1bp-3}, + types::NumberPair{0x1.9cf8b2c3c2e78p-46, 0x1.6574ebe8c1p-3}, + types::NumberPair{-0x1.5118de59c21e1p-45, 0x1.6f0128b757p-3}, + types::NumberPair{0x1.e0ddb9a631e83p-46, 0x1.823c16551ap-3}, + types::NumberPair{-0x1.73d54aae92cd1p-47, 0x1.8beafeb39p-3}, + types::NumberPair{0x1.7f22858a0ff6fp-47, 0x1.95a5adcf7p-3}, + types::NumberPair{-0x1.8724350562169p-45, 0x1.a93ed3c8aep-3}, + types::NumberPair{-0x1.c358d4eace1aap-47, 0x1.b31d8575bdp-3}, + types::NumberPair{-0x1.d4bc4595412b6p-45, 0x1.bd087383bep-3}, + types::NumberPair{-0x1.84a7e75b6f6e4p-47, 0x1.d1037f2656p-3}, + types::NumberPair{-0x1.aff2af715b035p-45, 0x1.db13db0d49p-3}, + types::NumberPair{0x1.212276041f43p-51, 0x1.e530effe71p-3}, + types::NumberPair{-0x1.a211565bb8e11p-51, 0x1.ef5ade4ddp-3}, + types::NumberPair{0x1.bcbecca0cdf3p-46, 0x1.f991c6cb3bp-3}, + types::NumberPair{0x1.89cdb16ed4e91p-48, 0x1.07138604d58p-2}, + types::NumberPair{0x1.7188b163ceae9p-45, 0x1.0c42d67616p-2}, + types::NumberPair{-0x1.c210e63a5f01cp-45, 0x1.1178e8227e8p-2}, + types::NumberPair{0x1.b9acdf7a51681p-45, 0x1.16b5ccbacf8p-2}, + types::NumberPair{0x1.ca6ed5147bdb7p-45, 0x1.1bf99635a68p-2}, + types::NumberPair{0x1.c93c1df5bb3b6p-45, 0x1.269621134d8p-2}, + types::NumberPair{0x1.a9cfa4a5004f4p-45, 0x1.2bef07cdc9p-2}, + types::NumberPair{-0x1.8e27ad3213cb8p-45, 0x1.314f1e1d36p-2}, + types::NumberPair{0x1.16ecdb0f177c8p-46, 0x1.36b6776be1p-2}, + types::NumberPair{0x1.83b54b606bd5cp-46, 0x1.3c25277333p-2}, + types::NumberPair{0x1.8e436ec90e09dp-47, 0x1.419b423d5e8p-2}, + types::NumberPair{-0x1.f27ce0967d675p-45, 0x1.4718dc271c8p-2}, + types::NumberPair{-0x1.e20891b0ad8a4p-45, 0x1.4c9e09e173p-2}, + types::NumberPair{0x1.ebe708164c759p-45, 0x1.522ae0738ap-2}, + types::NumberPair{0x1.fadedee5d40efp-46, 0x1.57bf753c8dp-2}, + types::NumberPair{-0x1.a0b2a08a465dcp-47, 0x1.5d5bddf596p-2}, + types::NumberPair{-0x1.db623e731aep-45, 0x1.630030b3abp-2}, + types::NumberPair{0x1.0a0d32756ebap-45, 0x1.68ac83e9c68p-2}, + types::NumberPair{0x1.721657c222d87p-46, 0x1.6e60ee6af18p-2}, + types::NumberPair{0x1.d8b0949dc60b3p-45, 0x1.741d876c678p-2}, + types::NumberPair{0x1.9ec7d2efd1778p-45, 0x1.79e26687cf8p-2}, + types::NumberPair{-0x1.72090c812566ap-45, 0x1.7fafa3bd818p-2}, + types::NumberPair{0x1.fd56f3333778ap-45, 0x1.85855776dc8p-2}, + types::NumberPair{-0x1.05ae1e5e7047p-45, 0x1.8b639a88b3p-2}, + types::NumberPair{-0x1.766b52ee6307dp-46, 0x1.914a8635bf8p-2}, + types::NumberPair{-0x1.52313a502d9fp-46, 0x1.973a3431358p-2}, + types::NumberPair{-0x1.6279e10d0c0bp-45, 0x1.9d32bea15fp-2}, + types::NumberPair{0x1.3c6457f9d79f5p-45, 0x1.a33440224f8p-2}, + types::NumberPair{0x1.3c6457f9d79f5p-45, 0x1.a33440224f8p-2}, + types::NumberPair{0x1.e36f2bea77a5dp-46, 0x1.a93ed3c8ad8p-2}, + types::NumberPair{-0x1.17cc552774458p-45, 0x1.af5295248dp-2}, + types::NumberPair{0x1.095252d841995p-46, 0x1.b56fa044628p-2}, + types::NumberPair{0x1.7d85bf40a666dp-45, 0x1.bb9611b80ep-2}, + types::NumberPair{0x1.cec807fe8e18p-45, 0x1.c1c60693fap-2}, + types::NumberPair{0x1.cec807fe8e18p-45, 0x1.c1c60693fap-2}, + types::NumberPair{-0x1.9b6ddc15249aep-45, 0x1.c7ff9c74558p-2}, + types::NumberPair{-0x1.797c33ec7a6bp-47, 0x1.ce42f180648p-2}, + types::NumberPair{0x1.35bafe9a767a8p-45, 0x1.d490246def8p-2}, + types::NumberPair{-0x1.ea42d60dc616ap-46, 0x1.dae75484c98p-2}, + types::NumberPair{-0x1.326b207322938p-46, 0x1.e148a1a2728p-2}, + types::NumberPair{-0x1.326b207322938p-46, 0x1.e148a1a2728p-2}, + types::NumberPair{-0x1.465505372bd08p-45, 0x1.e7b42c3ddbp-2}, + types::NumberPair{0x1.f27f45a470251p-45, 0x1.ee2a156b41p-2}, + types::NumberPair{0x1.2cde56f014a8bp-46, 0x1.f4aa7ee0318p-2}, + types::NumberPair{0x1.2cde56f014a8bp-46, 0x1.f4aa7ee0318p-2}, + types::NumberPair{0x1.085fa3c164935p-47, 0x1.fb358af7a48p-2}, + types::NumberPair{-0x1.53ba3b1727b1cp-47, 0x1.00e5ae5b208p-1}, + types::NumberPair{-0x1.4c45fe79539ep-47, 0x1.04360be7604p-1}, + types::NumberPair{-0x1.4c45fe79539ep-47, 0x1.04360be7604p-1}, + types::NumberPair{0x1.6812241edf5fdp-45, 0x1.078bf0533c4p-1}, + types::NumberPair{0x1.f486b887e7e27p-46, 0x1.0ae76e2d054p-1}, + types::NumberPair{0x1.f486b887e7e27p-46, 0x1.0ae76e2d054p-1}, + types::NumberPair{0x1.c299807801742p-46, 0x1.0e4898611ccp-1}, + types::NumberPair{-0x1.58647bb9ddcb2p-45, 0x1.11af823c75cp-1}, + types::NumberPair{-0x1.58647bb9ddcb2p-45, 0x1.11af823c75cp-1}, + types::NumberPair{-0x1.edd97a293ae49p-45, 0x1.151c3f6f298p-1}, + types::NumberPair{0x1.4cc4ef8ab465p-46, 0x1.188ee40f23cp-1}, + types::NumberPair{0x1.4cc4ef8ab465p-46, 0x1.188ee40f23cp-1}, + types::NumberPair{0x1.cacdeed70e667p-51, 0x1.1c07849ae6p-1}, + types::NumberPair{-0x1.a7242c9fe81d3p-45, 0x1.1f8635fc618p-1}, + types::NumberPair{-0x1.a7242c9fe81d3p-45, 0x1.1f8635fc618p-1}, + types::NumberPair{0x1.2fc066e48667bp-46, 0x1.230b0d8bebcp-1}, + types::NumberPair{-0x1.b61f10522625p-47, 0x1.269621134dcp-1}, + types::NumberPair{-0x1.b61f10522625p-47, 0x1.269621134dcp-1}, + types::NumberPair{0x1.06d2be797882dp-45, 0x1.2a2786d0ecp-1}, + types::NumberPair{-0x1.7a6e507b9dc11p-46, 0x1.2dbf557b0ep-1}, + types::NumberPair{-0x1.7a6e507b9dc11p-46, 0x1.2dbf557b0ep-1}, + types::NumberPair{-0x1.74e93c5a0ed9cp-45, 0x1.315da443408p-1}, + types::NumberPair{-0x1.74e93c5a0ed9cp-45, 0x1.315da443408p-1}, + types::NumberPair{0x1.0b83f9527e6acp-46, 0x1.35028ad9d8cp-1}, + types::NumberPair{-0x1.18b7abb5569a4p-45, 0x1.38ae2171978p-1}, + types::NumberPair{-0x1.18b7abb5569a4p-45, 0x1.38ae2171978p-1}, + types::NumberPair{-0x1.2b7367cfe13c2p-47, 0x1.3c6080c36cp-1}, + types::NumberPair{-0x1.2b7367cfe13c2p-47, 0x1.3c6080c36cp-1}, + types::NumberPair{-0x1.6ce7930f0c74cp-45, 0x1.4019c2125ccp-1}, + types::NumberPair{-0x1.d984f481051f7p-48, 0x1.43d9ff2f924p-1}, + types::NumberPair{-0x1.d984f481051f7p-48, 0x1.43d9ff2f924p-1}, + types::NumberPair{-0x1.2cb6af94d60aap-45, 0x1.47a1527e8a4p-1}, + types::NumberPair{-0x1.2cb6af94d60aap-45, 0x1.47a1527e8a4p-1}, + types::NumberPair{0x1.f7115ed4c541cp-49, 0x1.4b6fd6f970cp-1}, + types::NumberPair{0x1.f7115ed4c541cp-49, 0x1.4b6fd6f970cp-1}, + types::NumberPair{-0x1.e6c516d93b8fbp-45, 0x1.4f45a835a5p-1}, + types::NumberPair{-0x1.e6c516d93b8fbp-45, 0x1.4f45a835a5p-1}, + types::NumberPair{0x1.5ccc45d257531p-47, 0x1.5322e268678p-1}, + types::NumberPair{0x1.5ccc45d257531p-47, 0x1.5322e268678p-1}, + types::NumberPair{0x1.9980bff3303ddp-47, 0x1.5707a26bb8cp-1}, + types::NumberPair{0x1.9980bff3303ddp-47, 0x1.5707a26bb8cp-1}, + types::NumberPair{0x1.dfa63ac10c9fbp-45, 0x1.5af405c3648p-1}, + types::NumberPair{0x1.dfa63ac10c9fbp-45, 0x1.5af405c3648p-1}, + types::NumberPair{0x1.202380cda46bep-45, 0x1.5ee82aa2418p-1}, + types::NumberPair{0.0, 0.0}, }; // Logarithm range reduction - Step 2: @@ -338,8 +332,7 @@ namespace ccm::support::constants -0xf7, -0xfb, -0xff, -0x103, -0x107, -0x10b, -0x10f, -0x113, -0x117, -0x11b, -0x11f, -0x123, -0x127, -0x12b, -0x12f, -0x133, -0x137, -0x13a, -0x13e, -0x142, -0x146, -0x14a, -0x14e, -0x152, -0x156, -0x15a, -0x15e, -0x162, -0x166, -0x16a, -0x16e, -0x172, -0x176, -0x17a, -0x17e, -0x182, -0x186, -0x18a, -0x18e, -0x192, -0x195, -0x199, -0x19d, -0x1a1, -0x1a5, -0x1a9, -0x1ad, -0x1b1, -0x1b5, -0x1b9, -0x1bd, -0x1c1, -0x1c5, -0x1c9, - -0x1cd, -0x1d1, -0x1d5, -0x1d9, -0x1dd, -0x1e0, -0x1e4, -0x1e8, -0x1ec, -0x1f0, -0x1f4, -0x1f8, -0x1fc - }; + -0x1cd, -0x1d1, -0x1d5, -0x1d9, -0x1dd, -0x1e0, -0x1e4, -0x1e8, -0x1ec, -0x1f0, -0x1f4, -0x1f8, -0x1fc}; alignas(64) constexpr std::array R2 = { 0x1.0101p0, 0x1.00fdp0, 0x1.00f9p0, 0x1.00f5p0, 0x1.00f1p0, 0x1.00edp0, 0x1.00e9p0, 0x1.00e5p0, 0x1.00e1p0, 0x1.00ddp0, 0x1.00d9p0, @@ -480,70 +473,70 @@ namespace ccm::support::constants // print("{", d, ",", c, ",", b, "},"); // }; constexpr std::array EXP2_MID1 = { - types::TripleDouble{ 0, 0, 0x1p0 }, - types::TripleDouble{ -0x1.9085b0a3d74d5p-110, -0x1.19083535b085dp-56, 0x1.02c9a3e778061p0 }, - types::TripleDouble{ 0x1.05ff94f8d257ep-110, 0x1.d73e2a475b465p-55, 0x1.059b0d3158574p0 }, - types::TripleDouble{ 0x1.15820d96b414fp-111, 0x1.186be4bb284ffp-57, 0x1.0874518759bc8p0 }, - types::TripleDouble{ -0x1.67c9bd6ebf74cp-108, 0x1.8a62e4adc610bp-54, 0x1.0b5586cf9890fp0 }, - types::TripleDouble{ -0x1.5aa76994e9ddbp-113, 0x1.03a1727c57b53p-59, 0x1.0e3ec32d3d1a2p0 }, - types::TripleDouble{ 0x1.9d58b988f562dp-109, -0x1.6c51039449b3ap-54, 0x1.11301d0125b51p0 }, - types::TripleDouble{ -0x1.2fe7bb4c76416p-108, -0x1.32fbf9af1369ep-54, 0x1.1429aaea92dep0 }, - types::TripleDouble{ 0x1.4f2406aa13ffp-109, -0x1.19041b9d78a76p-55, 0x1.172b83c7d517bp0 }, - types::TripleDouble{ 0x1.ad36183926ae8p-111, 0x1.e5b4c7b4968e4p-55, 0x1.1a35beb6fcb75p0 }, - types::TripleDouble{ 0x1.ea62d0881b918p-110, 0x1.e016e00a2643cp-54, 0x1.1d4873168b9aap0 }, - types::TripleDouble{ -0x1.781dbc16f1ea4p-111, 0x1.dc775814a8495p-55, 0x1.2063b88628cd6p0 }, - types::TripleDouble{ -0x1.4d89f9af532ep-109, 0x1.9b07eb6c70573p-54, 0x1.2387a6e756238p0 }, - types::TripleDouble{ 0x1.277393a461b77p-110, 0x1.2bd339940e9d9p-55, 0x1.26b4565e27cddp0 }, - types::TripleDouble{ 0x1.de5448560469p-111, 0x1.612e8afad1255p-55, 0x1.29e9df51fdee1p0 }, - types::TripleDouble{ -0x1.ee9d8f8cb9307p-110, 0x1.0024754db41d5p-54, 0x1.2d285a6e4030bp0 }, - types::TripleDouble{ 0x1.7b7b2f09cd0d9p-110, 0x1.6f46ad23182e4p-55, 0x1.306fe0a31b715p0 }, - types::TripleDouble{ -0x1.406a2ea6cfc6bp-108, 0x1.32721843659a6p-54, 0x1.33c08b26416ffp0 }, - types::TripleDouble{ 0x1.87e3e12516bfap-108, -0x1.63aeabf42eae2p-54, 0x1.371a7373aa9cbp0 }, - types::TripleDouble{ 0x1.9b0b1ff17c296p-111, -0x1.5e436d661f5e3p-56, 0x1.3a7db34e59ff7p0 }, - types::TripleDouble{ -0x1.808ba68fa8fb7p-109, 0x1.ada0911f09ebcp-55, 0x1.3dea64c123422p0 }, - types::TripleDouble{ -0x1.32b43eafc6518p-114, -0x1.ef3691c309278p-58, 0x1.4160a21f72e2ap0 }, - types::TripleDouble{ -0x1.0ac312de3d922p-114, 0x1.89b7a04ef80dp-59, 0x1.44e086061892dp0 }, - types::TripleDouble{ 0x1.e1eebae743acp-111, 0x1.3c1a3b69062fp-56, 0x1.486a2b5c13cdp0 }, - types::TripleDouble{ 0x1.c06c7745c2b39p-113, 0x1.d4397afec42e2p-56, 0x1.4bfdad5362a27p0 }, - types::TripleDouble{ -0x1.1aa1fd7b685cdp-112, -0x1.4b309d25957e3p-54, 0x1.4f9b2769d2ca7p0 }, - types::TripleDouble{ 0x1.fa733951f214cp-111, -0x1.07abe1db13cadp-55, 0x1.5342b569d4f82p0 }, - types::TripleDouble{ -0x1.ff86852a613ffp-111, 0x1.9bb2c011d93adp-54, 0x1.56f4736b527dap0 }, - types::TripleDouble{ -0x1.744ee506fdafep-109, 0x1.6324c054647adp-54, 0x1.5ab07dd485429p0 }, - types::TripleDouble{ -0x1.95f9ab75fa7d6p-108, 0x1.ba6f93080e65ep-54, 0x1.5e76f15ad2148p0 }, - types::TripleDouble{ 0x1.5d8e757cfb991p-111, -0x1.383c17e40b497p-54, 0x1.6247eb03a5585p0 }, - types::TripleDouble{ 0x1.4a337f4dc0a3bp-108, -0x1.bb60987591c34p-54, 0x1.6623882552225p0 }, - types::TripleDouble{ 0x1.57d3e3adec175p-108, -0x1.bdd3413b26456p-54, 0x1.6a09e667f3bcdp0 }, - types::TripleDouble{ 0x1.a59f88abbe778p-115, -0x1.bbe3a683c88abp-57, 0x1.6dfb23c651a2fp0 }, - types::TripleDouble{ -0x1.269796953a4c3p-109, -0x1.16e4786887a99p-55, 0x1.71f75e8ec5f74p0 }, - types::TripleDouble{ -0x1.8f8e7fa19e5e8p-108, -0x1.0245957316dd3p-54, 0x1.75feb564267c9p0 }, - types::TripleDouble{ -0x1.4217a932d10d4p-113, -0x1.41577ee04992fp-55, 0x1.7a11473eb0187p0 }, - types::TripleDouble{ 0x1.70a1427f8fcdfp-112, 0x1.05d02ba15797ep-56, 0x1.7e2f336cf4e62p0 }, - types::TripleDouble{ 0x1.0f6ad65cbbac1p-112, -0x1.d4c1dd41532d8p-54, 0x1.82589994cce13p0 }, - types::TripleDouble{ -0x1.f16f65181d921p-109, -0x1.fc6f89bd4f6bap-54, 0x1.868d99b4492edp0 }, - types::TripleDouble{ -0x1.30644a7836333p-110, 0x1.6e9f156864b27p-54, 0x1.8ace5422aa0dbp0 }, - types::TripleDouble{ 0x1.3bf26d2b85163p-114, 0x1.5cc13a2e3976cp-55, 0x1.8f1ae99157736p0 }, - types::TripleDouble{ 0x1.697e257ac0db2p-111, -0x1.75fc781b57ebcp-57, 0x1.93737b0cdc5e5p0 }, - types::TripleDouble{ 0x1.7edb9d7144b6fp-108, -0x1.d185b7c1b85d1p-54, 0x1.97d829fde4e5p0 }, - types::TripleDouble{ 0x1.6376b7943085cp-110, 0x1.c7c46b071f2bep-56, 0x1.9c49182a3f09p0 }, - types::TripleDouble{ 0x1.354084551b4fbp-109, -0x1.359495d1cd533p-54, 0x1.a0c667b5de565p0 }, - types::TripleDouble{ -0x1.bfd7adfd63f48p-111, -0x1.d2f6edb8d41e1p-54, 0x1.a5503b23e255dp0 }, - types::TripleDouble{ 0x1.8b16ae39e8cb9p-109, 0x1.0fac90ef7fd31p-54, 0x1.a9e6b5579fdbfp0 }, - types::TripleDouble{ 0x1.a7fbc3ae675eap-108, 0x1.7a1cd345dcc81p-54, 0x1.ae89f995ad3adp0 }, - types::TripleDouble{ 0x1.2babc0edda4d9p-111, -0x1.2805e3084d708p-57, 0x1.b33a2b84f15fbp0 }, - types::TripleDouble{ 0x1.aa64481e1ab72p-111, -0x1.5584f7e54ac3bp-56, 0x1.b7f76f2fb5e47p0 }, - types::TripleDouble{ 0x1.9a164050e1258p-109, 0x1.23dd07a2d9e84p-55, 0x1.bcc1e904bc1d2p0 }, - types::TripleDouble{ 0x1.99e51125928dap-110, 0x1.11065895048ddp-55, 0x1.c199bdd85529cp0 }, - types::TripleDouble{ -0x1.fc44c329d5cb2p-109, 0x1.2884dff483cadp-54, 0x1.c67f12e57d14bp0 }, - types::TripleDouble{ 0x1.d8765566b032ep-110, 0x1.503cbd1e949dbp-56, 0x1.cb720dcef9069p0 }, - types::TripleDouble{ -0x1.e7044039da0f6p-108, -0x1.cbc3743797a9cp-54, 0x1.d072d4a07897cp0 }, - types::TripleDouble{ -0x1.ab053b05531fcp-111, 0x1.2ed02d75b3707p-55, 0x1.d5818dcfba487p0 }, - types::TripleDouble{ 0x1.7f6246f0ec615p-108, 0x1.c2300696db532p-54, 0x1.da9e603db3285p0 }, - types::TripleDouble{ 0x1.b7225a944efd6p-108, -0x1.1a5cd4f184b5cp-54, 0x1.dfc97337b9b5fp0 }, - types::TripleDouble{ 0x1.1e92cb3c2d278p-109, 0x1.39e8980a9cc8fp-55, 0x1.e502ee78b3ff6p0 }, - types::TripleDouble{ -0x1.fc0f242bbf3dep-109, -0x1.e9c23179c2893p-54, 0x1.ea4afa2a490dap0 }, - types::TripleDouble{ 0x1.f6dd5d229ff69p-108, 0x1.dc7f486a4b6bp-54, 0x1.efa1bee615a27p0 }, - types::TripleDouble{ -0x1.4019bffc80ef3p-110, 0x1.9d3e12dd8a18bp-54, 0x1.f50765b6e454p0 }, - types::TripleDouble{ 0x1.dc060c36f7651p-112, 0x1.74853f3a5931ep-55, 0x1.fa7c1819e90d8p0 }, + types::TripleDouble{0, 0, 0x1p0}, + types::TripleDouble{-0x1.9085b0a3d74d5p-110, -0x1.19083535b085dp-56, 0x1.02c9a3e778061p0}, + types::TripleDouble{0x1.05ff94f8d257ep-110, 0x1.d73e2a475b465p-55, 0x1.059b0d3158574p0}, + types::TripleDouble{0x1.15820d96b414fp-111, 0x1.186be4bb284ffp-57, 0x1.0874518759bc8p0}, + types::TripleDouble{-0x1.67c9bd6ebf74cp-108, 0x1.8a62e4adc610bp-54, 0x1.0b5586cf9890fp0}, + types::TripleDouble{-0x1.5aa76994e9ddbp-113, 0x1.03a1727c57b53p-59, 0x1.0e3ec32d3d1a2p0}, + types::TripleDouble{0x1.9d58b988f562dp-109, -0x1.6c51039449b3ap-54, 0x1.11301d0125b51p0}, + types::TripleDouble{-0x1.2fe7bb4c76416p-108, -0x1.32fbf9af1369ep-54, 0x1.1429aaea92dep0}, + types::TripleDouble{0x1.4f2406aa13ffp-109, -0x1.19041b9d78a76p-55, 0x1.172b83c7d517bp0}, + types::TripleDouble{0x1.ad36183926ae8p-111, 0x1.e5b4c7b4968e4p-55, 0x1.1a35beb6fcb75p0}, + types::TripleDouble{0x1.ea62d0881b918p-110, 0x1.e016e00a2643cp-54, 0x1.1d4873168b9aap0}, + types::TripleDouble{-0x1.781dbc16f1ea4p-111, 0x1.dc775814a8495p-55, 0x1.2063b88628cd6p0}, + types::TripleDouble{-0x1.4d89f9af532ep-109, 0x1.9b07eb6c70573p-54, 0x1.2387a6e756238p0}, + types::TripleDouble{0x1.277393a461b77p-110, 0x1.2bd339940e9d9p-55, 0x1.26b4565e27cddp0}, + types::TripleDouble{0x1.de5448560469p-111, 0x1.612e8afad1255p-55, 0x1.29e9df51fdee1p0}, + types::TripleDouble{-0x1.ee9d8f8cb9307p-110, 0x1.0024754db41d5p-54, 0x1.2d285a6e4030bp0}, + types::TripleDouble{0x1.7b7b2f09cd0d9p-110, 0x1.6f46ad23182e4p-55, 0x1.306fe0a31b715p0}, + types::TripleDouble{-0x1.406a2ea6cfc6bp-108, 0x1.32721843659a6p-54, 0x1.33c08b26416ffp0}, + types::TripleDouble{0x1.87e3e12516bfap-108, -0x1.63aeabf42eae2p-54, 0x1.371a7373aa9cbp0}, + types::TripleDouble{0x1.9b0b1ff17c296p-111, -0x1.5e436d661f5e3p-56, 0x1.3a7db34e59ff7p0}, + types::TripleDouble{-0x1.808ba68fa8fb7p-109, 0x1.ada0911f09ebcp-55, 0x1.3dea64c123422p0}, + types::TripleDouble{-0x1.32b43eafc6518p-114, -0x1.ef3691c309278p-58, 0x1.4160a21f72e2ap0}, + types::TripleDouble{-0x1.0ac312de3d922p-114, 0x1.89b7a04ef80dp-59, 0x1.44e086061892dp0}, + types::TripleDouble{0x1.e1eebae743acp-111, 0x1.3c1a3b69062fp-56, 0x1.486a2b5c13cdp0}, + types::TripleDouble{0x1.c06c7745c2b39p-113, 0x1.d4397afec42e2p-56, 0x1.4bfdad5362a27p0}, + types::TripleDouble{-0x1.1aa1fd7b685cdp-112, -0x1.4b309d25957e3p-54, 0x1.4f9b2769d2ca7p0}, + types::TripleDouble{0x1.fa733951f214cp-111, -0x1.07abe1db13cadp-55, 0x1.5342b569d4f82p0}, + types::TripleDouble{-0x1.ff86852a613ffp-111, 0x1.9bb2c011d93adp-54, 0x1.56f4736b527dap0}, + types::TripleDouble{-0x1.744ee506fdafep-109, 0x1.6324c054647adp-54, 0x1.5ab07dd485429p0}, + types::TripleDouble{-0x1.95f9ab75fa7d6p-108, 0x1.ba6f93080e65ep-54, 0x1.5e76f15ad2148p0}, + types::TripleDouble{0x1.5d8e757cfb991p-111, -0x1.383c17e40b497p-54, 0x1.6247eb03a5585p0}, + types::TripleDouble{0x1.4a337f4dc0a3bp-108, -0x1.bb60987591c34p-54, 0x1.6623882552225p0}, + types::TripleDouble{0x1.57d3e3adec175p-108, -0x1.bdd3413b26456p-54, 0x1.6a09e667f3bcdp0}, + types::TripleDouble{0x1.a59f88abbe778p-115, -0x1.bbe3a683c88abp-57, 0x1.6dfb23c651a2fp0}, + types::TripleDouble{-0x1.269796953a4c3p-109, -0x1.16e4786887a99p-55, 0x1.71f75e8ec5f74p0}, + types::TripleDouble{-0x1.8f8e7fa19e5e8p-108, -0x1.0245957316dd3p-54, 0x1.75feb564267c9p0}, + types::TripleDouble{-0x1.4217a932d10d4p-113, -0x1.41577ee04992fp-55, 0x1.7a11473eb0187p0}, + types::TripleDouble{0x1.70a1427f8fcdfp-112, 0x1.05d02ba15797ep-56, 0x1.7e2f336cf4e62p0}, + types::TripleDouble{0x1.0f6ad65cbbac1p-112, -0x1.d4c1dd41532d8p-54, 0x1.82589994cce13p0}, + types::TripleDouble{-0x1.f16f65181d921p-109, -0x1.fc6f89bd4f6bap-54, 0x1.868d99b4492edp0}, + types::TripleDouble{-0x1.30644a7836333p-110, 0x1.6e9f156864b27p-54, 0x1.8ace5422aa0dbp0}, + types::TripleDouble{0x1.3bf26d2b85163p-114, 0x1.5cc13a2e3976cp-55, 0x1.8f1ae99157736p0}, + types::TripleDouble{0x1.697e257ac0db2p-111, -0x1.75fc781b57ebcp-57, 0x1.93737b0cdc5e5p0}, + types::TripleDouble{0x1.7edb9d7144b6fp-108, -0x1.d185b7c1b85d1p-54, 0x1.97d829fde4e5p0}, + types::TripleDouble{0x1.6376b7943085cp-110, 0x1.c7c46b071f2bep-56, 0x1.9c49182a3f09p0}, + types::TripleDouble{0x1.354084551b4fbp-109, -0x1.359495d1cd533p-54, 0x1.a0c667b5de565p0}, + types::TripleDouble{-0x1.bfd7adfd63f48p-111, -0x1.d2f6edb8d41e1p-54, 0x1.a5503b23e255dp0}, + types::TripleDouble{0x1.8b16ae39e8cb9p-109, 0x1.0fac90ef7fd31p-54, 0x1.a9e6b5579fdbfp0}, + types::TripleDouble{0x1.a7fbc3ae675eap-108, 0x1.7a1cd345dcc81p-54, 0x1.ae89f995ad3adp0}, + types::TripleDouble{0x1.2babc0edda4d9p-111, -0x1.2805e3084d708p-57, 0x1.b33a2b84f15fbp0}, + types::TripleDouble{0x1.aa64481e1ab72p-111, -0x1.5584f7e54ac3bp-56, 0x1.b7f76f2fb5e47p0}, + types::TripleDouble{0x1.9a164050e1258p-109, 0x1.23dd07a2d9e84p-55, 0x1.bcc1e904bc1d2p0}, + types::TripleDouble{0x1.99e51125928dap-110, 0x1.11065895048ddp-55, 0x1.c199bdd85529cp0}, + types::TripleDouble{-0x1.fc44c329d5cb2p-109, 0x1.2884dff483cadp-54, 0x1.c67f12e57d14bp0}, + types::TripleDouble{0x1.d8765566b032ep-110, 0x1.503cbd1e949dbp-56, 0x1.cb720dcef9069p0}, + types::TripleDouble{-0x1.e7044039da0f6p-108, -0x1.cbc3743797a9cp-54, 0x1.d072d4a07897cp0}, + types::TripleDouble{-0x1.ab053b05531fcp-111, 0x1.2ed02d75b3707p-55, 0x1.d5818dcfba487p0}, + types::TripleDouble{0x1.7f6246f0ec615p-108, 0x1.c2300696db532p-54, 0x1.da9e603db3285p0}, + types::TripleDouble{0x1.b7225a944efd6p-108, -0x1.1a5cd4f184b5cp-54, 0x1.dfc97337b9b5fp0}, + types::TripleDouble{0x1.1e92cb3c2d278p-109, 0x1.39e8980a9cc8fp-55, 0x1.e502ee78b3ff6p0}, + types::TripleDouble{-0x1.fc0f242bbf3dep-109, -0x1.e9c23179c2893p-54, 0x1.ea4afa2a490dap0}, + types::TripleDouble{0x1.f6dd5d229ff69p-108, 0x1.dc7f486a4b6bp-54, 0x1.efa1bee615a27p0}, + types::TripleDouble{-0x1.4019bffc80ef3p-110, 0x1.9d3e12dd8a18bp-54, 0x1.f50765b6e454p0}, + types::TripleDouble{0x1.dc060c36f7651p-112, 0x1.74853f3a5931ep-55, 0x1.fa7c1819e90d8p0}, }; // Lookup table for 2^(k * 2^-12) with k = 0..63. @@ -558,69 +551,69 @@ namespace ccm::support::constants // print("{", d, ",", c, ",", b, "},"); // }; constexpr std::array EXP2_MID2 = { - types::TripleDouble{ 0, 0, 0x1p0 }, - types::TripleDouble{ 0x1.39726694630e3p-108, 0x1.ae8e38c59c72ap-54, 0x1.000b175effdc7p0 }, - types::TripleDouble{ 0x1.e5e06ddd31156p-112, -0x1.7b5d0d58ea8f4p-58, 0x1.00162f3904052p0 }, - types::TripleDouble{ 0x1.5a0768b51f609p-111, 0x1.4115cb6b16a8ep-54, 0x1.0021478e11ce6p0 }, - types::TripleDouble{ 0x1.d008403605217p-111, -0x1.d7c96f201bb2fp-55, 0x1.002c605e2e8cfp0 }, - types::TripleDouble{ 0x1.89bc16f765708p-109, 0x1.84711d4c35e9fp-54, 0x1.003779a95f959p0 }, - types::TripleDouble{ -0x1.4535b7f8c1e2dp-109, -0x1.0484245243777p-55, 0x1.0042936faa3d8p0 }, - types::TripleDouble{ -0x1.8ba92f6b25456p-108, -0x1.4b237da2025f9p-54, 0x1.004dadb113dap0 }, - types::TripleDouble{ -0x1.30c72e81f4294p-113, -0x1.5e00e62d6b30dp-56, 0x1.0058c86da1c0ap0 }, - types::TripleDouble{ -0x1.34a5384e6f0b9p-110, 0x1.a1d6cedbb9481p-54, 0x1.0063e3a559473p0 }, - types::TripleDouble{ 0x1.f8d0580865d2ep-108, -0x1.4acf197a00142p-54, 0x1.006eff583fc3dp0 }, - types::TripleDouble{ -0x1.002bcb3ae9a99p-111, -0x1.eaf2ea42391a5p-57, 0x1.007a1b865a8cap0 }, - types::TripleDouble{ 0x1.c3c5aedee9851p-111, 0x1.da93f90835f75p-56, 0x1.0085382faef83p0 }, - types::TripleDouble{ 0x1.7217851d1ec6ep-109, -0x1.6a79084ab093cp-55, 0x1.00905554425d4p0 }, - types::TripleDouble{ -0x1.80cbca335a7c3p-110, 0x1.86364f8fbe8f8p-54, 0x1.009b72f41a12bp0 }, - types::TripleDouble{ -0x1.706bd4eb22595p-110, -0x1.82e8e14e3110ep-55, 0x1.00a6910f3b6fdp0 }, - types::TripleDouble{ -0x1.b55dd523f3c08p-111, -0x1.4f6b2a7609f71p-55, 0x1.00b1afa5abcbfp0 }, - types::TripleDouble{ 0x1.90a1e207cced1p-110, -0x1.e1a258ea8f71bp-56, 0x1.00bcceb7707ecp0 }, - types::TripleDouble{ 0x1.78d0472db37c5p-110, 0x1.4362ca5bc26f1p-56, 0x1.00c7ee448ee02p0 }, - types::TripleDouble{ -0x1.bcd4db3cb52fep-109, 0x1.095a56c919d02p-54, 0x1.00d30e4d0c483p0 }, - types::TripleDouble{ -0x1.cf1b131575ec2p-112, -0x1.406ac4e81a645p-57, 0x1.00de2ed0ee0f5p0 }, - types::TripleDouble{ -0x1.6aaa1fa7ff913p-112, 0x1.b5a6902767e09p-54, 0x1.00e94fd0398ep0 }, - types::TripleDouble{ 0x1.68f236dff3218p-110, -0x1.91b2060859321p-54, 0x1.00f4714af41d3p0 }, - types::TripleDouble{ -0x1.e8bb58067e60ap-109, 0x1.427068ab22306p-55, 0x1.00ff93412315cp0 }, - types::TripleDouble{ 0x1.d4cd5e1d71fdfp-108, 0x1.c1d0660524e08p-54, 0x1.010ab5b2cbd11p0 }, - types::TripleDouble{ 0x1.e4ecf350ebe88p-108, -0x1.e7bdfb3204be8p-54, 0x1.0115d89ff3a8bp0 }, - types::TripleDouble{ 0x1.6a2aa2c89c4f8p-109, 0x1.843aa8b9cbbc6p-55, 0x1.0120fc089ff63p0 }, - types::TripleDouble{ 0x1.1ca368a20ed05p-110, -0x1.34104ee7edae9p-56, 0x1.012c1fecd613bp0 }, - types::TripleDouble{ 0x1.edb1095d925cfp-114, -0x1.2b6aeb6176892p-56, 0x1.0137444c9b5b5p0 }, - types::TripleDouble{ -0x1.488c78eded75fp-111, 0x1.a8cd33b8a1bb3p-56, 0x1.01426927f5278p0 }, - types::TripleDouble{ -0x1.7480f5ea1b3c9p-113, 0x1.2edc08e5da99ap-56, 0x1.014d8e7ee8d2fp0 }, - types::TripleDouble{ -0x1.ae45989a04dd5p-111, 0x1.57ba2dc7e0c73p-55, 0x1.0158b4517bb88p0 }, - types::TripleDouble{ 0x1.bf48007d80987p-109, 0x1.b61299ab8cdb7p-54, 0x1.0163da9fb3335p0 }, - types::TripleDouble{ 0x1.1aa91a059292cp-109, -0x1.90565902c5f44p-54, 0x1.016f0169949edp0 }, - types::TripleDouble{ 0x1.b6663292855f5p-110, 0x1.70fc41c5c2d53p-55, 0x1.017a28af25567p0 }, - types::TripleDouble{ 0x1.e7fbca6793d94p-108, 0x1.4b9a6e145d76cp-54, 0x1.018550706ab62p0 }, - types::TripleDouble{ -0x1.5b9f5c7de3b93p-110, -0x1.008eff5142bf9p-56, 0x1.019078ad6a19fp0 }, - types::TripleDouble{ 0x1.4638bf2f6acabp-110, -0x1.77669f033c7dep-54, 0x1.019ba16628de2p0 }, - types::TripleDouble{ -0x1.ab237b9a069c5p-109, -0x1.09bb78eeead0ap-54, 0x1.01a6ca9aac5f3p0 }, - types::TripleDouble{ 0x1.3ab358be97cefp-108, 0x1.371231477ece5p-54, 0x1.01b1f44af9f9ep0 }, - types::TripleDouble{ -0x1.4027b2294bb64p-110, 0x1.5e7626621eb5bp-56, 0x1.01bd1e77170b4p0 }, - types::TripleDouble{ 0x1.656394426c99p-111, -0x1.bc72b100828a5p-54, 0x1.01c8491f08f08p0 }, - types::TripleDouble{ 0x1.bf9785189bdd8p-111, -0x1.ce39cbbab8bbep-57, 0x1.01d37442d507p0 }, - types::TripleDouble{ 0x1.7c12f86114fe3p-109, 0x1.16996709da2e2p-55, 0x1.01de9fe280ac8p0 }, - types::TripleDouble{ -0x1.653d5d24b5d28p-109, -0x1.c11f5239bf535p-55, 0x1.01e9cbfe113efp0 }, - types::TripleDouble{ 0x1.04a0cdc1d86d7p-109, 0x1.e1d4eb5edc6b3p-55, 0x1.01f4f8958c1c6p0 }, - types::TripleDouble{ 0x1.c678c46149782p-109, -0x1.afb99946ee3fp-54, 0x1.020025a8f6a35p0 }, - types::TripleDouble{ 0x1.48524e1e9df7p-108, -0x1.8f06d8a148a32p-54, 0x1.020b533856324p0 }, - types::TripleDouble{ 0x1.9953ea727ff0bp-109, -0x1.2bf310fc54eb6p-55, 0x1.02168143b0281p0 }, - types::TripleDouble{ -0x1.ccfbbec22d28ep-108, -0x1.c95a035eb4175p-54, 0x1.0221afcb09e3ep0 }, - types::TripleDouble{ 0x1.9e2bb6e181de1p-108, -0x1.491793e46834dp-54, 0x1.022cdece68c4fp0 }, - types::TripleDouble{ 0x1.f17609ae29308p-110, -0x1.3e8d0d9c49091p-56, 0x1.02380e4dd22adp0 }, - types::TripleDouble{ -0x1.c7dc2c476bfb8p-110, -0x1.314aa16278aa3p-54, 0x1.02433e494b755p0 }, - types::TripleDouble{ -0x1.fab994971d4a3p-109, 0x1.48daf888e9651p-55, 0x1.024e6ec0da046p0 }, - types::TripleDouble{ 0x1.848b62cbdd0afp-109, 0x1.56dc8046821f4p-55, 0x1.02599fb483385p0 }, - types::TripleDouble{ -0x1.bf603ba715d0cp-109, 0x1.45b42356b9d47p-54, 0x1.0264d1244c719p0 }, - types::TripleDouble{ 0x1.89434e751e1aap-110, -0x1.082ef51b61d7ep-56, 0x1.027003103b10ep0 }, - types::TripleDouble{ -0x1.03b54fd64e8acp-110, 0x1.2106ed0920a34p-56, 0x1.027b357854772p0 }, - types::TripleDouble{ 0x1.7785ea0acc486p-109, -0x1.fd4cf26ea5d0fp-54, 0x1.0286685c9e059p0 }, - types::TripleDouble{ -0x1.ce447fdb35ff9p-109, -0x1.09f8775e78084p-54, 0x1.02919bbd1d1d8p0 }, - types::TripleDouble{ 0x1.5b884aab5642ap-112, 0x1.64cbba902ca27p-58, 0x1.029ccf99d720ap0 }, - types::TripleDouble{ -0x1.cfb3e46d7c1cp-108, 0x1.4383ef231d207p-54, 0x1.02a803f2d170dp0 }, - types::TripleDouble{ -0x1.0d40cee4b81afp-112, 0x1.4a47a505b3a47p-54, 0x1.02b338c811703p0 }, - types::TripleDouble{ 0x1.6ae7d36d7c1f7p-109, 0x1.e47120223467fp-54, 0x1.02be6e199c811p0 }, + types::TripleDouble{0, 0, 0x1p0}, + types::TripleDouble{0x1.39726694630e3p-108, 0x1.ae8e38c59c72ap-54, 0x1.000b175effdc7p0}, + types::TripleDouble{0x1.e5e06ddd31156p-112, -0x1.7b5d0d58ea8f4p-58, 0x1.00162f3904052p0}, + types::TripleDouble{0x1.5a0768b51f609p-111, 0x1.4115cb6b16a8ep-54, 0x1.0021478e11ce6p0}, + types::TripleDouble{0x1.d008403605217p-111, -0x1.d7c96f201bb2fp-55, 0x1.002c605e2e8cfp0}, + types::TripleDouble{0x1.89bc16f765708p-109, 0x1.84711d4c35e9fp-54, 0x1.003779a95f959p0}, + types::TripleDouble{-0x1.4535b7f8c1e2dp-109, -0x1.0484245243777p-55, 0x1.0042936faa3d8p0}, + types::TripleDouble{-0x1.8ba92f6b25456p-108, -0x1.4b237da2025f9p-54, 0x1.004dadb113dap0}, + types::TripleDouble{-0x1.30c72e81f4294p-113, -0x1.5e00e62d6b30dp-56, 0x1.0058c86da1c0ap0}, + types::TripleDouble{-0x1.34a5384e6f0b9p-110, 0x1.a1d6cedbb9481p-54, 0x1.0063e3a559473p0}, + types::TripleDouble{0x1.f8d0580865d2ep-108, -0x1.4acf197a00142p-54, 0x1.006eff583fc3dp0}, + types::TripleDouble{-0x1.002bcb3ae9a99p-111, -0x1.eaf2ea42391a5p-57, 0x1.007a1b865a8cap0}, + types::TripleDouble{0x1.c3c5aedee9851p-111, 0x1.da93f90835f75p-56, 0x1.0085382faef83p0}, + types::TripleDouble{0x1.7217851d1ec6ep-109, -0x1.6a79084ab093cp-55, 0x1.00905554425d4p0}, + types::TripleDouble{-0x1.80cbca335a7c3p-110, 0x1.86364f8fbe8f8p-54, 0x1.009b72f41a12bp0}, + types::TripleDouble{-0x1.706bd4eb22595p-110, -0x1.82e8e14e3110ep-55, 0x1.00a6910f3b6fdp0}, + types::TripleDouble{-0x1.b55dd523f3c08p-111, -0x1.4f6b2a7609f71p-55, 0x1.00b1afa5abcbfp0}, + types::TripleDouble{0x1.90a1e207cced1p-110, -0x1.e1a258ea8f71bp-56, 0x1.00bcceb7707ecp0}, + types::TripleDouble{0x1.78d0472db37c5p-110, 0x1.4362ca5bc26f1p-56, 0x1.00c7ee448ee02p0}, + types::TripleDouble{-0x1.bcd4db3cb52fep-109, 0x1.095a56c919d02p-54, 0x1.00d30e4d0c483p0}, + types::TripleDouble{-0x1.cf1b131575ec2p-112, -0x1.406ac4e81a645p-57, 0x1.00de2ed0ee0f5p0}, + types::TripleDouble{-0x1.6aaa1fa7ff913p-112, 0x1.b5a6902767e09p-54, 0x1.00e94fd0398ep0}, + types::TripleDouble{0x1.68f236dff3218p-110, -0x1.91b2060859321p-54, 0x1.00f4714af41d3p0}, + types::TripleDouble{-0x1.e8bb58067e60ap-109, 0x1.427068ab22306p-55, 0x1.00ff93412315cp0}, + types::TripleDouble{0x1.d4cd5e1d71fdfp-108, 0x1.c1d0660524e08p-54, 0x1.010ab5b2cbd11p0}, + types::TripleDouble{0x1.e4ecf350ebe88p-108, -0x1.e7bdfb3204be8p-54, 0x1.0115d89ff3a8bp0}, + types::TripleDouble{0x1.6a2aa2c89c4f8p-109, 0x1.843aa8b9cbbc6p-55, 0x1.0120fc089ff63p0}, + types::TripleDouble{0x1.1ca368a20ed05p-110, -0x1.34104ee7edae9p-56, 0x1.012c1fecd613bp0}, + types::TripleDouble{0x1.edb1095d925cfp-114, -0x1.2b6aeb6176892p-56, 0x1.0137444c9b5b5p0}, + types::TripleDouble{-0x1.488c78eded75fp-111, 0x1.a8cd33b8a1bb3p-56, 0x1.01426927f5278p0}, + types::TripleDouble{-0x1.7480f5ea1b3c9p-113, 0x1.2edc08e5da99ap-56, 0x1.014d8e7ee8d2fp0}, + types::TripleDouble{-0x1.ae45989a04dd5p-111, 0x1.57ba2dc7e0c73p-55, 0x1.0158b4517bb88p0}, + types::TripleDouble{0x1.bf48007d80987p-109, 0x1.b61299ab8cdb7p-54, 0x1.0163da9fb3335p0}, + types::TripleDouble{0x1.1aa91a059292cp-109, -0x1.90565902c5f44p-54, 0x1.016f0169949edp0}, + types::TripleDouble{0x1.b6663292855f5p-110, 0x1.70fc41c5c2d53p-55, 0x1.017a28af25567p0}, + types::TripleDouble{0x1.e7fbca6793d94p-108, 0x1.4b9a6e145d76cp-54, 0x1.018550706ab62p0}, + types::TripleDouble{-0x1.5b9f5c7de3b93p-110, -0x1.008eff5142bf9p-56, 0x1.019078ad6a19fp0}, + types::TripleDouble{0x1.4638bf2f6acabp-110, -0x1.77669f033c7dep-54, 0x1.019ba16628de2p0}, + types::TripleDouble{-0x1.ab237b9a069c5p-109, -0x1.09bb78eeead0ap-54, 0x1.01a6ca9aac5f3p0}, + types::TripleDouble{0x1.3ab358be97cefp-108, 0x1.371231477ece5p-54, 0x1.01b1f44af9f9ep0}, + types::TripleDouble{-0x1.4027b2294bb64p-110, 0x1.5e7626621eb5bp-56, 0x1.01bd1e77170b4p0}, + types::TripleDouble{0x1.656394426c99p-111, -0x1.bc72b100828a5p-54, 0x1.01c8491f08f08p0}, + types::TripleDouble{0x1.bf9785189bdd8p-111, -0x1.ce39cbbab8bbep-57, 0x1.01d37442d507p0}, + types::TripleDouble{0x1.7c12f86114fe3p-109, 0x1.16996709da2e2p-55, 0x1.01de9fe280ac8p0}, + types::TripleDouble{-0x1.653d5d24b5d28p-109, -0x1.c11f5239bf535p-55, 0x1.01e9cbfe113efp0}, + types::TripleDouble{0x1.04a0cdc1d86d7p-109, 0x1.e1d4eb5edc6b3p-55, 0x1.01f4f8958c1c6p0}, + types::TripleDouble{0x1.c678c46149782p-109, -0x1.afb99946ee3fp-54, 0x1.020025a8f6a35p0}, + types::TripleDouble{0x1.48524e1e9df7p-108, -0x1.8f06d8a148a32p-54, 0x1.020b533856324p0}, + types::TripleDouble{0x1.9953ea727ff0bp-109, -0x1.2bf310fc54eb6p-55, 0x1.02168143b0281p0}, + types::TripleDouble{-0x1.ccfbbec22d28ep-108, -0x1.c95a035eb4175p-54, 0x1.0221afcb09e3ep0}, + types::TripleDouble{0x1.9e2bb6e181de1p-108, -0x1.491793e46834dp-54, 0x1.022cdece68c4fp0}, + types::TripleDouble{0x1.f17609ae29308p-110, -0x1.3e8d0d9c49091p-56, 0x1.02380e4dd22adp0}, + types::TripleDouble{-0x1.c7dc2c476bfb8p-110, -0x1.314aa16278aa3p-54, 0x1.02433e494b755p0}, + types::TripleDouble{-0x1.fab994971d4a3p-109, 0x1.48daf888e9651p-55, 0x1.024e6ec0da046p0}, + types::TripleDouble{0x1.848b62cbdd0afp-109, 0x1.56dc8046821f4p-55, 0x1.02599fb483385p0}, + types::TripleDouble{-0x1.bf603ba715d0cp-109, 0x1.45b42356b9d47p-54, 0x1.0264d1244c719p0}, + types::TripleDouble{0x1.89434e751e1aap-110, -0x1.082ef51b61d7ep-56, 0x1.027003103b10ep0}, + types::TripleDouble{-0x1.03b54fd64e8acp-110, 0x1.2106ed0920a34p-56, 0x1.027b357854772p0}, + types::TripleDouble{0x1.7785ea0acc486p-109, -0x1.fd4cf26ea5d0fp-54, 0x1.0286685c9e059p0}, + types::TripleDouble{-0x1.ce447fdb35ff9p-109, -0x1.09f8775e78084p-54, 0x1.02919bbd1d1d8p0}, + types::TripleDouble{0x1.5b884aab5642ap-112, 0x1.64cbba902ca27p-58, 0x1.029ccf99d720ap0}, + types::TripleDouble{-0x1.cfb3e46d7c1cp-108, 0x1.4383ef231d207p-54, 0x1.02a803f2d170dp0}, + types::TripleDouble{-0x1.0d40cee4b81afp-112, 0x1.4a47a505b3a47p-54, 0x1.02b338c811703p0}, + types::TripleDouble{0x1.6ae7d36d7c1f7p-109, 0x1.e47120223467fp-54, 0x1.02be6e199c811p0}, }; } // namespace ccm::support::constants diff --git a/include/ccmath/internal/support/fp/fma.hpp b/include/ccmath/internal/support/fp/fma.hpp index a7753591..2ee2bf42 100644 --- a/include/ccmath/internal/support/fp/fma.hpp +++ b/include/ccmath/internal/support/fp/fma.hpp @@ -80,8 +80,8 @@ namespace ccm::support::fp if constexpr (std::is_integral_v) { - const Int mask = (Int{ 1 } << bit_count) - Int{ 1 }; - return (value & mask) != Int{ 0 }; + const Int mask = (Int{1} << bit_count) - Int{1}; + return (value & mask) != Int{0}; } else { for (int bit = 0; bit < bit_count; ++bit) @@ -105,7 +105,7 @@ namespace ccm::support::fp constexpr int DIGITS = std::numeric_limits::digits; if (shift_length >= DIGITS) { - value = Int{ 0 }; + value = Int{0}; return true; } @@ -452,7 +452,7 @@ namespace ccm::support::fp base_exponent = z_value.top_exponent - (Traits::accumulator_bits - 1); } - AccInt result_mantissa{ 0 }; + AccInt result_mantissa{0}; bool sticky_tail = false; Sign result_sign = product_sign; @@ -492,7 +492,7 @@ namespace ccm::support::fp result_sign = product_sign; if (z_sticky) { - result_mantissa = product_acc - z_acc - AccInt{ 1 }; + result_mantissa = product_acc - z_acc - AccInt{1}; sticky_tail = true; } else { @@ -504,7 +504,7 @@ namespace ccm::support::fp result_sign = z_value.sign; if (product_sticky) { - result_mantissa = z_acc - product_acc - AccInt{ 1 }; + result_mantissa = z_acc - product_acc - AccInt{1}; sticky_tail = true; } else { diff --git a/include/ccmath/internal/support/helpers/exp10.hpp b/include/ccmath/internal/support/helpers/exp10.hpp index d4f4fe2d..1b8897e3 100644 --- a/include/ccmath/internal/support/helpers/exp10.hpp +++ b/include/ccmath/internal/support/helpers/exp10.hpp @@ -63,13 +63,13 @@ namespace ccm::support::helpers { // Taylor polynomial. constexpr std::array COEFFS = { - DoubleDouble{ 0, 0x1p0 }, - DoubleDouble{ -0x1.f48ad494e927bp-53, 0x1.26bb1bbb55516p1 }, - DoubleDouble{ -0x1.e2bfab3191cd2p-53, 0x1.53524c73cea69p1 }, - DoubleDouble{ 0x1.80fb65ec3b503p-53, 0x1.0470591de2ca4p1 }, - DoubleDouble{ 0x1.338fc05e21e55p-54, 0x1.2bd7609fd98c4p0 }, - DoubleDouble{ 0x1.d4ea116818fbp-56, 0x1.1429ffd519865p-1 }, - DoubleDouble{ -0x1.872a8ff352077p-57, 0x1.a7ed70847c8b3p-3 }, + DoubleDouble{0, 0x1p0}, + DoubleDouble{-0x1.f48ad494e927bp-53, 0x1.26bb1bbb55516p1}, + DoubleDouble{-0x1.e2bfab3191cd2p-53, 0x1.53524c73cea69p1}, + DoubleDouble{0x1.80fb65ec3b503p-53, 0x1.0470591de2ca4p1}, + DoubleDouble{0x1.338fc05e21e55p-54, 0x1.2bd7609fd98c4p0}, + DoubleDouble{0x1.d4ea116818fbp-56, 0x1.1429ffd519865p-1}, + DoubleDouble{-0x1.872a8ff352077p-57, 0x1.a7ed70847c8b3p-3}, }; const DoubleDouble p = support::polyeval(x, COEFFS[0], COEFFS[1], COEFFS[2], COEFFS[3], COEFFS[4], COEFFS[5], COEFFS[6]); diff --git a/include/ccmath/internal/types/big_int.hpp b/include/ccmath/internal/types/big_int.hpp index 7ccbc5df..3c184bdf 100644 --- a/include/ccmath/internal/types/big_int.hpp +++ b/include/ccmath/internal/types/big_int.hpp @@ -83,7 +83,7 @@ namespace ccm::types * \param lo The low part of the double-wide value. * \param hi The high part of the double-wide value. */ - constexpr DoubleWide(T lo, T hi) : UP({ lo, hi }) {} + constexpr DoubleWide(T lo, T hi) : UP({lo, hi}) {} }; /** @@ -322,7 +322,7 @@ namespace ccm::types /** * \brief Initializes the Accumulator with zero values. */ - constexpr Accumulator() : UP({ 0, 0 }) {} + constexpr Accumulator() : UP({0, 0}) {} /** * \brief Advances the accumulator with a new carry-in value. @@ -1479,12 +1479,12 @@ namespace ccm::types constexpr void increment() { - multiword::add_with_carry(val, std::array{ 1 }); + multiword::add_with_carry(val, std::array{1}); } constexpr void decrement() { - multiword::sub_with_borrow(val, std::array{ 1 }); + multiword::sub_with_borrow(val, std::array{1}); } constexpr void extend(std::size_t index, bool is_neg) @@ -1532,7 +1532,7 @@ namespace ccm::types subtractor >>= 1; } } - return UnsignedDivision{ quotient, remainder }; + return UnsignedDivision{quotient, remainder}; } constexpr static Division divide_signed(const BigInt & dividend, const BigInt & divider) @@ -1540,7 +1540,7 @@ namespace ccm::types // This is a special case for the minimum value, as it is not possible to negate the minimum value of a signed integer. if (dividend == min() && divider == min()) { - return Division{ one(), zero() }; + return Division{one(), zero()}; } // Convert the dividend and divider to unsigned values. @@ -1702,9 +1702,9 @@ namespace ccm::support { template - constexpr std:: - enable_if_t<(sizeof(To) == sizeof(From)) && std::is_trivially_copyable_v && std::is_trivially_copyable_v && types::is_big_int::value, To> - bit_cast(const From & from) + constexpr std::enable_if_t< + (sizeof(To) == sizeof(From)) && std::is_trivially_copyable_v && std::is_trivially_copyable_v && types::is_big_int::value, To> + bit_cast(const From & from) { To out{}; using Storage = decltype(out.val); diff --git a/include/ccmath/internal/types/double_double.hpp b/include/ccmath/internal/types/double_double.hpp index 3a08f657..14e7c5f8 100644 --- a/include/ccmath/internal/types/double_double.hpp +++ b/include/ccmath/internal/types/double_double.hpp @@ -44,7 +44,7 @@ namespace ccm // if assumption: |a| >= |b|, or a = 0. constexpr DoubleDouble exact_add(double a, double b) { - DoubleDouble r{ 0.0, 0.0 }; + DoubleDouble r{0.0, 0.0}; r.hi = a + b; const double t = r.hi - a; r.lo = b - t; @@ -69,7 +69,7 @@ namespace ccm // Velkamp's Splitting for double precision. constexpr DoubleDouble split(double a) { - DoubleDouble r{ 0.0, 0.0 }; + DoubleDouble r{0.0, 0.0}; // Splitting constant = 2^ceil(prec(double)/2) + 1 = 2^27 + 1. constexpr double C = 0x1.0p27 + 1.0; const double t1 = C * a; @@ -81,7 +81,7 @@ namespace ccm constexpr DoubleDouble exact_mult(double a, double b) { - DoubleDouble r{ 0.0, 0.0 }; + DoubleDouble r{0.0, 0.0}; // Dekker's Product. const DoubleDouble as = split(a); const DoubleDouble bs = split(b); @@ -116,8 +116,8 @@ namespace ccm { // Assuming |c| >= |a * b|. template <> - constexpr types::DoubleDouble - multiply_add(const types::DoubleDouble & x, const types::DoubleDouble & y, const types::DoubleDouble & z) + constexpr types::DoubleDouble multiply_add(const types::DoubleDouble & x, const types::DoubleDouble & y, + const types::DoubleDouble & z) { return add(z, quick_mult(x, y)); } diff --git a/include/ccmath/internal/types/dyadic_float.hpp b/include/ccmath/internal/types/dyadic_float.hpp index 2dcfd8f7..74b7621a 100644 --- a/include/ccmath/internal/types/dyadic_float.hpp +++ b/include/ccmath/internal/types/dyadic_float.hpp @@ -370,8 +370,7 @@ namespace ccm::types * this DyadicFloat to \p T. */ - template && (support::fp::FPBits::fraction_length < Bits), void>> constexpr T fast_as() const { @@ -503,8 +502,7 @@ namespace ccm::types * * \return A floating-point value of type \p T that reflects the conversion. */ - template && (support::fp::FPBits::fraction_length < Bits), void>> constexpr T as() const { diff --git a/include/ccmath/internal/types/number_pair.hpp b/include/ccmath/internal/types/number_pair.hpp index 79f73935..8a67c7f4 100644 --- a/include/ccmath/internal/types/number_pair.hpp +++ b/include/ccmath/internal/types/number_pair.hpp @@ -23,7 +23,7 @@ namespace ccm::types template std::enable_if_t && std::is_unsigned_v, NumberPair> split(T x) { constexpr std::size_t half_bits_width = sizeof(T) * 4; - constexpr T Low_mask = (T{ 1 } << half_bits_width) - T{ 1 }; + constexpr T Low_mask = (T{1} << half_bits_width) - T{1}; NumberPair result; result.lo = x & Low_mask; result.hi = x >> half_bits_width; diff --git a/include/ccmath/internal/types/triple_double.hpp b/include/ccmath/internal/types/triple_double.hpp index e1947b48..35d2bfbe 100644 --- a/include/ccmath/internal/types/triple_double.hpp +++ b/include/ccmath/internal/types/triple_double.hpp @@ -14,8 +14,8 @@ namespace ccm::types { struct TripleDouble { - double lo{ 0.0 }; - double mid{ 0.0 }; - double hi{ 0.0 }; + double lo{0.0}; + double mid{0.0}; + double hi{0.0}; }; } // namespace ccm::types diff --git a/include/ccmath/math/basic/impl/nan_double_impl.hpp b/include/ccmath/math/basic/impl/nan_double_impl.hpp index 39f0e819..448d2f59 100644 --- a/include/ccmath/math/basic/impl/nan_double_impl.hpp +++ b/include/ccmath/math/basic/impl/nan_double_impl.hpp @@ -35,8 +35,8 @@ namespace ccm::internal::impl return std::numeric_limits::quiet_NaN(); #endif - std::uint64_t dbl_bits{ 0 }; - bool has_hex_been_detected{ false }; + std::uint64_t dbl_bits{0}; + bool has_hex_been_detected{false}; if (arg == nullptr) { diff --git a/include/ccmath/math/basic/impl/nan_float_impl.hpp b/include/ccmath/math/basic/impl/nan_float_impl.hpp index d6d0a79e..1d129f04 100644 --- a/include/ccmath/math/basic/impl/nan_float_impl.hpp +++ b/include/ccmath/math/basic/impl/nan_float_impl.hpp @@ -34,8 +34,8 @@ namespace ccm::internal::impl return std::numeric_limits::quiet_NaN(); // Default NaN #endif - std::uint32_t flt_bits{ 0 }; - bool has_hex_been_detected{ false }; + std::uint32_t flt_bits{0}; + bool has_hex_been_detected{false}; // NOLINTBEGIN diff --git a/include/ccmath/math/basic/impl/nan_ldouble_impl.hpp b/include/ccmath/math/basic/impl/nan_ldouble_impl.hpp index ab1f3c53..56a3f5be 100644 --- a/include/ccmath/math/basic/impl/nan_ldouble_impl.hpp +++ b/include/ccmath/math/basic/impl/nan_ldouble_impl.hpp @@ -50,7 +50,7 @@ namespace ccm::internal::impl return std::numeric_limits::quiet_NaN(); // Default NaN } - bool has_hex_been_detected{ false }; + bool has_hex_been_detected{false}; // Check for a hex prefix and if its detected, skip the prefix and set the flag. if (arg[0] == '0' && (arg[1] == 'x' || arg[1] == 'X')) @@ -71,7 +71,7 @@ namespace ccm::internal::impl } } - ccm::types::uint128_t dbl_bits{ 0 }; + ccm::types::uint128_t dbl_bits{0}; if (has_hex_been_detected) { diff --git a/include/ccmath/math/expo/impl/exp2_data.hpp b/include/ccmath/math/expo/impl/exp2_data.hpp index ebdb42c8..212c9f1b 100644 --- a/include/ccmath/math/expo/impl/exp2_data.hpp +++ b/include/ccmath/math/expo/impl/exp2_data.hpp @@ -27,9 +27,9 @@ namespace ccm::internal static constexpr std::size_t poly_order = 3; static constexpr std::uint64_t shifted_table_bits = (1 << table_bits); - double shift_scaled{ 0x1.8p+52 / shifted_table_bits }; + double shift_scaled{0x1.8p+52 / shifted_table_bits}; - std::array poly = { 0x1.c6af84b912394p-5, 0x1.ebfce50fac4f3p-3, 0x1.62e42ff0c52d6p-1 }; + std::array poly = {0x1.c6af84b912394p-5, 0x1.ebfce50fac4f3p-3, 0x1.62e42ff0c52d6p-1}; // tab[i] = uint(2^(i/N)) - (i << 52-BITS) // N = (1 << BITS) // used for computing 2^(k/N) for an int |k| < 150 N as @@ -53,7 +53,7 @@ namespace ccm::internal static constexpr std::size_t internal_table_size = static_cast(2 * shifted_table_bits); public: - double shift{ 0x1.8p52 / shifted_table_bits }; + double shift{0x1.8p52 / shifted_table_bits}; // exp2 polynomial coefficients // abs error: 1.2195*2^-65 @@ -61,7 +61,11 @@ namespace ccm::internal // if |x| < 1/256 // abs error if |x| < 1/128: 1.9941*2^-56 std::array poly = { - 0x1.62e42fefa39efp-1, 0x1.ebfbdff82c424p-3, 0x1.c6b08d70cf4b5p-5, 0x1.3b2abd24650ccp-7, 0x1.5d7e09b4e3a84p-10, + 0x1.62e42fefa39efp-1, + 0x1.ebfbdff82c424p-3, + 0x1.c6b08d70cf4b5p-5, + 0x1.3b2abd24650ccp-7, + 0x1.5d7e09b4e3a84p-10, }; std::array tab = { diff --git a/include/ccmath/math/expo/impl/exp_data.hpp b/include/ccmath/math/expo/impl/exp_data.hpp index 5792336c..3908a7b2 100644 --- a/include/ccmath/math/expo/impl/exp_data.hpp +++ b/include/ccmath/math/expo/impl/exp_data.hpp @@ -31,8 +31,8 @@ namespace ccm::internal template <> struct exp_data { - double invln2_scaled{ 0x1.71547652b82fep0 * (1 << k_exp_table_bits_flt) }; - double shift{ 0x1.8p+52 }; + double invln2_scaled{0x1.71547652b82fep0 * (1 << k_exp_table_bits_flt)}; + double shift{0x1.8p+52}; std::array tab = { 0x3ff0000000000000, 0x3fefd9b0d3158574, 0x3fefb5586cf9890f, 0x3fef9301d0125b51, 0x3fef72b83c7d517b, 0x3fef54873168b9aa, 0x3fef387a6e756238, 0x3fef1e9df51fdee1, 0x3fef06fe0a31b715, 0x3feef1a7373aa9cb, 0x3feedea64c123422, 0x3feece086061892d, 0x3feebfdad5362a27, 0x3feeb42b569d4f82, @@ -50,10 +50,10 @@ namespace ccm::internal template <> struct exp_data { - double invln2N{ 0x1.71547652b82fep0 * (1 << k_exp_table_bits_dbl) }; // N/ln2 - double shift{ 0x1.8p52 }; - double negln2hiN{ -0x1.62e42fefa0000p-8 }; - double negln2loN{ -0x1.cf79abc9e3b3ap-47 }; + double invln2N{0x1.71547652b82fep0 * (1 << k_exp_table_bits_dbl)}; // N/ln2 + double shift{0x1.8p52}; + double negln2hiN{-0x1.62e42fefa0000p-8}; + double negln2loN{-0x1.cf79abc9e3b3ap-47}; // Last four coefficients. // abs error: 1.555*2^-66 diff --git a/include/ccmath/math/expo/impl/log2_data.hpp b/include/ccmath/math/expo/impl/log2_data.hpp index 10ca2c4c..31c7aed8 100644 --- a/include/ccmath/math/expo/impl/log2_data.hpp +++ b/include/ccmath/math/expo/impl/log2_data.hpp @@ -37,43 +37,64 @@ namespace ccm::internal }; static constexpr std::array tab = { - TabEntry{ 0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2 }, TabEntry{ 0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2 }, - TabEntry{ 0x1.49539f0f010bp+0, -0x1.7418b0a1fb77bp-2 }, TabEntry{ 0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2 }, - TabEntry{ 0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2 }, TabEntry{ 0x1.25e227b0b8eap+0, -0x1.97c1d1b3b7afp-3 }, - TabEntry{ 0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3 }, TabEntry{ 0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4 }, - TabEntry{ 0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5 }, TabEntry{ 0x1p+0, 0x0p+0 }, - TabEntry{ 0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4 }, TabEntry{ 0x1.ca4b31f026aap-1, 0x1.476a9543891bap-3 }, - TabEntry{ 0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3 }, TabEntry{ 0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2 }, - TabEntry{ 0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2 }, TabEntry{ 0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2 }, + TabEntry{0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2}, + TabEntry{0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2}, + TabEntry{0x1.49539f0f010bp+0, -0x1.7418b0a1fb77bp-2}, + TabEntry{0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2}, + TabEntry{0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2}, + TabEntry{0x1.25e227b0b8eap+0, -0x1.97c1d1b3b7afp-3}, + TabEntry{0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3}, + TabEntry{0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4}, + TabEntry{0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5}, + TabEntry{0x1p+0, 0x0p+0}, + TabEntry{0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4}, + TabEntry{0x1.ca4b31f026aap-1, 0x1.476a9543891bap-3}, + TabEntry{0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3}, + TabEntry{0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2}, + TabEntry{0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2}, + TabEntry{0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2}, }; - std::array poly{ { + std::array poly{{ -0x1.712b6f70a7e4dp-2, 0x1.ecabf496832ep-2, -0x1.715479ffae3dep-1, 0x1.715475f35c8b8p0, - } }; + }}; }; template <> struct log2_data { // First coefficient: 0x1.71547652b82fe1777d0ffda0d24p0 - double invln2hi{ 0x1.7154765200000p+0 }; - double invln2lo{ 0x1.705fc2eefa200p-33 }; + double invln2hi{0x1.7154765200000p+0}; + double invln2lo{0x1.705fc2eefa200p-33}; // relative error: 0x1.a72c2bf8p-58 // abs error: 0x1.67a552c8p-66 // in -0x1.f45p-8 0x1.f45p-8 std::array poly{ - -0x1.71547652b8339p-1, 0x1.ec709dc3a04bep-2, -0x1.7154764702ffbp-2, 0x1.2776c50034c48p-2, -0x1.ec7b328ea92bcp-3, 0x1.a6225e117f92ep-3, + -0x1.71547652b8339p-1, + 0x1.ec709dc3a04bep-2, + -0x1.7154764702ffbp-2, + 0x1.2776c50034c48p-2, + -0x1.ec7b328ea92bcp-3, + 0x1.a6225e117f92ep-3, }; // relative error: 0x1.2fad8188p-63 // in -0x1.5b51p-5 0x1.6ab2p-5 std::array poly1{ - -0x1.71547652b82fep-1, 0x1.ec709dc3a03f7p-2, -0x1.71547652b7c3fp-2, 0x1.2776c50f05be4p-2, -0x1.ec709dd768fe5p-3, - 0x1.a61761ec4e736p-3, -0x1.7153fbc64a79bp-3, 0x1.484d154f01b4ap-3, -0x1.289e4a72c383cp-3, 0x1.0b32f285aee66p-3, + -0x1.71547652b82fep-1, + 0x1.ec709dc3a03f7p-2, + -0x1.71547652b7c3fp-2, + 0x1.2776c50f05be4p-2, + -0x1.ec709dd768fe5p-3, + 0x1.a61761ec4e736p-3, + -0x1.7153fbc64a79bp-3, + 0x1.484d154f01b4ap-3, + -0x1.289e4a72c383cp-3, + 0x1.0b32f285aee66p-3, }; struct TabEntry @@ -83,38 +104,38 @@ namespace ccm::internal }; static constexpr std::array tab = { - TabEntry{ 0x1.724286bb1acf8p+0, -0x1.1095feecdb000p-1 }, TabEntry{ 0x1.6e1f766d2cca1p+0, -0x1.08494bd76d000p-1 }, - TabEntry{ 0x1.6a13d0e30d48ap+0, -0x1.00143aee8f800p-1 }, TabEntry{ 0x1.661ec32d06c85p+0, -0x1.efec5360b4000p-2 }, - TabEntry{ 0x1.623fa951198f8p+0, -0x1.dfdd91ab7e000p-2 }, TabEntry{ 0x1.5e75ba4cf026cp+0, -0x1.cffae0cc79000p-2 }, - TabEntry{ 0x1.5ac055a214fb8p+0, -0x1.c043811fda000p-2 }, TabEntry{ 0x1.571ed0f166e1ep+0, -0x1.b0b67323ae000p-2 }, - TabEntry{ 0x1.53909590bf835p+0, -0x1.a152f5a2db000p-2 }, TabEntry{ 0x1.5014fed61adddp+0, -0x1.9217f5af86000p-2 }, - TabEntry{ 0x1.4cab88e487bd0p+0, -0x1.8304db0719000p-2 }, TabEntry{ 0x1.49539b4334feep+0, -0x1.74189f9a9e000p-2 }, - TabEntry{ 0x1.460cbdfafd569p+0, -0x1.6552bb5199000p-2 }, TabEntry{ 0x1.42d664ee4b953p+0, -0x1.56b23a29b1000p-2 }, - TabEntry{ 0x1.3fb01111dd8a6p+0, -0x1.483650f5fa000p-2 }, TabEntry{ 0x1.3c995b70c5836p+0, -0x1.39de937f6a000p-2 }, - TabEntry{ 0x1.3991c4ab6fd4ap+0, -0x1.2baa1538d6000p-2 }, TabEntry{ 0x1.3698e0ce099b5p+0, -0x1.1d98340ca4000p-2 }, - TabEntry{ 0x1.33ae48213e7b2p+0, -0x1.0fa853a40e000p-2 }, TabEntry{ 0x1.30d191985bdb1p+0, -0x1.01d9c32e73000p-2 }, - TabEntry{ 0x1.2e025cab271d7p+0, -0x1.e857da2fa6000p-3 }, TabEntry{ 0x1.2b404cf13cd82p+0, -0x1.cd3c8633d8000p-3 }, - TabEntry{ 0x1.288b02c7ccb50p+0, -0x1.b26034c14a000p-3 }, TabEntry{ 0x1.25e2263944de5p+0, -0x1.97c1c2f4fe000p-3 }, - TabEntry{ 0x1.234563d8615b1p+0, -0x1.7d6023f800000p-3 }, TabEntry{ 0x1.20b46e33eaf38p+0, -0x1.633a71a05e000p-3 }, - TabEntry{ 0x1.1e2eefdcda3ddp+0, -0x1.494f5e9570000p-3 }, TabEntry{ 0x1.1bb4a580b3930p+0, -0x1.2f9e424e0a000p-3 }, - TabEntry{ 0x1.19453847f2200p+0, -0x1.162595afdc000p-3 }, TabEntry{ 0x1.16e06c0d5d73cp+0, -0x1.f9c9a75bd8000p-4 }, - TabEntry{ 0x1.1485f47b7e4c2p+0, -0x1.c7b575bf9c000p-4 }, TabEntry{ 0x1.12358ad0085d1p+0, -0x1.960c60ff48000p-4 }, - TabEntry{ 0x1.0fef00f532227p+0, -0x1.64ce247b60000p-4 }, TabEntry{ 0x1.0db2077d03a8fp+0, -0x1.33f78b2014000p-4 }, - TabEntry{ 0x1.0b7e6d65980d9p+0, -0x1.0387d1a42c000p-4 }, TabEntry{ 0x1.0953efe7b408dp+0, -0x1.a6f9208b50000p-5 }, - TabEntry{ 0x1.07325cac53b83p+0, -0x1.47a954f770000p-5 }, TabEntry{ 0x1.05197e40d1b5cp+0, -0x1.d23a8c50c0000p-6 }, - TabEntry{ 0x1.03091c1208ea2p+0, -0x1.16a2629780000p-6 }, TabEntry{ 0x1.0101025b37e21p+0, -0x1.720f8d8e80000p-8 }, - TabEntry{ 0x1.fc07ef9caa76bp-1, 0x1.6fe53b1500000p-7 }, TabEntry{ 0x1.f4465d3f6f184p-1, 0x1.11ccce10f8000p-5 }, - TabEntry{ 0x1.ecc079f84107fp-1, 0x1.c4dfc8c8b8000p-5 }, TabEntry{ 0x1.e573a99975ae8p-1, 0x1.3aa321e574000p-4 }, - TabEntry{ 0x1.de5d6f0bd3de6p-1, 0x1.918a0d08b8000p-4 }, TabEntry{ 0x1.d77b681ff38b3p-1, 0x1.e72e9da044000p-4 }, - TabEntry{ 0x1.d0cb5724de943p-1, 0x1.1dcd2507f6000p-3 }, TabEntry{ 0x1.ca4b2dc0e7563p-1, 0x1.476ab03dea000p-3 }, - TabEntry{ 0x1.c3f8ee8d6cb51p-1, 0x1.7074377e22000p-3 }, TabEntry{ 0x1.bdd2b4f020c4cp-1, 0x1.98ede8ba94000p-3 }, - TabEntry{ 0x1.b7d6c006015cap-1, 0x1.c0db86ad2e000p-3 }, TabEntry{ 0x1.b20366e2e338fp-1, 0x1.e840aafcee000p-3 }, - TabEntry{ 0x1.ac57026295039p-1, 0x1.0790ab4678000p-2 }, TabEntry{ 0x1.a6d01bc2731ddp-1, 0x1.1ac056801c000p-2 }, - TabEntry{ 0x1.a16d3bc3ff18bp-1, 0x1.2db11d4fee000p-2 }, TabEntry{ 0x1.9c2d14967feadp-1, 0x1.406464ec58000p-2 }, - TabEntry{ 0x1.970e4f47c9902p-1, 0x1.52dbe093af000p-2 }, TabEntry{ 0x1.920fb3982bcf2p-1, 0x1.651902050d000p-2 }, - TabEntry{ 0x1.8d30187f759f1p-1, 0x1.771d2cdeaf000p-2 }, TabEntry{ 0x1.886e5ebb9f66dp-1, 0x1.88e9c857d9000p-2 }, - TabEntry{ 0x1.83c97b658b994p-1, 0x1.9a80155e16000p-2 }, TabEntry{ 0x1.7f405ffc61022p-1, 0x1.abe186ed3d000p-2 }, - TabEntry{ 0x1.7ad22181415cap-1, 0x1.bd0f2aea0e000p-2 }, TabEntry{ 0x1.767dcf99eff8cp-1, 0x1.ce0a43dbf4000p-2 }, + TabEntry{0x1.724286bb1acf8p+0, -0x1.1095feecdb000p-1}, TabEntry{0x1.6e1f766d2cca1p+0, -0x1.08494bd76d000p-1}, + TabEntry{0x1.6a13d0e30d48ap+0, -0x1.00143aee8f800p-1}, TabEntry{0x1.661ec32d06c85p+0, -0x1.efec5360b4000p-2}, + TabEntry{0x1.623fa951198f8p+0, -0x1.dfdd91ab7e000p-2}, TabEntry{0x1.5e75ba4cf026cp+0, -0x1.cffae0cc79000p-2}, + TabEntry{0x1.5ac055a214fb8p+0, -0x1.c043811fda000p-2}, TabEntry{0x1.571ed0f166e1ep+0, -0x1.b0b67323ae000p-2}, + TabEntry{0x1.53909590bf835p+0, -0x1.a152f5a2db000p-2}, TabEntry{0x1.5014fed61adddp+0, -0x1.9217f5af86000p-2}, + TabEntry{0x1.4cab88e487bd0p+0, -0x1.8304db0719000p-2}, TabEntry{0x1.49539b4334feep+0, -0x1.74189f9a9e000p-2}, + TabEntry{0x1.460cbdfafd569p+0, -0x1.6552bb5199000p-2}, TabEntry{0x1.42d664ee4b953p+0, -0x1.56b23a29b1000p-2}, + TabEntry{0x1.3fb01111dd8a6p+0, -0x1.483650f5fa000p-2}, TabEntry{0x1.3c995b70c5836p+0, -0x1.39de937f6a000p-2}, + TabEntry{0x1.3991c4ab6fd4ap+0, -0x1.2baa1538d6000p-2}, TabEntry{0x1.3698e0ce099b5p+0, -0x1.1d98340ca4000p-2}, + TabEntry{0x1.33ae48213e7b2p+0, -0x1.0fa853a40e000p-2}, TabEntry{0x1.30d191985bdb1p+0, -0x1.01d9c32e73000p-2}, + TabEntry{0x1.2e025cab271d7p+0, -0x1.e857da2fa6000p-3}, TabEntry{0x1.2b404cf13cd82p+0, -0x1.cd3c8633d8000p-3}, + TabEntry{0x1.288b02c7ccb50p+0, -0x1.b26034c14a000p-3}, TabEntry{0x1.25e2263944de5p+0, -0x1.97c1c2f4fe000p-3}, + TabEntry{0x1.234563d8615b1p+0, -0x1.7d6023f800000p-3}, TabEntry{0x1.20b46e33eaf38p+0, -0x1.633a71a05e000p-3}, + TabEntry{0x1.1e2eefdcda3ddp+0, -0x1.494f5e9570000p-3}, TabEntry{0x1.1bb4a580b3930p+0, -0x1.2f9e424e0a000p-3}, + TabEntry{0x1.19453847f2200p+0, -0x1.162595afdc000p-3}, TabEntry{0x1.16e06c0d5d73cp+0, -0x1.f9c9a75bd8000p-4}, + TabEntry{0x1.1485f47b7e4c2p+0, -0x1.c7b575bf9c000p-4}, TabEntry{0x1.12358ad0085d1p+0, -0x1.960c60ff48000p-4}, + TabEntry{0x1.0fef00f532227p+0, -0x1.64ce247b60000p-4}, TabEntry{0x1.0db2077d03a8fp+0, -0x1.33f78b2014000p-4}, + TabEntry{0x1.0b7e6d65980d9p+0, -0x1.0387d1a42c000p-4}, TabEntry{0x1.0953efe7b408dp+0, -0x1.a6f9208b50000p-5}, + TabEntry{0x1.07325cac53b83p+0, -0x1.47a954f770000p-5}, TabEntry{0x1.05197e40d1b5cp+0, -0x1.d23a8c50c0000p-6}, + TabEntry{0x1.03091c1208ea2p+0, -0x1.16a2629780000p-6}, TabEntry{0x1.0101025b37e21p+0, -0x1.720f8d8e80000p-8}, + TabEntry{0x1.fc07ef9caa76bp-1, 0x1.6fe53b1500000p-7}, TabEntry{0x1.f4465d3f6f184p-1, 0x1.11ccce10f8000p-5}, + TabEntry{0x1.ecc079f84107fp-1, 0x1.c4dfc8c8b8000p-5}, TabEntry{0x1.e573a99975ae8p-1, 0x1.3aa321e574000p-4}, + TabEntry{0x1.de5d6f0bd3de6p-1, 0x1.918a0d08b8000p-4}, TabEntry{0x1.d77b681ff38b3p-1, 0x1.e72e9da044000p-4}, + TabEntry{0x1.d0cb5724de943p-1, 0x1.1dcd2507f6000p-3}, TabEntry{0x1.ca4b2dc0e7563p-1, 0x1.476ab03dea000p-3}, + TabEntry{0x1.c3f8ee8d6cb51p-1, 0x1.7074377e22000p-3}, TabEntry{0x1.bdd2b4f020c4cp-1, 0x1.98ede8ba94000p-3}, + TabEntry{0x1.b7d6c006015cap-1, 0x1.c0db86ad2e000p-3}, TabEntry{0x1.b20366e2e338fp-1, 0x1.e840aafcee000p-3}, + TabEntry{0x1.ac57026295039p-1, 0x1.0790ab4678000p-2}, TabEntry{0x1.a6d01bc2731ddp-1, 0x1.1ac056801c000p-2}, + TabEntry{0x1.a16d3bc3ff18bp-1, 0x1.2db11d4fee000p-2}, TabEntry{0x1.9c2d14967feadp-1, 0x1.406464ec58000p-2}, + TabEntry{0x1.970e4f47c9902p-1, 0x1.52dbe093af000p-2}, TabEntry{0x1.920fb3982bcf2p-1, 0x1.651902050d000p-2}, + TabEntry{0x1.8d30187f759f1p-1, 0x1.771d2cdeaf000p-2}, TabEntry{0x1.886e5ebb9f66dp-1, 0x1.88e9c857d9000p-2}, + TabEntry{0x1.83c97b658b994p-1, 0x1.9a80155e16000p-2}, TabEntry{0x1.7f405ffc61022p-1, 0x1.abe186ed3d000p-2}, + TabEntry{0x1.7ad22181415cap-1, 0x1.bd0f2aea0e000p-2}, TabEntry{0x1.767dcf99eff8cp-1, 0x1.ce0a43dbf4000p-2}, }; struct Tab2Entry @@ -124,38 +145,38 @@ namespace ccm::internal }; static constexpr std::array tab2 = { - Tab2Entry{ 0x1.6200012b90a8ep-1, 0x1.904ab0644b605p-55 }, Tab2Entry{ 0x1.66000045734a6p-1, 0x1.1ff9bea62f7a9p-57 }, - Tab2Entry{ 0x1.69fffc325f2c5p-1, 0x1.27ecfcb3c90bap-55 }, Tab2Entry{ 0x1.6e00038b95a04p-1, 0x1.8ff8856739326p-55 }, - Tab2Entry{ 0x1.71fffe09994e3p-1, 0x1.afd40275f82b1p-55 }, Tab2Entry{ 0x1.7600015590e1p-1, -0x1.2fd75b4238341p-56 }, - Tab2Entry{ 0x1.7a00012655bd5p-1, 0x1.808e67c242b76p-56 }, Tab2Entry{ 0x1.7e0003259e9a6p-1, -0x1.208e426f622b7p-57 }, - Tab2Entry{ 0x1.81fffedb4b2d2p-1, -0x1.402461ea5c92fp-55 }, Tab2Entry{ 0x1.860002dfafcc3p-1, 0x1.df7f4a2f29a1fp-57 }, - Tab2Entry{ 0x1.89ffff78c6b5p-1, -0x1.e0453094995fdp-55 }, Tab2Entry{ 0x1.8e00039671566p-1, -0x1.a04f3bec77b45p-55 }, - Tab2Entry{ 0x1.91fffe2bf1745p-1, -0x1.7fa34400e203cp-56 }, Tab2Entry{ 0x1.95fffcc5c9fd1p-1, -0x1.6ff8005a0695dp-56 }, - Tab2Entry{ 0x1.9a0003bba4767p-1, 0x1.0f8c4c4ec7e03p-56 }, Tab2Entry{ 0x1.9dfffe7b92da5p-1, 0x1.e7fd9478c4602p-55 }, - Tab2Entry{ 0x1.a1fffd72efdafp-1, -0x1.a0c554dcdae7ep-57 }, Tab2Entry{ 0x1.a5fffde04ff95p-1, 0x1.67da98ce9b26bp-55 }, - Tab2Entry{ 0x1.a9fffca5e8d2bp-1, -0x1.284c9b54c13dep-55 }, Tab2Entry{ 0x1.adfffddad03eap-1, 0x1.812c8ea602e3cp-58 }, - Tab2Entry{ 0x1.b1ffff10d3d4dp-1, -0x1.efaddad27789cp-55 }, Tab2Entry{ 0x1.b5fffce21165ap-1, 0x1.3cb1719c61237p-58 }, - Tab2Entry{ 0x1.b9fffd950e674p-1, 0x1.3f7d94194cep-56 }, Tab2Entry{ 0x1.be000139ca8afp-1, 0x1.50ac4215d9bcp-56 }, - Tab2Entry{ 0x1.c20005b46df99p-1, 0x1.beea653e9c1c9p-57 }, Tab2Entry{ 0x1.c600040b9f7aep-1, -0x1.c079f274a70d6p-56 }, - Tab2Entry{ 0x1.ca0006255fd8ap-1, -0x1.a0b4076e84c1fp-56 }, Tab2Entry{ 0x1.cdfffd94c095dp-1, 0x1.8f933f99ab5d7p-55 }, - Tab2Entry{ 0x1.d1ffff975d6cfp-1, -0x1.82c08665fe1bep-58 }, Tab2Entry{ 0x1.d5fffa2561c93p-1, -0x1.b04289bd295f3p-56 }, - Tab2Entry{ 0x1.d9fff9d228b0cp-1, 0x1.70251340fa236p-55 }, Tab2Entry{ 0x1.de00065bc7e16p-1, -0x1.5011e16a4d80cp-56 }, - Tab2Entry{ 0x1.e200002f64791p-1, 0x1.9802f09ef62ep-55 }, Tab2Entry{ 0x1.e600057d7a6d8p-1, -0x1.e0b75580cf7fap-56 }, - Tab2Entry{ 0x1.ea00027edc00cp-1, -0x1.c848309459811p-55 }, Tab2Entry{ 0x1.ee0006cf5cb7cp-1, -0x1.f8027951576f4p-55 }, - Tab2Entry{ 0x1.f2000782b7dccp-1, -0x1.f81d97274538fp-55 }, Tab2Entry{ 0x1.f6000260c450ap-1, -0x1.071002727ffdcp-59 }, - Tab2Entry{ 0x1.f9fffe88cd533p-1, -0x1.81bdce1fda8bp-58 }, Tab2Entry{ 0x1.fdfffd50f8689p-1, 0x1.7f91acb918e6ep-55 }, - Tab2Entry{ 0x1.0200004292367p+0, 0x1.b7ff365324681p-54 }, Tab2Entry{ 0x1.05fffe3e3d668p+0, 0x1.6fa08ddae957bp-55 }, - Tab2Entry{ 0x1.0a0000a85a757p+0, -0x1.7e2de80d3fb91p-58 }, Tab2Entry{ 0x1.0e0001a5f3fccp+0, -0x1.1823305c5f014p-54 }, - Tab2Entry{ 0x1.11ffff8afbaf5p+0, -0x1.bfabb6680bac2p-55 }, Tab2Entry{ 0x1.15fffe54d91adp+0, -0x1.d7f121737e7efp-54 }, - Tab2Entry{ 0x1.1a00011ac36e1p+0, 0x1.c000a0516f5ffp-54 }, Tab2Entry{ 0x1.1e00019c84248p+0, -0x1.082fbe4da5dap-54 }, - Tab2Entry{ 0x1.220000ffe5e6ep+0, -0x1.8fdd04c9cfb43p-55 }, Tab2Entry{ 0x1.26000269fd891p+0, 0x1.cfe2a7994d182p-55 }, - Tab2Entry{ 0x1.2a00029a6e6dap+0, -0x1.00273715e8bc5p-56 }, Tab2Entry{ 0x1.2dfffe0293e39p+0, 0x1.b7c39dab2a6f9p-54 }, - Tab2Entry{ 0x1.31ffff7dcf082p+0, 0x1.df1336edc5254p-56 }, Tab2Entry{ 0x1.35ffff05a8b6p+0, -0x1.e03564ccd31ebp-54 }, - Tab2Entry{ 0x1.3a0002e0eaeccp+0, 0x1.5f0e74bd3a477p-56 }, Tab2Entry{ 0x1.3e000043bb236p+0, 0x1.c7dcb149d8833p-54 }, - Tab2Entry{ 0x1.4200002d187ffp+0, 0x1.e08afcf2d3d28p-56 }, Tab2Entry{ 0x1.460000d387cb1p+0, 0x1.20837856599a6p-55 }, - Tab2Entry{ 0x1.4a00004569f89p+0, -0x1.9fa5c904fbcd2p-55 }, Tab2Entry{ 0x1.4e000043543f3p+0, -0x1.81125ed175329p-56 }, - Tab2Entry{ 0x1.51fffcc027f0fp+0, 0x1.883d8847754dcp-54 }, Tab2Entry{ 0x1.55ffffd87b36fp+0, -0x1.709e731d02807p-55 }, - Tab2Entry{ 0x1.59ffff21df7bap+0, 0x1.7f79f68727b02p-55 }, Tab2Entry{ 0x1.5dfffebfc3481p+0, -0x1.180902e30e93ep-54 }, + Tab2Entry{0x1.6200012b90a8ep-1, 0x1.904ab0644b605p-55}, Tab2Entry{0x1.66000045734a6p-1, 0x1.1ff9bea62f7a9p-57}, + Tab2Entry{0x1.69fffc325f2c5p-1, 0x1.27ecfcb3c90bap-55}, Tab2Entry{0x1.6e00038b95a04p-1, 0x1.8ff8856739326p-55}, + Tab2Entry{0x1.71fffe09994e3p-1, 0x1.afd40275f82b1p-55}, Tab2Entry{0x1.7600015590e1p-1, -0x1.2fd75b4238341p-56}, + Tab2Entry{0x1.7a00012655bd5p-1, 0x1.808e67c242b76p-56}, Tab2Entry{0x1.7e0003259e9a6p-1, -0x1.208e426f622b7p-57}, + Tab2Entry{0x1.81fffedb4b2d2p-1, -0x1.402461ea5c92fp-55}, Tab2Entry{0x1.860002dfafcc3p-1, 0x1.df7f4a2f29a1fp-57}, + Tab2Entry{0x1.89ffff78c6b5p-1, -0x1.e0453094995fdp-55}, Tab2Entry{0x1.8e00039671566p-1, -0x1.a04f3bec77b45p-55}, + Tab2Entry{0x1.91fffe2bf1745p-1, -0x1.7fa34400e203cp-56}, Tab2Entry{0x1.95fffcc5c9fd1p-1, -0x1.6ff8005a0695dp-56}, + Tab2Entry{0x1.9a0003bba4767p-1, 0x1.0f8c4c4ec7e03p-56}, Tab2Entry{0x1.9dfffe7b92da5p-1, 0x1.e7fd9478c4602p-55}, + Tab2Entry{0x1.a1fffd72efdafp-1, -0x1.a0c554dcdae7ep-57}, Tab2Entry{0x1.a5fffde04ff95p-1, 0x1.67da98ce9b26bp-55}, + Tab2Entry{0x1.a9fffca5e8d2bp-1, -0x1.284c9b54c13dep-55}, Tab2Entry{0x1.adfffddad03eap-1, 0x1.812c8ea602e3cp-58}, + Tab2Entry{0x1.b1ffff10d3d4dp-1, -0x1.efaddad27789cp-55}, Tab2Entry{0x1.b5fffce21165ap-1, 0x1.3cb1719c61237p-58}, + Tab2Entry{0x1.b9fffd950e674p-1, 0x1.3f7d94194cep-56}, Tab2Entry{0x1.be000139ca8afp-1, 0x1.50ac4215d9bcp-56}, + Tab2Entry{0x1.c20005b46df99p-1, 0x1.beea653e9c1c9p-57}, Tab2Entry{0x1.c600040b9f7aep-1, -0x1.c079f274a70d6p-56}, + Tab2Entry{0x1.ca0006255fd8ap-1, -0x1.a0b4076e84c1fp-56}, Tab2Entry{0x1.cdfffd94c095dp-1, 0x1.8f933f99ab5d7p-55}, + Tab2Entry{0x1.d1ffff975d6cfp-1, -0x1.82c08665fe1bep-58}, Tab2Entry{0x1.d5fffa2561c93p-1, -0x1.b04289bd295f3p-56}, + Tab2Entry{0x1.d9fff9d228b0cp-1, 0x1.70251340fa236p-55}, Tab2Entry{0x1.de00065bc7e16p-1, -0x1.5011e16a4d80cp-56}, + Tab2Entry{0x1.e200002f64791p-1, 0x1.9802f09ef62ep-55}, Tab2Entry{0x1.e600057d7a6d8p-1, -0x1.e0b75580cf7fap-56}, + Tab2Entry{0x1.ea00027edc00cp-1, -0x1.c848309459811p-55}, Tab2Entry{0x1.ee0006cf5cb7cp-1, -0x1.f8027951576f4p-55}, + Tab2Entry{0x1.f2000782b7dccp-1, -0x1.f81d97274538fp-55}, Tab2Entry{0x1.f6000260c450ap-1, -0x1.071002727ffdcp-59}, + Tab2Entry{0x1.f9fffe88cd533p-1, -0x1.81bdce1fda8bp-58}, Tab2Entry{0x1.fdfffd50f8689p-1, 0x1.7f91acb918e6ep-55}, + Tab2Entry{0x1.0200004292367p+0, 0x1.b7ff365324681p-54}, Tab2Entry{0x1.05fffe3e3d668p+0, 0x1.6fa08ddae957bp-55}, + Tab2Entry{0x1.0a0000a85a757p+0, -0x1.7e2de80d3fb91p-58}, Tab2Entry{0x1.0e0001a5f3fccp+0, -0x1.1823305c5f014p-54}, + Tab2Entry{0x1.11ffff8afbaf5p+0, -0x1.bfabb6680bac2p-55}, Tab2Entry{0x1.15fffe54d91adp+0, -0x1.d7f121737e7efp-54}, + Tab2Entry{0x1.1a00011ac36e1p+0, 0x1.c000a0516f5ffp-54}, Tab2Entry{0x1.1e00019c84248p+0, -0x1.082fbe4da5dap-54}, + Tab2Entry{0x1.220000ffe5e6ep+0, -0x1.8fdd04c9cfb43p-55}, Tab2Entry{0x1.26000269fd891p+0, 0x1.cfe2a7994d182p-55}, + Tab2Entry{0x1.2a00029a6e6dap+0, -0x1.00273715e8bc5p-56}, Tab2Entry{0x1.2dfffe0293e39p+0, 0x1.b7c39dab2a6f9p-54}, + Tab2Entry{0x1.31ffff7dcf082p+0, 0x1.df1336edc5254p-56}, Tab2Entry{0x1.35ffff05a8b6p+0, -0x1.e03564ccd31ebp-54}, + Tab2Entry{0x1.3a0002e0eaeccp+0, 0x1.5f0e74bd3a477p-56}, Tab2Entry{0x1.3e000043bb236p+0, 0x1.c7dcb149d8833p-54}, + Tab2Entry{0x1.4200002d187ffp+0, 0x1.e08afcf2d3d28p-56}, Tab2Entry{0x1.460000d387cb1p+0, 0x1.20837856599a6p-55}, + Tab2Entry{0x1.4a00004569f89p+0, -0x1.9fa5c904fbcd2p-55}, Tab2Entry{0x1.4e000043543f3p+0, -0x1.81125ed175329p-56}, + Tab2Entry{0x1.51fffcc027f0fp+0, 0x1.883d8847754dcp-54}, Tab2Entry{0x1.55ffffd87b36fp+0, -0x1.709e731d02807p-55}, + Tab2Entry{0x1.59ffff21df7bap+0, 0x1.7f79f68727b02p-55}, Tab2Entry{0x1.5dfffebfc3481p+0, -0x1.180902e30e93ep-54}, }; }; diff --git a/include/ccmath/math/expo/impl/log_data.hpp b/include/ccmath/math/expo/impl/log_data.hpp index 34a5604f..0e780529 100644 --- a/include/ccmath/math/expo/impl/log_data.hpp +++ b/include/ccmath/math/expo/impl/log_data.hpp @@ -36,14 +36,22 @@ namespace ccm::internal }; static constexpr std::array tab = { - TabEntry{ 0x1.661ec79f8f3bep+0, -0x1.57bf7808caadep-2 }, TabEntry{ 0x1.571ed4aaf883dp+0, -0x1.2bef0a7c06ddbp-2 }, - TabEntry{ 0x1.49539f0f010bp+0, -0x1.01eae7f513a67p-2 }, TabEntry{ 0x1.3c995b0b80385p+0, -0x1.b31d8a68224e9p-3 }, - TabEntry{ 0x1.30d190c8864a5p+0, -0x1.6574f0ac07758p-3 }, TabEntry{ 0x1.25e227b0b8eap+0, -0x1.1aa2bc79c81p-3 }, - TabEntry{ 0x1.1bb4a4a1a343fp+0, -0x1.a4e76ce8c0e5ep-4 }, TabEntry{ 0x1.12358f08ae5bap+0, -0x1.1973c5a611cccp-4 }, - TabEntry{ 0x1.0953f419900a7p+0, -0x1.252f438e10c1ep-5 }, TabEntry{ 0x1p+0, 0x0p+0 }, - TabEntry{ 0x1.e608cfd9a47acp-1, 0x1.aa5aa5df25984p-5 }, TabEntry{ 0x1.ca4b31f026aap-1, 0x1.c5e53aa362eb4p-4 }, - TabEntry{ 0x1.b2036576afce6p-1, 0x1.526e57720db08p-3 }, TabEntry{ 0x1.9c2d163a1aa2dp-1, 0x1.bc2860d22477p-3 }, - TabEntry{ 0x1.886e6037841edp-1, 0x1.1058bc8a07ee1p-2 }, TabEntry{ 0x1.767dcf5534862p-1, 0x1.4043057b6ee09p-2 }, + TabEntry{0x1.661ec79f8f3bep+0, -0x1.57bf7808caadep-2}, + TabEntry{0x1.571ed4aaf883dp+0, -0x1.2bef0a7c06ddbp-2}, + TabEntry{0x1.49539f0f010bp+0, -0x1.01eae7f513a67p-2}, + TabEntry{0x1.3c995b0b80385p+0, -0x1.b31d8a68224e9p-3}, + TabEntry{0x1.30d190c8864a5p+0, -0x1.6574f0ac07758p-3}, + TabEntry{0x1.25e227b0b8eap+0, -0x1.1aa2bc79c81p-3}, + TabEntry{0x1.1bb4a4a1a343fp+0, -0x1.a4e76ce8c0e5ep-4}, + TabEntry{0x1.12358f08ae5bap+0, -0x1.1973c5a611cccp-4}, + TabEntry{0x1.0953f419900a7p+0, -0x1.252f438e10c1ep-5}, + TabEntry{0x1p+0, 0x0p+0}, + TabEntry{0x1.e608cfd9a47acp-1, 0x1.aa5aa5df25984p-5}, + TabEntry{0x1.ca4b31f026aap-1, 0x1.c5e53aa362eb4p-4}, + TabEntry{0x1.b2036576afce6p-1, 0x1.526e57720db08p-3}, + TabEntry{0x1.9c2d163a1aa2dp-1, 0x1.bc2860d22477p-3}, + TabEntry{0x1.886e6037841edp-1, 0x1.1058bc8a07ee1p-2}, + TabEntry{0x1.767dcf5534862p-1, 0x1.4043057b6ee09p-2}, }; double ln2 = 0x1.62e42fefa39efp-1; @@ -61,14 +69,18 @@ namespace ccm::internal // log(2) generated by Sollya with: // > a = 2^-43 * nearestint(2^43*log(2)); // LSB = 2^-43 is chosen so that e_x * ln2hi is exact for -1075 < e_x < 1024. - double ln2hi{ 0x1.62e42fefa3800p-1 }; // LSB = 2^-43 - double ln2lo{ 0x1.ef35793c76730p-45 }; // LSB = 2^-97 + double ln2hi{0x1.62e42fefa3800p-1}; // LSB = 2^-43 + double ln2lo{0x1.ef35793c76730p-45}; // LSB = 2^-97 // relative error: 0x1.926199e8p-56 // abs error: 0x1.882ff33p-65 // in -0x1.fp-9 0x1.fp-9n std::array poly{ - -0x1.0000000000001p-1, 0x1.555555551305bp-2, -0x1.fffffffeb459p-3, 0x1.999b324f10111p-3, -0x1.55575e506c89fp-3, + -0x1.0000000000001p-1, + 0x1.555555551305bp-2, + -0x1.fffffffeb459p-3, + 0x1.999b324f10111p-3, + -0x1.55575e506c89fp-3, }; // relative error: 0x1.c04d76cp-63 @@ -94,70 +106,70 @@ namespace ccm::internal }; static constexpr std::array tab = { - TabEntry{ 0x1.734f0c3e0de9fp+0, -0x1.7cc7f79e69000p-2 }, TabEntry{ 0x1.713786a2ce91fp+0, -0x1.76feec20d0000p-2 }, - TabEntry{ 0x1.6f26008fab5a0p+0, -0x1.713e31351e000p-2 }, TabEntry{ 0x1.6d1a61f138c7dp+0, -0x1.6b85b38287800p-2 }, - TabEntry{ 0x1.6b1490bc5b4d1p+0, -0x1.65d5590807800p-2 }, TabEntry{ 0x1.69147332f0cbap+0, -0x1.602d076180000p-2 }, - TabEntry{ 0x1.6719f18224223p+0, -0x1.5a8ca86909000p-2 }, TabEntry{ 0x1.6524f99a51ed9p+0, -0x1.54f4356035000p-2 }, - TabEntry{ 0x1.63356aa8f24c4p+0, -0x1.4f637c36b4000p-2 }, TabEntry{ 0x1.614b36b9ddc14p+0, -0x1.49da7fda85000p-2 }, - TabEntry{ 0x1.5f66452c65c4cp+0, -0x1.445923989a800p-2 }, TabEntry{ 0x1.5d867b5912c4fp+0, -0x1.3edf439b0b800p-2 }, - TabEntry{ 0x1.5babccb5b90dep+0, -0x1.396ce448f7000p-2 }, TabEntry{ 0x1.59d61f2d91a78p+0, -0x1.3401e17bda000p-2 }, - TabEntry{ 0x1.5805612465687p+0, -0x1.2e9e2ef468000p-2 }, TabEntry{ 0x1.56397cee76bd3p+0, -0x1.2941b3830e000p-2 }, - TabEntry{ 0x1.54725e2a77f93p+0, -0x1.23ec58cda8800p-2 }, TabEntry{ 0x1.52aff42064583p+0, -0x1.1e9e129279000p-2 }, - TabEntry{ 0x1.50f22dbb2bddfp+0, -0x1.1956d2b48f800p-2 }, TabEntry{ 0x1.4f38f4734ded7p+0, -0x1.141679ab9f800p-2 }, - TabEntry{ 0x1.4d843cfde2840p+0, -0x1.0edd094ef9800p-2 }, TabEntry{ 0x1.4bd3ec078a3c8p+0, -0x1.09aa518db1000p-2 }, - TabEntry{ 0x1.4a27fc3e0258ap+0, -0x1.047e65263b800p-2 }, TabEntry{ 0x1.4880524d48434p+0, -0x1.feb224586f000p-3 }, - TabEntry{ 0x1.46dce1b192d0bp+0, -0x1.f474a7517b000p-3 }, TabEntry{ 0x1.453d9d3391854p+0, -0x1.ea4443d103000p-3 }, - TabEntry{ 0x1.43a2744b4845ap+0, -0x1.e020d44e9b000p-3 }, TabEntry{ 0x1.420b54115f8fbp+0, -0x1.d60a22977f000p-3 }, - TabEntry{ 0x1.40782da3ef4b1p+0, -0x1.cc00104959000p-3 }, TabEntry{ 0x1.3ee8f5d57fe8fp+0, -0x1.c202956891000p-3 }, - TabEntry{ 0x1.3d5d9a00b4ce9p+0, -0x1.b81178d811000p-3 }, TabEntry{ 0x1.3bd60c010c12bp+0, -0x1.ae2c9ccd3d000p-3 }, - TabEntry{ 0x1.3a5242b75dab8p+0, -0x1.a45402e129000p-3 }, TabEntry{ 0x1.38d22cd9fd002p+0, -0x1.9a877681df000p-3 }, - TabEntry{ 0x1.3755bc5847a1cp+0, -0x1.90c6d69483000p-3 }, TabEntry{ 0x1.35dce49ad36e2p+0, -0x1.87120a645c000p-3 }, - TabEntry{ 0x1.34679984dd440p+0, -0x1.7d68fb4143000p-3 }, TabEntry{ 0x1.32f5cceffcb24p+0, -0x1.73cb83c627000p-3 }, - TabEntry{ 0x1.3187775a10d49p+0, -0x1.6a39a9b376000p-3 }, TabEntry{ 0x1.301c8373e3990p+0, -0x1.60b3154b7a000p-3 }, - TabEntry{ 0x1.2eb4ebb95f841p+0, -0x1.5737d76243000p-3 }, TabEntry{ 0x1.2d50a0219a9d1p+0, -0x1.4dc7b8fc23000p-3 }, - TabEntry{ 0x1.2bef9a8b7fd2ap+0, -0x1.4462c51d20000p-3 }, TabEntry{ 0x1.2a91c7a0c1babp+0, -0x1.3b08abc830000p-3 }, - TabEntry{ 0x1.293726014b530p+0, -0x1.31b996b490000p-3 }, TabEntry{ 0x1.27dfa5757a1f5p+0, -0x1.2875490a44000p-3 }, - TabEntry{ 0x1.268b39b1d3bbfp+0, -0x1.1f3b9f879a000p-3 }, TabEntry{ 0x1.2539d838ff5bdp+0, -0x1.160c8252ca000p-3 }, - TabEntry{ 0x1.23eb7aac9083bp+0, -0x1.0ce7f57f72000p-3 }, TabEntry{ 0x1.22a012ba940b6p+0, -0x1.03cdc49fea000p-3 }, - TabEntry{ 0x1.2157996cc4132p+0, -0x1.f57bdbc4b8000p-4 }, TabEntry{ 0x1.201201dd2fc9bp+0, -0x1.e370896404000p-4 }, - TabEntry{ 0x1.1ecf4494d480bp+0, -0x1.d17983ef94000p-4 }, TabEntry{ 0x1.1d8f5528f6569p+0, -0x1.bf9674ed8a000p-4 }, - TabEntry{ 0x1.1c52311577e7cp+0, -0x1.adc79202f6000p-4 }, TabEntry{ 0x1.1b17c74cb26e9p+0, -0x1.9c0c3e7288000p-4 }, - TabEntry{ 0x1.19e010c2c1ab6p+0, -0x1.8a646b372c000p-4 }, TabEntry{ 0x1.18ab07bb670bdp+0, -0x1.78d01b3ac0000p-4 }, - TabEntry{ 0x1.1778a25efbcb6p+0, -0x1.674f145380000p-4 }, TabEntry{ 0x1.1648d354c31dap+0, -0x1.55e0e6d878000p-4 }, - TabEntry{ 0x1.151b990275fddp+0, -0x1.4485cdea1e000p-4 }, TabEntry{ 0x1.13f0ea432d24cp+0, -0x1.333d94d6aa000p-4 }, - TabEntry{ 0x1.12c8b7210f9dap+0, -0x1.22079f8c56000p-4 }, TabEntry{ 0x1.11a3028ecb531p+0, -0x1.10e4698622000p-4 }, - TabEntry{ 0x1.107fbda8434afp+0, -0x1.ffa6c6ad20000p-5 }, TabEntry{ 0x1.0f5ee0f4e6bb3p+0, -0x1.dda8d4a774000p-5 }, - TabEntry{ 0x1.0e4065d2a9fcep+0, -0x1.bbcece4850000p-5 }, TabEntry{ 0x1.0d244632ca521p+0, -0x1.9a1894012c000p-5 }, - TabEntry{ 0x1.0c0a77ce2981ap+0, -0x1.788583302c000p-5 }, TabEntry{ 0x1.0af2f83c636d1p+0, -0x1.5715e67d68000p-5 }, - TabEntry{ 0x1.09ddb98a01339p+0, -0x1.35c8a49658000p-5 }, TabEntry{ 0x1.08cabaf52e7dfp+0, -0x1.149e364154000p-5 }, - TabEntry{ 0x1.07b9f2f4e28fbp+0, -0x1.e72c082eb8000p-6 }, TabEntry{ 0x1.06ab58c358f19p+0, -0x1.a55f152528000p-6 }, - TabEntry{ 0x1.059eea5ecf92cp+0, -0x1.63d62cf818000p-6 }, TabEntry{ 0x1.04949cdd12c90p+0, -0x1.228fb8caa0000p-6 }, - TabEntry{ 0x1.038c6c6f0ada9p+0, -0x1.c317b20f90000p-7 }, TabEntry{ 0x1.02865137932a9p+0, -0x1.419355daa0000p-7 }, - TabEntry{ 0x1.0182427ea7348p+0, -0x1.81203c2ec0000p-8 }, TabEntry{ 0x1.008040614b195p+0, -0x1.0040979240000p-9 }, - TabEntry{ 0x1.fe01ff726fa1ap-1, 0x1.feff384900000p-9 }, TabEntry{ 0x1.fa11cc261ea74p-1, 0x1.7dc41353d0000p-7 }, - TabEntry{ 0x1.f6310b081992ep-1, 0x1.3cea3c4c28000p-6 }, TabEntry{ 0x1.f25f63ceeadcdp-1, 0x1.b9fc114890000p-6 }, - TabEntry{ 0x1.ee9c8039113e7p-1, 0x1.1b0d8ce110000p-5 }, TabEntry{ 0x1.eae8078cbb1abp-1, 0x1.58a5bd001c000p-5 }, - TabEntry{ 0x1.e741aa29d0c9bp-1, 0x1.95c8340d88000p-5 }, TabEntry{ 0x1.e3a91830a99b5p-1, 0x1.d276aef578000p-5 }, - TabEntry{ 0x1.e01e009609a56p-1, 0x1.07598e598c000p-4 }, TabEntry{ 0x1.dca01e577bb98p-1, 0x1.253f5e30d2000p-4 }, - TabEntry{ 0x1.d92f20b7c9103p-1, 0x1.42edd8b380000p-4 }, TabEntry{ 0x1.d5cac66fb5ccep-1, 0x1.606598757c000p-4 }, - TabEntry{ 0x1.d272caa5ede9dp-1, 0x1.7da76356a0000p-4 }, TabEntry{ 0x1.cf26e3e6b2ccdp-1, 0x1.9ab434e1c6000p-4 }, - TabEntry{ 0x1.cbe6da2a77902p-1, 0x1.b78c7bb0d6000p-4 }, TabEntry{ 0x1.c8b266d37086dp-1, 0x1.d431332e72000p-4 }, - TabEntry{ 0x1.c5894bd5d5804p-1, 0x1.f0a3171de6000p-4 }, TabEntry{ 0x1.c26b533bb9f8cp-1, 0x1.067152b914000p-3 }, - TabEntry{ 0x1.bf583eeece73fp-1, 0x1.147858292b000p-3 }, TabEntry{ 0x1.bc4fd75db96c1p-1, 0x1.2266ecdca3000p-3 }, - TabEntry{ 0x1.b951e0c864a28p-1, 0x1.303d7a6c55000p-3 }, TabEntry{ 0x1.b65e2c5ef3e2cp-1, 0x1.3dfc33c331000p-3 }, - TabEntry{ 0x1.b374867c9888bp-1, 0x1.4ba366b7a8000p-3 }, TabEntry{ 0x1.b094b211d304ap-1, 0x1.5933928d1f000p-3 }, - TabEntry{ 0x1.adbe885f2ef7ep-1, 0x1.66acd2418f000p-3 }, TabEntry{ 0x1.aaf1d31603da2p-1, 0x1.740f8ec669000p-3 }, - TabEntry{ 0x1.a82e63fd358a7p-1, 0x1.815c0f51af000p-3 }, TabEntry{ 0x1.a5740ef09738bp-1, 0x1.8e92954f68000p-3 }, - TabEntry{ 0x1.a2c2a90ab4b27p-1, 0x1.9bb3602f84000p-3 }, TabEntry{ 0x1.a01a01393f2d1p-1, 0x1.a8bed1c2c0000p-3 }, - TabEntry{ 0x1.9d79f24db3c1bp-1, 0x1.b5b515c01d000p-3 }, TabEntry{ 0x1.9ae2505c7b190p-1, 0x1.c2967ccbcc000p-3 }, - TabEntry{ 0x1.9852ef297ce2fp-1, 0x1.cf635d5486000p-3 }, TabEntry{ 0x1.95cbaeea44b75p-1, 0x1.dc1bd3446c000p-3 }, - TabEntry{ 0x1.934c69de74838p-1, 0x1.e8c01b8cfe000p-3 }, TabEntry{ 0x1.90d4f2f6752e6p-1, 0x1.f5509c0179000p-3 }, - TabEntry{ 0x1.8e6528effd79dp-1, 0x1.00e6c121fb800p-2 }, TabEntry{ 0x1.8bfce9fcc007cp-1, 0x1.071b80e93d000p-2 }, - TabEntry{ 0x1.899c0dabec30ep-1, 0x1.0d46b9e867000p-2 }, TabEntry{ 0x1.87427aa2317fbp-1, 0x1.13687334bd000p-2 }, - TabEntry{ 0x1.84f00acb39a08p-1, 0x1.1980d67234800p-2 }, TabEntry{ 0x1.82a49e8653e55p-1, 0x1.1f8ffe0cc8000p-2 }, - TabEntry{ 0x1.8060195f40260p-1, 0x1.2595fd7636800p-2 }, TabEntry{ 0x1.7e22563e0a329p-1, 0x1.2b9300914a800p-2 }, - TabEntry{ 0x1.7beb377dcb5adp-1, 0x1.3187210436000p-2 }, TabEntry{ 0x1.79baa679725c2p-1, 0x1.377266dec1800p-2 }, - TabEntry{ 0x1.77907f2170657p-1, 0x1.3d54ffbaf3000p-2 }, TabEntry{ 0x1.756cadbd6130cp-1, 0x1.432eee32fe000p-2 }, + TabEntry{0x1.734f0c3e0de9fp+0, -0x1.7cc7f79e69000p-2}, TabEntry{0x1.713786a2ce91fp+0, -0x1.76feec20d0000p-2}, + TabEntry{0x1.6f26008fab5a0p+0, -0x1.713e31351e000p-2}, TabEntry{0x1.6d1a61f138c7dp+0, -0x1.6b85b38287800p-2}, + TabEntry{0x1.6b1490bc5b4d1p+0, -0x1.65d5590807800p-2}, TabEntry{0x1.69147332f0cbap+0, -0x1.602d076180000p-2}, + TabEntry{0x1.6719f18224223p+0, -0x1.5a8ca86909000p-2}, TabEntry{0x1.6524f99a51ed9p+0, -0x1.54f4356035000p-2}, + TabEntry{0x1.63356aa8f24c4p+0, -0x1.4f637c36b4000p-2}, TabEntry{0x1.614b36b9ddc14p+0, -0x1.49da7fda85000p-2}, + TabEntry{0x1.5f66452c65c4cp+0, -0x1.445923989a800p-2}, TabEntry{0x1.5d867b5912c4fp+0, -0x1.3edf439b0b800p-2}, + TabEntry{0x1.5babccb5b90dep+0, -0x1.396ce448f7000p-2}, TabEntry{0x1.59d61f2d91a78p+0, -0x1.3401e17bda000p-2}, + TabEntry{0x1.5805612465687p+0, -0x1.2e9e2ef468000p-2}, TabEntry{0x1.56397cee76bd3p+0, -0x1.2941b3830e000p-2}, + TabEntry{0x1.54725e2a77f93p+0, -0x1.23ec58cda8800p-2}, TabEntry{0x1.52aff42064583p+0, -0x1.1e9e129279000p-2}, + TabEntry{0x1.50f22dbb2bddfp+0, -0x1.1956d2b48f800p-2}, TabEntry{0x1.4f38f4734ded7p+0, -0x1.141679ab9f800p-2}, + TabEntry{0x1.4d843cfde2840p+0, -0x1.0edd094ef9800p-2}, TabEntry{0x1.4bd3ec078a3c8p+0, -0x1.09aa518db1000p-2}, + TabEntry{0x1.4a27fc3e0258ap+0, -0x1.047e65263b800p-2}, TabEntry{0x1.4880524d48434p+0, -0x1.feb224586f000p-3}, + TabEntry{0x1.46dce1b192d0bp+0, -0x1.f474a7517b000p-3}, TabEntry{0x1.453d9d3391854p+0, -0x1.ea4443d103000p-3}, + TabEntry{0x1.43a2744b4845ap+0, -0x1.e020d44e9b000p-3}, TabEntry{0x1.420b54115f8fbp+0, -0x1.d60a22977f000p-3}, + TabEntry{0x1.40782da3ef4b1p+0, -0x1.cc00104959000p-3}, TabEntry{0x1.3ee8f5d57fe8fp+0, -0x1.c202956891000p-3}, + TabEntry{0x1.3d5d9a00b4ce9p+0, -0x1.b81178d811000p-3}, TabEntry{0x1.3bd60c010c12bp+0, -0x1.ae2c9ccd3d000p-3}, + TabEntry{0x1.3a5242b75dab8p+0, -0x1.a45402e129000p-3}, TabEntry{0x1.38d22cd9fd002p+0, -0x1.9a877681df000p-3}, + TabEntry{0x1.3755bc5847a1cp+0, -0x1.90c6d69483000p-3}, TabEntry{0x1.35dce49ad36e2p+0, -0x1.87120a645c000p-3}, + TabEntry{0x1.34679984dd440p+0, -0x1.7d68fb4143000p-3}, TabEntry{0x1.32f5cceffcb24p+0, -0x1.73cb83c627000p-3}, + TabEntry{0x1.3187775a10d49p+0, -0x1.6a39a9b376000p-3}, TabEntry{0x1.301c8373e3990p+0, -0x1.60b3154b7a000p-3}, + TabEntry{0x1.2eb4ebb95f841p+0, -0x1.5737d76243000p-3}, TabEntry{0x1.2d50a0219a9d1p+0, -0x1.4dc7b8fc23000p-3}, + TabEntry{0x1.2bef9a8b7fd2ap+0, -0x1.4462c51d20000p-3}, TabEntry{0x1.2a91c7a0c1babp+0, -0x1.3b08abc830000p-3}, + TabEntry{0x1.293726014b530p+0, -0x1.31b996b490000p-3}, TabEntry{0x1.27dfa5757a1f5p+0, -0x1.2875490a44000p-3}, + TabEntry{0x1.268b39b1d3bbfp+0, -0x1.1f3b9f879a000p-3}, TabEntry{0x1.2539d838ff5bdp+0, -0x1.160c8252ca000p-3}, + TabEntry{0x1.23eb7aac9083bp+0, -0x1.0ce7f57f72000p-3}, TabEntry{0x1.22a012ba940b6p+0, -0x1.03cdc49fea000p-3}, + TabEntry{0x1.2157996cc4132p+0, -0x1.f57bdbc4b8000p-4}, TabEntry{0x1.201201dd2fc9bp+0, -0x1.e370896404000p-4}, + TabEntry{0x1.1ecf4494d480bp+0, -0x1.d17983ef94000p-4}, TabEntry{0x1.1d8f5528f6569p+0, -0x1.bf9674ed8a000p-4}, + TabEntry{0x1.1c52311577e7cp+0, -0x1.adc79202f6000p-4}, TabEntry{0x1.1b17c74cb26e9p+0, -0x1.9c0c3e7288000p-4}, + TabEntry{0x1.19e010c2c1ab6p+0, -0x1.8a646b372c000p-4}, TabEntry{0x1.18ab07bb670bdp+0, -0x1.78d01b3ac0000p-4}, + TabEntry{0x1.1778a25efbcb6p+0, -0x1.674f145380000p-4}, TabEntry{0x1.1648d354c31dap+0, -0x1.55e0e6d878000p-4}, + TabEntry{0x1.151b990275fddp+0, -0x1.4485cdea1e000p-4}, TabEntry{0x1.13f0ea432d24cp+0, -0x1.333d94d6aa000p-4}, + TabEntry{0x1.12c8b7210f9dap+0, -0x1.22079f8c56000p-4}, TabEntry{0x1.11a3028ecb531p+0, -0x1.10e4698622000p-4}, + TabEntry{0x1.107fbda8434afp+0, -0x1.ffa6c6ad20000p-5}, TabEntry{0x1.0f5ee0f4e6bb3p+0, -0x1.dda8d4a774000p-5}, + TabEntry{0x1.0e4065d2a9fcep+0, -0x1.bbcece4850000p-5}, TabEntry{0x1.0d244632ca521p+0, -0x1.9a1894012c000p-5}, + TabEntry{0x1.0c0a77ce2981ap+0, -0x1.788583302c000p-5}, TabEntry{0x1.0af2f83c636d1p+0, -0x1.5715e67d68000p-5}, + TabEntry{0x1.09ddb98a01339p+0, -0x1.35c8a49658000p-5}, TabEntry{0x1.08cabaf52e7dfp+0, -0x1.149e364154000p-5}, + TabEntry{0x1.07b9f2f4e28fbp+0, -0x1.e72c082eb8000p-6}, TabEntry{0x1.06ab58c358f19p+0, -0x1.a55f152528000p-6}, + TabEntry{0x1.059eea5ecf92cp+0, -0x1.63d62cf818000p-6}, TabEntry{0x1.04949cdd12c90p+0, -0x1.228fb8caa0000p-6}, + TabEntry{0x1.038c6c6f0ada9p+0, -0x1.c317b20f90000p-7}, TabEntry{0x1.02865137932a9p+0, -0x1.419355daa0000p-7}, + TabEntry{0x1.0182427ea7348p+0, -0x1.81203c2ec0000p-8}, TabEntry{0x1.008040614b195p+0, -0x1.0040979240000p-9}, + TabEntry{0x1.fe01ff726fa1ap-1, 0x1.feff384900000p-9}, TabEntry{0x1.fa11cc261ea74p-1, 0x1.7dc41353d0000p-7}, + TabEntry{0x1.f6310b081992ep-1, 0x1.3cea3c4c28000p-6}, TabEntry{0x1.f25f63ceeadcdp-1, 0x1.b9fc114890000p-6}, + TabEntry{0x1.ee9c8039113e7p-1, 0x1.1b0d8ce110000p-5}, TabEntry{0x1.eae8078cbb1abp-1, 0x1.58a5bd001c000p-5}, + TabEntry{0x1.e741aa29d0c9bp-1, 0x1.95c8340d88000p-5}, TabEntry{0x1.e3a91830a99b5p-1, 0x1.d276aef578000p-5}, + TabEntry{0x1.e01e009609a56p-1, 0x1.07598e598c000p-4}, TabEntry{0x1.dca01e577bb98p-1, 0x1.253f5e30d2000p-4}, + TabEntry{0x1.d92f20b7c9103p-1, 0x1.42edd8b380000p-4}, TabEntry{0x1.d5cac66fb5ccep-1, 0x1.606598757c000p-4}, + TabEntry{0x1.d272caa5ede9dp-1, 0x1.7da76356a0000p-4}, TabEntry{0x1.cf26e3e6b2ccdp-1, 0x1.9ab434e1c6000p-4}, + TabEntry{0x1.cbe6da2a77902p-1, 0x1.b78c7bb0d6000p-4}, TabEntry{0x1.c8b266d37086dp-1, 0x1.d431332e72000p-4}, + TabEntry{0x1.c5894bd5d5804p-1, 0x1.f0a3171de6000p-4}, TabEntry{0x1.c26b533bb9f8cp-1, 0x1.067152b914000p-3}, + TabEntry{0x1.bf583eeece73fp-1, 0x1.147858292b000p-3}, TabEntry{0x1.bc4fd75db96c1p-1, 0x1.2266ecdca3000p-3}, + TabEntry{0x1.b951e0c864a28p-1, 0x1.303d7a6c55000p-3}, TabEntry{0x1.b65e2c5ef3e2cp-1, 0x1.3dfc33c331000p-3}, + TabEntry{0x1.b374867c9888bp-1, 0x1.4ba366b7a8000p-3}, TabEntry{0x1.b094b211d304ap-1, 0x1.5933928d1f000p-3}, + TabEntry{0x1.adbe885f2ef7ep-1, 0x1.66acd2418f000p-3}, TabEntry{0x1.aaf1d31603da2p-1, 0x1.740f8ec669000p-3}, + TabEntry{0x1.a82e63fd358a7p-1, 0x1.815c0f51af000p-3}, TabEntry{0x1.a5740ef09738bp-1, 0x1.8e92954f68000p-3}, + TabEntry{0x1.a2c2a90ab4b27p-1, 0x1.9bb3602f84000p-3}, TabEntry{0x1.a01a01393f2d1p-1, 0x1.a8bed1c2c0000p-3}, + TabEntry{0x1.9d79f24db3c1bp-1, 0x1.b5b515c01d000p-3}, TabEntry{0x1.9ae2505c7b190p-1, 0x1.c2967ccbcc000p-3}, + TabEntry{0x1.9852ef297ce2fp-1, 0x1.cf635d5486000p-3}, TabEntry{0x1.95cbaeea44b75p-1, 0x1.dc1bd3446c000p-3}, + TabEntry{0x1.934c69de74838p-1, 0x1.e8c01b8cfe000p-3}, TabEntry{0x1.90d4f2f6752e6p-1, 0x1.f5509c0179000p-3}, + TabEntry{0x1.8e6528effd79dp-1, 0x1.00e6c121fb800p-2}, TabEntry{0x1.8bfce9fcc007cp-1, 0x1.071b80e93d000p-2}, + TabEntry{0x1.899c0dabec30ep-1, 0x1.0d46b9e867000p-2}, TabEntry{0x1.87427aa2317fbp-1, 0x1.13687334bd000p-2}, + TabEntry{0x1.84f00acb39a08p-1, 0x1.1980d67234800p-2}, TabEntry{0x1.82a49e8653e55p-1, 0x1.1f8ffe0cc8000p-2}, + TabEntry{0x1.8060195f40260p-1, 0x1.2595fd7636800p-2}, TabEntry{0x1.7e22563e0a329p-1, 0x1.2b9300914a800p-2}, + TabEntry{0x1.7beb377dcb5adp-1, 0x1.3187210436000p-2}, TabEntry{0x1.79baa679725c2p-1, 0x1.377266dec1800p-2}, + TabEntry{0x1.77907f2170657p-1, 0x1.3d54ffbaf3000p-2}, TabEntry{0x1.756cadbd6130cp-1, 0x1.432eee32fe000p-2}, }; struct Tab2Entry @@ -167,70 +179,70 @@ namespace ccm::internal }; static constexpr std::array tab2 = { - Tab2Entry{ 0x1.61000014fb66bp-1, 0x1.e026c91425b3cp-56 }, Tab2Entry{ 0x1.63000034db495p-1, 0x1.dbfea48005d41p-55 }, - Tab2Entry{ 0x1.650000d94d478p-1, 0x1.e7fa786d6a5b7p-55 }, Tab2Entry{ 0x1.67000074e6fadp-1, 0x1.1fcea6b54254cp-57 }, - Tab2Entry{ 0x1.68ffffedf0faep-1, -0x1.c7e274c590efdp-56 }, Tab2Entry{ 0x1.6b0000763c5bcp-1, -0x1.ac16848dcda01p-55 }, - Tab2Entry{ 0x1.6d0001e5cc1f6p-1, 0x1.33f1c9d499311p-55 }, Tab2Entry{ 0x1.6efffeb05f63ep-1, -0x1.e80041ae22d53p-56 }, - Tab2Entry{ 0x1.710000e86978p-1, 0x1.bff6671097952p-56 }, Tab2Entry{ 0x1.72ffffc67e912p-1, 0x1.c00e226bd8724p-55 }, - Tab2Entry{ 0x1.74fffdf81116ap-1, -0x1.e02916ef101d2p-57 }, Tab2Entry{ 0x1.770000f679c9p-1, -0x1.7fc71cd549c74p-57 }, - Tab2Entry{ 0x1.78ffffa7ec835p-1, 0x1.1bec19ef50483p-55 }, Tab2Entry{ 0x1.7affffe20c2e6p-1, -0x1.07e1729cc6465p-56 }, - Tab2Entry{ 0x1.7cfffed3fc9p-1, -0x1.08072087b8b1cp-55 }, Tab2Entry{ 0x1.7efffe9261a76p-1, 0x1.dc0286d9df9aep-55 }, - Tab2Entry{ 0x1.81000049ca3e8p-1, 0x1.97fd251e54c33p-55 }, Tab2Entry{ 0x1.8300017932c8fp-1, -0x1.afee9b630f381p-55 }, - Tab2Entry{ 0x1.850000633739cp-1, 0x1.9bfbf6b6535bcp-55 }, Tab2Entry{ 0x1.87000204289c6p-1, -0x1.bbf65f3117b75p-55 }, - Tab2Entry{ 0x1.88fffebf57904p-1, -0x1.9006ea23dcb57p-55 }, Tab2Entry{ 0x1.8b00022bc04dfp-1, -0x1.d00df38e04b0ap-56 }, - Tab2Entry{ 0x1.8cfffe50c1b8ap-1, -0x1.8007146ff9f05p-55 }, Tab2Entry{ 0x1.8effffc918e43p-1, 0x1.3817bd07a7038p-55 }, - Tab2Entry{ 0x1.910001efa5fc7p-1, 0x1.93e9176dfb403p-55 }, Tab2Entry{ 0x1.9300013467bb9p-1, 0x1.f804e4b980276p-56 }, - Tab2Entry{ 0x1.94fffe6ee076fp-1, -0x1.f7ef0d9ff622ep-55 }, Tab2Entry{ 0x1.96fffde3c12d1p-1, -0x1.082aa962638bap-56 }, - Tab2Entry{ 0x1.98ffff4458a0dp-1, -0x1.7801b9164a8efp-55 }, Tab2Entry{ 0x1.9afffdd982e3ep-1, -0x1.740e08a5a9337p-55 }, - Tab2Entry{ 0x1.9cfffed49fb66p-1, 0x1.fce08c19bep-60 }, Tab2Entry{ 0x1.9f00020f19c51p-1, -0x1.a3faa27885b0ap-55 }, - Tab2Entry{ 0x1.a10001145b006p-1, 0x1.4ff489958da56p-56 }, Tab2Entry{ 0x1.a300007bbf6fap-1, 0x1.cbeab8a2b6d18p-55 }, - Tab2Entry{ 0x1.a500010971d79p-1, 0x1.8fecadd78793p-55 }, Tab2Entry{ 0x1.a70001df52e48p-1, -0x1.f41763dd8abdbp-55 }, - Tab2Entry{ 0x1.a90001c593352p-1, -0x1.ebf0284c27612p-55 }, Tab2Entry{ 0x1.ab0002a4f3e4bp-1, -0x1.9fd043cff3f5fp-57 }, - Tab2Entry{ 0x1.acfffd7ae1ed1p-1, -0x1.23ee7129070b4p-55 }, Tab2Entry{ 0x1.aefffee510478p-1, 0x1.a063ee00edea3p-57 }, - Tab2Entry{ 0x1.b0fffdb650d5bp-1, 0x1.a06c8381f0ab9p-58 }, Tab2Entry{ 0x1.b2ffffeaaca57p-1, -0x1.9011e74233c1dp-56 }, - Tab2Entry{ 0x1.b4fffd995badcp-1, -0x1.9ff1068862a9fp-56 }, Tab2Entry{ 0x1.b7000249e659cp-1, 0x1.aff45d0864f3ep-55 }, - Tab2Entry{ 0x1.b8ffff987164p-1, 0x1.cfe7796c2c3f9p-56 }, Tab2Entry{ 0x1.bafffd204cb4fp-1, -0x1.3ff27eef22bc4p-57 }, - Tab2Entry{ 0x1.bcfffd2415c45p-1, -0x1.cffb7ee3bea21p-57 }, Tab2Entry{ 0x1.beffff86309dfp-1, -0x1.14103972e0b5cp-55 }, - Tab2Entry{ 0x1.c0fffe1b57653p-1, 0x1.bc16494b76a19p-55 }, Tab2Entry{ 0x1.c2ffff1fa57e3p-1, -0x1.4feef8d30c6edp-57 }, - Tab2Entry{ 0x1.c4fffdcbfe424p-1, -0x1.43f68bcec4775p-55 }, Tab2Entry{ 0x1.c6fffed54b9f7p-1, 0x1.47ea3f053e0ecp-55 }, - Tab2Entry{ 0x1.c8fffeb998fd5p-1, 0x1.383068df992f1p-56 }, Tab2Entry{ 0x1.cb0002125219ap-1, -0x1.8fd8e64180e04p-57 }, - Tab2Entry{ 0x1.ccfffdd94469cp-1, 0x1.e7ebe1cc7ea72p-55 }, Tab2Entry{ 0x1.cefffeafdc476p-1, 0x1.ebe39ad9f88fep-55 }, - Tab2Entry{ 0x1.d1000169af82bp-1, 0x1.57d91a8b95a71p-56 }, Tab2Entry{ 0x1.d30000d0ff71dp-1, 0x1.9c1906970c7dap-55 }, - Tab2Entry{ 0x1.d4fffea790fc4p-1, -0x1.80e37c558fe0cp-58 }, Tab2Entry{ 0x1.d70002edc87e5p-1, -0x1.f80d64dc10f44p-56 }, - Tab2Entry{ 0x1.d900021dc82aap-1, -0x1.47c8f94fd5c5cp-56 }, Tab2Entry{ 0x1.dafffd86b0283p-1, 0x1.c7f1dc521617ep-55 }, - Tab2Entry{ 0x1.dd000296c4739p-1, 0x1.8019eb2ffb153p-55 }, Tab2Entry{ 0x1.defffe54490f5p-1, 0x1.e00d2c652cc89p-57 }, - Tab2Entry{ 0x1.e0fffcdabf694p-1, -0x1.f8340202d69d2p-56 }, Tab2Entry{ 0x1.e2fffdb52c8ddp-1, 0x1.b00c1ca1b0864p-56 }, - Tab2Entry{ 0x1.e4ffff24216efp-1, 0x1.2ffa8b094ab51p-56 }, Tab2Entry{ 0x1.e6fffe88a5e11p-1, -0x1.7f673b1efbe59p-58 }, - Tab2Entry{ 0x1.e9000119eff0dp-1, -0x1.4808d5e0bc801p-55 }, Tab2Entry{ 0x1.eafffdfa51744p-1, 0x1.80006d54320b5p-56 }, - Tab2Entry{ 0x1.ed0001a127fa1p-1, -0x1.002f860565c92p-58 }, Tab2Entry{ 0x1.ef00007babcc4p-1, -0x1.540445d35e611p-55 }, - Tab2Entry{ 0x1.f0ffff57a8d02p-1, -0x1.ffb3139ef9105p-59 }, Tab2Entry{ 0x1.f30001ee58ac7p-1, 0x1.a81acf2731155p-55 }, - Tab2Entry{ 0x1.f4ffff5823494p-1, 0x1.a3f41d4d7c743p-55 }, Tab2Entry{ 0x1.f6ffffca94c6bp-1, -0x1.202f41c987875p-57 }, - Tab2Entry{ 0x1.f8fffe1f9c441p-1, 0x1.77dd1f477e74bp-56 }, Tab2Entry{ 0x1.fafffd2e0e37ep-1, -0x1.f01199a7ca331p-57 }, - Tab2Entry{ 0x1.fd0001c77e49ep-1, 0x1.181ee4bceacb1p-56 }, Tab2Entry{ 0x1.feffff7e0c331p-1, -0x1.e05370170875ap-57 }, - Tab2Entry{ 0x1.00ffff465606ep+0, -0x1.a7ead491c0adap-55 }, Tab2Entry{ 0x1.02ffff3867a58p+0, -0x1.77f69c3fcb2ep-54 }, - Tab2Entry{ 0x1.04ffffdfc0d17p+0, 0x1.7bffe34cb945bp-54 }, Tab2Entry{ 0x1.0700003cd4d82p+0, 0x1.20083c0e456cbp-55 }, - Tab2Entry{ 0x1.08ffff9f2cbe8p+0, -0x1.dffdfbe37751ap-57 }, Tab2Entry{ 0x1.0b000010cda65p+0, -0x1.13f7faee626ebp-54 }, - Tab2Entry{ 0x1.0d00001a4d338p+0, 0x1.07dfa79489ff7p-55 }, Tab2Entry{ 0x1.0effffadafdfdp+0, -0x1.7040570d66bcp-56 }, - Tab2Entry{ 0x1.110000bbafd96p+0, 0x1.e80d4846d0b62p-55 }, Tab2Entry{ 0x1.12ffffae5f45dp+0, 0x1.dbffa64fd36efp-54 }, - Tab2Entry{ 0x1.150000dd59ad9p+0, 0x1.a0077701250aep-54 }, Tab2Entry{ 0x1.170000f21559ap+0, 0x1.dfdf9e2e3deeep-55 }, - Tab2Entry{ 0x1.18ffffc275426p+0, 0x1.10030dc3b7273p-54 }, Tab2Entry{ 0x1.1b000123d3c59p+0, 0x1.97f7980030188p-54 }, - Tab2Entry{ 0x1.1cffff8299eb7p+0, -0x1.5f932ab9f8c67p-57 }, Tab2Entry{ 0x1.1effff48ad4p+0, 0x1.37fbf9da75bebp-54 }, - Tab2Entry{ 0x1.210000c8b86a4p+0, 0x1.f806b91fd5b22p-54 }, Tab2Entry{ 0x1.2300003854303p+0, 0x1.3ffc2eb9fbf33p-54 }, - Tab2Entry{ 0x1.24fffffbcf684p+0, 0x1.601e77e2e2e72p-56 }, Tab2Entry{ 0x1.26ffff52921d9p+0, 0x1.ffcbb767f0c61p-56 }, - Tab2Entry{ 0x1.2900014933a3cp+0, -0x1.202ca3c02412bp-56 }, Tab2Entry{ 0x1.2b00014556313p+0, -0x1.2808233f21f02p-54 }, - Tab2Entry{ 0x1.2cfffebfe523bp+0, -0x1.8ff7e384fdcf2p-55 }, Tab2Entry{ 0x1.2f0000bb8ad96p+0, -0x1.5ff51503041c5p-55 }, - Tab2Entry{ 0x1.30ffffb7ae2afp+0, -0x1.10071885e289dp-55 }, Tab2Entry{ 0x1.32ffffeac5f7fp+0, -0x1.1ff5d3fb7b715p-54 }, - Tab2Entry{ 0x1.350000ca66756p+0, 0x1.57f82228b82bdp-54 }, Tab2Entry{ 0x1.3700011fbf721p+0, 0x1.000bac40dd5ccp-55 }, - Tab2Entry{ 0x1.38ffff9592fb9p+0, -0x1.43f9d2db2a751p-54 }, Tab2Entry{ 0x1.3b00004ddd242p+0, 0x1.57f6b707638e1p-55 }, - Tab2Entry{ 0x1.3cffff5b2c957p+0, 0x1.a023a10bf1231p-56 }, Tab2Entry{ 0x1.3efffeab0b418p+0, 0x1.87f6d66b152bp-54 }, - Tab2Entry{ 0x1.410001532aff4p+0, 0x1.7f8375f198524p-57 }, Tab2Entry{ 0x1.4300017478b29p+0, 0x1.301e672dc5143p-55 }, - Tab2Entry{ 0x1.44fffe795b463p+0, 0x1.9ff69b8b2895ap-55 }, Tab2Entry{ 0x1.46fffe80475ep+0, -0x1.5c0b19bc2f254p-54 }, - Tab2Entry{ 0x1.48fffef6fc1e7p+0, 0x1.b4009f23a2a72p-54 }, Tab2Entry{ 0x1.4afffe5bea704p+0, -0x1.4ffb7bf0d7d45p-54 }, - Tab2Entry{ 0x1.4d000171027dep+0, -0x1.9c06471dc6a3dp-54 }, Tab2Entry{ 0x1.4f0000ff03ee2p+0, 0x1.77f890b85531cp-54 }, - Tab2Entry{ 0x1.5100012dc4bd1p+0, 0x1.004657166a436p-57 }, Tab2Entry{ 0x1.530001605277ap+0, -0x1.6bfcece233209p-54 }, - Tab2Entry{ 0x1.54fffecdb704cp+0, -0x1.902720505a1d7p-55 }, Tab2Entry{ 0x1.56fffef5f54a9p+0, 0x1.bbfe60ec96412p-54 }, - Tab2Entry{ 0x1.5900017e61012p+0, 0x1.87ec581afef9p-55 }, Tab2Entry{ 0x1.5b00003c93e92p+0, -0x1.f41080abf0ccp-54 }, - Tab2Entry{ 0x1.5d0001d4919bcp+0, -0x1.8812afb254729p-54 }, Tab2Entry{ 0x1.5efffe7b87a89p+0, -0x1.47eb780ed6904p-54 }, + Tab2Entry{0x1.61000014fb66bp-1, 0x1.e026c91425b3cp-56}, Tab2Entry{0x1.63000034db495p-1, 0x1.dbfea48005d41p-55}, + Tab2Entry{0x1.650000d94d478p-1, 0x1.e7fa786d6a5b7p-55}, Tab2Entry{0x1.67000074e6fadp-1, 0x1.1fcea6b54254cp-57}, + Tab2Entry{0x1.68ffffedf0faep-1, -0x1.c7e274c590efdp-56}, Tab2Entry{0x1.6b0000763c5bcp-1, -0x1.ac16848dcda01p-55}, + Tab2Entry{0x1.6d0001e5cc1f6p-1, 0x1.33f1c9d499311p-55}, Tab2Entry{0x1.6efffeb05f63ep-1, -0x1.e80041ae22d53p-56}, + Tab2Entry{0x1.710000e86978p-1, 0x1.bff6671097952p-56}, Tab2Entry{0x1.72ffffc67e912p-1, 0x1.c00e226bd8724p-55}, + Tab2Entry{0x1.74fffdf81116ap-1, -0x1.e02916ef101d2p-57}, Tab2Entry{0x1.770000f679c9p-1, -0x1.7fc71cd549c74p-57}, + Tab2Entry{0x1.78ffffa7ec835p-1, 0x1.1bec19ef50483p-55}, Tab2Entry{0x1.7affffe20c2e6p-1, -0x1.07e1729cc6465p-56}, + Tab2Entry{0x1.7cfffed3fc9p-1, -0x1.08072087b8b1cp-55}, Tab2Entry{0x1.7efffe9261a76p-1, 0x1.dc0286d9df9aep-55}, + Tab2Entry{0x1.81000049ca3e8p-1, 0x1.97fd251e54c33p-55}, Tab2Entry{0x1.8300017932c8fp-1, -0x1.afee9b630f381p-55}, + Tab2Entry{0x1.850000633739cp-1, 0x1.9bfbf6b6535bcp-55}, Tab2Entry{0x1.87000204289c6p-1, -0x1.bbf65f3117b75p-55}, + Tab2Entry{0x1.88fffebf57904p-1, -0x1.9006ea23dcb57p-55}, Tab2Entry{0x1.8b00022bc04dfp-1, -0x1.d00df38e04b0ap-56}, + Tab2Entry{0x1.8cfffe50c1b8ap-1, -0x1.8007146ff9f05p-55}, Tab2Entry{0x1.8effffc918e43p-1, 0x1.3817bd07a7038p-55}, + Tab2Entry{0x1.910001efa5fc7p-1, 0x1.93e9176dfb403p-55}, Tab2Entry{0x1.9300013467bb9p-1, 0x1.f804e4b980276p-56}, + Tab2Entry{0x1.94fffe6ee076fp-1, -0x1.f7ef0d9ff622ep-55}, Tab2Entry{0x1.96fffde3c12d1p-1, -0x1.082aa962638bap-56}, + Tab2Entry{0x1.98ffff4458a0dp-1, -0x1.7801b9164a8efp-55}, Tab2Entry{0x1.9afffdd982e3ep-1, -0x1.740e08a5a9337p-55}, + Tab2Entry{0x1.9cfffed49fb66p-1, 0x1.fce08c19bep-60}, Tab2Entry{0x1.9f00020f19c51p-1, -0x1.a3faa27885b0ap-55}, + Tab2Entry{0x1.a10001145b006p-1, 0x1.4ff489958da56p-56}, Tab2Entry{0x1.a300007bbf6fap-1, 0x1.cbeab8a2b6d18p-55}, + Tab2Entry{0x1.a500010971d79p-1, 0x1.8fecadd78793p-55}, Tab2Entry{0x1.a70001df52e48p-1, -0x1.f41763dd8abdbp-55}, + Tab2Entry{0x1.a90001c593352p-1, -0x1.ebf0284c27612p-55}, Tab2Entry{0x1.ab0002a4f3e4bp-1, -0x1.9fd043cff3f5fp-57}, + Tab2Entry{0x1.acfffd7ae1ed1p-1, -0x1.23ee7129070b4p-55}, Tab2Entry{0x1.aefffee510478p-1, 0x1.a063ee00edea3p-57}, + Tab2Entry{0x1.b0fffdb650d5bp-1, 0x1.a06c8381f0ab9p-58}, Tab2Entry{0x1.b2ffffeaaca57p-1, -0x1.9011e74233c1dp-56}, + Tab2Entry{0x1.b4fffd995badcp-1, -0x1.9ff1068862a9fp-56}, Tab2Entry{0x1.b7000249e659cp-1, 0x1.aff45d0864f3ep-55}, + Tab2Entry{0x1.b8ffff987164p-1, 0x1.cfe7796c2c3f9p-56}, Tab2Entry{0x1.bafffd204cb4fp-1, -0x1.3ff27eef22bc4p-57}, + Tab2Entry{0x1.bcfffd2415c45p-1, -0x1.cffb7ee3bea21p-57}, Tab2Entry{0x1.beffff86309dfp-1, -0x1.14103972e0b5cp-55}, + Tab2Entry{0x1.c0fffe1b57653p-1, 0x1.bc16494b76a19p-55}, Tab2Entry{0x1.c2ffff1fa57e3p-1, -0x1.4feef8d30c6edp-57}, + Tab2Entry{0x1.c4fffdcbfe424p-1, -0x1.43f68bcec4775p-55}, Tab2Entry{0x1.c6fffed54b9f7p-1, 0x1.47ea3f053e0ecp-55}, + Tab2Entry{0x1.c8fffeb998fd5p-1, 0x1.383068df992f1p-56}, Tab2Entry{0x1.cb0002125219ap-1, -0x1.8fd8e64180e04p-57}, + Tab2Entry{0x1.ccfffdd94469cp-1, 0x1.e7ebe1cc7ea72p-55}, Tab2Entry{0x1.cefffeafdc476p-1, 0x1.ebe39ad9f88fep-55}, + Tab2Entry{0x1.d1000169af82bp-1, 0x1.57d91a8b95a71p-56}, Tab2Entry{0x1.d30000d0ff71dp-1, 0x1.9c1906970c7dap-55}, + Tab2Entry{0x1.d4fffea790fc4p-1, -0x1.80e37c558fe0cp-58}, Tab2Entry{0x1.d70002edc87e5p-1, -0x1.f80d64dc10f44p-56}, + Tab2Entry{0x1.d900021dc82aap-1, -0x1.47c8f94fd5c5cp-56}, Tab2Entry{0x1.dafffd86b0283p-1, 0x1.c7f1dc521617ep-55}, + Tab2Entry{0x1.dd000296c4739p-1, 0x1.8019eb2ffb153p-55}, Tab2Entry{0x1.defffe54490f5p-1, 0x1.e00d2c652cc89p-57}, + Tab2Entry{0x1.e0fffcdabf694p-1, -0x1.f8340202d69d2p-56}, Tab2Entry{0x1.e2fffdb52c8ddp-1, 0x1.b00c1ca1b0864p-56}, + Tab2Entry{0x1.e4ffff24216efp-1, 0x1.2ffa8b094ab51p-56}, Tab2Entry{0x1.e6fffe88a5e11p-1, -0x1.7f673b1efbe59p-58}, + Tab2Entry{0x1.e9000119eff0dp-1, -0x1.4808d5e0bc801p-55}, Tab2Entry{0x1.eafffdfa51744p-1, 0x1.80006d54320b5p-56}, + Tab2Entry{0x1.ed0001a127fa1p-1, -0x1.002f860565c92p-58}, Tab2Entry{0x1.ef00007babcc4p-1, -0x1.540445d35e611p-55}, + Tab2Entry{0x1.f0ffff57a8d02p-1, -0x1.ffb3139ef9105p-59}, Tab2Entry{0x1.f30001ee58ac7p-1, 0x1.a81acf2731155p-55}, + Tab2Entry{0x1.f4ffff5823494p-1, 0x1.a3f41d4d7c743p-55}, Tab2Entry{0x1.f6ffffca94c6bp-1, -0x1.202f41c987875p-57}, + Tab2Entry{0x1.f8fffe1f9c441p-1, 0x1.77dd1f477e74bp-56}, Tab2Entry{0x1.fafffd2e0e37ep-1, -0x1.f01199a7ca331p-57}, + Tab2Entry{0x1.fd0001c77e49ep-1, 0x1.181ee4bceacb1p-56}, Tab2Entry{0x1.feffff7e0c331p-1, -0x1.e05370170875ap-57}, + Tab2Entry{0x1.00ffff465606ep+0, -0x1.a7ead491c0adap-55}, Tab2Entry{0x1.02ffff3867a58p+0, -0x1.77f69c3fcb2ep-54}, + Tab2Entry{0x1.04ffffdfc0d17p+0, 0x1.7bffe34cb945bp-54}, Tab2Entry{0x1.0700003cd4d82p+0, 0x1.20083c0e456cbp-55}, + Tab2Entry{0x1.08ffff9f2cbe8p+0, -0x1.dffdfbe37751ap-57}, Tab2Entry{0x1.0b000010cda65p+0, -0x1.13f7faee626ebp-54}, + Tab2Entry{0x1.0d00001a4d338p+0, 0x1.07dfa79489ff7p-55}, Tab2Entry{0x1.0effffadafdfdp+0, -0x1.7040570d66bcp-56}, + Tab2Entry{0x1.110000bbafd96p+0, 0x1.e80d4846d0b62p-55}, Tab2Entry{0x1.12ffffae5f45dp+0, 0x1.dbffa64fd36efp-54}, + Tab2Entry{0x1.150000dd59ad9p+0, 0x1.a0077701250aep-54}, Tab2Entry{0x1.170000f21559ap+0, 0x1.dfdf9e2e3deeep-55}, + Tab2Entry{0x1.18ffffc275426p+0, 0x1.10030dc3b7273p-54}, Tab2Entry{0x1.1b000123d3c59p+0, 0x1.97f7980030188p-54}, + Tab2Entry{0x1.1cffff8299eb7p+0, -0x1.5f932ab9f8c67p-57}, Tab2Entry{0x1.1effff48ad4p+0, 0x1.37fbf9da75bebp-54}, + Tab2Entry{0x1.210000c8b86a4p+0, 0x1.f806b91fd5b22p-54}, Tab2Entry{0x1.2300003854303p+0, 0x1.3ffc2eb9fbf33p-54}, + Tab2Entry{0x1.24fffffbcf684p+0, 0x1.601e77e2e2e72p-56}, Tab2Entry{0x1.26ffff52921d9p+0, 0x1.ffcbb767f0c61p-56}, + Tab2Entry{0x1.2900014933a3cp+0, -0x1.202ca3c02412bp-56}, Tab2Entry{0x1.2b00014556313p+0, -0x1.2808233f21f02p-54}, + Tab2Entry{0x1.2cfffebfe523bp+0, -0x1.8ff7e384fdcf2p-55}, Tab2Entry{0x1.2f0000bb8ad96p+0, -0x1.5ff51503041c5p-55}, + Tab2Entry{0x1.30ffffb7ae2afp+0, -0x1.10071885e289dp-55}, Tab2Entry{0x1.32ffffeac5f7fp+0, -0x1.1ff5d3fb7b715p-54}, + Tab2Entry{0x1.350000ca66756p+0, 0x1.57f82228b82bdp-54}, Tab2Entry{0x1.3700011fbf721p+0, 0x1.000bac40dd5ccp-55}, + Tab2Entry{0x1.38ffff9592fb9p+0, -0x1.43f9d2db2a751p-54}, Tab2Entry{0x1.3b00004ddd242p+0, 0x1.57f6b707638e1p-55}, + Tab2Entry{0x1.3cffff5b2c957p+0, 0x1.a023a10bf1231p-56}, Tab2Entry{0x1.3efffeab0b418p+0, 0x1.87f6d66b152bp-54}, + Tab2Entry{0x1.410001532aff4p+0, 0x1.7f8375f198524p-57}, Tab2Entry{0x1.4300017478b29p+0, 0x1.301e672dc5143p-55}, + Tab2Entry{0x1.44fffe795b463p+0, 0x1.9ff69b8b2895ap-55}, Tab2Entry{0x1.46fffe80475ep+0, -0x1.5c0b19bc2f254p-54}, + Tab2Entry{0x1.48fffef6fc1e7p+0, 0x1.b4009f23a2a72p-54}, Tab2Entry{0x1.4afffe5bea704p+0, -0x1.4ffb7bf0d7d45p-54}, + Tab2Entry{0x1.4d000171027dep+0, -0x1.9c06471dc6a3dp-54}, Tab2Entry{0x1.4f0000ff03ee2p+0, 0x1.77f890b85531cp-54}, + Tab2Entry{0x1.5100012dc4bd1p+0, 0x1.004657166a436p-57}, Tab2Entry{0x1.530001605277ap+0, -0x1.6bfcece233209p-54}, + Tab2Entry{0x1.54fffecdb704cp+0, -0x1.902720505a1d7p-55}, Tab2Entry{0x1.56fffef5f54a9p+0, 0x1.bbfe60ec96412p-54}, + Tab2Entry{0x1.5900017e61012p+0, 0x1.87ec581afef9p-55}, Tab2Entry{0x1.5b00003c93e92p+0, -0x1.f41080abf0ccp-54}, + Tab2Entry{0x1.5d0001d4919bcp+0, -0x1.8812afb254729p-54}, Tab2Entry{0x1.5efffe7b87a89p+0, -0x1.47eb780ed6904p-54}, }; }; diff --git a/include/ccmath/math/misc/impl/gamma_data.hpp b/include/ccmath/math/misc/impl/gamma_data.hpp index 9367f74a..01b4fa64 100644 --- a/include/ccmath/math/misc/impl/gamma_data.hpp +++ b/include/ccmath/math/misc/impl/gamma_data.hpp @@ -22,8 +22,14 @@ namespace ccm::internal::impl::data // Polynomial approximating tgamma(d + 2.875) on [-0.5, 0.5] generated by // Sollya with: P = fpminimax(tgamma(x + 2.875), [|0,1,2,3,4,5,6,7|], [|D...|], [-0.5, 0.5]) - inline constexpr std::array k_gamma_coeffs = { 0x1.c9a76b7de6f60p+0, 0x1.8f2754874fe83p+0, 0x1.0d11cba0c229fp+0, 0x1.e1f47c012064dp-2, - 0x1.828b9f2afb74fp-3, 0x1.e1cc49d830795p-5, 0x1.2c9af3e686836p-6, 0x1.1bf60c7e311f6p-8 }; + inline constexpr std::array k_gamma_coeffs = {0x1.c9a76b7de6f60p+0, + 0x1.8f2754874fe83p+0, + 0x1.0d11cba0c229fp+0, + 0x1.e1f47c012064dp-2, + 0x1.828b9f2afb74fp-3, + 0x1.e1cc49d830795p-5, + 0x1.2c9af3e686836p-6, + 0x1.1bf60c7e311f6p-8}; inline constexpr double k_gamma_base = 0x1.7p+1; diff --git a/include/ccmath/math/misc/lerp.hpp b/include/ccmath/math/misc/lerp.hpp index 5fc61c2c..998b84fc 100644 --- a/include/ccmath/math/misc/lerp.hpp +++ b/include/ccmath/math/misc/lerp.hpp @@ -60,8 +60,8 @@ namespace ccm * \return Interpolated value in the common type of T, U, and V. */ template - constexpr std::enable_if_t && std::is_arithmetic_v && std::is_arithmetic_v, std::common_type_t> - lerp(T a, U b, V t) noexcept + constexpr std::enable_if_t && std::is_arithmetic_v && std::is_arithmetic_v, std::common_type_t> lerp(T a, U b, + V t) noexcept { using result_type = std::common_type_t; static_assert(!(std::is_same_v && std::is_same_v && std::is_same_v)); diff --git a/include/ccmath/math/nearest/nearbyint.hpp b/include/ccmath/math/nearest/nearbyint.hpp index 204d7ee8..77d86ae2 100644 --- a/include/ccmath/math/nearest/nearbyint.hpp +++ b/include/ccmath/math/nearest/nearbyint.hpp @@ -37,7 +37,7 @@ namespace ccm return ccm::rt::nearbyint_rt(num); } - constexpr auto rounding_mode{ ccm::support::fenv::get_rounding_mode() }; + constexpr auto rounding_mode{ccm::support::fenv::get_rounding_mode()}; return ccm::support::fp::directional_round(num, rounding_mode); } diff --git a/include/ccmath/math/nearest/rint.hpp b/include/ccmath/math/nearest/rint.hpp index cd008861..91a87c9d 100644 --- a/include/ccmath/math/nearest/rint.hpp +++ b/include/ccmath/math/nearest/rint.hpp @@ -37,7 +37,7 @@ namespace ccm return ccm::rt::rint_rt(num); } - constexpr auto rounding_mode{ ccm::support::fenv::get_rounding_mode() }; + constexpr auto rounding_mode{ccm::support::fenv::get_rounding_mode()}; return ccm::support::fp::directional_round(num, rounding_mode); } diff --git a/include/ccmath/math/power/hypot.hpp b/include/ccmath/math/power/hypot.hpp index 9aa100b1..2e15aff3 100644 --- a/include/ccmath/math/power/hypot.hpp +++ b/include/ccmath/math/power/hypot.hpp @@ -64,9 +64,7 @@ namespace ccm return ccm::hypot(ccm::hypot(x, y), z); } - template && std::is_arithmetic_v && std::is_arithmetic_v, bool> = true> constexpr auto hypot(Arithmetic1 x, Arithmetic2 y, Arithmetic3 z) noexcept { diff --git a/include/ccmath/math/power/pow.hpp b/include/ccmath/math/power/pow.hpp index 0f5161e5..25bc105a 100644 --- a/include/ccmath/math/power/pow.hpp +++ b/include/ccmath/math/power/pow.hpp @@ -26,8 +26,7 @@ namespace ccm::detail using left_type = cmath_pow_argument_t; using right_type = cmath_pow_argument_t; - using type = std::conditional_t || std::is_same_v, - long double, + using type = std::conditional_t || std::is_same_v, long double, std::conditional_t || std::is_same_v, double, float>>; }; @@ -83,8 +82,7 @@ namespace ccm * \param exp Exponent value. * \return base raised to exp in the promoted floating-point type. */ - template && std::is_arithmetic_v && !(std::is_floating_point_v && std::is_same_v, std::remove_cv_t>), bool> = true> diff --git a/include/ccmath/math/trig/impl/inv_trig_data.hpp b/include/ccmath/math/trig/impl/inv_trig_data.hpp index 3d1e0fa6..41506632 100644 --- a/include/ccmath/math/trig/impl/inv_trig_data.hpp +++ b/include/ccmath/math/trig/impl/inv_trig_data.hpp @@ -21,7 +21,17 @@ namespace ccm::internal::inv_trig_data // P(x^2) - 1 where P(x^2) approximates asin(x)/x on [0, 0.5]. inline constexpr std::array k_asin_coeffs = { - 0x1.555555555538p-3, 0x1.333333336fd5bp-4, 0x1.6db6db41ce4bcp-5, 0x1.f1c72c66896dep-6, 0x1.6e89f0a0ac64bp-6, 0x1.1c6c111de4074p-6, - 0x1.c6fa84b5699acp-7, 0x1.8ed60a3e6dd19p-7, 0x1.ab3a090750049p-8, 0x1.405213cd1ef46p-6, -0x1.0a5a381f73f65p-6, 0x1.05985a32a9045p-5, + 0x1.555555555538p-3, + 0x1.333333336fd5bp-4, + 0x1.6db6db41ce4bcp-5, + 0x1.f1c72c66896dep-6, + 0x1.6e89f0a0ac64bp-6, + 0x1.1c6c111de4074p-6, + 0x1.c6fa84b5699acp-7, + 0x1.8ed60a3e6dd19p-7, + 0x1.ab3a090750049p-8, + 0x1.405213cd1ef46p-6, + -0x1.0a5a381f73f65p-6, + 0x1.05985a32a9045p-5, }; } // namespace ccm::internal::inv_trig_data diff --git a/include/ccmath/math/trig/impl/sincos_double_data.hpp b/include/ccmath/math/trig/impl/sincos_double_data.hpp index 95d5e563..a8c177bd 100644 --- a/include/ccmath/math/trig/impl/sincos_double_data.hpp +++ b/include/ccmath/math/trig/impl/sincos_double_data.hpp @@ -21,14 +21,28 @@ namespace ccm::internal::sincos_double_data // sin(k * pi/8) for k = 0..15, correctly rounded to double. constexpr std::array SIN_K_PI_OVER_8 = { - 0.0, 0x1.87de2a6aea963p-2, 0x1.6a09e667f3bcdp-1, 0x1.d906bcf328d46p-1, 1.0, 0x1.d906bcf328d46p-1, 0x1.6a09e667f3bcdp-1, 0x1.87de2a6aea963p-2, - 0.0, -0x1.87de2a6aea963p-2, -0x1.6a09e667f3bcdp-1, -0x1.d906bcf328d46p-1, -1.0, -0x1.d906bcf328d46p-1, -0x1.6a09e667f3bcdp-1, -0x1.87de2a6aea963p-2, + 0.0, + 0x1.87de2a6aea963p-2, + 0x1.6a09e667f3bcdp-1, + 0x1.d906bcf328d46p-1, + 1.0, + 0x1.d906bcf328d46p-1, + 0x1.6a09e667f3bcdp-1, + 0x1.87de2a6aea963p-2, + 0.0, + -0x1.87de2a6aea963p-2, + -0x1.6a09e667f3bcdp-1, + -0x1.d906bcf328d46p-1, + -1.0, + -0x1.d906bcf328d46p-1, + -0x1.6a09e667f3bcdp-1, + -0x1.87de2a6aea963p-2, }; // Cody-Waite three-part -pi/8 for the small-range reduction. The high part has 31 significant // bits so k * MPI[0] is exact for |k| < 2^22, which covers the small-range threshold (|x| < 2^20, // |k| < 2^21.4). The lower parts carry pi/8 to ~115 bits total. - constexpr std::array MPI = { -0x1.921fb544p-2, -0x1.0b4611a8p-36, 0x1.d9cceba3f91f2p-68 }; + constexpr std::array MPI = {-0x1.921fb544p-2, -0x1.0b4611a8p-36, 0x1.d9cceba3f91f2p-68}; // Reciprocal of pi/8. The reduction computes k = round(x * 8/pi) from it. constexpr double EIGHT_OVER_PI = 0x1.45f306dc9c883p+1; @@ -46,7 +60,12 @@ namespace ccm::internal::sincos_double_data // cos(y) on [-pi/16, pi/16] = COS_POLY[0] + y^2 (COS_POLY[1] + ...). Sollya minimax, error ~2^-68. constexpr std::array COS_POLY = { - 0x1.0p0, -0x1.0p-1, 0x1.55555555554fp-5, -0x1.6c16c16b84c68p-10, 0x1.a019f88d4441ep-16, -0x1.27a8a5f9090d7p-22, + 0x1.0p0, + -0x1.0p-1, + 0x1.55555555554fp-5, + -0x1.6c16c16b84c68p-10, + 0x1.a019f88d4441ep-16, + -0x1.27a8a5f9090d7p-22, }; // Large-|x| reduction is handled by the shared Payne-Hanek path in sincos_payne_hanek.hpp. diff --git a/include/ccmath/math/trig/impl/sincos_float_data.hpp b/include/ccmath/math/trig/impl/sincos_float_data.hpp index 4d26940d..ddb74687 100644 --- a/include/ccmath/math/trig/impl/sincos_float_data.hpp +++ b/include/ccmath/math/trig/impl/sincos_float_data.hpp @@ -19,12 +19,26 @@ namespace ccm::internal::sincos_float_data { // sin(k * pi/8) for k = 0..15, generated by Sollya. constexpr std::array SIN_K_PI_OVER_8 = { - 0.0f, 0x1.87de2ap-2f, 0x1.6a09e6p-1f, 0x1.d906bcp-1f, 1.0f, 0x1.d906bcp-1f, 0x1.6a09e6p-1f, 0x1.87de2ap-2f, - 0.0f, -0x1.87de2ap-2f, -0x1.6a09e6p-1f, -0x1.d906bcp-1f, -1.0f, -0x1.d906bcp-1f, -0x1.6a09e6p-1f, -0x1.87de2ap-2f, + 0.0f, + 0x1.87de2ap-2f, + 0x1.6a09e6p-1f, + 0x1.d906bcp-1f, + 1.0f, + 0x1.d906bcp-1f, + 0x1.6a09e6p-1f, + 0x1.87de2ap-2f, + 0.0f, + -0x1.87de2ap-2f, + -0x1.6a09e6p-1f, + -0x1.d906bcp-1f, + -1.0f, + -0x1.d906bcp-1f, + -0x1.6a09e6p-1f, + -0x1.87de2ap-2f, }; // Cody-Waite three-part -pi/8 for the small-range reduction. - constexpr std::array MPI = { -0x1.921f8p-2f, -0x1.aa22p-21f, -0x1.68c234p-41f }; + constexpr std::array MPI = {-0x1.921f8p-2f, -0x1.aa22p-21f, -0x1.68c234p-41f}; // Reciprocal of pi/8. The reduction computes k = round(x * 8/pi) from it. constexpr float EIGHT_OVER_PI = 0x1.45f306p+1f; diff --git a/include/ccmath/math/trig/impl/sincos_payne_hanek.hpp b/include/ccmath/math/trig/impl/sincos_payne_hanek.hpp index b8273c2c..46002348 100644 --- a/include/ccmath/math/trig/impl/sincos_payne_hanek.hpp +++ b/include/ccmath/math/trig/impl/sincos_payne_hanek.hpp @@ -60,7 +60,7 @@ namespace ccm::internal::impl::sincos_ph const std::uint64_t mid = (ll >> 32) + (lh & 0xffffffffULL) + (hl & 0xffffffffULL); const std::uint64_t lo = (ll & 0xffffffffULL) | (mid << 32); const std::uint64_t hi = hh + (lh >> 32) + (hl >> 32) + (mid >> 32); - return U128{ hi, lo }; + return U128{hi, lo}; } // Add a 64-bit word into the 256-bit accumulator (acc[0] low .. acc[3] high) at limb word, @@ -127,7 +127,7 @@ namespace ccm::internal::impl::sincos_ph // acc holds (x * 8/pi) mod 16 scaled by 2^252: top 4 bits (255..252) are the integer mod 16, // the rest is the fraction. 8/pi = 2 + frac(8/pi). The integer part 2 contributes 2*x. - std::array acc = { 0ULL, 0ULL, 0ULL, 0ULL }; + std::array acc = {0ULL, 0ULL, 0ULL, 0ULL}; add_word_at(acc, mantissa, binary_exp + 1 + 252); for (int i = 0; i < 32; ++i) { diff --git a/showcase/common/accuracy/unary_mpfr_runner.hpp b/showcase/common/accuracy/unary_mpfr_runner.hpp index 23d32076..39c24182 100644 --- a/showcase/common/accuracy/unary_mpfr_runner.hpp +++ b/showcase/common/accuracy/unary_mpfr_runner.hpp @@ -79,7 +79,7 @@ namespace ccm::showcase::accuracy case unary_function::sqrt_fn: return ccm::showcase::ccmath_path::sqrt_is_supported(path); case unary_function::sin_fn : return ccm::showcase::ccmath_path::sin_is_supported(path); } - return { false, "unknown function" }; + return {false, "unknown function"}; } inline double invoke_ccmath_path(unary_function fn, ccm::showcase::ccmath_path::path path, double x) @@ -100,8 +100,8 @@ namespace ccm::showcase::accuracy std::uint64_t max_observed_ulp = 0; }; - inline int run_ccmath_path_campaign( - unary_function fn, ccm::showcase::ccmath_path::path path, mpfr_prec_t precision, std::uint64_t max_ulp, const std::optional & output_path) + inline int run_ccmath_path_campaign(unary_function fn, ccm::showcase::ccmath_path::path path, mpfr_prec_t precision, std::uint64_t max_ulp, + const std::optional & output_path) { const auto support = path_is_supported(fn, path); if (!support.supported) @@ -117,7 +117,7 @@ namespace ccm::showcase::accuracy for (const double input : cases) { - ccm::test::oracle::unary_case test_case{ input, "showcase corpus" }; + ccm::test::oracle::unary_case test_case{input, "showcase corpus"}; (void)ccm::test::oracle::evaluate_unary_mpfr_case( test_case, fn_label, @@ -167,7 +167,7 @@ namespace ccm::showcase::accuracy for (const double input : cases) { - ccm::test::oracle::unary_case test_case{ input, "showcase corpus" }; + ccm::test::oracle::unary_case test_case{input, "showcase corpus"}; (void)ccm::test::oracle::evaluate_unary_mpfr_case( test_case, fn_label, diff --git a/showcase/common/backend_traits.hpp b/showcase/common/backend_traits.hpp index f5845112..548fec18 100644 --- a/showcase/common/backend_traits.hpp +++ b/showcase/common/backend_traits.hpp @@ -7,13 +7,13 @@ namespace ccm::showcase { template concept RuntimeUnaryBackend = requires(double x) { - { Backend::label() }->std::convertible_to; - { Backend::eval(x) }->std::same_as; + {Backend::label()}->std::convertible_to; + {Backend::eval(x)}->std::same_as; }; template concept ConstexprUnaryBackend = requires(double x) { - { Backend::label() }->std::convertible_to; - { Backend::consteval_probe(x) }->std::same_as; + {Backend::label()}->std::convertible_to; + {Backend::consteval_probe(x)}->std::same_as; }; } // namespace ccm::showcase diff --git a/showcase/common/ccmath_paths.hpp b/showcase/common/ccmath_paths.hpp index ac38cc86..37589acf 100644 --- a/showcase/common/ccmath_paths.hpp +++ b/showcase/common/ccmath_paths.hpp @@ -77,21 +77,21 @@ namespace ccm::showcase::ccmath_path { case path::public_default: case path::generic_gen: - case path::runtime_rt : return { true, {} }; + case path::runtime_rt : return {true, {}}; case path::runtime_simd: #if defined(CCMATH_HAS_SIMD) - return { true, {} }; + return {true, {}}; #else - return { false, "runtime_simd requires CCMATH_HAS_SIMD" }; + return {false, "runtime_simd requires CCMATH_HAS_SIMD"}; #endif case path::runtime_builtin: #if CCM_HAS_BUILTIN(__builtin_sqrt) || defined(__builtin_sqrt) - return { true, {} }; + return {true, {}}; #else - return { false, "runtime_builtin requires __builtin_sqrt" }; + return {false, "runtime_builtin requires __builtin_sqrt"}; #endif } - return { false, "unknown path" }; + return {false, "unknown path"}; } inline path_support sin_is_supported(path value) @@ -100,21 +100,21 @@ namespace ccm::showcase::ccmath_path { case path::public_default: case path::generic_gen: - case path::runtime_rt : return { true, {} }; + case path::runtime_rt : return {true, {}}; case path::runtime_simd: #if defined(CCMATH_HAS_SIMD) && !(CCM_HAS_BUILTIN(__builtin_sin) || defined(__builtin_sin)) - return { true, {} }; + return {true, {}}; #else - return { false, "runtime_simd sin requires SIMD without a trusted sin builtin" }; + return {false, "runtime_simd sin requires SIMD without a trusted sin builtin"}; #endif case path::runtime_builtin: #if CCM_HAS_BUILTIN(__builtin_sin) || defined(__builtin_sin) - return { true, {} }; + return {true, {}}; #else - return { false, "runtime_builtin requires __builtin_sin" }; + return {false, "runtime_builtin requires __builtin_sin"}; #endif } - return { false, "unknown path" }; + return {false, "unknown path"}; } inline double invoke_sqrt(path value, double x) diff --git a/tests/conformance/fenv_disabled_test.cpp b/tests/conformance/fenv_disabled_test.cpp index 1826de77..89d0433a 100644 --- a/tests/conformance/fenv_disabled_test.cpp +++ b/tests/conformance/fenv_disabled_test.cpp @@ -44,7 +44,7 @@ TEST(CcmathFenvDisabledTests, RoundingModeIsPinnedToNearest) TEST(CcmathFenvDisabledTests, ExplicitExceptionSignalingIsNoOp) { - // The explicit ccmath entry points do nothing when the host fenv is unavailable. + // The explicit ccmath entry points do nothing when the host fenv is unavailable. EXPECT_EQ(fenv::raise_except_if_required(FE_OVERFLOW | FE_INVALID), 0); EXPECT_EQ(fenv::set_except_if_required(FE_INEXACT), 0); EXPECT_EQ(fenv::ccm_math_err_handling() & fenv::get_mode(fenv::ccm_math_err_mode::eErrnoExcept), 0); diff --git a/tests/conformance/pow_errno_fenv_test.cpp b/tests/conformance/pow_errno_fenv_test.cpp index ea072710..6bb81f9e 100644 --- a/tests/conformance/pow_errno_fenv_test.cpp +++ b/tests/conformance/pow_errno_fenv_test.cpp @@ -121,13 +121,13 @@ TEST(CcmathPowFenvTests, GenericPowfBaseTwoCorrectlyRoundedAtRangeThresholdsAllM constexpr float kMinSub = std::numeric_limits::denorm_min(); // 2^128 and 2^129 overflow. 2^-150 and below sit beneath the smallest subnormal 2^-149. - constexpr std::array kCases = { { - { 128.0F, kInf, kInf, kMax, kMax }, - { 129.0F, kInf, kInf, kMax, kMax }, - { -150.0F, 0.0F, kMinSub, 0.0F, 0.0F }, - { -151.0F, 0.0F, kMinSub, 0.0F, 0.0F }, - { -152.0F, 0.0F, kMinSub, 0.0F, 0.0F }, - } }; + constexpr std::array kCases = {{ + {128.0F, kInf, kInf, kMax, kMax}, + {129.0F, kInf, kInf, kMax, kMax}, + {-150.0F, 0.0F, kMinSub, 0.0F, 0.0F}, + {-151.0F, 0.0F, kMinSub, 0.0F, 0.0F}, + {-152.0F, 0.0F, kMinSub, 0.0F, 0.0F}, + }}; ccm::test::ForEachRoundingModeOrSkip([&](int mode) { for (const ThresholdCase & threshold : kCases) diff --git a/tests/conformance/pow_path_config_test.cpp b/tests/conformance/pow_path_config_test.cpp index a49ff377..981f52b9 100644 --- a/tests/conformance/pow_path_config_test.cpp +++ b/tests/conformance/pow_path_config_test.cpp @@ -17,8 +17,8 @@ namespace const auto report = ccm::test::pow_path::make_configuration_report(path); ccm::test::pow_path::print_configuration_banner(report); - const std::array bases = { static_cast(2), static_cast(0.5), static_cast(1.25) }; - const std::array exponents = { static_cast(3), static_cast(-2), static_cast(0.5) }; + const std::array bases = {static_cast(2), static_cast(0.5), static_cast(1.25)}; + const std::array exponents = {static_cast(3), static_cast(-2), static_cast(0.5)}; for (T base : bases) { diff --git a/tests/conformance/powl_platform_test.cpp b/tests/conformance/powl_platform_test.cpp index 916b2b1d..f0ab955d 100644 --- a/tests/conformance/powl_platform_test.cpp +++ b/tests/conformance/powl_platform_test.cpp @@ -26,8 +26,8 @@ TEST(PowlPlatform, CharacterizationSmoke) TEST(PowlPlatform, StdPowRegressionCorpus) { - const std::array bases = { 0.5L, 1.0L, 2.0L, 3.0L }; - const std::array exponents = { -1.0L, 0.5L, 2.0L, 3.0L }; + const std::array bases = {0.5L, 1.0L, 2.0L, 3.0L}; + const std::array exponents = {-1.0L, 0.5L, 2.0L, 3.0L}; for (long double base : bases) { for (long double exponent : exponents) diff --git a/tests/conformance/rounding_conformance_test.cpp b/tests/conformance/rounding_conformance_test.cpp index 1798ee4b..3950b96d 100644 --- a/tests/conformance/rounding_conformance_test.cpp +++ b/tests/conformance/rounding_conformance_test.cpp @@ -35,8 +35,15 @@ namespace // the host libm is most likely to disagree with the correctly rounded result under a directed // mode. Valid inputs for log, log2 and log10. constexpr std::array kLogDirectedProbes = { - 0x1.5fdffffffff32p-1, 0x1.921fb54442d18p+0, 0x1.5bf0a8b145769p+1, 0x1.62e42fefa39efp+2, 0x1.b7e151628aed3p+4, - 0x1.0000000000001p+0, 0x1.fffffffffffffp+9, 0x1.199999999999ap-7, 0x1.5fdffffffff32p+40, + 0x1.5fdffffffff32p-1, + 0x1.921fb54442d18p+0, + 0x1.5bf0a8b145769p+1, + 0x1.62e42fefa39efp+2, + 0x1.b7e151628aed3p+4, + 0x1.0000000000001p+0, + 0x1.fffffffffffffp+9, + 0x1.199999999999ap-7, + 0x1.5fdffffffff32p+40, }; // TODO(IanP): re-enable with the log1p directed-mode test once the generic log1p kernel meets the @@ -52,8 +59,16 @@ namespace // Finite magnitudes for exp and exp2 that stay well clear of overflow and underflow so the // result is a full-precision normal value rather than a saturated edge. constexpr std::array kExpDirectedProbes = { - -0x1.62e42fefa39efp+5, -0x1.5fdffffffff32p+4, -0x1.921fb54442d18p+0, -0x1.199999999999ap-7, 0x1.199999999999ap-7, - 0x1.5bf0a8b145769p+1, 0x1.921fb54442d18p+0, 0x1.5fdffffffff32p+4, 0x1.b7e151628aed3p+2, 0x1.62e42fefa39efp+5, + -0x1.62e42fefa39efp+5, + -0x1.5fdffffffff32p+4, + -0x1.921fb54442d18p+0, + -0x1.199999999999ap-7, + 0x1.199999999999ap-7, + 0x1.5bf0a8b145769p+1, + 0x1.921fb54442d18p+0, + 0x1.5fdffffffff32p+4, + 0x1.b7e151628aed3p+2, + 0x1.62e42fefa39efp+5, }; // The expo runtime headers route to the generic kernel outside FE_TONEAREST, because the libm diff --git a/tests/conformance/worst_case_ulp_test.cpp b/tests/conformance/worst_case_ulp_test.cpp index a4d9e3bc..cb5d82d2 100644 --- a/tests/conformance/worst_case_ulp_test.cpp +++ b/tests/conformance/worst_case_ulp_test.cpp @@ -160,11 +160,11 @@ TEST(CcmathWorstCaseUlpTests, PowFloatHard) TEST(CcmathWorstCaseUlpTests, PowLongDoubleHard) { - constexpr std::array, 3> kPowLongDoubleHard = { { - { 0x1.0p-50L, 0x1.0p+50L, "long-double-shaped alias of the legacy tiny-base / huge-exponent case" }, - { -1.0L, 3.0L, "long-double-shaped odd-integer sign regression anchor" }, - { -1.0L, 1.5L, "long-double-shaped non-integer domain regression anchor" }, - } }; + constexpr std::array, 3> kPowLongDoubleHard = {{ + {0x1.0p-50L, 0x1.0p+50L, "long-double-shaped alias of the legacy tiny-base / huge-exponent case"}, + {-1.0L, 3.0L, "long-double-shaped odd-integer sign regression anchor"}, + {-1.0L, 1.5L, "long-double-shaped non-integer domain regression anchor"}, + }}; ExpectWorstCaseBinaryPairsOver(kPowLongDoubleHard, ccm::powl, static_cast(std::pow)); } diff --git a/tests/proofs/math/power/pow_accuracy_probe.cpp b/tests/proofs/math/power/pow_accuracy_probe.cpp index 64dc00e3..1258219a 100644 --- a/tests/proofs/math/power/pow_accuracy_probe.cpp +++ b/tests/proofs/math/power/pow_accuracy_probe.cpp @@ -207,8 +207,8 @@ int main() print_stats("pow_gen random", double_generic); const auto long_double_suite = measure_grid( - std::array{ 0.25L, 0.5L, 1.0L, 2.0L, 3.0L, 4.0L, 10.0L, 14.0L }, - std::array{ -2.0L, -1.0L, -0.5L, 0.0L, 0.5L, 1.0L, 2.0L, 3.0L, 4.0L }, + std::array{0.25L, 0.5L, 1.0L, 2.0L, 3.0L, 4.0L, 10.0L, 14.0L}, + std::array{-2.0L, -1.0L, -0.5L, 0.0L, 0.5L, 1.0L, 2.0L, 3.0L, 4.0L}, [](long double base, long double exponent) { return ccm::powl(base, exponent); }, [](long double base, long double exponent) { return std::pow(base, exponent); }); print_stats("powl suite", long_double_suite); diff --git a/tests/shared/oracle/big_int_gmp.cpp b/tests/shared/oracle/big_int_gmp.cpp index 48a821fd..d6ffa784 100644 --- a/tests/shared/oracle/big_int_gmp.cpp +++ b/tests/shared/oracle/big_int_gmp.cpp @@ -81,28 +81,28 @@ namespace [[nodiscard]] std::vector build_unsigned_cases() { std::vector out; - const std::array, 11> patterns = { { - { 0ULL, 0ULL, 0ULL, 0ULL }, - { 1ULL, 0ULL, 0ULL, 0ULL }, - { std::numeric_limits::max(), - std::numeric_limits::max(), - std::numeric_limits::max(), - std::numeric_limits::max() }, - { std::numeric_limits::max(), 0ULL, 0ULL, 0ULL }, - { 0ULL, 0ULL, 0ULL, 0x8000000000000000ULL }, - { 0xAAAAAAAAAAAAAAAAULL, 0xAAAAAAAAAAAAAAAAULL, 0xAAAAAAAAAAAAAAAAULL, 0xAAAAAAAAAAAAAAAAULL }, - { 0x5555555555555555ULL, 0x5555555555555555ULL, 0x5555555555555555ULL, 0x5555555555555555ULL }, - { 0x001FFFFFFFFFFFFEULL, 0ULL, 0ULL, 0ULL }, - { 0x001FFFFFFFFFF000ULL, 0ULL, 0ULL, 0ULL }, - { 0xFEDCBA9876543210ULL, 0x0123456789ABCDEFULL, 0x0F0E0D0C0B0A0908ULL, 0x8070605040302010ULL }, - { 0xFFFFFFFF00000000ULL, 0x00000000FFFFFFFFULL, 0x7FFFFFFF80000000ULL, 0x800000007FFFFFFFULL }, - } }; + const std::array, 11> patterns = {{ + {0ULL, 0ULL, 0ULL, 0ULL}, + {1ULL, 0ULL, 0ULL, 0ULL}, + {std::numeric_limits::max(), + std::numeric_limits::max(), + std::numeric_limits::max(), + std::numeric_limits::max()}, + {std::numeric_limits::max(), 0ULL, 0ULL, 0ULL}, + {0ULL, 0ULL, 0ULL, 0x8000000000000000ULL}, + {0xAAAAAAAAAAAAAAAAULL, 0xAAAAAAAAAAAAAAAAULL, 0xAAAAAAAAAAAAAAAAULL, 0xAAAAAAAAAAAAAAAAULL}, + {0x5555555555555555ULL, 0x5555555555555555ULL, 0x5555555555555555ULL, 0x5555555555555555ULL}, + {0x001FFFFFFFFFFFFEULL, 0ULL, 0ULL, 0ULL}, + {0x001FFFFFFFFFF000ULL, 0ULL, 0ULL, 0ULL}, + {0xFEDCBA9876543210ULL, 0x0123456789ABCDEFULL, 0x0F0E0D0C0B0A0908ULL, 0x8070605040302010ULL}, + {0xFFFFFFFF00000000ULL, 0x00000000FFFFFFFFULL, 0x7FFFFFFF80000000ULL, 0x800000007FFFFFFFULL}, + }}; for (const auto & pattern : patterns) { out.push_back(make_big(pattern)); } - for (std::uint64_t seed : { 0x0123456789ABCDEFULL, 0xFEDCBA9876543210ULL, 0x9E3779B97F4A7C15ULL, 0xD1B54A32D192ED03ULL, 0x94D049BB133111EBULL }) + for (std::uint64_t seed : {0x0123456789ABCDEFULL, 0xFEDCBA9876543210ULL, 0x9E3779B97F4A7C15ULL, 0xD1B54A32D192ED03ULL, 0x94D049BB133111EBULL}) { out.push_back(make_big(generated_words(seed))); } @@ -112,29 +112,29 @@ namespace [[nodiscard]] std::vector build_signed_cases() { std::vector out; - const std::array, 9> patterns = { { - { 0ULL, 0ULL, 0ULL, 0ULL }, - { 1ULL, 0ULL, 0ULL, 0ULL }, - { std::numeric_limits::max(), - std::numeric_limits::max(), - std::numeric_limits::max(), - std::numeric_limits::max() }, - { 0ULL, 0ULL, 0ULL, 0x8000000000000000ULL }, - { 0xFFFFFFFFFFFFFFFEULL, - std::numeric_limits::max(), - std::numeric_limits::max(), - std::numeric_limits::max() }, - { 0x0123456789ABCDEFULL, 0x0FEDCBA987654321ULL, 0ULL, 0ULL }, - { 0x0123456789ABCDEFULL, 0x0FEDCBA987654321ULL, 0ULL, 0x8000000000000000ULL }, - { 0xAAAAAAAAAAAAAAAAULL, 0x5555555555555555ULL, 0xAAAAAAAAAAAAAAAAULL, 0xD555555555555555ULL }, - { 0x001FFFFFFFFFFFFEULL, 0x001FFFFFFFFFFFFEULL, 0ULL, 0x8000000000000000ULL }, - } }; + const std::array, 9> patterns = {{ + {0ULL, 0ULL, 0ULL, 0ULL}, + {1ULL, 0ULL, 0ULL, 0ULL}, + {std::numeric_limits::max(), + std::numeric_limits::max(), + std::numeric_limits::max(), + std::numeric_limits::max()}, + {0ULL, 0ULL, 0ULL, 0x8000000000000000ULL}, + {0xFFFFFFFFFFFFFFFEULL, + std::numeric_limits::max(), + std::numeric_limits::max(), + std::numeric_limits::max()}, + {0x0123456789ABCDEFULL, 0x0FEDCBA987654321ULL, 0ULL, 0ULL}, + {0x0123456789ABCDEFULL, 0x0FEDCBA987654321ULL, 0ULL, 0x8000000000000000ULL}, + {0xAAAAAAAAAAAAAAAAULL, 0x5555555555555555ULL, 0xAAAAAAAAAAAAAAAAULL, 0xD555555555555555ULL}, + {0x001FFFFFFFFFFFFEULL, 0x001FFFFFFFFFFFFEULL, 0ULL, 0x8000000000000000ULL}, + }}; for (const auto & pattern : patterns) { out.push_back(make_big(pattern)); } - for (std::uint64_t seed : { 0x2545F4914F6CDD1DULL, 0x94D049BB133111EBULL, 0xD1B54A32D192ED03ULL }) + for (std::uint64_t seed : {0x2545F4914F6CDD1DULL, 0x94D049BB133111EBULL, 0xD1B54A32D192ED03ULL}) { auto words = generated_words(seed); words.back() |= 0x8000000000000000ULL; @@ -254,19 +254,19 @@ int main() for (const auto & numerator : unsigned_cases) { const mpz_holder numerator_mpz = mpz_from_unsigned_big(numerator); - for (std::uint32_t divisor : { 1U, 3U, 5U, 0x7FFFFFFFU, 0x80000001U, 0xFFFFFFFFU }) + for (std::uint32_t divisor : {1U, 3U, 5U, 0x7FFFFFFFU, 0x80000001U, 0xFFFFFFFFU}) { - for (std::size_t shift : { std::size_t(0), - std::size_t(1), - std::size_t(31), - std::size_t(32), - std::size_t(63), - std::size_t(64), - std::size_t(95), - std::size_t(127), - std::size_t(191), - std::size_t(255), - std::size_t(320) }) + for (std::size_t shift : {std::size_t(0), + std::size_t(1), + std::size_t(31), + std::size_t(32), + std::size_t(63), + std::size_t(64), + std::size_t(95), + std::size_t(127), + std::size_t(191), + std::size_t(255), + std::size_t(320)}) { U256 quotient = numerator; const auto remainder = quotient.div_uint_half_times_pow_2(divisor, shift); diff --git a/tests/shared/oracle/coremath_oracle_harness.hpp b/tests/shared/oracle/coremath_oracle_harness.hpp index 2d81e224..91405b3b 100644 --- a/tests/shared/oracle/coremath_oracle_harness.hpp +++ b/tests/shared/oracle/coremath_oracle_harness.hpp @@ -10,19 +10,12 @@ namespace ccm::test::oracle { template - inline std::optional> evaluate_binary_coremath_case_in_mode(const pow_case & test_case, - std::string_view function_name, - std::string_view path_name, - int rounding_mode, - ActualFn actual_fn, - ReferenceFn reference_fn, - EligibilityFn is_reference_case_fn, - TruthFn matches_truth_fn, - run_summary & summary, - std::uint64_t seed = 0, - std::string_view search_mode = {}, - std::string_view mismatch_note = "bit-exact mismatch vs CORE-MATH reference", - std::vector> * event_log = nullptr) + inline std::optional> + evaluate_binary_coremath_case_in_mode(const pow_case & test_case, std::string_view function_name, std::string_view path_name, int rounding_mode, + ActualFn actual_fn, ReferenceFn reference_fn, EligibilityFn is_reference_case_fn, TruthFn matches_truth_fn, + run_summary & summary, std::uint64_t seed = 0, std::string_view search_mode = {}, + std::string_view mismatch_note = "bit-exact mismatch vs CORE-MATH reference", + std::vector> * event_log = nullptr) { if (!is_reference_case_fn(test_case.base, test_case.exponent)) { @@ -99,18 +92,10 @@ namespace ccm::test::oracle } template - inline void evaluate_binary_coremath_case_all_modes(const pow_case & test_case, - std::string_view function_name, - std::string_view path_name, - const std::vector & rounding_modes, - ActualFn actual_fn, - ReferenceFn reference_fn, - EligibilityFn is_reference_case_fn, - TruthFn matches_truth_fn, - run_summary & summary, - std::vector> & failures, - std::uint64_t seed = 0, - std::string_view search_mode = {}, + inline void evaluate_binary_coremath_case_all_modes(const pow_case & test_case, std::string_view function_name, std::string_view path_name, + const std::vector & rounding_modes, ActualFn actual_fn, ReferenceFn reference_fn, + EligibilityFn is_reference_case_fn, TruthFn matches_truth_fn, run_summary & summary, + std::vector> & failures, std::uint64_t seed = 0, std::string_view search_mode = {}, std::string_view mismatch_note = "bit-exact mismatch vs CORE-MATH reference", std::vector> * event_log = nullptr) { diff --git a/tests/shared/oracle/coremath_pow_cases.hpp b/tests/shared/oracle/coremath_pow_cases.hpp index d3466d93..98f2612b 100644 --- a/tests/shared/oracle/coremath_pow_cases.hpp +++ b/tests/shared/oracle/coremath_pow_cases.hpp @@ -15,11 +15,8 @@ namespace ccm::test::oracle::coremath_cases return pow_cases::build_double_cases(mode, seed, is_coremath_oracle_case); } - inline std::vector> build_float_cases(campaign_mode mode, - const std::set & domain_filter, - std::uint64_t seed, - std::vector & domains_covered, - std::vector & domains_skipped) + inline std::vector> build_float_cases(campaign_mode mode, const std::set & domain_filter, std::uint64_t seed, + std::vector & domains_covered, std::vector & domains_skipped) { return pow_cases::build_float_cases(mode, domain_filter, seed, domains_covered, domains_skipped, is_coremath_oracle_case); } diff --git a/tests/shared/oracle/coremath_pow_common.hpp b/tests/shared/oracle/coremath_pow_common.hpp index 3636085d..4ea1eb8b 100644 --- a/tests/shared/oracle/coremath_pow_common.hpp +++ b/tests/shared/oracle/coremath_pow_common.hpp @@ -114,15 +114,9 @@ namespace ccm::test::oracle } template - inline std::optional> evaluate_case_in_mode(const pow_case & test_case, - std::string_view function_name, - std::string_view path_name, - int rounding_mode, - Fn fn, - run_summary & summary, - std::uint64_t seed = 0, - std::string_view search_mode = {}, - std::vector> * event_log = nullptr) + inline std::optional> evaluate_case_in_mode(const pow_case & test_case, std::string_view function_name, std::string_view path_name, + int rounding_mode, Fn fn, run_summary & summary, std::uint64_t seed = 0, + std::string_view search_mode = {}, std::vector> * event_log = nullptr) { return evaluate_binary_coremath_case_in_mode( test_case, @@ -141,16 +135,9 @@ namespace ccm::test::oracle } template - inline void evaluate_case_all_modes(const pow_case & test_case, - std::string_view function_name, - std::string_view path_name, - const std::vector & rounding_modes, - Fn fn, - run_summary & summary, - std::vector> & failures, - std::uint64_t seed = 0, - std::string_view search_mode = {}, - std::vector> * event_log = nullptr) + inline void evaluate_case_all_modes(const pow_case & test_case, std::string_view function_name, std::string_view path_name, + const std::vector & rounding_modes, Fn fn, run_summary & summary, std::vector> & failures, + std::uint64_t seed = 0, std::string_view search_mode = {}, std::vector> * event_log = nullptr) { evaluate_binary_coremath_case_all_modes( test_case, diff --git a/tests/shared/oracle/cross_libm_common.hpp b/tests/shared/oracle/cross_libm_common.hpp index 319a6d55..d0569d7f 100644 --- a/tests/shared/oracle/cross_libm_common.hpp +++ b/tests/shared/oracle/cross_libm_common.hpp @@ -41,22 +41,22 @@ namespace ccm::test::oracle::cross_libm inline std::vector detect_backends() { std::vector backends; - backends.push_back({ "std_pow", "std::pow", true }); - backends.push_back({ "platform_libm", platform_libm_label(), true }); + backends.push_back({"std_pow", "std::pow", true}); + backends.push_back({"platform_libm", platform_libm_label(), true}); #ifdef CCMATH_CROSS_LIBM_OPENLIBM - backends.push_back({ "openlibm", "OpenLibm", true }); + backends.push_back({"openlibm", "OpenLibm", true}); #else - backends.push_back({ "openlibm", "OpenLibm", false }); + backends.push_back({"openlibm", "OpenLibm", false}); #endif #ifdef CCMATH_CROSS_LIBM_SLEEF - backends.push_back({ "sleef", "SLEEF", true }); + backends.push_back({"sleef", "SLEEF", true}); #else - backends.push_back({ "sleef", "SLEEF", false }); + backends.push_back({"sleef", "SLEEF", false}); #endif #ifdef CCMATH_CROSS_LIBM_LLVM_LIBC - backends.push_back({ "llvm_libc", "LLVM libc", true }); + backends.push_back({"llvm_libc", "LLVM libc", true}); #else - backends.push_back({ "llvm_libc", "LLVM libc", false }); + backends.push_back({"llvm_libc", "LLVM libc", false}); #endif return backends; } diff --git a/tests/shared/oracle/cross_libm_pow.cpp b/tests/shared/oracle/cross_libm_pow.cpp index 2ca58aad..3c6b2094 100644 --- a/tests/shared/oracle/cross_libm_pow.cpp +++ b/tests/shared/oracle/cross_libm_pow.cpp @@ -26,15 +26,15 @@ namespace std::vector cases; for (const auto & hard : ccm::test::worst_case::kPowDoubleHard) { - cases.push_back({ hard.base, hard.exponent, {} }); + cases.push_back({hard.base, hard.exponent, {}}); } if (corpus == "extended") { - for (double base : { 0.5, 1.0, 2.0, -2.0, 1e-300, 1e300 }) + for (double base : {0.5, 1.0, 2.0, -2.0, 1e-300, 1e300}) { - for (double exponent : { -3.0, -0.5, 0.0, 0.5, 2.0, 10.0 }) + for (double exponent : {-3.0, -0.5, 0.0, 0.5, 2.0, 10.0}) { - cases.push_back({ base, exponent, {} }); + cases.push_back({base, exponent, {}}); } } } diff --git a/tests/shared/oracle/mpfr_fma_common.hpp b/tests/shared/oracle/mpfr_fma_common.hpp index 62c08d50..abd9364f 100644 --- a/tests/shared/oracle/mpfr_fma_common.hpp +++ b/tests/shared/oracle/mpfr_fma_common.hpp @@ -144,33 +144,33 @@ namespace ccm::test::oracle::fma_oracle { for (const auto & input : ccm::test::samples::kFmaFloatCases) { - cases.push_back({ input.x, input.y, input.z, "structured regression corpus" }); + cases.push_back({input.x, input.y, input.z, "structured regression corpus"}); } } else { for (const auto & input : ccm::test::samples::kFmaDoubleCases) { - cases.push_back({ input.x, input.y, input.z, "structured regression corpus" }); + cases.push_back({input.x, input.y, input.z, "structured regression corpus"}); } } const T one = static_cast(1); const T next_up = std::nextafter(one, std::numeric_limits::infinity()); const T next_down = std::nextafter(one, static_cast(0)); - cases.push_back({ next_up, next_up, -one, "near-unity cancellation above 1" }); - cases.push_back({ next_down, next_down, -one, "near-unity cancellation below 1" }); - cases.push_back({ next_down, next_up, -one, "mixed-neighbor near-unity cancellation" }); + cases.push_back({next_up, next_up, -one, "near-unity cancellation above 1"}); + cases.push_back({next_down, next_down, -one, "near-unity cancellation below 1"}); + cases.push_back({next_down, next_up, -one, "mixed-neighbor near-unity cancellation"}); const T min_normal = std::numeric_limits::min(); const T min_subnormal = std::numeric_limits::denorm_min(); if constexpr (std::is_same_v) { - cases.push_back({ min_normal, 0x1.0p-23F, -min_subnormal, "float exact subnormal cancellation" }); - cases.push_back({ min_normal, 0x1.0p-24F, -min_subnormal, "float sticky-bit underflow boundary" }); + cases.push_back({min_normal, 0x1.0p-23F, -min_subnormal, "float exact subnormal cancellation"}); + cases.push_back({min_normal, 0x1.0p-24F, -min_subnormal, "float sticky-bit underflow boundary"}); } else { - cases.push_back({ min_normal, 0x1.0p-52, -min_subnormal, "double exact subnormal cancellation" }); - cases.push_back({ min_normal, 0x1.0p-53, -min_subnormal, "double sticky-bit underflow boundary" }); + cases.push_back({min_normal, 0x1.0p-52, -min_subnormal, "double exact subnormal cancellation"}); + cases.push_back({min_normal, 0x1.0p-53, -min_subnormal, "double sticky-bit underflow boundary"}); } } @@ -195,14 +195,14 @@ namespace ccm::test::oracle::fma_oracle { for (T z : values) { - cases.push_back({ x, y, z, "special-value matrix" }); + cases.push_back({x, y, z, "special-value matrix"}); } } } - cases.push_back({ std::numeric_limits::quiet_NaN(), static_cast(1), static_cast(1), "quiet NaN multiplicand" }); - cases.push_back({ static_cast(1), std::numeric_limits::quiet_NaN(), static_cast(1), "quiet NaN multiplier" }); - cases.push_back({ static_cast(1), static_cast(1), std::numeric_limits::quiet_NaN(), "quiet NaN addend" }); + cases.push_back({std::numeric_limits::quiet_NaN(), static_cast(1), static_cast(1), "quiet NaN multiplicand"}); + cases.push_back({static_cast(1), std::numeric_limits::quiet_NaN(), static_cast(1), "quiet NaN multiplier"}); + cases.push_back({static_cast(1), static_cast(1), std::numeric_limits::quiet_NaN(), "quiet NaN addend"}); } template inline void append_random_cases(std::vector> & cases, campaign_mode mode, std::uint64_t seed) diff --git a/tests/shared/oracle/mpfr_oracle_harness.hpp b/tests/shared/oracle/mpfr_oracle_harness.hpp index 94120a9b..0070075d 100644 --- a/tests/shared/oracle/mpfr_oracle_harness.hpp +++ b/tests/shared/oracle/mpfr_oracle_harness.hpp @@ -163,23 +163,13 @@ namespace ccm::test::oracle } template - inline std::optional> evaluate_binary_mpfr_case(const pow_case & test_case, - std::string_view function_name, - std::string_view path_name, - ccm::test::pow_path::validation_path path, - ActualFn actual_fn, - ReferenceFn reference_fn, - ExceptionalReferenceFn exceptional_reference_fn, - UsesFullOracleFn uses_full_oracle_fn, - SkipReasonFn skip_reason_fn, - mpfr_prec_t oracle_precision, - std::uint64_t max_ulp, - run_summary & summary, - std::uint64_t target_ulp = 0, - std::uint64_t seed = 0, - std::string_view search_mode = {}, - std::string_view mismatch_note = "exceptional mismatch vs std reference", - std::vector> * event_log = nullptr) + inline std::optional> + evaluate_binary_mpfr_case(const pow_case & test_case, std::string_view function_name, std::string_view path_name, + ccm::test::pow_path::validation_path path, ActualFn actual_fn, ReferenceFn reference_fn, + ExceptionalReferenceFn exceptional_reference_fn, UsesFullOracleFn uses_full_oracle_fn, SkipReasonFn skip_reason_fn, + mpfr_prec_t oracle_precision, std::uint64_t max_ulp, run_summary & summary, std::uint64_t target_ulp = 0, + std::uint64_t seed = 0, std::string_view search_mode = {}, + std::string_view mismatch_note = "exceptional mismatch vs std reference", std::vector> * event_log = nullptr) { if (const auto skip = skip_reason_fn(path, test_case.base, test_case.exponent)) { @@ -363,19 +353,9 @@ namespace ccm::test::oracle } template - inline ternary_failure_record make_ternary_failure_record(std::string_view function_name, - std::string_view path, - std::string_view provenance, - T x, - T y, - T z, - T actual, - T expected, - std::uint64_t ulp_distance, - unsigned long oracle_precision, - std::uint64_t seed, - std::string_view notes, - std::string_view event_kind = "mpfr_hard_failure") + inline ternary_failure_record make_ternary_failure_record(std::string_view function_name, std::string_view path, std::string_view provenance, T x, T y, + T z, T actual, T expected, std::uint64_t ulp_distance, unsigned long oracle_precision, + std::uint64_t seed, std::string_view notes, std::string_view event_kind = "mpfr_hard_failure") { return ternary_failure_record{ std::string(function_name), @@ -409,17 +389,10 @@ namespace ccm::test::oracle } template - inline std::optional> evaluate_ternary_mpfr_case(const ternary_case & test_case, - std::string_view function_name, - std::string_view path_name, - ActualFn actual_fn, - ReferenceFn reference_fn, - ExceptionalReferenceFn exceptional_reference_fn, - mpfr_prec_t oracle_precision, - std::uint64_t max_ulp, - std::uint64_t seed, - ternary_run_summary & summary, - std::string_view mismatch_note = "exceptional mismatch vs std reference") + inline std::optional> + evaluate_ternary_mpfr_case(const ternary_case & test_case, std::string_view function_name, std::string_view path_name, ActualFn actual_fn, + ReferenceFn reference_fn, ExceptionalReferenceFn exceptional_reference_fn, mpfr_prec_t oracle_precision, std::uint64_t max_ulp, + std::uint64_t seed, ternary_run_summary & summary, std::string_view mismatch_note = "exceptional mismatch vs std reference") { ++summary.case_count; @@ -537,17 +510,9 @@ namespace ccm::test::oracle } template - inline unary_failure_record make_unary_failure_record(std::string_view function_name, - std::string_view path, - std::string_view provenance, - T input, - T actual, - T expected, - std::uint64_t ulp_distance, - unsigned long oracle_precision, - std::uint64_t seed, - std::string_view notes, - std::string_view event_kind = "mpfr_hard_failure") + inline unary_failure_record make_unary_failure_record(std::string_view function_name, std::string_view path, std::string_view provenance, T input, + T actual, T expected, std::uint64_t ulp_distance, unsigned long oracle_precision, + std::uint64_t seed, std::string_view notes, std::string_view event_kind = "mpfr_hard_failure") { return unary_failure_record{ std::string(function_name), @@ -576,19 +541,12 @@ namespace ccm::test::oracle } template - inline std::optional> evaluate_unary_mpfr_case(const unary_case & test_case, - std::string_view function_name, - std::string_view path_name, - ActualFn actual_fn, - ReferenceFn reference_fn, - ExceptionalReferenceFn exceptional_reference_fn, - mpfr_prec_t oracle_precision, - std::uint64_t max_ulp, - std::uint64_t seed, - unary_run_summary & summary, - std::uint64_t target_ulp = 0, - std::string_view mismatch_note = "exceptional mismatch vs std reference", - std::vector> * event_log = nullptr) + inline std::optional> + evaluate_unary_mpfr_case(const unary_case & test_case, std::string_view function_name, std::string_view path_name, ActualFn actual_fn, + ReferenceFn reference_fn, ExceptionalReferenceFn exceptional_reference_fn, mpfr_prec_t oracle_precision, std::uint64_t max_ulp, + std::uint64_t seed, unary_run_summary & summary, std::uint64_t target_ulp = 0, + std::string_view mismatch_note = "exceptional mismatch vs std reference", + std::vector> * event_log = nullptr) { ++summary.case_count; diff --git a/tests/shared/oracle/mpfr_pow_common.hpp b/tests/shared/oracle/mpfr_pow_common.hpp index d289a0e7..6a750178 100644 --- a/tests/shared/oracle/mpfr_pow_common.hpp +++ b/tests/shared/oracle/mpfr_pow_common.hpp @@ -78,18 +78,10 @@ namespace ccm::test::oracle } template - inline std::optional> evaluate_case(const pow_case & test_case, - std::string_view function_name, - std::string_view path_name, - ccm::test::pow_path::validation_path path, - Fn fn, - mpfr_prec_t oracle_precision, - std::uint64_t max_ulp, - run_summary & summary, - std::uint64_t target_ulp = 0, - std::uint64_t seed = 0, - std::string_view search_mode = {}, - std::vector> * event_log = nullptr) + inline std::optional> evaluate_case(const pow_case & test_case, std::string_view function_name, std::string_view path_name, + ccm::test::pow_path::validation_path path, Fn fn, mpfr_prec_t oracle_precision, std::uint64_t max_ulp, + run_summary & summary, std::uint64_t target_ulp = 0, std::uint64_t seed = 0, + std::string_view search_mode = {}, std::vector> * event_log = nullptr) { return evaluate_binary_mpfr_case( test_case, diff --git a/tests/shared/oracle/mpfr_powl.cpp b/tests/shared/oracle/mpfr_powl.cpp index 671037da..a4294d20 100644 --- a/tests/shared/oracle/mpfr_powl.cpp +++ b/tests/shared/oracle/mpfr_powl.cpp @@ -16,14 +16,14 @@ namespace std::vector> build_ld64_cases() { - const std::array bases = { 0.25L, 0.5L, 1.0L, 2.0L, 3.0L, 10.0L }; - const std::array exponents = { -2.0L, -0.5L, 0.0L, 0.5L, 2.0L, 3.0L }; + const std::array bases = {0.25L, 0.5L, 1.0L, 2.0L, 3.0L, 10.0L}; + const std::array exponents = {-2.0L, -0.5L, 0.0L, 0.5L, 2.0L, 3.0L}; std::vector> cases; for (long double base : bases) { for (long double exponent : exponents) { - cases.push_back({ base, exponent, "ld64 conservative oracle grid" }); + cases.push_back({base, exponent, "ld64 conservative oracle grid"}); } } return cases; @@ -34,17 +34,33 @@ namespace { std::vector> cases; const std::array special_bases = { - -std::numeric_limits::infinity(), -2.0L, -1.0L, -0.0L, 0.0L, 1.0L, 2.0L, 10.0L, std::numeric_limits::max(), + -std::numeric_limits::infinity(), + -2.0L, + -1.0L, + -0.0L, + 0.0L, + 1.0L, + 2.0L, + 10.0L, + std::numeric_limits::max(), std::numeric_limits::infinity(), }; const std::array special_exponents = { - -std::numeric_limits::infinity(), -3.0L, -1.0L, -0.0L, 0.0L, 0.5L, 2.0L, 3.0L, std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -3.0L, + -1.0L, + -0.0L, + 0.0L, + 0.5L, + 2.0L, + 3.0L, + std::numeric_limits::infinity(), }; for (long double base : special_bases) { for (long double exponent : special_exponents) { - cases.push_back({ base, exponent, "ld80 special-value matrix" }); + cases.push_back({base, exponent, "ld80 special-value matrix"}); } } return cases; @@ -53,16 +69,16 @@ namespace std::vector> build_ld80_bounded_integer_cases() { std::vector> cases; - for (long double base : { 0.5L, 1.0001L, 2.0L, -2.0L, 10.0L }) + for (long double base : {0.5L, 1.0001L, 2.0L, -2.0L, 10.0L}) { - for (long double exponent : { -1000.0L, -3.0L, -1.0L, 0.0L, 1.0L, 3.0L, 10.0L, 1000.0L, 0x1.0p40L }) + for (long double exponent : {-1000.0L, -3.0L, -1.0L, 0.0L, 1.0L, 3.0L, 10.0L, 1000.0L, 0x1.0p40L}) { - cases.push_back({ base, exponent, "ld80 bounded integer exponent corpus" }); + cases.push_back({base, exponent, "ld80 bounded integer exponent corpus"}); } } - for (long double exponent : { 0x1.0p62L, 0x1.0000000000001p62L, 0x1.0p63L }) + for (long double exponent : {0x1.0p62L, 0x1.0000000000001p62L, 0x1.0p63L}) { - cases.push_back({ -1.0L, exponent, "ld80 parity threshold corpus" }); + cases.push_back({-1.0L, exponent, "ld80 parity threshold corpus"}); } return cases; } @@ -70,20 +86,20 @@ namespace std::vector> build_ld80_general_finite_cases() { std::vector> cases; - for (long double base : { 0.999L, 1.001L, 0.5L, 2.0L, 8.0L, 0x1.0p-20L, 0x1.0p20L }) + for (long double base : {0.999L, 1.001L, 0.5L, 2.0L, 8.0L, 0x1.0p-20L, 0x1.0p20L}) { - for (long double exponent : { -1000.0L, -0.5L, 0.25L, 2.0L, 1000.0L }) + for (long double exponent : {-1000.0L, -0.5L, 0.25L, 2.0L, 1000.0L}) { if (base == 1.0L) { continue; } - cases.push_back({ base, exponent, "ld80 general finite structured grid" }); + cases.push_back({base, exponent, "ld80 general finite structured grid"}); } } - for (long double exponent : { 0x1.0p40L, 0x1.0p-40L, 16300.0L, -16300.0L }) + for (long double exponent : {0x1.0p40L, 0x1.0p-40L, 16300.0L, -16300.0L}) { - cases.push_back({ 1.0000001L, exponent, "ld80 general finite exponent stress" }); + cases.push_back({1.0000001L, exponent, "ld80 general finite exponent stress"}); } return cases; } @@ -267,13 +283,8 @@ namespace out << "}\n"; } - powl_campaign_report run_corpus(const std::string & corpus_name, - const std::vector> & cases, - const std::vector & rounding_modes, - ccm::config::LongDoubleFormat format, - mpfr_prec_t precision, - std::uint64_t max_ulp, - std::uint64_t target_ulp) + powl_campaign_report run_corpus(const std::string & corpus_name, const std::vector> & cases, const std::vector & rounding_modes, + ccm::config::LongDoubleFormat format, mpfr_prec_t precision, std::uint64_t max_ulp, std::uint64_t target_ulp) { powl_campaign_report report; report.format = format; diff --git a/tests/shared/oracle/mpfr_unary.cpp b/tests/shared/oracle/mpfr_unary.cpp index b888214e..5fe38e5b 100644 --- a/tests/shared/oracle/mpfr_unary.cpp +++ b/tests/shared/oracle/mpfr_unary.cpp @@ -72,15 +72,8 @@ namespace // measured: the generic kernel (default), the public ccmath path, or the system libm. The MPFR // reference and the exceptional libm cross-check are unaffected by the choice. template - int run_standard(int argc, - char ** argv, - std::string_view name, - GenFn gen_scalar, - PublicFn public_scalar, - oracle::mpfr_unary_op op, - StdFn std_scalar, - domain dom, - oracle::function_family family) + int run_standard(int argc, char ** argv, std::string_view name, GenFn gen_scalar, PublicFn public_scalar, oracle::mpfr_unary_op op, StdFn std_scalar, + domain dom, oracle::function_family family) { const oracle::impl_kind impl = oracle::parse_impl(argc, argv); return oracle::run_campaign( @@ -99,7 +92,7 @@ namespace oracle::make_unary_ref(op), [std_scalar](const std::array & inputs) { return std_scalar(inputs[0]); }, [dom](std::uint64_t seed, std::size_t count) { return oracle::build_unary_corpus(dom, seed, count); }, - std::array{ dom }, + std::array{dom}, oracle::unary_structured_seed(std_scalar, family), oracle::impl_token(impl)); } @@ -116,7 +109,7 @@ namespace [](T x) { return ccm::exp(ccm::test::runtime_value(x)); }, mpfr_exp, [](T x) { return std::exp(x); }, - domain{ -745.0, 710.0 }, + domain{-745.0, 710.0}, oracle::function_family::exp); } if (function == "exp2") @@ -129,7 +122,7 @@ namespace [](T x) { return ccm::exp2(ccm::test::runtime_value(x)); }, mpfr_exp2, [](T x) { return std::exp2(x); }, - domain{ -1100.0, 1030.0 }, + domain{-1100.0, 1030.0}, oracle::function_family::exp); } if (function == "expm1") @@ -142,7 +135,7 @@ namespace [](T x) { return ccm::expm1(ccm::test::runtime_value(x)); }, mpfr_expm1, [](T x) { return std::expm1(x); }, - domain{ -50.0, 710.0 }, + domain{-50.0, 710.0}, oracle::function_family::exp); } if (function == "log") @@ -155,7 +148,7 @@ namespace [](T x) { return ccm::log(ccm::test::runtime_value(x)); }, mpfr_log, [](T x) { return std::log(x); }, - domain{ 0.0, kInf, true }, + domain{0.0, kInf, true}, oracle::function_family::logarithm); } if (function == "log1p") @@ -168,7 +161,7 @@ namespace [](T x) { return ccm::log1p(ccm::test::runtime_value(x)); }, mpfr_log1p, [](T x) { return std::log1p(x); }, - domain{ -1.0, kInf, true }, + domain{-1.0, kInf, true}, oracle::function_family::logarithm); } if (function == "log2") @@ -181,7 +174,7 @@ namespace [](T x) { return ccm::log2(ccm::test::runtime_value(x)); }, mpfr_log2, [](T x) { return std::log2(x); }, - domain{ 0.0, kInf, true }, + domain{0.0, kInf, true}, oracle::function_family::logarithm); } if (function == "log10") @@ -194,7 +187,7 @@ namespace [](T x) { return ccm::log10(ccm::test::runtime_value(x)); }, mpfr_log10, [](T x) { return std::log10(x); }, - domain{ 0.0, kInf, true }, + domain{0.0, kInf, true}, oracle::function_family::logarithm); } if (function == "sin") @@ -207,7 +200,7 @@ namespace [](T x) { return ccm::sin(ccm::test::runtime_value(x)); }, mpfr_sin, [](T x) { return std::sin(x); }, - domain{ -kInf, kInf, true }, + domain{-kInf, kInf, true}, oracle::function_family::trig); } if (function == "cos") @@ -220,7 +213,7 @@ namespace [](T x) { return ccm::cos(ccm::test::runtime_value(x)); }, mpfr_cos, [](T x) { return std::cos(x); }, - domain{ -kInf, kInf, true }, + domain{-kInf, kInf, true}, oracle::function_family::trig); } if (function == "tan") @@ -233,7 +226,7 @@ namespace [](T x) { return ccm::tan(ccm::test::runtime_value(x)); }, mpfr_tan, [](T x) { return std::tan(x); }, - domain{ -kInf, kInf, true }, + domain{-kInf, kInf, true}, oracle::function_family::trig); } if (function == "asin") @@ -254,7 +247,7 @@ namespace [](T x) { return ccm::asin(ccm::test::runtime_value(x)); }, mpfr_asin, [](T x) { return std::asin(x); }, - domain{ -1.0, 1.0 }, + domain{-1.0, 1.0}, oracle::function_family::inverse_trig); } if (function == "acos") @@ -275,7 +268,7 @@ namespace [](T x) { return ccm::acos(ccm::test::runtime_value(x)); }, mpfr_acos, [](T x) { return std::acos(x); }, - domain{ -1.0, 1.0 }, + domain{-1.0, 1.0}, oracle::function_family::inverse_trig); } if (function == "atan") @@ -296,7 +289,7 @@ namespace [](T x) { return ccm::atan(ccm::test::runtime_value(x)); }, mpfr_atan, [](T x) { return std::atan(x); }, - domain{ -kInf, kInf, true }, + domain{-kInf, kInf, true}, oracle::function_family::inverse_trig); } if (function == "cbrt") @@ -309,7 +302,7 @@ namespace [](T x) { return ccm::cbrt(ccm::test::runtime_value(x)); }, mpfr_cbrt, [](T x) { return std::cbrt(x); }, - domain{ -kInf, kInf, true }, + domain{-kInf, kInf, true}, oracle::function_family::power); } if (function == "sqrt") @@ -322,7 +315,7 @@ namespace [](T x) { return ccm::sqrt(ccm::test::runtime_value(x)); }, mpfr_sqrt, [](T x) { return std::sqrt(x); }, - domain{ 0.0, kInf, true }, + domain{0.0, kInf, true}, oracle::function_family::power); } if (function == "tgamma") @@ -343,7 +336,7 @@ namespace [](T x) { return ccm::tgamma(ccm::test::runtime_value(x)); }, mpfr_gamma, [](T x) { return std::tgamma(x); }, - domain{ -20.0, 171.0 }, + domain{-20.0, 171.0}, oracle::function_family::gamma); } if (function == "lgamma") @@ -370,8 +363,8 @@ namespace }, oracle::make_lgamma_ref(), [](const std::array & inputs) { return std::lgamma(inputs[0]); }, - [](std::uint64_t seed, std::size_t count) { return oracle::build_unary_corpus(domain{ -50.0, kInf, true }, seed, count); }, - std::array{ domain{ -50.0, kInf, true } }, + [](std::uint64_t seed, std::size_t count) { return oracle::build_unary_corpus(domain{-50.0, kInf, true}, seed, count); }, + std::array{domain{-50.0, kInf, true}}, oracle::unary_structured_seed([](T x) { return std::lgamma(x); }, oracle::function_family::gamma), oracle::impl_token(impl)); } @@ -394,7 +387,7 @@ namespace oracle::make_pow_ref(), [](const std::array & inputs) { return std::pow(inputs[0], inputs[1]); }, [](std::uint64_t seed, std::size_t count) { return oracle::build_pow_corpus(seed, count); }, - std::array{ domain{ -kInf, kInf, true }, domain{ -kInf, kInf, true } }, + std::array{domain{-kInf, kInf, true}, domain{-kInf, kInf, true}}, oracle::pow_special_matrix(), oracle::impl_token(impl)); } diff --git a/tests/shared/oracle/mpfr_unary_common.hpp b/tests/shared/oracle/mpfr_unary_common.hpp index 2fd6b3ab..9c729aee 100644 --- a/tests/shared/oracle/mpfr_unary_common.hpp +++ b/tests/shared/oracle/mpfr_unary_common.hpp @@ -253,15 +253,8 @@ namespace ccm::test::oracle::unary_oracle // Exceptional and zero results are matched against libm or MPFR rather than scored as a ULP // distance, exactly as the per-arity evaluators in the shared harness do. template - inline void evaluate_case(const std::array & inputs, - KernelFn kernel, - RefFn reference, - StdFn std_reference, - mpfr_prec_t precision, - mpfr_rnd_t rounding, - std::uint64_t max_ulp, - campaign_summary & summary, - threshold_recorder * recorder) + inline void evaluate_case(const std::array & inputs, KernelFn kernel, RefFn reference, StdFn std_reference, mpfr_prec_t precision, + mpfr_rnd_t rounding, std::uint64_t max_ulp, campaign_summary & summary, threshold_recorder * recorder) { ++summary.case_count; const T actual = kernel(inputs); @@ -587,7 +580,7 @@ namespace ccm::test::oracle::unary_oracle add(static_cast(k) * 1.57079632679489661923); add(-static_cast(k) * 1.57079632679489661923); } - for (int e : { 10, 16, 20, 23, 30, 40, 50, 60, 80, 100 }) + for (int e : {10, 16, 20, 23, 30, 40, 50, 60, 80, 100}) { add(std::ldexp(1.57079632679489661923, e)); add(std::ldexp(1.0, e)); @@ -657,43 +650,43 @@ namespace ccm::test::oracle::unary_oracle const T nan = std::numeric_limits::quiet_NaN(); const T one = static_cast(1); - const std::vector bases = { static_cast(0), - -static_cast(0), - one, - -one, - static_cast(2), - -static_cast(2), - static_cast(0.5), - -static_cast(0.5), - static_cast(3), - -static_cast(3), - std::nextafter(one, static_cast(2)), - std::nextafter(one, static_cast(0)), - static_cast(1.0e30), - static_cast(-1.0e30), - static_cast(1.0e-30), - inf, - -inf, - nan }; - const std::vector exponents = { static_cast(0), - -static_cast(0), - one, - -one, - static_cast(2), - -static_cast(2), - static_cast(3), - -static_cast(3), - static_cast(0.5), - -static_cast(0.5), - static_cast(2.5), - -static_cast(2.5), - static_cast(100), - -static_cast(100), - static_cast(1.0e30), - -static_cast(1.0e30), - inf, - -inf, - nan }; + const std::vector bases = {static_cast(0), + -static_cast(0), + one, + -one, + static_cast(2), + -static_cast(2), + static_cast(0.5), + -static_cast(0.5), + static_cast(3), + -static_cast(3), + std::nextafter(one, static_cast(2)), + std::nextafter(one, static_cast(0)), + static_cast(1.0e30), + static_cast(-1.0e30), + static_cast(1.0e-30), + inf, + -inf, + nan}; + const std::vector exponents = {static_cast(0), + -static_cast(0), + one, + -one, + static_cast(2), + -static_cast(2), + static_cast(3), + -static_cast(3), + static_cast(0.5), + -static_cast(0.5), + static_cast(2.5), + -static_cast(2.5), + static_cast(100), + -static_cast(100), + static_cast(1.0e30), + -static_cast(1.0e30), + inf, + -inf, + nan}; std::vector> cases; cases.reserve(bases.size() * exponents.size()); @@ -701,7 +694,7 @@ namespace ccm::test::oracle::unary_oracle { for (const T exponent : exponents) { - cases.push_back({ base, exponent }); + cases.push_back({base, exponent}); } } return cases; @@ -734,8 +727,8 @@ namespace ccm::test::oracle::unary_oracle finite_pt = mid; } } - out.push_back({ finite_pt }); - out.push_back({ special_pt }); + out.push_back({finite_pt}); + out.push_back({special_pt}); }; const bool has_overflow = family == function_family::exp || family == function_family::gamma; @@ -761,7 +754,7 @@ namespace ccm::test::oracle::unary_oracle std::vector> out; for (const T value : unary_extra_inputs(family)) { - out.push_back({ value }); + out.push_back({value}); } const auto boundary = unary_boundary_cases(std_fn, family); out.insert(out.end(), boundary.begin(), boundary.end()); @@ -786,7 +779,7 @@ namespace ccm::test::oracle::unary_oracle std::vector> cases; for (const T value : structured_inputs()) { - cases.push_back({ value }); + cases.push_back({value}); } std::mt19937_64 rng(seed); @@ -804,7 +797,7 @@ namespace ccm::test::oracle::unary_oracle } if (value >= dom.lo && value <= dom.hi) { - cases.push_back({ static_cast(value) }); + cases.push_back({static_cast(value)}); } } } else @@ -814,7 +807,7 @@ namespace ccm::test::oracle::unary_oracle std::uniform_real_distribution uniform(lo, hi); for (std::size_t i = 0; i < count; ++i) { - cases.push_back({ static_cast(uniform(rng)) }); + cases.push_back({static_cast(uniform(rng))}); } } @@ -824,10 +817,10 @@ namespace ccm::test::oracle::unary_oracle { if constexpr (std::is_same_v) { - cases.push_back({ ccm::support::bit_cast(static_cast(bits())) }); + cases.push_back({ccm::support::bit_cast(static_cast(bits()))}); } else { - cases.push_back({ ccm::support::bit_cast(bits()) }); + cases.push_back({ccm::support::bit_cast(bits())}); } } return cases; @@ -841,7 +834,7 @@ namespace ccm::test::oracle::unary_oracle // never fully materialized at once. Only the compact array corpus is kept, which keeps // the per-case cost near 8 bytes and lets a very large sample fit in memory. const std::size_t random_count = count / 4 + 1; - constexpr std::size_t chunk_size = std::size_t{ 1 } << 22; + constexpr std::size_t chunk_size = std::size_t{1} << 22; std::vector> cases; cases.reserve(count + random_count); @@ -854,7 +847,7 @@ namespace ccm::test::oracle::unary_oracle add_targeted_random_cases(chunk, seed + done, n, "pow targeted finite band"); for (const auto & test_case : chunk) { - cases.push_back({ test_case.base, test_case.exponent }); + cases.push_back({test_case.base, test_case.exponent}); } } for (std::size_t done = 0; done < random_count; done += chunk_size) @@ -864,7 +857,7 @@ namespace ccm::test::oracle::unary_oracle add_random_cases(chunk, (seed ^ 0x9E3779B97F4A7C15ULL) + done, n, "pow whole-range bit pattern"); for (const auto & test_case : chunk) { - cases.push_back({ test_case.base, test_case.exponent }); + cases.push_back({test_case.base, test_case.exponent}); } } return cases; @@ -930,7 +923,7 @@ namespace ccm::test::oracle::unary_oracle { if (in_domain(domains[0], value)) { - cases.push_back({ value }); + cases.push_back({value}); } } } @@ -1106,7 +1099,7 @@ namespace ccm::test::oracle::unary_oracle // builder over to the confined region builder. inline bool domain_flags_present(int argc, char ** argv, std::size_t arity) { - static const char * const bases[] = { "--lo", "--hi", "--min-exp", "--max-exp", "--scale" }; + static const char * const bases[] = {"--lo", "--hi", "--min-exp", "--max-exp", "--scale"}; for (const char * base : bases) { if (option_value(argc, argv, std::string(base) + "=")) @@ -1144,7 +1137,7 @@ namespace ccm::test::oracle::unary_oracle const std::size_t colon = raw->find(':'); const std::uint64_t lo = std::stoull(raw->substr(0, colon), nullptr, 0); const std::uint64_t hi = colon == std::string::npos ? lo : std::stoull(raw->substr(colon + 1), nullptr, 0); - return { bit_interval{ lo, hi + 1 } }; + return {bit_interval{lo, hi + 1}}; } const auto to_bits = [](float value) { return static_cast(ccm::support::bit_cast(value)); }; @@ -1154,16 +1147,16 @@ namespace ccm::test::oracle::unary_oracle const float hi = static_cast(axis0.hi); if (lo >= 0.0F) { - return { bit_interval{ to_bits(lo), to_bits(hi) + 1 } }; + return {bit_interval{to_bits(lo), to_bits(hi) + 1}}; } if (hi <= 0.0F) { - return { bit_interval{ to_bits(hi), to_bits(lo) + 1 } }; + return {bit_interval{to_bits(hi), to_bits(lo) + 1}}; } - return { bit_interval{ to_bits(-0.0F), to_bits(lo) + 1 }, bit_interval{ to_bits(0.0F), to_bits(hi) + 1 } }; + return {bit_interval{to_bits(-0.0F), to_bits(lo) + 1}, bit_interval{to_bits(0.0F), to_bits(hi) + 1}}; } - return { bit_interval{ 0, std::uint64_t{ 1 } << 32 } }; + return {bit_interval{0, std::uint64_t{1} << 32}}; } inline std::string format_magnitude(std::uint64_t value) @@ -1172,7 +1165,7 @@ namespace ccm::test::oracle::unary_oracle { return std::to_string(value); } - static const char * const suffix[] = { "", "K", "M", "B", "T" }; + static const char * const suffix[] = {"", "K", "M", "B", "T"}; double scaled = static_cast(value); std::size_t step = 0; while (scaled >= 1000.0 && step + 1 < std::size(suffix)) @@ -1265,7 +1258,7 @@ namespace ccm::test::oracle::unary_oracle std::uint64_t chunk_; std::uint64_t total_; std::string label_; - std::atomic stop_{ false }; + std::atomic stop_{false}; std::thread worker_; }; @@ -1274,22 +1267,15 @@ namespace ccm::test::oracle::unary_oracle // the exhaustive sweep uses. The MPFR default rounding mode is set once per pass and only read by // the workers, and each worker sets its own hardware rounding mode. template - inline campaign_summary run_sampled(const std::vector> & cases, - const std::vector & rounding_modes, - mpfr_prec_t precision, - std::uint64_t max_ulp, - unsigned int thread_count, - KernelFn kernel, - RefFn reference, - StdFn std_reference, - threshold_recorder * recorder, - bool show_progress) + inline campaign_summary run_sampled(const std::vector> & cases, const std::vector & rounding_modes, mpfr_prec_t precision, + std::uint64_t max_ulp, unsigned int thread_count, KernelFn kernel, RefFn reference, StdFn std_reference, + threshold_recorder * recorder, bool show_progress) { if (thread_count == 0U) { thread_count = 1U; } - constexpr std::size_t chunk_size = std::size_t{ 1 } << 14; + constexpr std::size_t chunk_size = std::size_t{1} << 14; const std::size_t total_cases = cases.size(); const mpfr_rnd_t saved_default = mpfr_get_default_rounding_mode(); @@ -1302,7 +1288,7 @@ namespace ccm::test::oracle::unary_oracle std::vector> partials(thread_count); std::vector workers; workers.reserve(thread_count); - std::atomic next_chunk{ 0 }; + std::atomic next_chunk{0}; std::unique_ptr> ticker; if (show_progress) @@ -1356,22 +1342,15 @@ namespace ccm::test::oracle::unary_oracle // shared counter, so every core stays busy on the expensive band whether the sweep is the whole // 2^32 or a single targeted sub-range. template - inline campaign_summary run_exhaustive_float(const std::vector & intervals, - const std::vector & rounding_modes, - mpfr_prec_t precision, - std::uint64_t max_ulp, - unsigned int thread_count, - KernelFn kernel, - RefFn reference, - StdFn std_reference, - threshold_recorder * recorder, - bool show_progress) + inline campaign_summary run_exhaustive_float(const std::vector & intervals, const std::vector & rounding_modes, + mpfr_prec_t precision, std::uint64_t max_ulp, unsigned int thread_count, KernelFn kernel, + RefFn reference, StdFn std_reference, threshold_recorder * recorder, bool show_progress) { if (thread_count == 0U) { thread_count = 1U; } - constexpr std::uint64_t chunk_size = std::uint64_t{ 1 } << 20; + constexpr std::uint64_t chunk_size = std::uint64_t{1} << 20; std::uint64_t total_patterns = 0; for (const bit_interval & interval : intervals) @@ -1404,7 +1383,7 @@ namespace ccm::test::oracle::unary_oracle std::vector> partials(thread_count); std::vector workers; workers.reserve(thread_count); - std::atomic next_chunk{ 0 }; + std::atomic next_chunk{0}; std::unique_ptr> ticker; if (show_progress) @@ -1439,7 +1418,7 @@ namespace ccm::test::oracle::unary_oracle continue; } evaluate_case( - std::array{ input }, kernel, reference, std_reference, precision, rounding, max_ulp, summary, recorder); + std::array{input}, kernel, reference, std_reference, precision, rounding, max_ulp, summary, recorder); } } }); @@ -1460,15 +1439,8 @@ namespace ccm::test::oracle::unary_oracle } template - inline int run_campaign(int argc, - char ** argv, - std::string_view function_name, - KernelFn kernel, - RefFn reference, - StdFn std_reference, - CorpusFn build_corpus, - const std::array & default_domains, - std::vector> structured_seed, + inline int run_campaign(int argc, char ** argv, std::string_view function_name, KernelFn kernel, RefFn reference, StdFn std_reference, + CorpusFn build_corpus, const std::array & default_domains, std::vector> structured_seed, std::string_view implementation = "gen") { const auto mode = parse_mode(option_value(argc, argv, "--mode=")); @@ -1544,7 +1516,7 @@ namespace ccm::test::oracle::unary_oracle if (run_exhaustive) { intervals = float_exhaustive_intervals(argc, argv, domains[0]); - const bool full_space = intervals.size() == 1 && intervals[0].begin == 0 && intervals[0].end == (std::uint64_t{ 1 } << 32); + const bool full_space = intervals.size() == 1 && intervals[0].begin == 0 && intervals[0].end == (std::uint64_t{1} << 32); corpus = full_space ? "exhaustive binary32" : "exhaustive binary32 sub-range"; } diff --git a/tests/shared/oracle/oracle_campaign_common.hpp b/tests/shared/oracle/oracle_campaign_common.hpp index 8dc51aa5..f2f36e9c 100644 --- a/tests/shared/oracle/oracle_campaign_common.hpp +++ b/tests/shared/oracle/oracle_campaign_common.hpp @@ -226,19 +226,9 @@ namespace ccm::test::oracle } template - inline failure_record make_failure_record(std::string_view function_name, - std::string_view path_name, - std::string_view provenance, - T base, - T exponent, - T actual, - T expected, - std::uint64_t ulp_distance, - std::string_view rounding_mode, - unsigned long oracle_precision, - std::uint64_t seed, - std::string_view search_mode, - std::string_view notes, + inline failure_record make_failure_record(std::string_view function_name, std::string_view path_name, std::string_view provenance, T base, T exponent, + T actual, T expected, std::uint64_t ulp_distance, std::string_view rounding_mode, + unsigned long oracle_precision, std::uint64_t seed, std::string_view search_mode, std::string_view notes, std::string_view event_kind = {}) { return failure_record{ @@ -448,7 +438,7 @@ namespace ccm::test::oracle const auto raw = option_value(argc, argv, "--rounding-modes="); if (!raw.has_value() || *raw == "all") { - return { FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO }; + return {FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO}; } std::vector modes; @@ -478,7 +468,7 @@ namespace ccm::test::oracle } if (modes.empty()) { - modes = { FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO }; + modes = {FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO}; } return modes; } @@ -535,14 +525,9 @@ namespace ccm::test::oracle } template - inline campaign_report make_campaign_report(std::string_view path_name, - ccm::test::pow_path::validation_path path, - campaign_mode mode, - const run_summary & summary, - std::uint64_t seed, - std::uint64_t elapsed_ms, - const std::vector & domains_covered, - const std::vector & domains_skipped) + inline campaign_report make_campaign_report(std::string_view path_name, ccm::test::pow_path::validation_path path, campaign_mode mode, + const run_summary & summary, std::uint64_t seed, std::uint64_t elapsed_ms, + const std::vector & domains_covered, const std::vector & domains_skipped) { return campaign_report{ configuration_name(), @@ -575,12 +560,8 @@ namespace ccm::test::oracle } template - inline campaign_report make_coremath_campaign_report(std::string_view path_name, - campaign_mode mode, - const run_summary & summary, - std::uint64_t seed, - std::uint64_t elapsed_ms, - const std::vector & domains_covered, + inline campaign_report make_coremath_campaign_report(std::string_view path_name, campaign_mode mode, const run_summary & summary, std::uint64_t seed, + std::uint64_t elapsed_ms, const std::vector & domains_covered, const std::vector & domains_skipped) { return campaign_report{ @@ -614,12 +595,8 @@ namespace ccm::test::oracle } template - inline void run_path_campaign(ccm::test::pow_path::validation_path path, - run_summary & summary, - std::string_view summary_prefix, - ExecuteFn execute_cases, - ReportFn build_report, - PrintFn print_report) + inline void run_path_campaign(ccm::test::pow_path::validation_path path, run_summary & summary, std::string_view summary_prefix, ExecuteFn execute_cases, + ReportFn build_report, PrintFn print_report) { const auto support = ccm::test::pow_path::path_is_supported(path); if (!support.supported) @@ -681,7 +658,7 @@ namespace ccm::test::oracle std::uniform_real_distribution unit(1.0, 2.0); std::uniform_int_distribution base_exp(-(max_exp / 4), max_exp / 4); - auto add = [&](T base, T exponent) { cases.push_back(pow_case{ base, exponent, provenance }); }; + auto add = [&](T base, T exponent) { cases.push_back(pow_case{base, exponent, provenance}); }; const std::size_t per = count / 4 + 1; diff --git a/tests/shared/oracle/pow_adversarial_modes.hpp b/tests/shared/oracle/pow_adversarial_modes.hpp index a37c8330..481dca99 100644 --- a/tests/shared/oracle/pow_adversarial_modes.hpp +++ b/tests/shared/oracle/pow_adversarial_modes.hpp @@ -17,57 +17,57 @@ namespace ccm::test::oracle::adversarial template inline void add_near_one(std::vector> & cases) { - for (T exponent : { static_cast(-3.5), static_cast(-0.5), static_cast(0.5), static_cast(3.5), static_cast(10) }) + for (T exponent : {static_cast(-3.5), static_cast(-0.5), static_cast(0.5), static_cast(3.5), static_cast(10)}) { - cases.push_back({ static_cast(1), exponent, "near-one" }); - cases.push_back({ std::nextafter(static_cast(1), static_cast(0)), exponent, "near-one below" }); - cases.push_back({ std::nextafter(static_cast(1), std::numeric_limits::infinity()), exponent, "near-one above" }); + cases.push_back({static_cast(1), exponent, "near-one"}); + cases.push_back({std::nextafter(static_cast(1), static_cast(0)), exponent, "near-one below"}); + cases.push_back({std::nextafter(static_cast(1), std::numeric_limits::infinity()), exponent, "near-one above"}); } } template inline void add_near_negative_one(std::vector> & cases) { - for (T exponent : { static_cast(2), static_cast(3), static_cast(4), static_cast(3.5), static_cast(0.5) }) + for (T exponent : {static_cast(2), static_cast(3), static_cast(4), static_cast(3.5), static_cast(0.5)}) { - cases.push_back({ static_cast(-1), exponent, "near-negative-one" }); - cases.push_back({ std::nextafter(static_cast(-1), -std::numeric_limits::infinity()), exponent, "near-negative-one below" }); - cases.push_back({ std::nextafter(static_cast(-1), static_cast(0)), exponent, "near-negative-one above" }); + cases.push_back({static_cast(-1), exponent, "near-negative-one"}); + cases.push_back({std::nextafter(static_cast(-1), -std::numeric_limits::infinity()), exponent, "near-negative-one below"}); + cases.push_back({std::nextafter(static_cast(-1), static_cast(0)), exponent, "near-negative-one above"}); } } template inline void add_near_zero(std::vector> & cases) { - for (T exponent : { static_cast(-1), static_cast(0.5), static_cast(2), static_cast(3) }) + for (T exponent : {static_cast(-1), static_cast(0.5), static_cast(2), static_cast(3)}) { - cases.push_back({ static_cast(0), exponent, "near-zero" }); - cases.push_back({ std::numeric_limits::denorm_min(), exponent, "near-zero denorm min" }); - cases.push_back({ -std::numeric_limits::denorm_min(), exponent, "near-zero negative denorm min" }); + cases.push_back({static_cast(0), exponent, "near-zero"}); + cases.push_back({std::numeric_limits::denorm_min(), exponent, "near-zero denorm min"}); + cases.push_back({-std::numeric_limits::denorm_min(), exponent, "near-zero negative denorm min"}); } } template inline void add_near_power_of_two(std::vector> & cases) { - for (int exp2 : { -10, -1, 0, 1, 10, 20 }) + for (int exp2 : {-10, -1, 0, 1, 10, 20}) { const T base = std::ldexp(static_cast(1), exp2); - for (T exponent : { static_cast(-2), static_cast(0.5), static_cast(2), static_cast(3) }) + for (T exponent : {static_cast(-2), static_cast(0.5), static_cast(2), static_cast(3)}) { - cases.push_back({ base, exponent, "near-power-of-two" }); - cases.push_back({ std::nextafter(base, static_cast(0)), exponent, "near-power-of-two below" }); - cases.push_back({ std::nextafter(base, std::numeric_limits::infinity()), exponent, "near-power-of-two above" }); + cases.push_back({base, exponent, "near-power-of-two"}); + cases.push_back({std::nextafter(base, static_cast(0)), exponent, "near-power-of-two below"}); + cases.push_back({std::nextafter(base, std::numeric_limits::infinity()), exponent, "near-power-of-two above"}); } } } template inline void add_near_integer_exponent(std::vector> & cases) { - for (T base : { static_cast(1.25), static_cast(2), static_cast(-2), static_cast(0.5) }) + for (T base : {static_cast(1.25), static_cast(2), static_cast(-2), static_cast(0.5)}) { - for (T delta : { static_cast(-0.5), static_cast(-1e-6), static_cast(1e-6), static_cast(0.5) }) + for (T delta : {static_cast(-0.5), static_cast(-1e-6), static_cast(1e-6), static_cast(0.5)}) { - for (int integer : { -3, -1, 0, 1, 3, 7 }) + for (int integer : {-3, -1, 0, 1, 3, 7}) { - cases.push_back({ base, static_cast(integer) + delta, "near-integer-exponent" }); + cases.push_back({base, static_cast(integer) + delta, "near-integer-exponent"}); } } } @@ -75,9 +75,9 @@ namespace ccm::test::oracle::adversarial template inline void add_negative_base_parity(std::vector> & cases) { - for (T exponent : { static_cast(2), static_cast(3), static_cast(4), static_cast(3.5), static_cast(0.5) }) + for (T exponent : {static_cast(2), static_cast(3), static_cast(4), static_cast(3.5), static_cast(0.5)}) { - cases.push_back({ static_cast(-2), exponent, "negative-base-parity" }); + cases.push_back({static_cast(-2), exponent, "negative-base-parity"}); } } @@ -85,15 +85,15 @@ namespace ccm::test::oracle::adversarial { if constexpr (std::is_same_v) { - for (T exponent : { static_cast(126), static_cast(127), static_cast(128), static_cast(129) }) + for (T exponent : {static_cast(126), static_cast(127), static_cast(128), static_cast(129)}) { - cases.push_back({ static_cast(2), exponent, "overflow-boundary" }); + cases.push_back({static_cast(2), exponent, "overflow-boundary"}); } } else { - for (T exponent : { static_cast(1023), static_cast(1024), static_cast(1025) }) + for (T exponent : {static_cast(1023), static_cast(1024), static_cast(1025)}) { - cases.push_back({ static_cast(2), exponent, "overflow-boundary" }); + cases.push_back({static_cast(2), exponent, "overflow-boundary"}); } } } @@ -102,15 +102,15 @@ namespace ccm::test::oracle::adversarial { if constexpr (std::is_same_v) { - for (T exponent : { static_cast(-150), static_cast(-151), static_cast(-152) }) + for (T exponent : {static_cast(-150), static_cast(-151), static_cast(-152)}) { - cases.push_back({ static_cast(2), exponent, "underflow-boundary" }); + cases.push_back({static_cast(2), exponent, "underflow-boundary"}); } } else { - for (T exponent : { static_cast(-1074), static_cast(-1075), static_cast(-1076) }) + for (T exponent : {static_cast(-1074), static_cast(-1075), static_cast(-1076)}) { - cases.push_back({ static_cast(2), exponent, "underflow-boundary" }); + cases.push_back({static_cast(2), exponent, "underflow-boundary"}); } } } @@ -122,7 +122,7 @@ namespace ccm::test::oracle::adversarial { const T base = static_cast(0.5) + static_cast(rng() % 1000) / static_cast(10000); const T exponent = static_cast(-120) - static_cast(rng() % 40); - cases.push_back({ base, exponent, "subnormal-output" }); + cases.push_back({base, exponent, "subnormal-output"}); } } @@ -131,9 +131,9 @@ namespace ccm::test::oracle::adversarial for (int bucket = 0; bucket < 128; ++bucket) { const T boundary = static_cast(1) + static_cast(bucket) / static_cast(128); - cases.push_back({ boundary, static_cast(10), "table-boundary" }); - cases.push_back({ std::nextafter(boundary, static_cast(0)), static_cast(-10), "table-boundary below edge" }); - cases.push_back({ std::nextafter(boundary, std::numeric_limits::infinity()), static_cast(10), "table-boundary above edge" }); + cases.push_back({boundary, static_cast(10), "table-boundary"}); + cases.push_back({std::nextafter(boundary, static_cast(0)), static_cast(-10), "table-boundary below edge"}); + cases.push_back({std::nextafter(boundary, std::numeric_limits::infinity()), static_cast(10), "table-boundary above edge"}); } } @@ -153,7 +153,7 @@ namespace ccm::test::oracle::adversarial { base_bits ^= static_cast(1u << (rng() % 23)); } - cases.push_back({ ccm::support::bit_cast(base_bits), ccm::support::bit_cast(exp_bits), std::string(mode) }); + cases.push_back({ccm::support::bit_cast(base_bits), ccm::support::bit_cast(exp_bits), std::string(mode)}); } else { std::uint64_t base_bits = rng(); @@ -165,7 +165,7 @@ namespace ccm::test::oracle::adversarial { base_bits ^= (1ull << (rng() % 52)); } - cases.push_back({ ccm::support::bit_cast(base_bits), ccm::support::bit_cast(exp_bits), std::string(mode) }); + cases.push_back({ccm::support::bit_cast(base_bits), ccm::support::bit_cast(exp_bits), std::string(mode)}); } } } @@ -204,11 +204,11 @@ namespace ccm::test::oracle::adversarial { const T base = static_cast(hard_case.base); const T exponent = static_cast(hard_case.exponent); - cases.push_back({ base, exponent, "seed corpus case" }); - cases.push_back({ std::nextafter(base, std::numeric_limits::infinity()), exponent, "nextafter walk on base upward" }); - cases.push_back({ std::nextafter(base, static_cast(0)), exponent, "nextafter walk on base downward" }); - cases.push_back({ base, std::nextafter(exponent, std::numeric_limits::infinity()), "nextafter walk on exponent upward" }); - cases.push_back({ base, std::nextafter(exponent, static_cast(0)), "nextafter walk on exponent downward" }); + cases.push_back({base, exponent, "seed corpus case"}); + cases.push_back({std::nextafter(base, std::numeric_limits::infinity()), exponent, "nextafter walk on base upward"}); + cases.push_back({std::nextafter(base, static_cast(0)), exponent, "nextafter walk on base downward"}); + cases.push_back({base, std::nextafter(exponent, std::numeric_limits::infinity()), "nextafter walk on exponent upward"}); + cases.push_back({base, std::nextafter(exponent, static_cast(0)), "nextafter walk on exponent downward"}); } return cases; } diff --git a/tests/shared/oracle/pow_adversarial_search.cpp b/tests/shared/oracle/pow_adversarial_search.cpp index aa81639b..5652711e 100644 --- a/tests/shared/oracle/pow_adversarial_search.cpp +++ b/tests/shared/oracle/pow_adversarial_search.cpp @@ -10,15 +10,9 @@ namespace { template - std::vector> run_search(std::string_view function_name, - std::string_view path_name, - ccm::test::pow_path::validation_path path, - std::string_view search_mode, - Fn fn, - const std::vector> & cases, - mpfr_prec_t precision, - std::uint64_t max_ulp, - std::uint64_t seed) + std::vector> + run_search(std::string_view function_name, std::string_view path_name, ccm::test::pow_path::validation_path path, std::string_view search_mode, Fn fn, + const std::vector> & cases, mpfr_prec_t precision, std::uint64_t max_ulp, std::uint64_t seed) { std::vector> failures; ccm::test::oracle::run_summary summary; diff --git a/tests/shared/oracle/pow_cases.hpp b/tests/shared/oracle/pow_cases.hpp index c5c807b4..69e5d9c2 100644 --- a/tests/shared/oracle/pow_cases.hpp +++ b/tests/shared/oracle/pow_cases.hpp @@ -18,8 +18,16 @@ namespace ccm::test::oracle::pow_cases inline std::vector all_powf_domains() { return { - "mantissa-sweep", "all-x-for-y", "all-y-for-x", "exponent-field-sweep", "subnormal-x", - "unit-interval", "negative-base", "overflow-threshold", "underflow-threshold", "structured-corpus", + "mantissa-sweep", + "all-x-for-y", + "all-y-for-x", + "exponent-field-sweep", + "subnormal-x", + "unit-interval", + "negative-base", + "overflow-threshold", + "underflow-threshold", + "structured-corpus", }; } @@ -29,7 +37,7 @@ namespace ccm::test::oracle::pow_cases auto maybe_add = [&](double base, double exponent, const char * provenance) { if (eligible(base, exponent)) { - cases.push_back({ base, exponent, provenance }); + cases.push_back({base, exponent, provenance}); } }; @@ -51,7 +59,15 @@ namespace ccm::test::oracle::pow_cases std::numeric_limits::infinity(), }; constexpr std::array special_exponents = { - -std::numeric_limits::infinity(), -3.0, -1.0, -0.0, 0.0, 0.5, 2.0, 3.0, std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -3.0, + -1.0, + -0.0, + 0.0, + 0.5, + 2.0, + 3.0, + std::numeric_limits::infinity(), }; for (double base : special_bases) { @@ -70,7 +86,7 @@ namespace ccm::test::oracle::pow_cases std::nextafter(-1.0, 0.0), }) { - for (double exponent : { -3.5, -1.5, -0.5, 0.5, 1.5, 3.5, 0x1.fffffffffffffp52, 0x1.0p53 }) + for (double exponent : {-3.5, -1.5, -0.5, 0.5, 1.5, 3.5, 0x1.fffffffffffffp52, 0x1.0p53}) { maybe_add(base, exponent, "near +/-1 boundary campaign"); } @@ -85,10 +101,10 @@ namespace ccm::test::oracle::pow_cases maybe_add(std::nextafter(boundary, std::numeric_limits::infinity()), 10.0, "range-reduction boundary: next representable"); } - for (const int exp2_exponent : { -1022, -10, -1, 0, 1, 10, 1023 }) + for (const int exp2_exponent : {-1022, -10, -1, 0, 1, 10, 1023}) { const double base = std::ldexp(1.0, exp2_exponent); - for (double exponent : { -1.0, -0.5, 2.0, 3.0 }) + for (double exponent : {-1.0, -0.5, 2.0, 3.0}) { maybe_add(base, exponent, "power-of-two campaign"); maybe_add(std::nextafter(base, 0.0), exponent, "nextafter neighborhood below power-of-two"); @@ -96,20 +112,20 @@ namespace ccm::test::oracle::pow_cases } } - for (double exponent : { -3.0, -2.0, -1.0, 1.0, 2.0, 3.0, 0x1.fffffffffffffp52, 0x1.0p53 }) + for (double exponent : {-3.0, -2.0, -1.0, 1.0, 2.0, 3.0, 0x1.fffffffffffffp52, 0x1.0p53}) { maybe_add(-2.0, exponent, "negative base with integer exponent campaign"); } - for (double exponent : { 0.5, 1.5, 3.5, std::nextafter(1.0, 2.0), std::nextafter(2.0, 1.0) }) + for (double exponent : {0.5, 1.5, 3.5, std::nextafter(1.0, 2.0), std::nextafter(2.0, 1.0)}) { maybe_add(-2.0, exponent, "negative base near non-integer exponent boundary"); } - for (const auto exponent : { 1023.0, std::nextafter(1024.0, 0.0), 1024.0, 1025.0 }) + for (const auto exponent : {1023.0, std::nextafter(1024.0, 0.0), 1024.0, 1025.0}) { maybe_add(2.0, exponent, "overflow-threshold campaign"); } - for (const auto exponent : { -1074.0, -1075.0, -1076.0 }) + for (const auto exponent : {-1074.0, -1075.0, -1076.0}) { maybe_add(2.0, exponent, "underflow-threshold campaign"); } @@ -144,11 +160,8 @@ namespace ccm::test::oracle::pow_cases } template - std::vector> build_float_cases(campaign_mode mode, - const std::set & domain_filter, - std::uint64_t seed, - std::vector & domains_covered, - std::vector & domains_skipped, + std::vector> build_float_cases(campaign_mode mode, const std::set & domain_filter, std::uint64_t seed, + std::vector & domains_covered, std::vector & domains_skipped, EligibilityFn eligible) { namespace powf_domains = ccm::test::oracle::powf_domains; @@ -170,7 +183,7 @@ namespace ccm::test::oracle::pow_cases auto maybe_add = [&](float base, float exponent, const char * provenance) { if (eligible(base, exponent)) { - cases.push_back({ base, exponent, provenance }); + cases.push_back({base, exponent, provenance}); } }; @@ -195,7 +208,15 @@ namespace ccm::test::oracle::pow_cases std::numeric_limits::infinity(), }; constexpr std::array special_exponents = { - -std::numeric_limits::infinity(), -3.0F, -1.0F, -0.0F, 0.0F, 0.5F, 2.0F, 3.0F, std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -3.0F, + -1.0F, + -0.0F, + 0.0F, + 0.5F, + 2.0F, + 3.0F, + std::numeric_limits::infinity(), }; for (float base : special_bases) { @@ -252,7 +273,7 @@ namespace ccm::test::oracle::pow_cases if (domain_enabled("unit-interval")) { mark_domain("unit-interval", true); - powf_domains::add_unit_interval(mode, add_case, { "mantissa-sweep" }); + powf_domains::add_unit_interval(mode, add_case, {"mantissa-sweep"}); } else { mark_domain("unit-interval", false); @@ -286,11 +307,8 @@ namespace ccm::test::oracle::pow_cases return cases; } - inline std::vector> build_float_cases(campaign_mode mode, - const std::set & domain_filter, - std::uint64_t seed, - std::vector & domains_covered, - std::vector & domains_skipped) + inline std::vector> build_float_cases(campaign_mode mode, const std::set & domain_filter, std::uint64_t seed, + std::vector & domains_covered, std::vector & domains_skipped) { return build_float_cases(mode, domain_filter, seed, domains_covered, domains_skipped, [](float, float) { return true; }); } diff --git a/tests/shared/oracle/powf_exhaustive_domains.hpp b/tests/shared/oracle/powf_exhaustive_domains.hpp index 2c33ff61..ed4d7301 100644 --- a/tests/shared/oracle/powf_exhaustive_domains.hpp +++ b/tests/shared/oracle/powf_exhaustive_domains.hpp @@ -47,7 +47,7 @@ namespace ccm::test::oracle::powf_domains return; } - for (float exponent : { 2.0F, 0.5F, -1.0F, 3.14159265F }) + for (float exponent : {2.0F, 0.5F, -1.0F, 3.14159265F}) { const std::uint32_t step = (mode == campaign_mode::quick) ? (1u << 15) : (mode == campaign_mode::extended ? (1u << 8) : 1u); for (std::uint32_t mantissa = 0; mantissa < (1u << 23); mantissa += step) @@ -65,7 +65,7 @@ namespace ccm::test::oracle::powf_domains } const std::uint32_t step = (mode == campaign_mode::quick) ? (1u << 20) : (mode == campaign_mode::extended ? (1u << 12) : (1u << 8)); - for (float exponent : { 2.0F, -1.0F, 0.5F }) + for (float exponent : {2.0F, -1.0F, 0.5F}) { for (std::uint32_t bits = 0; bits < 0x7f800000u; bits += step) { @@ -82,7 +82,7 @@ namespace ccm::test::oracle::powf_domains } const std::uint32_t step = (mode == campaign_mode::quick) ? (1u << 20) : (mode == campaign_mode::extended ? (1u << 12) : (1u << 8)); - for (float base : { 1.25F, 2.0F, 0.5F, -2.0F }) + for (float base : {1.25F, 2.0F, 0.5F, -2.0F}) { for (std::uint32_t bits = 0; bits < 0x7f800000u; bits += step) { @@ -98,9 +98,9 @@ namespace ccm::test::oracle::powf_domains return; } - for (const float base : { 1.0F, -1.0F, 2.0F, -2.0F, 0x1.0p-126F, 0x1.0p-149F }) + for (const float base : {1.0F, -1.0F, 2.0F, -2.0F, 0x1.0p-126F, 0x1.0p-149F}) { - for (const std::uint32_t raw_exponent : { 0x00000000u, 0x3f800000u, 0x40000000u, 0x40400000u, 0xbf800000u }) + for (const std::uint32_t raw_exponent : {0x00000000u, 0x3f800000u, 0x40000000u, 0x40400000u, 0xbf800000u}) { add_case(base, ccm::support::bit_cast(raw_exponent), "selected-x sweep across exact exponent anchors"); } @@ -137,7 +137,7 @@ namespace ccm::test::oracle::powf_domains { return; } - add_mantissa_sweep(mode, add_case, { "mantissa-sweep" }); + add_mantissa_sweep(mode, add_case, {"mantissa-sweep"}); } template void add_negative_base([[maybe_unused]] campaign_mode mode, AddCaseFn add_case, const std::set & filter) @@ -147,11 +147,11 @@ namespace ccm::test::oracle::powf_domains return; } - for (float exponent : { -3.0F, -2.0F, -1.0F, 1.0F, 2.0F, 3.0F, 8388607.0F, 8388608.0F, 8388609.0F, 16777216.0F }) + for (float exponent : {-3.0F, -2.0F, -1.0F, 1.0F, 2.0F, 3.0F, 8388607.0F, 8388608.0F, 8388609.0F, 16777216.0F}) { add_case(-1.0F, exponent, "integer-parity threshold campaign"); } - for (float exponent : { 0.5F, 1.5F, 3.5F, std::nextafter(1.0F, 2.0F) }) + for (float exponent : {0.5F, 1.5F, 3.5F, std::nextafter(1.0F, 2.0F)}) { add_case(-2.0F, exponent, "negative-base non-integer boundary campaign"); } @@ -164,7 +164,7 @@ namespace ccm::test::oracle::powf_domains return; } - for (float exponent : { 126.0F, 127.0F, 128.0F, 129.0F }) + for (float exponent : {126.0F, 127.0F, 128.0F, 129.0F}) { add_case(2.0F, exponent, "overflow-threshold campaign"); } @@ -177,7 +177,7 @@ namespace ccm::test::oracle::powf_domains return; } - for (float exponent : { -150.0F, -151.0F, -152.0F }) + for (float exponent : {-150.0F, -151.0F, -152.0F}) { add_case(2.0F, exponent, "underflow-threshold campaign"); } diff --git a/tests/shared/oracle/powl_platform_characterization.cpp b/tests/shared/oracle/powl_platform_characterization.cpp index 5577a14b..abfdf86a 100644 --- a/tests/shared/oracle/powl_platform_characterization.cpp +++ b/tests/shared/oracle/powl_platform_characterization.cpp @@ -58,8 +58,8 @@ namespace // ReSharper enable CppDFAUnreachableCode } - const std::array bases = { 0.25L, 0.5L, 1.0L, 2.0L, 3.0L, 10.0L }; - const std::array exponents = { -2.0L, -0.5L, 0.0L, 0.5L, 2.0L, 3.0L }; + const std::array bases = {0.25L, 0.5L, 1.0L, 2.0L, 3.0L, 10.0L}; + const std::array exponents = {-2.0L, -0.5L, 0.0L, 0.5L, 2.0L, 3.0L}; ccm::test::oracle::run_summary summary; for (long double base : bases) diff --git a/tests/shared/oracle/runners/coremath_pow_runner.hpp b/tests/shared/oracle/runners/coremath_pow_runner.hpp index df32ccb1..59d4d955 100644 --- a/tests/shared/oracle/runners/coremath_pow_runner.hpp +++ b/tests/shared/oracle/runners/coremath_pow_runner.hpp @@ -24,8 +24,8 @@ namespace ccm::test::oracle::pow_coremath static constexpr std::uint64_t default_seed = 0xC0DEC0FFEEULL; static constexpr std::string_view corpus_label = "finite-binary64-corpus"; - static std::vector> - build_cases(campaign_mode mode, std::set const &, std::uint64_t seed, std::vector &, std::vector &) + static std::vector> build_cases(campaign_mode mode, std::set const &, std::uint64_t seed, std::vector &, + std::vector &) { return coremath_cases::build_double_cases(mode, seed); } @@ -38,26 +38,17 @@ namespace ccm::test::oracle::pow_coremath static constexpr std::uint64_t default_seed = 0xFACEB00CU; static constexpr std::string_view corpus_label = "finite-binary32-corpus"; - static std::vector> build_cases(campaign_mode mode, - std::set const & domain_filter, - std::uint64_t seed, - std::vector & domains_covered, - std::vector & domains_skipped) + static std::vector> build_cases(campaign_mode mode, std::set const & domain_filter, std::uint64_t seed, + std::vector & domains_covered, std::vector & domains_skipped) { return coremath_cases::build_float_cases(mode, domain_filter, seed, domains_covered, domains_skipped); } }; template - inline void run_path(validation_path path, - std::vector> const & cases, - std::vector const & rounding_modes, - std::uint64_t seed, - campaign_mode mode, - std::vector const & domains_covered, - std::vector const & domains_skipped, - std::vector> & events, - run_summary & summary) + inline void run_path(validation_path path, std::vector> const & cases, std::vector const & rounding_modes, std::uint64_t seed, + campaign_mode mode, std::vector const & domains_covered, std::vector const & domains_skipped, + std::vector> & events, run_summary & summary) { run_path_campaign( path, @@ -105,7 +96,7 @@ namespace ccm::test::oracle::pow_coremath std::vector domains_skipped; if constexpr (std::is_same_v) { - domains_covered = { std::string(traits::corpus_label) }; + domains_covered = {std::string(traits::corpus_label)}; } auto const cases = traits::build_cases(mode, domain_filter, seed, domains_covered, domains_skipped); std::vector> events; diff --git a/tests/shared/oracle/runners/mpfr_pow_runner.hpp b/tests/shared/oracle/runners/mpfr_pow_runner.hpp index a672f400..23bd6453 100644 --- a/tests/shared/oracle/runners/mpfr_pow_runner.hpp +++ b/tests/shared/oracle/runners/mpfr_pow_runner.hpp @@ -25,8 +25,8 @@ namespace ccm::test::oracle::pow_mpfr static constexpr mpfr_prec_t default_precision = 256; static constexpr std::string_view corpus_label = "structured-binary64-corpus"; - static std::vector> - build_cases(campaign_mode mode, std::set const &, std::uint64_t seed, std::vector &, std::vector &) + static std::vector> build_cases(campaign_mode mode, std::set const &, std::uint64_t seed, std::vector &, + std::vector &) { return pow_cases::build_double_cases(mode, seed); } @@ -40,29 +40,18 @@ namespace ccm::test::oracle::pow_mpfr static constexpr mpfr_prec_t default_precision = 192; static constexpr std::string_view corpus_label = "structured-binary32-corpus"; - static std::vector> build_cases(campaign_mode mode, - std::set const & domain_filter, - std::uint64_t seed, - std::vector & domains_covered, - std::vector & domains_skipped) + static std::vector> build_cases(campaign_mode mode, std::set const & domain_filter, std::uint64_t seed, + std::vector & domains_covered, std::vector & domains_skipped) { return pow_cases::build_float_cases(mode, domain_filter, seed, domains_covered, domains_skipped); } }; template - inline void run_path(validation_path path, - std::vector> const & cases, - std::vector const & rounding_modes, - mpfr_prec_t precision, - std::uint64_t max_ulp, - std::uint64_t target_ulp, - std::uint64_t seed, - campaign_mode mode, - std::vector const & domains_covered, - std::vector const & domains_skipped, - std::vector> & events, - run_summary & summary) + inline void run_path(validation_path path, std::vector> const & cases, std::vector const & rounding_modes, mpfr_prec_t precision, + std::uint64_t max_ulp, std::uint64_t target_ulp, std::uint64_t seed, campaign_mode mode, + std::vector const & domains_covered, std::vector const & domains_skipped, + std::vector> & events, run_summary & summary) { run_path_campaign( path, @@ -141,7 +130,7 @@ namespace ccm::test::oracle::pow_mpfr std::vector domains_skipped; if constexpr (std::is_same_v) { - domains_covered = { std::string(traits::corpus_label) }; + domains_covered = {std::string(traits::corpus_label)}; } auto const cases = traits::build_cases(mode, domain_filter, seed, domains_covered, domains_skipped); std::vector> events; diff --git a/tests/shared/utils/conformance_suite.hpp b/tests/shared/utils/conformance_suite.hpp index 5bee25a1..96ded43d 100644 --- a/tests/shared/utils/conformance_suite.hpp +++ b/tests/shared/utils/conformance_suite.hpp @@ -85,8 +85,8 @@ namespace ccm::test } template - void ExpectUlpBinaryOverAllRoundingModes( - const std::array & bases, const std::array & exponents, CcmFn ccm_fn, StdFn std_fn, int64_t max_ulp = kMaxAllowedUlp) + void ExpectUlpBinaryOverAllRoundingModes(const std::array & bases, const std::array & exponents, CcmFn ccm_fn, StdFn std_fn, + int64_t max_ulp = kMaxAllowedUlp) { static_assert(N > 0, "need at least one (base, exponent) pair"); ForEachRoundingModeOrSkip([&](int mode) { diff --git a/tests/shared/utils/fenv_fixture.hpp b/tests/shared/utils/fenv_fixture.hpp index 9dae87a4..0a39c9e2 100644 --- a/tests/shared/utils/fenv_fixture.hpp +++ b/tests/shared/utils/fenv_fixture.hpp @@ -26,7 +26,7 @@ namespace ccm::test TowardZero, }; - inline constexpr std::array kStdRoundingModes = { FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO }; + inline constexpr std::array kStdRoundingModes = {FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO}; inline constexpr const char * RoundingModeName(int rounding_mode) { diff --git a/tests/shared/utils/math_samples.hpp b/tests/shared/utils/math_samples.hpp index 139d6982..24d74a69 100644 --- a/tests/shared/utils/math_samples.hpp +++ b/tests/shared/utils/math_samples.hpp @@ -73,131 +73,265 @@ namespace ccm::test::samples }; inline constexpr std::array kExpoFloat = { - 0.001F, 0.01F, 0.1F, 0.25F, 0.5F, 0.75F, 1.0F, 1.25F, 1.5F, 2.0F, 3.0F, 4.0F, 8.0F, 10.0F, + 0.001F, + 0.01F, + 0.1F, + 0.25F, + 0.5F, + 0.75F, + 1.0F, + 1.25F, + 1.5F, + 2.0F, + 3.0F, + 4.0F, + 8.0F, + 10.0F, }; inline constexpr std::array kExpoDouble = { - 0.001, 0.01, 0.1, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0, 3.0, 4.0, 8.0, 10.0, 16.0, 32.0, 64.0, 128.0, + 0.001, + 0.01, + 0.1, + 0.25, + 0.5, + 0.75, + 1.0, + 1.25, + 1.5, + 2.0, + 3.0, + 4.0, + 8.0, + 10.0, + 16.0, + 32.0, + 64.0, + 128.0, }; - inline constexpr std::array kSqrtFloat = { 0.0F, 0.01F, 0.1F, 0.25F, 0.5F, 1.0F, 2.0F, 3.0F, 4.0F, 8.0F, 16.0F, 1024.0F }; + inline constexpr std::array kSqrtFloat = {0.0F, 0.01F, 0.1F, 0.25F, 0.5F, 1.0F, 2.0F, 3.0F, 4.0F, 8.0F, 16.0F, 1024.0F}; - inline constexpr std::array kSqrtDouble = { 0.0, 0.01, 0.1, 0.25, 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 16.0, 64.0, 128.0, 256.0, 1024.0 }; + inline constexpr std::array kSqrtDouble = {0.0, 0.01, 0.1, 0.25, 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 16.0, 64.0, 128.0, 256.0, 1024.0}; - inline constexpr std::array kPowBases = { 0.25, 0.5, 1.0, 2.0, 3.0, 4.0, 10.0, 14.0 }; - inline constexpr std::array kPowExponents = { -2.0, -1.0, -0.5, 0.0, 0.5, 1.0, 2.0, 3.0, 4.0 }; + inline constexpr std::array kPowBases = {0.25, 0.5, 1.0, 2.0, 3.0, 4.0, 10.0, 14.0}; + inline constexpr std::array kPowExponents = {-2.0, -1.0, -0.5, 0.0, 0.5, 1.0, 2.0, 3.0, 4.0}; - inline constexpr std::array kPowFloatPairsBase = { 2.0F, 3.0F, 0.5F, 10.0F, 0.25F, 4.0F }; - inline constexpr std::array kPowFloatPairsExp = { 0.0F, 1.0F, 2.0F, -1.0F, 0.5F, 3.0F }; + inline constexpr std::array kPowFloatPairsBase = {2.0F, 3.0F, 0.5F, 10.0F, 0.25F, 4.0F}; + inline constexpr std::array kPowFloatPairsExp = {0.0F, 1.0F, 2.0F, -1.0F, 0.5F, 3.0F}; // Exponent grid covering the full lo6 polynomial domain. Values are chosen // to spread y * log2(x) across many different fractional remainders so that // lo6 = 64 * frac(y * log2(x)) samples the exp2 polynomial throughout [-0.5, 0.5]. inline constexpr std::array kPowExpGrid = { - -10.0, -5.0, -3.0, -2.0, -1.5, -1.0, -0.5, -0.1, 0.1, 0.5, 1.0, 1.5, 2.0, 3.0, 5.0, 10.0, + -10.0, + -5.0, + -3.0, + -2.0, + -1.5, + -1.0, + -0.5, + -0.1, + 0.1, + 0.5, + 1.0, + 1.5, + 2.0, + 3.0, + 5.0, + 10.0, }; inline constexpr std::array kPowExpGridFloat = { - -10.0F, -5.0F, -3.0F, -2.0F, -1.5F, -1.0F, -0.5F, -0.1F, 0.1F, 0.5F, 1.0F, 1.5F, 2.0F, 3.0F, 5.0F, 10.0F, + -10.0F, + -5.0F, + -3.0F, + -2.0F, + -1.5F, + -1.0F, + -0.5F, + -0.1F, + 0.1F, + 0.5F, + 1.0F, + 1.5F, + 2.0F, + 3.0F, + 5.0F, + 10.0F, }; // Small grids for all-rounding-mode ULP sweeps (keep test time bounded). - inline constexpr std::array kAllModesProbeDouble = { 0.5, 1.0, 1.25, 2.0, 3.0, 10.0 }; - inline constexpr std::array kAllModesProbeFloat = { 0.5F, 1.0F, 1.5F, 2.0F, 4.0F }; + inline constexpr std::array kAllModesProbeDouble = {0.5, 1.0, 1.25, 2.0, 3.0, 10.0}; + inline constexpr std::array kAllModesProbeFloat = {0.5F, 1.0F, 1.5F, 2.0F, 4.0F}; // Inputs where IEEE 754 / C++ results can depend on rounding mode (signed zero, ties). - inline constexpr std::array kRoundingSensitiveDouble = { 0.0, -0.0, 1.0, -1.0 }; - inline constexpr std::array kRoundingSensitiveFloat = { 0.0F, -0.0F, 1.0F, -1.0F }; + inline constexpr std::array kRoundingSensitiveDouble = {0.0, -0.0, 1.0, -1.0}; + inline constexpr std::array kRoundingSensitiveFloat = {0.0F, -0.0F, 1.0F, -1.0F}; - inline constexpr std::array kNearbyIntProbeDouble = { 0.5, 1.5, 2.5, -0.5, -1.5, 123.4, -123.6, 1.0e10 + 0.5 }; - inline constexpr std::array kNearbyIntProbeFloat = { 0.5F, 1.5F, -0.5F, -1.5F, 123.4F, -123.6F }; + inline constexpr std::array kNearbyIntProbeDouble = {0.5, 1.5, 2.5, -0.5, -1.5, 123.4, -123.6, 1.0e10 + 0.5}; + inline constexpr std::array kNearbyIntProbeFloat = {0.5F, 1.5F, -0.5F, -1.5F, 123.4F, -123.6F}; // Halfway and tie cases for round/rint (C++ rounds halfway away from zero for round). inline constexpr std::array kNearestHalfwayDouble = { - 0.5, 1.5, 2.5, -0.5, -1.5, -2.5, 0.25, -0.25, 123.5, -123.5, + 0.5, + 1.5, + 2.5, + -0.5, + -1.5, + -2.5, + 0.25, + -0.25, + 123.5, + -123.5, }; - inline constexpr std::array kNearestHalfwayFloat = { 0.5F, 1.5F, 2.5F, -0.5F, -1.5F, -2.5F, 123.5F, -123.5F }; + inline constexpr std::array kNearestHalfwayFloat = {0.5F, 1.5F, 2.5F, -0.5F, -1.5F, -2.5F, 123.5F, -123.5F}; - inline constexpr std::array kAllModesPowBases = { 2.0, 3.0, 0.5, 4.0 }; - inline constexpr std::array kAllModesPowExponents = { 2.0, 1.0, 2.0, 0.5 }; + inline constexpr std::array kAllModesPowBases = {2.0, 3.0, 0.5, 4.0}; + inline constexpr std::array kAllModesPowExponents = {2.0, 1.0, 2.0, 0.5}; inline constexpr std::array, 14> kFmaFloatCases = { - ternary_input{ 1.0F, 2.0F, 3.0F }, - ternary_input{ -0.0F, -0.0F, -0.0F }, - ternary_input{ 0x1.fffep-1F, 0x1.fffep-1F, -0x1.ep-2F }, - ternary_input{ 0x1.fffep-1F, 0x1.fffep-1F, -0x1.fffcp-1F }, - ternary_input{ 0x1.0p-126F, 0x1.0p-23F, -0x1.0p-149F }, - ternary_input{ 0x1.fffffep127F, 2.0F, -0x1.fffffep127F }, - ternary_input{ 0x1.0p-126F, 0x1.0p-24F, -0x1.0p-149F }, - ternary_input{ 0.0F, std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN() }, - ternary_input{ std::numeric_limits::infinity(), std::numeric_limits::infinity(), -std::numeric_limits::infinity() }, - ternary_input{ std::numeric_limits::quiet_NaN(), 1.0F, 1.0F }, - ternary_input{ 1.0F, 1.0F, std::numeric_limits::quiet_NaN() }, + ternary_input{1.0F, 2.0F, 3.0F}, + ternary_input{-0.0F, -0.0F, -0.0F}, + ternary_input{0x1.fffep-1F, 0x1.fffep-1F, -0x1.ep-2F}, + ternary_input{0x1.fffep-1F, 0x1.fffep-1F, -0x1.fffcp-1F}, + ternary_input{0x1.0p-126F, 0x1.0p-23F, -0x1.0p-149F}, + ternary_input{0x1.fffffep127F, 2.0F, -0x1.fffffep127F}, + ternary_input{0x1.0p-126F, 0x1.0p-24F, -0x1.0p-149F}, + ternary_input{0.0F, std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN()}, + ternary_input{std::numeric_limits::infinity(), std::numeric_limits::infinity(), -std::numeric_limits::infinity()}, + ternary_input{std::numeric_limits::quiet_NaN(), 1.0F, 1.0F}, + ternary_input{1.0F, 1.0F, std::numeric_limits::quiet_NaN()}, // Double-rounding killers: double(x)*double(y) + double(z) cast back to float rounds twice // and is off by 1 ulp. Only a correctly-rounded fused kernel matches. See fma.hpp. - ternary_input{ 0x1.001p+0F, 0x1.001p+0F, 0x1.0p-53F }, // 1+2^-12 squared + 2^-53 -> 0x3f801001 - ternary_input{ 0x1.001p+0F, 0x1.001p+0F, -0x1.0p-53F }, // 1+2^-12 squared - 2^-53 -> 0x3f801000 - ternary_input{ 0x1.8p+1F, 0x1.000002p+0F, -0x1.0p-149F }, // 3*(1+2^-23) - 2^-149 + ternary_input{0x1.001p+0F, 0x1.001p+0F, 0x1.0p-53F}, // 1+2^-12 squared + 2^-53 -> 0x3f801001 + ternary_input{0x1.001p+0F, 0x1.001p+0F, -0x1.0p-53F}, // 1+2^-12 squared - 2^-53 -> 0x3f801000 + ternary_input{0x1.8p+1F, 0x1.000002p+0F, -0x1.0p-149F}, // 3*(1+2^-23) - 2^-149 }; inline constexpr std::array, 11> kFmaDoubleCases = { - ternary_input{ 1.0, 2.0, 3.0 }, - ternary_input{ -0.0, -0.0, -0.0 }, - ternary_input{ 0x1.ffffffffffffep-1, 0x1.ffffffffffffep-1, -0x1.ep-2 }, - ternary_input{ 0x1.ffffffffffep-1, 0x1.ffffffffffep-1, -0x1.ffffffffffcp-1 }, - ternary_input{ 0x1.0p-1022, 0x1.0p-52, -0x1.0p-1074 }, - ternary_input{ 0x1.fffffffffffffp1023, 2.0, -0x1.fffffffffffffp1023 }, - ternary_input{ 0x1.0p-1022, 0x1.0p-53, -0x1.0p-1074 }, - ternary_input{ 0.0, std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN() }, - ternary_input{ std::numeric_limits::infinity(), std::numeric_limits::infinity(), -std::numeric_limits::infinity() }, - ternary_input{ std::numeric_limits::quiet_NaN(), 1.0, 1.0 }, - ternary_input{ 1.0, 1.0, std::numeric_limits::quiet_NaN() }, + ternary_input{1.0, 2.0, 3.0}, + ternary_input{-0.0, -0.0, -0.0}, + ternary_input{0x1.ffffffffffffep-1, 0x1.ffffffffffffep-1, -0x1.ep-2}, + ternary_input{0x1.ffffffffffep-1, 0x1.ffffffffffep-1, -0x1.ffffffffffcp-1}, + ternary_input{0x1.0p-1022, 0x1.0p-52, -0x1.0p-1074}, + ternary_input{0x1.fffffffffffffp1023, 2.0, -0x1.fffffffffffffp1023}, + ternary_input{0x1.0p-1022, 0x1.0p-53, -0x1.0p-1074}, + ternary_input{0.0, std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN()}, + ternary_input{std::numeric_limits::infinity(), std::numeric_limits::infinity(), -std::numeric_limits::infinity()}, + ternary_input{std::numeric_limits::quiet_NaN(), 1.0, 1.0}, + ternary_input{1.0, 1.0, std::numeric_limits::quiet_NaN()}, }; inline constexpr std::array, 7> kFmaAllModesFloatCases = { - ternary_input{ 0x1.fffep-1F, 0x1.fffep-1F, -0x1.ep-2F }, - ternary_input{ 0x1.fffep-1F, 0x1.fffep-1F, -0x1.fffcp-1F }, - ternary_input{ 0x1.0p-126F, 0x1.0p-23F, -0x1.0p-149F }, - ternary_input{ 0.0F, std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN() }, - ternary_input{ std::numeric_limits::infinity(), std::numeric_limits::infinity(), -std::numeric_limits::infinity() }, - ternary_input{ 0x1.001p+0F, 0x1.001p+0F, 0x1.0p-53F }, // double-rounding killer (all modes) - ternary_input{ 0x1.001p+0F, 0x1.001p+0F, -0x1.0p-53F }, + ternary_input{0x1.fffep-1F, 0x1.fffep-1F, -0x1.ep-2F}, + ternary_input{0x1.fffep-1F, 0x1.fffep-1F, -0x1.fffcp-1F}, + ternary_input{0x1.0p-126F, 0x1.0p-23F, -0x1.0p-149F}, + ternary_input{0.0F, std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN()}, + ternary_input{std::numeric_limits::infinity(), std::numeric_limits::infinity(), -std::numeric_limits::infinity()}, + ternary_input{0x1.001p+0F, 0x1.001p+0F, 0x1.0p-53F}, // double-rounding killer (all modes) + ternary_input{0x1.001p+0F, 0x1.001p+0F, -0x1.0p-53F}, }; inline constexpr std::array, 5> kFmaAllModesDoubleCases = { - ternary_input{ 0x1.ffffffffffffep-1, 0x1.ffffffffffffep-1, -0x1.ep-2 }, - ternary_input{ 0x1.ffffffffffep-1, 0x1.ffffffffffep-1, -0x1.ffffffffffcp-1 }, - ternary_input{ 0x1.0p-1022, 0x1.0p-52, -0x1.0p-1074 }, - ternary_input{ 0.0, std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN() }, - ternary_input{ std::numeric_limits::infinity(), std::numeric_limits::infinity(), -std::numeric_limits::infinity() }, + ternary_input{0x1.ffffffffffffep-1, 0x1.ffffffffffffep-1, -0x1.ep-2}, + ternary_input{0x1.ffffffffffep-1, 0x1.ffffffffffep-1, -0x1.ffffffffffcp-1}, + ternary_input{0x1.0p-1022, 0x1.0p-52, -0x1.0p-1074}, + ternary_input{0.0, std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN()}, + ternary_input{std::numeric_limits::infinity(), std::numeric_limits::infinity(), -std::numeric_limits::infinity()}, }; // Inverse trig: asin/acos domain is [-1, 1]. atan accepts full range. inline constexpr std::array kInvTrigUnitFloat = { - -1.0F, -0.99F, -0.75F, -0.5F, -0.25F, -0.125F, -0.0F, 0.0F, 0.125F, 0.25F, 0.5F, 0.75F, 0.99F, 1.0F, 0x1.fffffep-1F, -0x1.fffffep-1F, + -1.0F, + -0.99F, + -0.75F, + -0.5F, + -0.25F, + -0.125F, + -0.0F, + 0.0F, + 0.125F, + 0.25F, + 0.5F, + 0.75F, + 0.99F, + 1.0F, + 0x1.fffffep-1F, + -0x1.fffffep-1F, }; inline constexpr std::array kInvTrigUnitDouble = { - -1.0, -0.99, -0.75, -0.5, -0.25, -0.125, -0.0, 0.0, 0.125, 0.25, 0.5, 0.75, 0.99, 1.0, 0x1.fffffffffffffp-1, -0x1.fffffffffffffp-1, + -1.0, + -0.99, + -0.75, + -0.5, + -0.25, + -0.125, + -0.0, + 0.0, + 0.125, + 0.25, + 0.5, + 0.75, + 0.99, + 1.0, + 0x1.fffffffffffffp-1, + -0x1.fffffffffffffp-1, }; inline constexpr std::array kAtanFloat = { - -10.0F, -1.0F, -0.5F, -0.0F, 0.0F, 0.5F, 1.0F, 10.0F, 100.0F, -100.0F, 0x1.0p+20F, -0x1.0p+20F, + -10.0F, + -1.0F, + -0.5F, + -0.0F, + 0.0F, + 0.5F, + 1.0F, + 10.0F, + 100.0F, + -100.0F, + 0x1.0p+20F, + -0x1.0p+20F, }; inline constexpr std::array kAtanDouble = { - -10.0, -1.0, -0.5, -0.0, 0.0, 0.5, 1.0, 10.0, 100.0, -100.0, 0x1.0p+300, -0x1.0p+300, + -10.0, + -1.0, + -0.5, + -0.0, + 0.0, + 0.5, + 1.0, + 10.0, + 100.0, + -100.0, + 0x1.0p+300, + -0x1.0p+300, }; // atan2 quadrant probes (y, x). - inline constexpr std::array kAtan2YFloat = { 1.0F, 1.0F, -1.0F, -1.0F, 0.0F, 0.0F, 1.0F, -1.0F }; - inline constexpr std::array kAtan2XFloat = { 1.0F, -1.0F, 1.0F, -1.0F, 1.0F, -1.0F, 0.0F, 0.0F }; + inline constexpr std::array kAtan2YFloat = {1.0F, 1.0F, -1.0F, -1.0F, 0.0F, 0.0F, 1.0F, -1.0F}; + inline constexpr std::array kAtan2XFloat = {1.0F, -1.0F, 1.0F, -1.0F, 1.0F, -1.0F, 0.0F, 0.0F}; - inline constexpr std::array kAtan2YDouble = { 1.0, 1.0, -1.0, -1.0, 0.0, 0.0, 1.0, -1.0 }; - inline constexpr std::array kAtan2XDouble = { 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 0.0, 0.0 }; + inline constexpr std::array kAtan2YDouble = {1.0, 1.0, -1.0, -1.0, 0.0, 0.0, 1.0, -1.0}; + inline constexpr std::array kAtan2XDouble = {1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 0.0, 0.0}; inline constexpr std::array kCbrtFloat = { - -27.0F, -8.0F, -1.0F, -0.0F, 0.0F, 0.125F, 1.0F, 8.0F, 27.0F, 64.0F, 1024.0F, 0x1.0p-126F, 0x1.0p+30F, -0x1.0p+30F, + -27.0F, + -8.0F, + -1.0F, + -0.0F, + 0.0F, + 0.125F, + 1.0F, + 8.0F, + 27.0F, + 64.0F, + 1024.0F, + 0x1.0p-126F, + 0x1.0p+30F, + -0x1.0p+30F, }; inline constexpr std::array kCbrtDouble = { @@ -220,22 +354,41 @@ namespace ccm::test::samples 0x1.428a2f98d728bp+0, }; - inline constexpr std::array kHypotPairXFloat = { 3.0F, 1e20F, 0.0F, 1.0F, 3.0F, 1e-30F }; - inline constexpr std::array kHypotPairYFloat = { 4.0F, 1e20F, 0.0F, 0.0F, -4.0F, 1e-30F }; + inline constexpr std::array kHypotPairXFloat = {3.0F, 1e20F, 0.0F, 1.0F, 3.0F, 1e-30F}; + inline constexpr std::array kHypotPairYFloat = {4.0F, 1e20F, 0.0F, 0.0F, -4.0F, 1e-30F}; - inline constexpr std::array kHypotPairXDouble = { 3.0, 1e200, 0.0, 1.0, 3.0, 1e-300 }; - inline constexpr std::array kHypotPairYDouble = { 4.0, 1e200, 0.0, 0.0, -4.0, 1e-300 }; + inline constexpr std::array kHypotPairXDouble = {3.0, 1e200, 0.0, 1.0, 3.0, 1e-300}; + inline constexpr std::array kHypotPairYDouble = {4.0, 1e200, 0.0, 0.0, -4.0, 1e-300}; inline constexpr std::array kIlogbProbeDouble = { - 1.0, 0.125, 0.0, -0.0, 0x1.0p-1022, -0x1.0p-1022, 0x1.0p+1023, -0x1.0p+1023, + 1.0, + 0.125, + 0.0, + -0.0, + 0x1.0p-1022, + -0x1.0p-1022, + 0x1.0p+1023, + -0x1.0p+1023, }; inline constexpr std::array kIlogbProbeFloat = { - 1.0F, 0.125F, 0.0F, -0.0F, 0x1.0p-126F, 0x1.0p+30F, + 1.0F, + 0.125F, + 0.0F, + -0.0F, + 0x1.0p-126F, + 0x1.0p+30F, }; inline constexpr std::array kLogbProbeDouble = { - 8.0, 0.125, 0.0, -0.0, 0x1.0p-1022, 0x1.0p+1023, -0x1.0p+1023, 1.0, + 8.0, + 0.125, + 0.0, + -0.0, + 0x1.0p-1022, + 0x1.0p+1023, + -0x1.0p+1023, + 1.0, }; inline constexpr std::array kGammaProbeDouble = { @@ -244,7 +397,22 @@ namespace ccm::test::samples }; inline constexpr std::array kGammaProbeFloat = { - 0.125F, 0.5F, 1.5F, 2.5F, 3.75F, 7.25F, 10.0F, 20.0F, 50.0F, -0.25F, -1.5F, -2.5F, -10.5F, 0x1.0p-10F, 0x1.0p+4F, 0x1.0p+10F, + 0.125F, + 0.5F, + 1.5F, + 2.5F, + 3.75F, + 7.25F, + 10.0F, + 20.0F, + 50.0F, + -0.25F, + -1.5F, + -2.5F, + -10.5F, + 0x1.0p-10F, + 0x1.0p+4F, + 0x1.0p+10F, }; } // namespace ccm::test::samples diff --git a/tests/shared/utils/pow_path_dispatch.hpp b/tests/shared/utils/pow_path_dispatch.hpp index 1c3c8081..b250dbeb 100644 --- a/tests/shared/utils/pow_path_dispatch.hpp +++ b/tests/shared/utils/pow_path_dispatch.hpp @@ -82,31 +82,31 @@ namespace ccm::test::pow_path { case validation_path::public_default: case validation_path::generic_runtime: - case validation_path::generic_modeled_domain: return { true, {} }; + case validation_path::generic_modeled_domain: return {true, {}}; case validation_path::runtime_no_builtin: #if defined(CCM_CONFIG_TEST_DISABLE_RUNTIME_BUILTIN_POW) - return { true, {} }; + return {true, {}}; #else - return { false, "runtime_no_builtin requires CCMATH_TEST_DISABLE_RUNTIME_BUILTIN=ON at configure time" }; + return {false, "runtime_no_builtin requires CCMATH_TEST_DISABLE_RUNTIME_BUILTIN=ON at configure time"}; #endif case validation_path::runtime_simd: #if defined(CCMATH_HAS_SIMD) if constexpr (std::is_same_v || std::is_same_v) { - return { true, {} }; + return {true, {}}; } - return { false, "runtime_simd is only supported for float and double" }; + return {false, "runtime_simd is only supported for float and double"}; #else - return { false, "runtime_simd requires runtime SIMD to be compiled in" }; + return {false, "runtime_simd requires runtime SIMD to be compiled in"}; #endif case validation_path::runtime_builtin: if constexpr (ccm::builtin::has_runtime_pow) { - return { true, {} }; + return {true, {}}; } - return { false, "runtime_builtin is unavailable on this toolchain" }; + return {false, "runtime_builtin is unavailable on this toolchain"}; } - return { false, "unknown path" }; + return {false, "unknown path"}; } template inline T invoke(validation_path path, T base, T exponent) @@ -163,8 +163,14 @@ namespace ccm::test::pow_path template inline configuration_report make_configuration_report(validation_path path) { return configuration_report{ - ccm::test::pow_configuration_name(), path_name(path), ccm::test::compiler_id(), ccm::test::platform_id(), - ccm::test::optimization_mode(), ccm::test::fma_status(), ccm::test::pow_builtin_status(), ccm::test::simd_status(), + ccm::test::pow_configuration_name(), + path_name(path), + ccm::test::compiler_id(), + ccm::test::platform_id(), + ccm::test::optimization_mode(), + ccm::test::fma_status(), + ccm::test::pow_builtin_status(), + ccm::test::simd_status(), }; } diff --git a/tests/shared/utils/ulp_distance.hpp b/tests/shared/utils/ulp_distance.hpp index 8d9a45d4..18ca96ee 100644 --- a/tests/shared/utils/ulp_distance.hpp +++ b/tests/shared/utils/ulp_distance.hpp @@ -67,28 +67,28 @@ namespace ccm::test::ulp if (lhs_bits.is_nan() && rhs_bits.is_nan()) { - return distance_result{ relation::both_nan, exact_bitwise_equal, false, 0 }; + return distance_result{relation::both_nan, exact_bitwise_equal, false, 0}; } if (lhs_bits.is_nan() || rhs_bits.is_nan()) { - return distance_result{ relation::nan_mismatch, exact_bitwise_equal, false, 0 }; + return distance_result{relation::nan_mismatch, exact_bitwise_equal, false, 0}; } if (lhs_bits.is_inf() && rhs_bits.is_inf()) { if (lhs_bits.sign() == rhs_bits.sign()) { - return distance_result{ relation::both_infinity_same_sign, exact_bitwise_equal, numerically_equal, 0 }; + return distance_result{relation::both_infinity_same_sign, exact_bitwise_equal, numerically_equal, 0}; } - return distance_result{ relation::infinity_mismatch, exact_bitwise_equal, false, 0 }; + return distance_result{relation::infinity_mismatch, exact_bitwise_equal, false, 0}; } if (lhs_bits.is_inf() || rhs_bits.is_inf()) { - return distance_result{ relation::infinity_mismatch, exact_bitwise_equal, false, 0 }; + return distance_result{relation::infinity_mismatch, exact_bitwise_equal, false, 0}; } if (lhs_bits.is_zero() && rhs_bits.is_zero()) { // Signed zero is numerically equal but still exposed through exact_bitwise_equal. - return distance_result{ relation::finite, exact_bitwise_equal, true, 0 }; + return distance_result{relation::finite, exact_bitwise_equal, true, 0}; } return distance_result{ diff --git a/tests/shared/utils/worst_case_samples.hpp b/tests/shared/utils/worst_case_samples.hpp index ba5bfb06..008e5191 100644 --- a/tests/shared/utils/worst_case_samples.hpp +++ b/tests/shared/utils/worst_case_samples.hpp @@ -32,7 +32,12 @@ namespace ccm::test::worst_case // LLVM-libc sinf exceptional values (reviews.llvm.org/D123154). inline constexpr std::array kSinFloatExceptional = { - 0x1.4f0654p0F, -0x1.4f0654p0F, 0x1.33333p13F, 0x1.fbd9c8p22F, 0x1.465d2p25F, 0x1.47d0fep+34F, + 0x1.4f0654p0F, + -0x1.4f0654p0F, + 0x1.33333p13F, + 0x1.fbd9c8p22F, + 0x1.465d2p25F, + 0x1.47d0fep+34F, }; inline constexpr std::array kCosFloatExceptional = { @@ -58,24 +63,47 @@ namespace ccm::test::worst_case // exp / expm1: tiny, subnormal-adjacent, overflow-adjacent, and split boundaries. inline constexpr std::array kExpm1FloatHard = { - 0x1.0p-25F, 0x1.0p-24F, 0x1.0p-2F, -0x1.0p-2F, 0x1.62e42ep6F, -0x1.9fe368p6F, + 0x1.0p-25F, + 0x1.0p-24F, + 0x1.0p-2F, + -0x1.0p-2F, + 0x1.62e42ep6F, + -0x1.9fe368p6F, }; inline constexpr std::array kExpm1DoubleHard = { - 0x1.0p-54, 0x1.0p-53, 0x1.0p-2, -0x1.0p-2, 0x1.0p-10, 0x1.62e42ep+6, -0x1.62e42ep+6, + 0x1.0p-54, + 0x1.0p-53, + 0x1.0p-2, + -0x1.0p-2, + 0x1.0p-10, + 0x1.62e42ep+6, + -0x1.62e42ep+6, }; inline constexpr std::array kExpFloatHard = { - 0x1.0p-25F, 0x1.0p+0F, 0x1.62e42ep6F, -0x1.0p+1F, -0x1.9fe368p6F, + 0x1.0p-25F, + 0x1.0p+0F, + 0x1.62e42ep6F, + -0x1.0p+1F, + -0x1.9fe368p6F, }; inline constexpr std::array kExpDoubleHard = { - 0x1.0p-54, 0x1.0p-1022, 0x1.0p+0, 0x1.62e42ep+6, -0x1.62e42ep+6, + 0x1.0p-54, + 0x1.0p-1022, + 0x1.0p+0, + 0x1.62e42ep+6, + -0x1.62e42ep+6, }; // log / log2 / log10: hard-to-round near 1 and subnormal (Zimmermann TMD / glibc accuracy tables). inline constexpr std::array kLogDoubleHard = { - 0x1.0000000000001p+0, 0x1.fffffffffffffp+0, 0x1.62a88613629b6p+0, 0x1.0p-1022, 0x1.0p+1023, + 0x1.0000000000001p+0, + 0x1.fffffffffffffp+0, + 0x1.62a88613629b6p+0, + 0x1.0p-1022, + 0x1.0p+1023, }; inline constexpr std::array kLogFloatHard = { @@ -87,11 +115,21 @@ namespace ccm::test::worst_case // log1p: inputs where 1+x loses bits and musl split boundaries. inline constexpr std::array kLog1pFloatHard = { - 0x1.0p-25F, 0x1.0p-24F, 0x1.6a09e667f3bcdp-1F, -0x1.6a09e667f3bcdp-1F, -0x1.0p-1F, 0x1.0p+1F, + 0x1.0p-25F, + 0x1.0p-24F, + 0x1.6a09e667f3bcdp-1F, + -0x1.6a09e667f3bcdp-1F, + -0x1.0p-1F, + 0x1.0p+1F, }; inline constexpr std::array kLog1pDoubleHard = { - 0x1.0p-53, 0x1.0p-52, 0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bcdp-1, -0x1.0p-1, 0x1.0p+4, + 0x1.0p-53, + 0x1.0p-52, + 0x1.6a09e667f3bcdp-1, + -0x1.6a09e667f3bcdp-1, + -0x1.0p-1, + 0x1.0p+4, }; // exp2 hard-to-round (Zimmermann, binary64 exp2 nearest). @@ -122,78 +160,107 @@ namespace ccm::test::worst_case }; // Non-builtin path-matrix underflow residual campaign, seed 0xC0DEC0FFEE. - inline constexpr std::array kPowDoubleUnderflowResidual = { { - { 0x251d5d43f50d0108ULL, 0x729c2b90e3442eecULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x4da248bc6a915c1eULL, 0xca93fd094b629db9ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x67add96f434533e9ULL, 0xd16be30ac7782b1aULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x4180947677866edfULL, 0xea29cdd38c9dafe5ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x2d6e4b3263a700ddULL, 0x66e5e2b8b62dae73ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x065feef2d691057dULL, 0x47261da68f57948eULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x5971deedd54a73feULL, 0xcab0e9312c710c18ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x00094b5d5317c3e7ULL, 0x7dbb01075a511900ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x3c77173d214943f7ULL, 0x67ebc39f38f67d55ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x0699eec8834512a3ULL, 0x6e78eef508a9755bULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x47c517385e76859bULL, 0xe5bf5928decba611ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x3d57779a52896ccdULL, 0x44f68ab37e9830bfULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x7890d582c1f40d45ULL, 0xcacc034085c17047ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x5dd7f4c26c0f13e7ULL, 0xf962e2383aff1c74ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x4bbae25fcc4bc621ULL, 0xccf980b7d3eae02dULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x103f8a410b76302dULL, 0x45602c8f1fc72c13ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x710c9c44942091b3ULL, 0xef1e832952550adeULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x3cb43cb6ffca5ea2ULL, 0x5f1869450668b0b9ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x5f07fbb85d4e5ce4ULL, 0xd6c16d495050197dULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x788b201b3728b3a8ULL, 0xfb15dbf2644b141dULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x3ec66615e45a70d0ULL, 0x51172a84d617a0daULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x40012e1f44115d27ULL, 0xd16d1b9e135d9410ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x1a419635071c475dULL, 0x49e26e56b9615aeeULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x07aaea00b075a713ULL, 0x5d9713d520484d14ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x6797251914607e72ULL, 0xe3ffce54797ed86aULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x70d0fc8216be69f1ULL, 0xfafd1b08bd0ea065ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x1cd3cfb993f9c5feULL, 0x5b355f216cca5f15ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x5b44c6a8ee131f1cULL, 0xc72897d5346718c8ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - { 0x20c2356781a19392ULL, 0x6ee4a8fe064ac7adULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE" }, - } }; - - inline constexpr std::array, 5> kPowDoubleHard = { { - { 0x1.0p-50, 0x1.0p+50, "legacy hard-case corpus: tiny base with huge positive exponent" }, - { -0x1.0p+0, 0x1.8p+0, "legacy hard-case corpus: negative base near non-integer exponent domain edge" }, - { 10.0, 4.0, "pow_gen regression case retained from PowGenDoubleRegressionCases" }, - { 30.637028068178267, -7.702539522452998, "pow_gen regression case retained from PowGenDoubleRegressionCases" }, - { 945971881662.053466796875, 15.38309228199631562, "pow_gen regression case retained from PowGenDoubleRegressionCases" }, - } }; - - inline constexpr std::array, 4> kPowFloatHard = { { - { 0x1.0p-20F, 0x1.0p+20F, "float analogue of the legacy tiny-base / huge-exponent stress case" }, - { -1.0F, 3.0F, "integer-parity sign propagation regression anchor" }, - { -1.0F, 4.0F, "integer-parity sign propagation regression anchor" }, - { -1.0F, 1.5F, "negative-base / non-integer exponent domain regression anchor" }, - } }; + inline constexpr std::array kPowDoubleUnderflowResidual = {{ + {0x251d5d43f50d0108ULL, 0x729c2b90e3442eecULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x4da248bc6a915c1eULL, 0xca93fd094b629db9ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x67add96f434533e9ULL, 0xd16be30ac7782b1aULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x4180947677866edfULL, 0xea29cdd38c9dafe5ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x2d6e4b3263a700ddULL, 0x66e5e2b8b62dae73ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x065feef2d691057dULL, 0x47261da68f57948eULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x5971deedd54a73feULL, 0xcab0e9312c710c18ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x00094b5d5317c3e7ULL, 0x7dbb01075a511900ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x3c77173d214943f7ULL, 0x67ebc39f38f67d55ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x0699eec8834512a3ULL, 0x6e78eef508a9755bULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x47c517385e76859bULL, 0xe5bf5928decba611ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x3d57779a52896ccdULL, 0x44f68ab37e9830bfULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x7890d582c1f40d45ULL, 0xcacc034085c17047ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x5dd7f4c26c0f13e7ULL, 0xf962e2383aff1c74ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x4bbae25fcc4bc621ULL, 0xccf980b7d3eae02dULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x103f8a410b76302dULL, 0x45602c8f1fc72c13ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x710c9c44942091b3ULL, 0xef1e832952550adeULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x3cb43cb6ffca5ea2ULL, 0x5f1869450668b0b9ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x5f07fbb85d4e5ce4ULL, 0xd6c16d495050197dULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x788b201b3728b3a8ULL, 0xfb15dbf2644b141dULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x3ec66615e45a70d0ULL, 0x51172a84d617a0daULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x40012e1f44115d27ULL, 0xd16d1b9e135d9410ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x1a419635071c475dULL, 0x49e26e56b9615aeeULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x07aaea00b075a713ULL, 0x5d9713d520484d14ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x6797251914607e72ULL, 0xe3ffce54797ed86aULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x70d0fc8216be69f1ULL, 0xfafd1b08bd0ea065ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x1cd3cfb993f9c5feULL, 0x5b355f216cca5f15ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x5b44c6a8ee131f1cULL, 0xc72897d5346718c8ULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + {0x20c2356781a19392ULL, 0x6ee4a8fe064ac7adULL, "non-builtin path-matrix underflow residual case, seed 0xC0DEC0FFEE"}, + }}; + + inline constexpr std::array, 5> kPowDoubleHard = {{ + {0x1.0p-50, 0x1.0p+50, "legacy hard-case corpus: tiny base with huge positive exponent"}, + {-0x1.0p+0, 0x1.8p+0, "legacy hard-case corpus: negative base near non-integer exponent domain edge"}, + {10.0, 4.0, "pow_gen regression case retained from PowGenDoubleRegressionCases"}, + {30.637028068178267, -7.702539522452998, "pow_gen regression case retained from PowGenDoubleRegressionCases"}, + {945971881662.053466796875, 15.38309228199631562, "pow_gen regression case retained from PowGenDoubleRegressionCases"}, + }}; + + inline constexpr std::array, 4> kPowFloatHard = {{ + {0x1.0p-20F, 0x1.0p+20F, "float analogue of the legacy tiny-base / huge-exponent stress case"}, + {-1.0F, 3.0F, "integer-parity sign propagation regression anchor"}, + {-1.0F, 4.0F, "integer-parity sign propagation regression anchor"}, + {-1.0F, 1.5F, "negative-base / non-integer exponent domain regression anchor"}, + }}; // asin/acos: hard-to-round near ±1 and tiny (LLVM-libc / musl accuracy tables). inline constexpr std::array kAsinDoubleHard = { - 0x1.0p-1022, -0x1.0p-1022, 0x1.fffffffffffffp-1, -0x1.fffffffffffffp-1, 0x1.0p-27, -0x1.0p-27, + 0x1.0p-1022, + -0x1.0p-1022, + 0x1.fffffffffffffp-1, + -0x1.fffffffffffffp-1, + 0x1.0p-27, + -0x1.0p-27, }; inline constexpr std::array kAsinFloatHard = { - 0x1.0p-126F, -0x1.0p-126F, 0x1.fffffep-1F, -0x1.fffffep-1F, 0x1.0p-14F, + 0x1.0p-126F, + -0x1.0p-126F, + 0x1.fffffep-1F, + -0x1.fffffep-1F, + 0x1.0p-14F, }; inline constexpr std::array kAtanDoubleHard = { - 0x1.0p-1022, -0x1.0p-1022, 0x1.0p+300, -0x1.0p+300, 0x1.1p+0, + 0x1.0p-1022, + -0x1.0p-1022, + 0x1.0p+300, + -0x1.0p+300, + 0x1.1p+0, }; // cbrt: subnormal, overflow-adjacent, and hard-to-round cube-root neighbors. inline constexpr std::array kCbrtDoubleHard = { - 0x1.0p-1022, -0x1.0p-1022, 0x1.fffffffffffffp+1023, -0x1.fffffffffffffp+1023, 0x1.428a2f98d728bp+0, -0x1.428a2f98d728bp+0, + 0x1.0p-1022, + -0x1.0p-1022, + 0x1.fffffffffffffp+1023, + -0x1.fffffffffffffp+1023, + 0x1.428a2f98d728bp+0, + -0x1.428a2f98d728bp+0, }; inline constexpr std::array kCbrtFloatHard = { - 0x1.0p-126F, -0x1.0p-126F, 0x1.fffffep+127F, -0x1.fffffep+127F, 0x1.428a2fp+0F, + 0x1.0p-126F, + -0x1.0p-126F, + 0x1.fffffep+127F, + -0x1.fffffep+127F, + 0x1.428a2fp+0F, }; // tgamma/lgamma: poles and large-magnitude stress (LLVM-libc tgamma tests). inline constexpr std::array kGammaDoubleHard = { - 0x1.0p-27, 0x1.fffffffffffp-1, 0x1.0p+4, 0x1.0p+20, -0x1.0p-3, -0x1.8p+0, -0x1.0p+1, -0x1.0p+4, + 0x1.0p-27, + 0x1.fffffffffffp-1, + 0x1.0p+4, + 0x1.0p+20, + -0x1.0p-3, + -0x1.8p+0, + -0x1.0p+1, + -0x1.0p+4, }; } // namespace ccm::test::worst_case diff --git a/tests/src/math/basic/abs_test.cpp b/tests/src/math/basic/abs_test.cpp index a8212231..d0e9b8a9 100644 --- a/tests/src/math/basic/abs_test.cpp +++ b/tests/src/math/basic/abs_test.cpp @@ -40,142 +40,142 @@ namespace const std::vector> kAbsDoubleTestParams{ // Floating point whole values - { 1.0, std::abs(1.0) }, - { -1.0, std::abs(-1.0) }, - { 2.0, std::abs(2.0) }, - { -2.0, std::abs(-2.0) }, - { 4.0, std::abs(4.0) }, - { -4.0, std::abs(-4.0) }, - { 8.0, std::abs(8.0) }, - { -8.0, std::abs(-8.0) }, - { 16.0, std::abs(16.0) }, - { -16.0, std::abs(-16.0) }, - { 32.0, std::abs(32.0) }, - { -32.0, std::abs(-32.0) }, + {1.0, std::abs(1.0)}, + {-1.0, std::abs(-1.0)}, + {2.0, std::abs(2.0)}, + {-2.0, std::abs(-2.0)}, + {4.0, std::abs(4.0)}, + {-4.0, std::abs(-4.0)}, + {8.0, std::abs(8.0)}, + {-8.0, std::abs(-8.0)}, + {16.0, std::abs(16.0)}, + {-16.0, std::abs(-16.0)}, + {32.0, std::abs(32.0)}, + {-32.0, std::abs(-32.0)}, // Testing zeroes - { 0.0, std::abs(0.0) }, - { -0.0, std::abs(-0.0) }, + {0.0, std::abs(0.0)}, + {-0.0, std::abs(-0.0)}, // Floating point non-whole values - { 1.12345, std::abs(1.12345) }, - { -1.12345, std::abs(1.12345) }, - { 74.5928, std::abs(74.5928) }, - { -74.5928, std::abs(-74.5928) }, + {1.12345, std::abs(1.12345)}, + {-1.12345, std::abs(1.12345)}, + {74.5928, std::abs(74.5928)}, + {-74.5928, std::abs(-74.5928)}, // Edge cases - { std::numeric_limits::min(), std::abs(std::numeric_limits::min()) }, - { std::numeric_limits::max(), std::abs(std::numeric_limits::max()) }, - { std::numeric_limits::denorm_min(), std::abs(std::numeric_limits::denorm_min()) }, - { -std::numeric_limits::denorm_min(), std::abs(-std::numeric_limits::denorm_min()) }, - { std::numeric_limits::infinity(), std::abs(std::numeric_limits::infinity()) }, - { -std::numeric_limits::infinity(), std::abs(-std::numeric_limits::infinity()) }, - { -std::numeric_limits::max() * 10, std::abs(-std::numeric_limits::max() * 10) }, - { std::numeric_limits::max() * 10, std::abs(std::numeric_limits::max() * 10) }, - { std::numeric_limits::quiet_NaN(), std::abs(std::numeric_limits::quiet_NaN()) }, + {std::numeric_limits::min(), std::abs(std::numeric_limits::min())}, + {std::numeric_limits::max(), std::abs(std::numeric_limits::max())}, + {std::numeric_limits::denorm_min(), std::abs(std::numeric_limits::denorm_min())}, + {-std::numeric_limits::denorm_min(), std::abs(-std::numeric_limits::denorm_min())}, + {std::numeric_limits::infinity(), std::abs(std::numeric_limits::infinity())}, + {-std::numeric_limits::infinity(), std::abs(-std::numeric_limits::infinity())}, + {-std::numeric_limits::max() * 10, std::abs(-std::numeric_limits::max() * 10)}, + {std::numeric_limits::max() * 10, std::abs(std::numeric_limits::max() * 10)}, + {std::numeric_limits::quiet_NaN(), std::abs(std::numeric_limits::quiet_NaN())}, }; const std::vector> kAbsFloatTestParams{ // Floating point whole values - { 1.0F, std::abs(1.0F) }, - { -1.0F, std::abs(-1.0F) }, - { 2.0F, std::abs(2.0F) }, - { -2.0F, std::abs(-2.0F) }, - { 4.0F, std::abs(4.0F) }, - { -4.0F, std::abs(-4.0F) }, - { 8.0F, std::abs(8.0F) }, - { -8.0F, std::abs(-8.0F) }, - { 16.0F, std::abs(16.0F) }, - { -16.0F, std::abs(-16.0F) }, - { 32.0F, std::abs(32.0F) }, - { -32.0F, std::abs(-32.0F) }, + {1.0F, std::abs(1.0F)}, + {-1.0F, std::abs(-1.0F)}, + {2.0F, std::abs(2.0F)}, + {-2.0F, std::abs(-2.0F)}, + {4.0F, std::abs(4.0F)}, + {-4.0F, std::abs(-4.0F)}, + {8.0F, std::abs(8.0F)}, + {-8.0F, std::abs(-8.0F)}, + {16.0F, std::abs(16.0F)}, + {-16.0F, std::abs(-16.0F)}, + {32.0F, std::abs(32.0F)}, + {-32.0F, std::abs(-32.0F)}, // Testing zeroes - { 0.0F, std::abs(0.0F) }, - { -0.0F, std::abs(-0.0F) }, + {0.0F, std::abs(0.0F)}, + {-0.0F, std::abs(-0.0F)}, // Floating point non-whole values - { 1.12345F, std::abs(1.12345F) }, - { -1.12345F, std::abs(1.12345F) }, - { 74.5928F, std::abs(74.5928F) }, - { -74.5928F, std::abs(-74.5928F) }, + {1.12345F, std::abs(1.12345F)}, + {-1.12345F, std::abs(1.12345F)}, + {74.5928F, std::abs(74.5928F)}, + {-74.5928F, std::abs(-74.5928F)}, // Edge cases - { std::numeric_limits::min(), std::abs(std::numeric_limits::min()) }, - { std::numeric_limits::max(), std::abs(std::numeric_limits::max()) }, - { std::numeric_limits::denorm_min(), std::abs(std::numeric_limits::denorm_min()) }, - { -std::numeric_limits::denorm_min(), std::abs(-std::numeric_limits::denorm_min()) }, - { std::numeric_limits::infinity(), std::abs(std::numeric_limits::infinity()) }, - { -std::numeric_limits::infinity(), std::abs(-std::numeric_limits::infinity()) }, - { -std::numeric_limits::max() * 10, std::abs(-std::numeric_limits::max() * 10) }, - { std::numeric_limits::max() * 10, std::abs(std::numeric_limits::max() * 10) }, - { std::numeric_limits::quiet_NaN(), std::abs(std::numeric_limits::quiet_NaN()) }, + {std::numeric_limits::min(), std::abs(std::numeric_limits::min())}, + {std::numeric_limits::max(), std::abs(std::numeric_limits::max())}, + {std::numeric_limits::denorm_min(), std::abs(std::numeric_limits::denorm_min())}, + {-std::numeric_limits::denorm_min(), std::abs(-std::numeric_limits::denorm_min())}, + {std::numeric_limits::infinity(), std::abs(std::numeric_limits::infinity())}, + {-std::numeric_limits::infinity(), std::abs(-std::numeric_limits::infinity())}, + {-std::numeric_limits::max() * 10, std::abs(-std::numeric_limits::max() * 10)}, + {std::numeric_limits::max() * 10, std::abs(std::numeric_limits::max() * 10)}, + {std::numeric_limits::quiet_NaN(), std::abs(std::numeric_limits::quiet_NaN())}, }; const std::vector> kAbsLongDoubleTestParams{ // Floating point whole values - { 1.0L, std::abs(1.0L) }, - { -1.0L, std::abs(-1.0L) }, - { 2.0L, std::abs(2.0L) }, - { -2.0L, std::abs(-2.0L) }, - { 4.0L, std::abs(4.0L) }, - { -4.0L, std::abs(-4.0L) }, - { 8.0L, std::abs(8.0L) }, - { -8.0L, std::abs(-8.0L) }, - { 16.0L, std::abs(16.0L) }, - { -16.0L, std::abs(-16.0L) }, - { 32.0L, std::abs(32.0L) }, - { -32.0L, std::abs(-32.0L) }, + {1.0L, std::abs(1.0L)}, + {-1.0L, std::abs(-1.0L)}, + {2.0L, std::abs(2.0L)}, + {-2.0L, std::abs(-2.0L)}, + {4.0L, std::abs(4.0L)}, + {-4.0L, std::abs(-4.0L)}, + {8.0L, std::abs(8.0L)}, + {-8.0L, std::abs(-8.0L)}, + {16.0L, std::abs(16.0L)}, + {-16.0L, std::abs(-16.0L)}, + {32.0L, std::abs(32.0L)}, + {-32.0L, std::abs(-32.0L)}, // Testing zeroes - { 0.0L, std::abs(0.0L) }, - { -0.0L, std::abs(-0.0L) }, + {0.0L, std::abs(0.0L)}, + {-0.0L, std::abs(-0.0L)}, // Floating point non-whole values - { 1.12345L, std::abs(1.12345L) }, - { -1.12345L, std::abs(1.12345L) }, - { 74.5928L, std::abs(74.5928L) }, - { -74.5928L, std::abs(-74.5928L) }, + {1.12345L, std::abs(1.12345L)}, + {-1.12345L, std::abs(1.12345L)}, + {74.5928L, std::abs(74.5928L)}, + {-74.5928L, std::abs(-74.5928L)}, // Edge cases - { std::numeric_limits::min(), std::abs(std::numeric_limits::min()) }, - { std::numeric_limits::max(), std::abs(std::numeric_limits::max()) }, - { std::numeric_limits::denorm_min(), std::abs(std::numeric_limits::denorm_min()) }, - { -std::numeric_limits::denorm_min(), std::abs(-std::numeric_limits::denorm_min()) }, - { std::numeric_limits::infinity(), std::abs(std::numeric_limits::infinity()) }, - { -std::numeric_limits::infinity(), std::abs(-std::numeric_limits::infinity()) }, - { -std::numeric_limits::max() * 10, std::abs(-std::numeric_limits::max() * 10) }, - { std::numeric_limits::max() * 10, std::abs(std::numeric_limits::max() * 10) }, - { std::numeric_limits::quiet_NaN(), std::abs(std::numeric_limits::quiet_NaN()) }, + {std::numeric_limits::min(), std::abs(std::numeric_limits::min())}, + {std::numeric_limits::max(), std::abs(std::numeric_limits::max())}, + {std::numeric_limits::denorm_min(), std::abs(std::numeric_limits::denorm_min())}, + {-std::numeric_limits::denorm_min(), std::abs(-std::numeric_limits::denorm_min())}, + {std::numeric_limits::infinity(), std::abs(std::numeric_limits::infinity())}, + {-std::numeric_limits::infinity(), std::abs(-std::numeric_limits::infinity())}, + {-std::numeric_limits::max() * 10, std::abs(-std::numeric_limits::max() * 10)}, + {std::numeric_limits::max() * 10, std::abs(std::numeric_limits::max() * 10)}, + {std::numeric_limits::quiet_NaN(), std::abs(std::numeric_limits::quiet_NaN())}, }; const std::vector> kAbsIntTestParams{ - { 1, std::abs(1) }, - { -1, std::abs(-1) }, - { 2, std::abs(2) }, - { -2, std::abs(-2) }, - { 4, std::abs(4) }, - { -4, std::abs(-4) }, - { 8, std::abs(8) }, - { -8, std::abs(-8) }, - { 16, std::abs(16) }, - { -16, std::abs(-16) }, - { 32, std::abs(32) }, - { -32, std::abs(-32) }, + {1, std::abs(1)}, + {-1, std::abs(-1)}, + {2, std::abs(2)}, + {-2, std::abs(-2)}, + {4, std::abs(4)}, + {-4, std::abs(-4)}, + {8, std::abs(8)}, + {-8, std::abs(-8)}, + {16, std::abs(16)}, + {-16, std::abs(-16)}, + {32, std::abs(32)}, + {-32, std::abs(-32)}, // Testing zeroes - { 0, std::abs(0) }, + {0, std::abs(0)}, // Edge cases // TODO(IanP): int max and denorm_min rows trip aggressive compiler warnings on some toolchains. - { std::numeric_limits::max(), std::abs(std::numeric_limits::max()) }, - { std::numeric_limits::denorm_min(), std::abs(std::numeric_limits::denorm_min()) }, - { -std::numeric_limits::denorm_min(), std::abs(-std::numeric_limits::denorm_min()) }, - { std::numeric_limits::infinity(), std::abs(std::numeric_limits::infinity()) }, - { -std::numeric_limits::infinity(), std::abs(-std::numeric_limits::infinity()) }, + {std::numeric_limits::max(), std::abs(std::numeric_limits::max())}, + {std::numeric_limits::denorm_min(), std::abs(std::numeric_limits::denorm_min())}, + {-std::numeric_limits::denorm_min(), std::abs(-std::numeric_limits::denorm_min())}, + {std::numeric_limits::infinity(), std::abs(std::numeric_limits::infinity())}, + {-std::numeric_limits::infinity(), std::abs(-std::numeric_limits::infinity())}, //{ -std::numeric_limits::max() * 10, std::abs(-std::numeric_limits::max() * 10) }, //{ std::numeric_limits::max() * 10, std::abs(std::numeric_limits::max() * 10) }, }; @@ -199,10 +199,10 @@ INSTANTIATE_TEST_SUITE_P(AbsIntTests, CcmathAbsIntTests, ValuesIn(kAbsIntTestPar TEST_P(CcmathAbsDoubleTests, AbsWithDoubleReturnsAppropriateValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::abs(param.input) }; + const auto actual{ccm::abs(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -210,10 +210,10 @@ TEST_P(CcmathAbsDoubleTests, AbsWithDoubleReturnsAppropriateValue) TEST_P(CcmathAbsFloatTests, AbsWithFloatReturnsAppropriateValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::abs(param.input) }; + const auto actual{ccm::abs(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -221,10 +221,10 @@ TEST_P(CcmathAbsFloatTests, AbsWithFloatReturnsAppropriateValue) TEST_P(CcmathAbsLongDoubleTests, AbsWithLongDoubleReturnsAppropriateValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::abs(param.input) }; + const auto actual{ccm::abs(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -232,17 +232,17 @@ TEST_P(CcmathAbsLongDoubleTests, AbsWithLongDoubleReturnsAppropriateValue) TEST_P(CcmathAbsIntTests, AbsWithIntReturnsAppropriateValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::abs(param.input) }; + const auto actual{ccm::abs(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } TEST(CcmathBasicTests, CcmAbsCanBeEvaluatedAtCompileTime) { - constexpr auto abs{ ccm::abs(1) }; + constexpr auto abs{ccm::abs(1)}; static_assert(abs == 1, "abs has failed testing that it is static_assert-able!"); // Integer abs avoids compiler builtins, so it must stay constexpr on every compiler even // where __builtin_abs and __builtin_llabs are not usable in constant evaluation. diff --git a/tests/src/math/basic/fdim_test.cpp b/tests/src/math/basic/fdim_test.cpp index 4e5a4b2f..160ba1c3 100644 --- a/tests/src/math/basic/fdim_test.cpp +++ b/tests/src/math/basic/fdim_test.cpp @@ -31,93 +31,93 @@ namespace }; const std::vector> kFDimDoubleTestParams{ - { 1.0, 1.0, std::fdim(1.0, 1.0) }, - { 2.0, 2.0, std::fdim(2.0, 2.0) }, - { 4.0, 4.0, std::fdim(4.0, 4.0) }, - { 8.0, 8.0, std::fdim(8.0, 8.0) }, - { 16.0, 16.0, std::fdim(16.0, 16.0) }, - { 32.0, 32.0, std::fdim(32.0, 32.0) }, - - { 1.0, 0.0, std::fdim(1.0, 0.0) }, - { 0.0, 1.0, std::fdim(0.0, 1.0) }, - { 0.0, 0.0, std::fdim(0.0, 0.0) }, - { -1.0, 1.0, std::fdim(-1.0, 1.0) }, - { 1.0, -1.0, std::fdim(1.0, -1.0) }, - { -1.0, -1.0, std::fdim(-1.0, -1.0) }, + {1.0, 1.0, std::fdim(1.0, 1.0)}, + {2.0, 2.0, std::fdim(2.0, 2.0)}, + {4.0, 4.0, std::fdim(4.0, 4.0)}, + {8.0, 8.0, std::fdim(8.0, 8.0)}, + {16.0, 16.0, std::fdim(16.0, 16.0)}, + {32.0, 32.0, std::fdim(32.0, 32.0)}, + + {1.0, 0.0, std::fdim(1.0, 0.0)}, + {0.0, 1.0, std::fdim(0.0, 1.0)}, + {0.0, 0.0, std::fdim(0.0, 0.0)}, + {-1.0, 1.0, std::fdim(-1.0, 1.0)}, + {1.0, -1.0, std::fdim(1.0, -1.0)}, + {-1.0, -1.0, std::fdim(-1.0, -1.0)}, // Edge cases - { std::numeric_limits::infinity(), 1.0, std::fdim(std::numeric_limits::infinity(), 1.0) }, - { 1.0, std::numeric_limits::infinity(), std::fdim(1.0, std::numeric_limits::infinity()) }, + {std::numeric_limits::infinity(), 1.0, std::fdim(std::numeric_limits::infinity(), 1.0)}, + {1.0, std::numeric_limits::infinity(), std::fdim(1.0, std::numeric_limits::infinity())}, // fdim(inf, inf) is +0 by the standard, the host libm oracle is non-conformant on some platforms - { std::numeric_limits::infinity(), std::numeric_limits::infinity(), +0.0 }, - { std::numeric_limits::quiet_NaN(), 1.0, std::fdim(std::numeric_limits::quiet_NaN(), 1.0) }, - { 1.0, std::numeric_limits::quiet_NaN(), std::fdim(1.0, std::numeric_limits::quiet_NaN()) }, - { std::numeric_limits::max(), - std::numeric_limits::max() - 1.0, - std::fdim(std::numeric_limits::max(), std::numeric_limits::max() - 1.0) }, - { -std::numeric_limits::max(), - std::numeric_limits::max(), - std::fdim(-std::numeric_limits::max(), std::numeric_limits::max()) }, + {std::numeric_limits::infinity(), std::numeric_limits::infinity(), +0.0}, + {std::numeric_limits::quiet_NaN(), 1.0, std::fdim(std::numeric_limits::quiet_NaN(), 1.0)}, + {1.0, std::numeric_limits::quiet_NaN(), std::fdim(1.0, std::numeric_limits::quiet_NaN())}, + {std::numeric_limits::max(), + std::numeric_limits::max() - 1.0, + std::fdim(std::numeric_limits::max(), std::numeric_limits::max() - 1.0)}, + {-std::numeric_limits::max(), + std::numeric_limits::max(), + std::fdim(-std::numeric_limits::max(), std::numeric_limits::max())}, }; const std::vector> kFDimFloatTestParams{ - { 1.0F, 1.0F, std::fdim(1.0F, 1.0F) }, - { 2.0F, 2.0F, std::fdim(2.0F, 2.0F) }, - { 4.0F, 4.0F, std::fdim(4.0F, 4.0F) }, - { 8.0F, 8.0F, std::fdim(8.0F, 8.0F) }, - { 16.0F, 16.0F, std::fdim(16.0F, 16.0F) }, - { 32.0F, 32.0F, std::fdim(32.0F, 32.0F) }, - - { 1.0F, 0.0F, std::fdim(1.0F, 0.0F) }, - { 0.0F, 1.0F, std::fdim(0.0F, 1.0F) }, - { 0.0F, 0.0F, std::fdim(0.0F, 0.0F) }, - { -1.0F, 1.0F, std::fdim(-1.0F, 1.0F) }, - { 1.0F, -1.0F, std::fdim(1.0F, -1.0F) }, - { -1.0F, -1.0F, std::fdim(-1.0F, -1.0F) }, + {1.0F, 1.0F, std::fdim(1.0F, 1.0F)}, + {2.0F, 2.0F, std::fdim(2.0F, 2.0F)}, + {4.0F, 4.0F, std::fdim(4.0F, 4.0F)}, + {8.0F, 8.0F, std::fdim(8.0F, 8.0F)}, + {16.0F, 16.0F, std::fdim(16.0F, 16.0F)}, + {32.0F, 32.0F, std::fdim(32.0F, 32.0F)}, + + {1.0F, 0.0F, std::fdim(1.0F, 0.0F)}, + {0.0F, 1.0F, std::fdim(0.0F, 1.0F)}, + {0.0F, 0.0F, std::fdim(0.0F, 0.0F)}, + {-1.0F, 1.0F, std::fdim(-1.0F, 1.0F)}, + {1.0F, -1.0F, std::fdim(1.0F, -1.0F)}, + {-1.0F, -1.0F, std::fdim(-1.0F, -1.0F)}, // Edge cases - { std::numeric_limits::infinity(), 1.0F, std::fdim(std::numeric_limits::infinity(), 1.0F) }, - { 1.0F, std::numeric_limits::infinity(), std::fdim(1.0F, std::numeric_limits::infinity()) }, + {std::numeric_limits::infinity(), 1.0F, std::fdim(std::numeric_limits::infinity(), 1.0F)}, + {1.0F, std::numeric_limits::infinity(), std::fdim(1.0F, std::numeric_limits::infinity())}, // fdim(inf, inf) is +0 by the standard, the host libm oracle is non-conformant on some platforms - { std::numeric_limits::infinity(), std::numeric_limits::infinity(), +0.0F }, - { std::numeric_limits::quiet_NaN(), 1.0F, std::fdim(std::numeric_limits::quiet_NaN(), 1.0F) }, - { 1.0F, std::numeric_limits::quiet_NaN(), std::fdim(1.0F, std::numeric_limits::quiet_NaN()) }, - { std::numeric_limits::max(), - std::numeric_limits::max() - 1.0F, - std::fdim(std::numeric_limits::max(), std::numeric_limits::max() - 1.0F) }, - { -std::numeric_limits::max(), - std::numeric_limits::max(), - std::fdim(-std::numeric_limits::max(), std::numeric_limits::max()) }, + {std::numeric_limits::infinity(), std::numeric_limits::infinity(), +0.0F}, + {std::numeric_limits::quiet_NaN(), 1.0F, std::fdim(std::numeric_limits::quiet_NaN(), 1.0F)}, + {1.0F, std::numeric_limits::quiet_NaN(), std::fdim(1.0F, std::numeric_limits::quiet_NaN())}, + {std::numeric_limits::max(), + std::numeric_limits::max() - 1.0F, + std::fdim(std::numeric_limits::max(), std::numeric_limits::max() - 1.0F)}, + {-std::numeric_limits::max(), + std::numeric_limits::max(), + std::fdim(-std::numeric_limits::max(), std::numeric_limits::max())}, }; const std::vector> kFDimLongDoubleTestParams{ - { 1.0L, 1.0L, std::fdim(1.0L, 1.0L) }, - { 2.0L, 2.0L, std::fdim(2.0L, 2.0L) }, - { 4.0L, 4.0L, std::fdim(4.0L, 4.0L) }, - { 8.0L, 8.0L, std::fdim(8.0L, 8.0L) }, - { 16.0L, 16.0L, std::fdim(16.0L, 16.0L) }, - { 32.0L, 32.0L, std::fdim(32.0L, 32.0L) }, - - { 1.0L, 0.0L, std::fdim(1.0L, 0.0L) }, - { 0.0L, 1.0L, std::fdim(0.0L, 1.0L) }, - { 0.0L, 0.0L, std::fdim(0.0L, 0.0L) }, - { -1.0L, 1.0L, std::fdim(-1.0L, 1.0L) }, - { 1.0L, -1.0L, std::fdim(1.0L, -1.0L) }, - { -1.0L, -1.0L, std::fdim(-1.0L, -1.0L) }, + {1.0L, 1.0L, std::fdim(1.0L, 1.0L)}, + {2.0L, 2.0L, std::fdim(2.0L, 2.0L)}, + {4.0L, 4.0L, std::fdim(4.0L, 4.0L)}, + {8.0L, 8.0L, std::fdim(8.0L, 8.0L)}, + {16.0L, 16.0L, std::fdim(16.0L, 16.0L)}, + {32.0L, 32.0L, std::fdim(32.0L, 32.0L)}, + + {1.0L, 0.0L, std::fdim(1.0L, 0.0L)}, + {0.0L, 1.0L, std::fdim(0.0L, 1.0L)}, + {0.0L, 0.0L, std::fdim(0.0L, 0.0L)}, + {-1.0L, 1.0L, std::fdim(-1.0L, 1.0L)}, + {1.0L, -1.0L, std::fdim(1.0L, -1.0L)}, + {-1.0L, -1.0L, std::fdim(-1.0L, -1.0L)}, // Edge cases - { std::numeric_limits::infinity(), 1.0L, std::fdim(std::numeric_limits::infinity(), 1.0L) }, - { 1.0L, std::numeric_limits::infinity(), std::fdim(1.0L, std::numeric_limits::infinity()) }, + {std::numeric_limits::infinity(), 1.0L, std::fdim(std::numeric_limits::infinity(), 1.0L)}, + {1.0L, std::numeric_limits::infinity(), std::fdim(1.0L, std::numeric_limits::infinity())}, // fdim(inf, inf) is +0 by the standard, the host libm oracle is non-conformant on some platforms - { std::numeric_limits::infinity(), std::numeric_limits::infinity(), +0.0L }, - { std::numeric_limits::quiet_NaN(), 1.0L, std::fdim(std::numeric_limits::quiet_NaN(), 1.0L) }, - { 1.0L, std::numeric_limits::quiet_NaN(), std::fdim(1.0L, std::numeric_limits::quiet_NaN()) }, - { std::numeric_limits::max(), - std::numeric_limits::max() - 1.0L, - std::fdim(std::numeric_limits::max(), std::numeric_limits::max() - 1.0L) }, - { -std::numeric_limits::max(), - std::numeric_limits::max(), - std::fdim(-std::numeric_limits::max(), std::numeric_limits::max()) }, + {std::numeric_limits::infinity(), std::numeric_limits::infinity(), +0.0L}, + {std::numeric_limits::quiet_NaN(), 1.0L, std::fdim(std::numeric_limits::quiet_NaN(), 1.0L)}, + {1.0L, std::numeric_limits::quiet_NaN(), std::fdim(1.0L, std::numeric_limits::quiet_NaN())}, + {std::numeric_limits::max(), + std::numeric_limits::max() - 1.0L, + std::fdim(std::numeric_limits::max(), std::numeric_limits::max() - 1.0L)}, + {-std::numeric_limits::max(), + std::numeric_limits::max(), + std::fdim(-std::numeric_limits::max(), std::numeric_limits::max())}, }; } // namespace @@ -136,10 +136,10 @@ INSTANTIATE_TEST_SUITE_P(FDimLongDoubleTests, CcmathFDimLongDoubleTests, ValuesI TEST_P(CcmathFDimDoubleTests, FDimWithDoubleReturnsApropriateValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::fdim(param.x, param.y) }; + const auto actual{ccm::fdim(param.x, param.y)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -147,10 +147,10 @@ TEST_P(CcmathFDimDoubleTests, FDimWithDoubleReturnsApropriateValue) TEST_P(CcmathFDimFloatTests, FDimWithFloatReturnsAppropriateValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::fdim(param.x, param.y) }; + const auto actual{ccm::fdim(param.x, param.y)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -158,10 +158,10 @@ TEST_P(CcmathFDimFloatTests, FDimWithFloatReturnsAppropriateValue) TEST_P(CcmathFDimLongDoubleTests, FDimWithLongDoubleReturnsAppropriateValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::fdim(param.x, param.y) }; + const auto actual{ccm::fdim(param.x, param.y)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -169,7 +169,7 @@ TEST_P(CcmathFDimLongDoubleTests, FDimWithLongDoubleReturnsAppropriateValue) TEST(CcmathBasicTests, FdimCanBeEvaluatedAtCompileTime) { // Act - constexpr auto fdim{ ccm::fdim(1.0, 1.0) }; + constexpr auto fdim{ccm::fdim(1.0, 1.0)}; // Assert static_assert(fdim == 0.0, "fdim has failed testing that it is static_assert-able!"); diff --git a/tests/src/math/basic/fma_correct_rounding_test.cpp b/tests/src/math/basic/fma_correct_rounding_test.cpp index 59c943d5..dd716fbc 100644 --- a/tests/src/math/basic/fma_correct_rounding_test.cpp +++ b/tests/src/math/basic/fma_correct_rounding_test.cpp @@ -66,54 +66,54 @@ namespace // Goldens generated with MPFR mpfr_fma at the target precision plus mpfr_subnormalize. constexpr FloatCase kFloatCases[] = { - { 0x3f800800U, 0x3f800800U, 0x25000000U, { 0x3f801001U, 0x3f801000U, 0x3f801001U, 0x3f801000U } }, - { 0x3f800800U, 0x3f800800U, 0xa5000000U, { 0x3f801000U, 0x3f801000U, 0x3f801001U, 0x3f801000U } }, - { 0x3f7ff800U, 0x3f7ff800U, 0x24800000U, { 0x3f7ff000U, 0x3f7ff000U, 0x3f7ff001U, 0x3f7ff000U } }, - { 0x3f801000U, 0x3f800400U, 0x25800000U, { 0x3f801401U, 0x3f801400U, 0x3f801401U, 0x3f801400U } }, - { 0xc27a0cd9U, 0x5302830dU, 0x96599102U, { 0xd5fef50fU, 0xd5fef50eU, 0xd5fef50eU, 0xd5fef50fU } }, - { 0x40400000U, 0x40a00000U, 0x40e00000U, { 0x41b00000U, 0x41b00000U, 0x41b00000U, 0x41b00000U } }, - { 0x71aba7f8U, 0x58635fa9U, 0x3f800000U, { 0x7f800000U, 0x7f7fffffU, 0x7f800000U, 0x7f7fffffU } }, - { 0xf1aba7f8U, 0x58635fa9U, 0x3f800000U, { 0xff800000U, 0xff7fffffU, 0xff7fffffU, 0xff800000U } }, - { 0x0da24260U, 0x26901d7dU, 0x00000000U, { 0x00000001U, 0x00000000U, 0x00000001U, 0x00000000U } }, + {0x3f800800U, 0x3f800800U, 0x25000000U, {0x3f801001U, 0x3f801000U, 0x3f801001U, 0x3f801000U}}, + {0x3f800800U, 0x3f800800U, 0xa5000000U, {0x3f801000U, 0x3f801000U, 0x3f801001U, 0x3f801000U}}, + {0x3f7ff800U, 0x3f7ff800U, 0x24800000U, {0x3f7ff000U, 0x3f7ff000U, 0x3f7ff001U, 0x3f7ff000U}}, + {0x3f801000U, 0x3f800400U, 0x25800000U, {0x3f801401U, 0x3f801400U, 0x3f801401U, 0x3f801400U}}, + {0xc27a0cd9U, 0x5302830dU, 0x96599102U, {0xd5fef50fU, 0xd5fef50eU, 0xd5fef50eU, 0xd5fef50fU}}, + {0x40400000U, 0x40a00000U, 0x40e00000U, {0x41b00000U, 0x41b00000U, 0x41b00000U, 0x41b00000U}}, + {0x71aba7f8U, 0x58635fa9U, 0x3f800000U, {0x7f800000U, 0x7f7fffffU, 0x7f800000U, 0x7f7fffffU}}, + {0xf1aba7f8U, 0x58635fa9U, 0x3f800000U, {0xff800000U, 0xff7fffffU, 0xff7fffffU, 0xff800000U}}, + {0x0da24260U, 0x26901d7dU, 0x00000000U, {0x00000001U, 0x00000000U, 0x00000001U, 0x00000000U}}, }; constexpr DoubleCase kDoubleCases[] = { - { 0x3ff0000002000000ULL, - 0x3ff0000002000000ULL, - 0x3950000000000000ULL, - { 0x3ff0000004000000ULL, 0x3ff0000004000000ULL, 0x3ff0000004000001ULL, 0x3ff0000004000000ULL } }, - { 0x3ff0000002000000ULL, - 0x3ff0000002000000ULL, - 0xb950000000000000ULL, - { 0x3ff0000004000000ULL, 0x3ff0000004000000ULL, 0x3ff0000004000001ULL, 0x3ff0000004000000ULL } }, - { 0xc04f419b20000000ULL, - 0x42605061a0000000ULL, - 0xbacb322040000000ULL, - { 0xc2bfdea1ddec8140ULL, 0xc2bfdea1ddec8140ULL, 0xc2bfdea1ddec8140ULL, 0xc2bfdea1ddec8141ULL } }, - { 0x4008000000000000ULL, - 0x4014000000000000ULL, - 0x401c000000000000ULL, - { 0x4036000000000000ULL, 0x4036000000000000ULL, 0x4036000000000000ULL, 0x4036000000000000ULL } }, - { 0x7e444ecd0d33972bULL, - 0x46293e5939a08ceaULL, - 0x3ff0000000000000ULL, - { 0x7ff0000000000000ULL, 0x7fefffffffffffffULL, 0x7ff0000000000000ULL, 0x7fefffffffffffffULL } }, - { 0xfe444ecd0d33972bULL, - 0x46293e5939a08ceaULL, - 0x3ff0000000000000ULL, - { 0xfff0000000000000ULL, 0xffefffffffffffffULL, 0xffefffffffffffffULL, 0xfff0000000000000ULL } }, - { 0x01a56e1fc2f8f359ULL, - 0x39b4484bfeebc2a0ULL, - 0x0000000000000000ULL, - { 0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000001ULL, 0x0000000000000000ULL } }, - { 0x3fffffffffffffffULL, - 0x3ff0000000000001ULL, - 0x3c30000000000000ULL, - { 0x4000000000000001ULL, 0x4000000000000000ULL, 0x4000000000000001ULL, 0x4000000000000000ULL } }, + {0x3ff0000002000000ULL, + 0x3ff0000002000000ULL, + 0x3950000000000000ULL, + {0x3ff0000004000000ULL, 0x3ff0000004000000ULL, 0x3ff0000004000001ULL, 0x3ff0000004000000ULL}}, + {0x3ff0000002000000ULL, + 0x3ff0000002000000ULL, + 0xb950000000000000ULL, + {0x3ff0000004000000ULL, 0x3ff0000004000000ULL, 0x3ff0000004000001ULL, 0x3ff0000004000000ULL}}, + {0xc04f419b20000000ULL, + 0x42605061a0000000ULL, + 0xbacb322040000000ULL, + {0xc2bfdea1ddec8140ULL, 0xc2bfdea1ddec8140ULL, 0xc2bfdea1ddec8140ULL, 0xc2bfdea1ddec8141ULL}}, + {0x4008000000000000ULL, + 0x4014000000000000ULL, + 0x401c000000000000ULL, + {0x4036000000000000ULL, 0x4036000000000000ULL, 0x4036000000000000ULL, 0x4036000000000000ULL}}, + {0x7e444ecd0d33972bULL, + 0x46293e5939a08ceaULL, + 0x3ff0000000000000ULL, + {0x7ff0000000000000ULL, 0x7fefffffffffffffULL, 0x7ff0000000000000ULL, 0x7fefffffffffffffULL}}, + {0xfe444ecd0d33972bULL, + 0x46293e5939a08ceaULL, + 0x3ff0000000000000ULL, + {0xfff0000000000000ULL, 0xffefffffffffffffULL, 0xffefffffffffffffULL, 0xfff0000000000000ULL}}, + {0x01a56e1fc2f8f359ULL, + 0x39b4484bfeebc2a0ULL, + 0x0000000000000000ULL, + {0x0000000000000000ULL, 0x0000000000000000ULL, 0x0000000000000001ULL, 0x0000000000000000ULL}}, + {0x3fffffffffffffffULL, + 0x3ff0000000000001ULL, + 0x3c30000000000000ULL, + {0x4000000000000001ULL, 0x4000000000000000ULL, 0x4000000000000001ULL, 0x4000000000000000ULL}}, }; - constexpr std::array kModes = { FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD, FE_DOWNWARD }; - constexpr std::array kName = { "FE_TONEAREST", "FE_TOWARDZERO", "FE_UPWARD", "FE_DOWNWARD" }; + constexpr std::array kModes = {FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD, FE_DOWNWARD}; + constexpr std::array kName = {"FE_TONEAREST", "FE_TOWARDZERO", "FE_UPWARD", "FE_DOWNWARD"}; } // namespace TEST(CcmathFmaCorrectRounding, FloatAllModes) diff --git a/tests/src/math/basic/fmod_test.cpp b/tests/src/math/basic/fmod_test.cpp index 8a366f60..bb48830f 100644 --- a/tests/src/math/basic/fmod_test.cpp +++ b/tests/src/math/basic/fmod_test.cpp @@ -70,17 +70,17 @@ TEST(CcmathBasicTests, FmodLargeQuotientCompileTime) TEST(CcmathBasicTests, FmodBitExactVsStd) { - for (double y : { 3.0, -3.0, 2.5, 0.5, 1024.0, 1e-300 }) + for (double y : {3.0, -3.0, 2.5, 0.5, 1024.0, 1e-300}) { - for (double x : { 10.0, -10.0, 7.5, -7.5, 0.0, -0.0, 1.5, 1e30, -1e30, 1e300 }) + for (double x : {10.0, -10.0, 7.5, -7.5, 0.0, -0.0, 1.5, 1e30, -1e30, 1e300}) { expect_public_exact(x, y); expect_kernel_exact(x, y); } } - for (float y : { 3.0F, -3.0F, 2.5F, 0.5F }) + for (float y : {3.0F, -3.0F, 2.5F, 0.5F}) { - for (float x : { 10.0F, -10.0F, 7.5F, 0.0F, -0.0F, 1e30F }) + for (float x : {10.0F, -10.0F, 7.5F, 0.0F, -0.0F, 1e30F}) { expect_public_exact_f(x, y); expect_kernel_exact_f(x, y); diff --git a/tests/src/math/basic/nan_test.cpp b/tests/src/math/basic/nan_test.cpp index e2a4e53f..1322f1e9 100644 --- a/tests/src/math/basic/nan_test.cpp +++ b/tests/src/math/basic/nan_test.cpp @@ -182,7 +182,7 @@ template void removePaddingBits(std::array & byteA // Zero out everything after the 10th element for (std::size_t i = 10; i < N; ++i) { - byteArray.at(i) = std::byte{ 0 }; + byteArray.at(i) = std::byte{0}; } } diff --git a/tests/src/math/basic/remainder_test.cpp b/tests/src/math/basic/remainder_test.cpp index 3de18746..b326a541 100644 --- a/tests/src/math/basic/remainder_test.cpp +++ b/tests/src/math/basic/remainder_test.cpp @@ -118,9 +118,8 @@ TEST(CcmathBasicTests, Remainder) // A spread of normal values, both signs, for double. const double doubles[][2] = { - { 1.0, 1.0 }, { 1.0, 0.0 }, { 0.0, 1.0 }, { 0.0, 0.0 }, { -1.0, 1.0 }, { 1.0, -1.0 }, { -1.0, -1.0 }, - { -1.0, 0.0 }, { 5.0, 3.0 }, { 7.5, 2.0 }, { -5.0, 3.0 }, { 5.0, -3.0 }, { -7.5, 2.0 }, { 9.0, 4.0 }, - { 2.0, 1.0 }, { 3.0, 2.0 }, { 10.5, 3.25 }, { -10.5, 3.25 }, { 123.456, 7.0 }, { 0.1, 0.03 }, { -0.1, 0.03 }, + {1.0, 1.0}, {1.0, 0.0}, {0.0, 1.0}, {0.0, 0.0}, {-1.0, 1.0}, {1.0, -1.0}, {-1.0, -1.0}, {-1.0, 0.0}, {5.0, 3.0}, {7.5, 2.0}, {-5.0, 3.0}, + {5.0, -3.0}, {-7.5, 2.0}, {9.0, 4.0}, {2.0, 1.0}, {3.0, 2.0}, {10.5, 3.25}, {-10.5, 3.25}, {123.456, 7.0}, {0.1, 0.03}, {-0.1, 0.03}, }; for (const auto & c : doubles) { @@ -129,8 +128,16 @@ TEST(CcmathBasicTests, Remainder) // A spread of normal values, both signs, for float. const float floats[][2] = { - { 1.0F, 1.0F }, { 5.0F, 3.0F }, { 7.5F, 2.0F }, { -5.0F, 3.0F }, { 5.0F, -3.0F }, - { 9.0F, 4.0F }, { 2.0F, 1.0F }, { 10.5F, 3.25F }, { 123.456F, 7.0F }, { 0.1F, 0.03F }, + {1.0F, 1.0F}, + {5.0F, 3.0F}, + {7.5F, 2.0F}, + {-5.0F, 3.0F}, + {5.0F, -3.0F}, + {9.0F, 4.0F}, + {2.0F, 1.0F}, + {10.5F, 3.25F}, + {123.456F, 7.0F}, + {0.1F, 0.03F}, }; for (const auto & c : floats) { diff --git a/tests/src/math/basic/remquo_test.cpp b/tests/src/math/basic/remquo_test.cpp index 14ad3faf..f931ec95 100644 --- a/tests/src/math/basic/remquo_test.cpp +++ b/tests/src/math/basic/remquo_test.cpp @@ -19,28 +19,28 @@ constexpr double get_ccm_rem(double x, double y) { - int quotient{ 0 }; + int quotient{0}; double remainder = ccm::remquo(x, y, "ient); return remainder; } constexpr int get_ccm_quo(double x, double y) { - int quotient{ 0 }; + int quotient{0}; ccm::remquo(x, y, "ient); // remainder = 1 return quotient; } double get_std_rem(double x, double y) { - int quotient{ 0 }; + int quotient{0}; double remainder = std::remquo(x, y, "ient); return remainder; } int get_std_quo(double x, double y) { - int quotient{ 0 }; + int quotient{0}; std::remquo(x, y, "ient); return quotient; } diff --git a/tests/src/math/expo/exp2_test.cpp b/tests/src/math/expo/exp2_test.cpp index fe99cae7..1e9cb1e2 100644 --- a/tests/src/math/expo/exp2_test.cpp +++ b/tests/src/math/expo/exp2_test.cpp @@ -18,7 +18,7 @@ TEST(CcmathExponentialTests, Exp2_Double_ValidInput) { - constexpr double inputs[] = { 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, 512.0, 1024.0, 2048.0, 4096.0 }; + constexpr double inputs[] = {1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, 512.0, 1024.0, 2048.0, 4096.0}; for (double input : inputs) { ccm::test::ExpectUnaryMatchesStd(input, ccm::exp2, static_cast(std::exp2)); @@ -31,17 +31,17 @@ TEST(CcmathExponentialTests, Exp2_Double_ValidInput) TEST(CcmathExponentialTests, Exp2_Double_EdgeCases) { - constexpr double inputs[] = { 0.0, - -0.0, - std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - std::numeric_limits::min(), - -std::numeric_limits::min(), - std::numeric_limits::max(), - -std::numeric_limits::max(), - std::numeric_limits::denorm_min(), - -std::numeric_limits::denorm_min(), - std::numeric_limits::quiet_NaN() }; + constexpr double inputs[] = {0.0, + -0.0, + std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + std::numeric_limits::min(), + -std::numeric_limits::min(), + std::numeric_limits::max(), + -std::numeric_limits::max(), + std::numeric_limits::denorm_min(), + -std::numeric_limits::denorm_min(), + std::numeric_limits::quiet_NaN()}; for (double input : inputs) { ccm::test::ExpectUnaryMatchesStd(input, ccm::exp2, static_cast(std::exp2)); @@ -50,7 +50,7 @@ TEST(CcmathExponentialTests, Exp2_Double_EdgeCases) TEST(CcmathExponentialTests, Exp2_Float) { - constexpr float inputs[] = { 1.0F, 2.0F, 4.0F, 8.0F, 16.0F, 32.0F, 64.0F, 128.0F, 256.0F, 512.0F, 1024.0F, 2048.0F, 4096.0F }; + constexpr float inputs[] = {1.0F, 2.0F, 4.0F, 8.0F, 16.0F, 32.0F, 64.0F, 128.0F, 256.0F, 512.0F, 1024.0F, 2048.0F, 4096.0F}; for (float input : inputs) { ccm::test::ExpectUnaryMatchesStd(input, ccm::exp2, static_cast(std::exp2)); @@ -59,12 +59,12 @@ TEST(CcmathExponentialTests, Exp2_Float) TEST(CcmathExponentialTests, Exp2_Float_EdgeCases) { - constexpr float inputs[] = { 0.0F, - -0.0F, - std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -1.038470636961323e34F, - std::numeric_limits::quiet_NaN() }; + constexpr float inputs[] = {0.0F, + -0.0F, + std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -1.038470636961323e34F, + std::numeric_limits::quiet_NaN()}; for (float input : inputs) { ccm::test::ExpectUnaryMatchesStd(input, ccm::exp2, static_cast(std::exp2)); diff --git a/tests/src/math/expo/exp_test.cpp b/tests/src/math/expo/exp_test.cpp index 1df6a67b..0fa9dde6 100644 --- a/tests/src/math/expo/exp_test.cpp +++ b/tests/src/math/expo/exp_test.cpp @@ -22,7 +22,7 @@ TEST(CcmathExponentialTests, Exp) // ccm::exp(1.0) is equivalent to the mathematical constant e static_assert(ccm::exp(1.0) == ccm::numbers::e, "ccm::exp is not working with static_assert!"); - constexpr double double_inputs[] = { 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 256.0, 512.0, 1024.0, 2048.0, 4096.0 }; + constexpr double double_inputs[] = {1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 256.0, 512.0, 1024.0, 2048.0, 4096.0}; for (double input : double_inputs) { ccm::test::ExpectUnaryMatchesStd(input, ccm::exp, static_cast(std::exp)); @@ -44,8 +44,7 @@ TEST(CcmathExponentialTests, Exp) // Edge cases for float overloads. constexpr double double_edges[] = { - 0.0, -0.0, std::numeric_limits::infinity(), -std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN() - }; + 0.0, -0.0, std::numeric_limits::infinity(), -std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN()}; for (double input : double_edges) { ccm::test::ExpectUnaryMatchesStd(input, ccm::exp, static_cast(std::exp)); @@ -53,15 +52,14 @@ TEST(CcmathExponentialTests, Exp) // Float overloads. - constexpr float float_inputs[] = { 1.0F, 2.0F, 4.0F, 8.0F, 16.0F, 32.0F, 64.0F, 256.0F, 512.0F, 1024.0F, 2048.0F, 4096.0F }; + constexpr float float_inputs[] = {1.0F, 2.0F, 4.0F, 8.0F, 16.0F, 32.0F, 64.0F, 256.0F, 512.0F, 1024.0F, 2048.0F, 4096.0F}; for (float input : float_inputs) { ccm::test::ExpectUnaryMatchesStd(input, ccm::exp, static_cast(std::exp)); } // EXPECT_EQ(ccm::exp(128.0F), std::exp(128.0F)); // See above. constexpr float float_edges[] = { - 0.0F, -0.0F, std::numeric_limits::infinity(), -std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN() - }; + 0.0F, -0.0F, std::numeric_limits::infinity(), -std::numeric_limits::infinity(), std::numeric_limits::quiet_NaN()}; for (float input : float_edges) { ccm::test::ExpectUnaryMatchesStd(input, ccm::exp, static_cast(std::exp)); diff --git a/tests/src/math/expo/log10_test.cpp b/tests/src/math/expo/log10_test.cpp index 2d8339ac..fec86c78 100644 --- a/tests/src/math/expo/log10_test.cpp +++ b/tests/src/math/expo/log10_test.cpp @@ -37,8 +37,14 @@ TEST(CcmathExponentialTests, Log10DoubleLastTableBucket) static_assert(ccm::log10(0x1.5fdffffffff32p+0) == 0x1.1aed92aadd55p-3, "log10 must use the final log table entry in the last bucket"); constexpr double inputs[] = { - 0x1.5fdffffffff32p-1011, 0x1.5fdffffffff32p-1, 0x1.5fdffffffff32p+0, 0x1.5fdffffffff32p+1, 0x1.5ep+0, - 0x1.5ffffffffffffp+0, 0x1.5ep-512, 0x1.5ffffffffffffp+512, + 0x1.5fdffffffff32p-1011, + 0x1.5fdffffffff32p-1, + 0x1.5fdffffffff32p+0, + 0x1.5fdffffffff32p+1, + 0x1.5ep+0, + 0x1.5ffffffffffffp+0, + 0x1.5ep-512, + 0x1.5ffffffffffffp+512, }; for (double input : inputs) { diff --git a/tests/src/math/expo/log2_test.cpp b/tests/src/math/expo/log2_test.cpp index d3799b79..3cc47786 100644 --- a/tests/src/math/expo/log2_test.cpp +++ b/tests/src/math/expo/log2_test.cpp @@ -20,14 +20,14 @@ TEST(CcmathExponentialTests, Log2) { static_assert(ccm::log2(1.0) == 0.0, "log2 has failed testing that it is static_assert-able!"); // Check that we can use static_assert with this function - constexpr double double_inputs[] = { 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, 512.0, 1024.0, 2048.0, 4096.0 }; + constexpr double double_inputs[] = {1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, 512.0, 1024.0, 2048.0, 4096.0}; for (double input : double_inputs) { ccm::test::ExpectUnaryMatchesStd(input, ccm::log2, static_cast(std::log2)); } // Test floating point precision - constexpr float float_inputs[] = { 1.0F, 2.0F, 4.0F, 8.0F, 16.0F, 32.0F, 64.0F, 128.0F, 256.0F, 512.0F, 1024.0F, 2048.0F, 4096.0F }; + constexpr float float_inputs[] = {1.0F, 2.0F, 4.0F, 8.0F, 16.0F, 32.0F, 64.0F, 128.0F, 256.0F, 512.0F, 1024.0F, 2048.0F, 4096.0F}; for (float input : float_inputs) { ccm::test::ExpectUnaryMatchesStd(input, ccm::log2, static_cast(std::log2)); diff --git a/tests/src/math/expo/log_test.cpp b/tests/src/math/expo/log_test.cpp index caec9c5d..5295d091 100644 --- a/tests/src/math/expo/log_test.cpp +++ b/tests/src/math/expo/log_test.cpp @@ -24,8 +24,8 @@ TEST(CcmathExponentialTests, Log) // 1.3862943611198906 was generated with std::log(4.0) static_assert(ccm::log(4.0) == 1.3862943611198906, "log has failed testing that it is static_assert-able!"); - constexpr double inputs[] = { 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, 512.0, 1024.0, - 2048.0, 4096.0, 8192.0, 16384.0, 32768.0, 65536.0, 131072.0, 262144.0, 524288.0, 1048576.0 }; + constexpr double inputs[] = {1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, 512.0, 1024.0, + 2048.0, 4096.0, 8192.0, 16384.0, 32768.0, 65536.0, 131072.0, 262144.0, 524288.0, 1048576.0}; for (double input : inputs) { ccm::test::ExpectUnaryMatchesStd(input, ccm::log, static_cast(std::log)); @@ -49,8 +49,16 @@ TEST(CcmathExponentialTests, LogDoubleLastTableBucket) // Same patterns plus the bucket boundaries through the runtime generic kernel. constexpr double inputs[] = { - 0x1.5fdffffffff32p-1011, 0x1.5fdffffffff32p-1, 0x1.5fdffffffff32p+0, 0x1.5fdffffffff32p+1, 0x1.5ep+0, - 0x1.5ffffffffffffp+0, 0x1.5ep-512, 0x1.5ffffffffffffp+512, 0x1.5dfffffffffffp+0, 0x1.6p+0, + 0x1.5fdffffffff32p-1011, + 0x1.5fdffffffff32p-1, + 0x1.5fdffffffff32p+0, + 0x1.5fdffffffff32p+1, + 0x1.5ep+0, + 0x1.5ffffffffffffp+0, + 0x1.5ep-512, + 0x1.5ffffffffffffp+512, + 0x1.5dfffffffffffp+0, + 0x1.6p+0, }; for (double input : inputs) { diff --git a/tests/src/math/internal/simd/pp_simd_test.cpp b/tests/src/math/internal/simd/pp_simd_test.cpp index 5df708cf..76e81b75 100644 --- a/tests/src/math/internal/simd/pp_simd_test.cpp +++ b/tests/src/math/internal/simd/pp_simd_test.cpp @@ -568,7 +568,7 @@ TEST(PpSimdTest, MaskIndexAndBits) TEST(PpSimdTest, CatSplit) { using V4 = basic_simd>; - alignas(64) float a[8] = { 1, 2, 3, 4, 5, 6, 7, 8 }; + alignas(64) float a[8] = {1, 2, 3, 4, 5, 6, 7, 8}; V4 lo(a, element_aligned); V4 hi(a + 4, element_aligned); @@ -603,7 +603,7 @@ TEST(PpSimdTest, ResizeRebindConvert) static_assert(std::is_same, basic_simd>::value, ""); static_assert(std::is_same, basic_simd>>::value, ""); - alignas(64) float a[8] = { 1.4F, 2.6F, -3.5F, 4.9F, 5.1F, -6.2F, 7.8F, 8.0F }; + alignas(64) float a[8] = {1.4F, 2.6F, -3.5F, 4.9F, 5.1F, -6.2F, 7.8F, 8.0F}; V v(a, element_aligned); basic_simd> iv(v); // converting ctor (truncation) basic_simd> dv(v); diff --git a/tests/src/math/internal/support/math_support_test.cpp b/tests/src/math/internal/support/math_support_test.cpp index fb0a1968..b4d28503 100644 --- a/tests/src/math/internal/support/math_support_test.cpp +++ b/tests/src/math/internal/support/math_support_test.cpp @@ -137,7 +137,7 @@ TEST(CcmathInternalSupportTests, AddWithCarryUint8MatchesReferenceExhaustively) { for (int rhs = 0; rhs <= 0xFF; ++rhs) { - for (std::uint8_t carry_in : { static_cast(0), static_cast(1) }) + for (std::uint8_t carry_in : {static_cast(0), static_cast(1)}) { std::uint8_t carry_out = 0; const std::uint8_t actual = @@ -157,7 +157,7 @@ TEST(CcmathInternalSupportTests, SubWithBorrowUint8MatchesReferenceExhaustively) { for (int rhs = 0; rhs <= 0xFF; ++rhs) { - for (std::uint8_t borrow_in : { static_cast(0), static_cast(1) }) + for (std::uint8_t borrow_in : {static_cast(0), static_cast(1)}) { std::uint8_t borrow_out = 0; const std::uint8_t actual = @@ -182,16 +182,16 @@ TEST(CcmathInternalSupportTests, AddWithCarryUint64MatchesBoundaryCases) std::uint64_t expected_carry; }; - const std::array cases = { { - { 0ULL, 0ULL, 0ULL, 0ULL, 0ULL }, - { 0ULL, 0ULL, 1ULL, 1ULL, 0ULL }, - { std::numeric_limits::max(), 0ULL, 1ULL, 0ULL, 1ULL }, - { std::numeric_limits::max(), 1ULL, 0ULL, 0ULL, 1ULL }, - { std::numeric_limits::max(), std::numeric_limits::max(), 0ULL, std::numeric_limits::max() - 1ULL, 1ULL }, - { std::numeric_limits::max() - 1ULL, 1ULL, 1ULL, 0ULL, 1ULL }, - { 0xFFFFFFFF00000000ULL, 0x00000000FFFFFFFFULL, 1ULL, 0ULL, 1ULL }, - { 0x8000000000000000ULL, 0x8000000000000000ULL, 0ULL, 0ULL, 1ULL }, - } }; + const std::array cases = {{ + {0ULL, 0ULL, 0ULL, 0ULL, 0ULL}, + {0ULL, 0ULL, 1ULL, 1ULL, 0ULL}, + {std::numeric_limits::max(), 0ULL, 1ULL, 0ULL, 1ULL}, + {std::numeric_limits::max(), 1ULL, 0ULL, 0ULL, 1ULL}, + {std::numeric_limits::max(), std::numeric_limits::max(), 0ULL, std::numeric_limits::max() - 1ULL, 1ULL}, + {std::numeric_limits::max() - 1ULL, 1ULL, 1ULL, 0ULL, 1ULL}, + {0xFFFFFFFF00000000ULL, 0x00000000FFFFFFFFULL, 1ULL, 0ULL, 1ULL}, + {0x8000000000000000ULL, 0x8000000000000000ULL, 0ULL, 0ULL, 1ULL}, + }}; for (const auto & test_case : cases) { @@ -214,16 +214,16 @@ TEST(CcmathInternalSupportTests, SubWithBorrowUint64MatchesBoundaryCases) std::uint64_t expected_borrow; }; - const std::array cases = { { - { 0ULL, 0ULL, 0ULL, 0ULL, 0ULL }, - { 0ULL, 0ULL, 1ULL, std::numeric_limits::max(), 1ULL }, - { 0ULL, 1ULL, 0ULL, std::numeric_limits::max(), 1ULL }, - { 5ULL, 3ULL, 1ULL, 1ULL, 0ULL }, - { std::numeric_limits::max(), std::numeric_limits::max(), 1ULL, std::numeric_limits::max(), 1ULL }, - { 0x100000000ULL, 1ULL, 1ULL, 0xFFFFFFFEULL, 0ULL }, - { 0x8000000000000000ULL, 0x7FFFFFFFFFFFFFFFULL, 1ULL, 0ULL, 0ULL }, - { 0x7FFFFFFFFFFFFFFFULL, 0x8000000000000000ULL, 0ULL, std::numeric_limits::max(), 1ULL }, - } }; + const std::array cases = {{ + {0ULL, 0ULL, 0ULL, 0ULL, 0ULL}, + {0ULL, 0ULL, 1ULL, std::numeric_limits::max(), 1ULL}, + {0ULL, 1ULL, 0ULL, std::numeric_limits::max(), 1ULL}, + {5ULL, 3ULL, 1ULL, 1ULL, 0ULL}, + {std::numeric_limits::max(), std::numeric_limits::max(), 1ULL, std::numeric_limits::max(), 1ULL}, + {0x100000000ULL, 1ULL, 1ULL, 0xFFFFFFFEULL, 0ULL}, + {0x8000000000000000ULL, 0x7FFFFFFFFFFFFFFFULL, 1ULL, 0ULL, 0ULL}, + {0x7FFFFFFFFFFFFFFFULL, 0x8000000000000000ULL, 0ULL, std::numeric_limits::max(), 1ULL}, + }}; for (const auto & test_case : cases) { @@ -284,7 +284,7 @@ TEST(CcmathInternalSupportTests, VeltkampSplitReconstructsInput) long double xh = 0.0L; long double xl = 0.0L; - for (long double input : { 0.0L, 1.0L, -1.0L, 0x1.12345678p+40L, -0x1.98765432p-20L, 0x1.ffffffffp+12L }) + for (long double input : {0.0L, 1.0L, -1.0L, 0x1.12345678p+40L, -0x1.98765432p-20L, 0x1.ffffffffp+12L}) { ccm::support::veltkamp_split(xh, xl, input); EXPECT_EQ(xh + xl, input); diff --git a/tests/src/math/internal/types/big_int_test.cpp b/tests/src/math/internal/types/big_int_test.cpp index e90ce219..8ece7737 100644 --- a/tests/src/math/internal/types/big_int_test.cpp +++ b/tests/src/math/internal/types/big_int_test.cpp @@ -168,7 +168,7 @@ namespace out.limbs[i] = static_cast(sum); carry = sum >> limb_bits; } - return { out, carry != 0 }; + return {out, carry != 0}; } [[nodiscard]] std::pair sub(const RefUint & other) const @@ -182,7 +182,7 @@ namespace out.limbs[i] = static_cast(lhs - rhs); borrow = lhs < rhs ? 1U : 0U; } - return { out, borrow != 0 }; + return {out, borrow != 0}; } template [[nodiscard]] RefUint full_mul(const RefUint & other) const @@ -282,7 +282,7 @@ namespace RefUint remainder; if (divider.is_zero()) { - return { quotient, remainder }; + return {quotient, remainder}; } for (std::size_t bit = Bits; bit-- > 0;) @@ -298,7 +298,7 @@ namespace quotient.set_bit(bit); } } - return { quotient, remainder }; + return {quotient, remainder}; } template [[nodiscard]] RefUint truncate_low() const @@ -466,15 +466,15 @@ namespace [[nodiscard]] RefInt add(const RefInt & other) const { - return RefInt{ raw.add(other.raw).first }; + return RefInt{raw.add(other.raw).first}; } [[nodiscard]] RefInt sub(const RefInt & other) const { - return RefInt{ raw.sub(other.raw).first }; + return RefInt{raw.sub(other.raw).first}; } [[nodiscard]] RefInt mul(const RefInt & other) const { - return RefInt{ raw.full_mul(other.raw).template truncate_low() }; + return RefInt{raw.full_mul(other.raw).template truncate_low()}; } [[nodiscard]] RefUint abs_unsigned() const @@ -507,7 +507,7 @@ namespace RefInt remainder; if (divider.raw.is_zero()) { - return { quotient, remainder }; + return {quotient, remainder}; } const RefUint lhs_mag = abs_unsigned(); @@ -525,7 +525,7 @@ namespace { remainder = remainder.negated(); } - return { quotient, remainder }; + return {quotient, remainder}; } [[nodiscard]] std::string hex_string() const @@ -568,7 +568,7 @@ namespace template [[nodiscard]] RefInt to_ref_signed(const ccm::types::BigInt & value) { - return RefInt{ to_ref_unsigned(value) }; + return RefInt{to_ref_unsigned(value)}; } template [[nodiscard]] RefUint repeat_limb(std::uint32_t value) @@ -620,14 +620,14 @@ namespace out.push_back(carry_chain); RefUint sparse = RefUint::zero(); - for (std::size_t bit : { static_cast(0), - static_cast(1), - static_cast(31), - static_cast(32), - Bits / 2 - 1, - Bits / 2, - Bits - 2, - Bits - 1 }) + for (std::size_t bit : {static_cast(0), + static_cast(1), + static_cast(31), + static_cast(32), + Bits / 2 - 1, + Bits / 2, + Bits - 2, + Bits - 1}) { sparse.set_bit(bit); } @@ -641,7 +641,7 @@ namespace out.push_back(descending); for (std::uint64_t seed : - { 0x0123456789ABCDEFULL, 0xFEDCBA9876543210ULL, 0x9E3779B97F4A7C15ULL, 0xD1B54A32D192ED03ULL, 0x94D049BB133111EBULL, 0x2545F4914F6CDD1DULL }) + {0x0123456789ABCDEFULL, 0xFEDCBA9876543210ULL, 0x9E3779B97F4A7C15ULL, 0xD1B54A32D192ED03ULL, 0x94D049BB133111EBULL, 0x2545F4914F6CDD1DULL}) { out.push_back(generated_case(seed)); } @@ -666,7 +666,7 @@ namespace const auto unsigned_cases = build_unsigned_cases(); for (std::size_t i = 0; i < unsigned_cases.size() && i < 8; ++i) { - RefInt value{ unsigned_cases[i] }; + RefInt value{unsigned_cases[i]}; value.raw.set_bit(Bits - 1); out.push_back(value); } @@ -805,15 +805,15 @@ TEST(CcmathInternalTypesTests, BigIntFullMultiplyPreservesLowWordCarries) TEST(CcmathInternalTypesTests, BigIntMultiwordMul2MatchesReference) { - const std::array, 7> cases = { { - { 0ULL, 0ULL }, - { 1ULL, std::numeric_limits::max() }, - { std::numeric_limits::max(), std::numeric_limits::max() }, - { 0x001FFFFFFFFFFFFEULL, 0x001FFFFFFFFFFFFEULL }, - { 0x001FFFFFFFFFF000ULL, 0x001FFFFFFFFFF000ULL }, - { 0x8000000000000005ULL, 0x8000000000000007ULL }, - { 0xFEDCBA9876543210ULL, 0x0123456789ABCDEFULL }, - } }; + const std::array, 7> cases = {{ + {0ULL, 0ULL}, + {1ULL, std::numeric_limits::max()}, + {std::numeric_limits::max(), std::numeric_limits::max()}, + {0x001FFFFFFFFFFFFEULL, 0x001FFFFFFFFFFFFEULL}, + {0x001FFFFFFFFFF000ULL, 0x001FFFFFFFFFF000ULL}, + {0x8000000000000005ULL, 0x8000000000000007ULL}, + {0xFEDCBA9876543210ULL, 0x0123456789ABCDEFULL}, + }}; for (const auto & [lhs, rhs] : cases) { @@ -833,7 +833,7 @@ TEST(CcmathInternalTypesTests, BigIntUnsignedShiftsAndCountHelpersMatchReference using Big = ccm::types::BigInt<256, false, std::uint64_t>; const auto cases = build_unsigned_cases<256>(); - const std::array shifts = { 0, 1, 7, 31, 32, 33, 63, 64, 65, 95, 127, 128, 129, 191, 255 }; + const std::array shifts = {0, 1, 7, 31, 32, 33, 63, 64, 65, 95, 127, 128, 129, 191, 255}; for (const auto & value : cases) { @@ -922,7 +922,7 @@ TEST(CcmathInternalTypesTests, BigIntPowNMatchesReference) const auto cases = build_unsigned_cases<128>(); for (std::size_t i = 0; i < std::min(cases.size(), 10); ++i) { - for (std::uint64_t exponent : { 0ULL, 1ULL, 2ULL, 3ULL, 5ULL, 8ULL, 13ULL }) + for (std::uint64_t exponent : {0ULL, 1ULL, 2ULL, 3ULL, 5ULL, 8ULL, 13ULL}) { RefUint<128> expected = RefUint<128>::one(); RefUint<128> power = cases[i]; @@ -954,8 +954,8 @@ TEST(CcmathInternalTypesTests, BigIntDivHalfWordTimesPowerOfTwoMatchesReference) using HalfWord = ccm::types::multiword::half_width_t; const auto cases = build_unsigned_cases<256>(); - const std::array divisors = { 1U, 3U, 5U, 0x7FFFFFFFU, 0x80000001U, 0xFFFFFFFFU }; - const std::array shifts = { 0, 1, 7, 31, 32, 33, 63, 64, 95, 127, 191, 320 }; + const std::array divisors = {1U, 3U, 5U, 0x7FFFFFFFU, 0x80000001U, 0xFFFFFFFFU}; + const std::array shifts = {0, 1, 7, 31, 32, 33, 63, 64, 95, 127, 191, 320}; for (const auto & numerator_ref : cases) { @@ -989,7 +989,7 @@ TEST(CcmathInternalTypesTests, BigIntSignedArithmeticAndDivisionMatchReference) using Big = ccm::types::BigInt<128, true, std::uint64_t>; const auto cases = build_signed_cases<128>(); - const std::array shifts = { 0, 1, 2, 31, 32, 33, 63, 64, 65, 127 }; + const std::array shifts = {0, 1, 2, 31, 32, 33, 63, 64, 65, 127}; for (const auto & lhs_ref : cases) { @@ -1000,7 +1000,7 @@ TEST(CcmathInternalTypesTests, BigIntSignedArithmeticAndDivisionMatchReference) { SCOPED_TRACE(shift); expect_signed_bigint_equals_ref(lhs >> shift, lhs_ref.arithmetic_shift_right(shift)); - expect_signed_bigint_equals_ref(lhs << shift, RefInt<128>{ lhs_ref.raw.shift_left(shift) }); + expect_signed_bigint_equals_ref(lhs << shift, RefInt<128>{lhs_ref.raw.shift_left(shift)}); } for (const auto & rhs_ref : cases) @@ -1077,9 +1077,9 @@ TEST(CcmathInternalTypesTests, BigIntCrossWordSignedAndUnsignedConversionsPreser expect_bigint_equals_ref(wide_u, wide_unsigned_expected); expect_bigint_equals_ref(narrow_u, unsigned_ref); - RefInt<96> signed_ref{ generated_case<96>(0x94D049BB133111EBULL) }; + RefInt<96> signed_ref{generated_case<96>(0x94D049BB133111EBULL)}; signed_ref.raw.set_bit(95); - RefInt<192> wide_signed_expected{ signed_ref.raw.template slice<192>(0) }; + RefInt<192> wide_signed_expected{signed_ref.raw.template slice<192>(0)}; if (signed_ref.is_negative()) { for (std::size_t bit = 96; bit < 192; ++bit) diff --git a/tests/src/math/internal/types/normalized_float_test.cpp b/tests/src/math/internal/types/normalized_float_test.cpp index 8178527f..8b04a446 100644 --- a/tests/src/math/internal/types/normalized_float_test.cpp +++ b/tests/src/math/internal/types/normalized_float_test.cpp @@ -20,9 +20,9 @@ namespace { using FPBits = ccm::support::fp::FPBits; - constexpr ccm::support::fp::ExceptValues kFloatExcepts{ { { - { 0x3f800000U, 0x3f000000U, 0U, 0U, 0U }, - } } }; + constexpr ccm::support::fp::ExceptValues kFloatExcepts{{{ + {0x3f800000U, 0x3f000000U, 0U, 0U, 0U}, + }}}; } // namespace TEST(CcmathInternalTypesTests, NormalizedFloatMul2MatchesLdexp) diff --git a/tests/src/math/misc/lgamma_test.cpp b/tests/src/math/misc/lgamma_test.cpp index ba1be896..75205029 100644 --- a/tests/src/math/misc/lgamma_test.cpp +++ b/tests/src/math/misc/lgamma_test.cpp @@ -77,7 +77,7 @@ TEST(CcmathMiscTests, LgammaMatchesLibmFloat) TEST(CcmathMiscTests, LgammaSignAgreement) { // std::lgamma stores sign in signgam on some platforms. Compare magnitude only for negative non-integers. - const double samples[] = { -0.25, -1.5, -2.5, -3.25, -10.5 }; + const double samples[] = {-0.25, -1.5, -2.5, -3.25, -10.5}; for (double x : samples) { SCOPED_TRACE(x); diff --git a/tests/src/math/nearest/ceil_round_rint_test.cpp b/tests/src/math/nearest/ceil_round_rint_test.cpp index 5e5fdd8e..f1ab6cc9 100644 --- a/tests/src/math/nearest/ceil_round_rint_test.cpp +++ b/tests/src/math/nearest/ceil_round_rint_test.cpp @@ -39,22 +39,22 @@ namespace template const std::vector> & BasicNearestParams() { static const std::vector> params{ - { static_cast(1.0), StdFn(static_cast(1.0)) }, - { static_cast(1.5), StdFn(static_cast(1.5)) }, - { static_cast(1.9), StdFn(static_cast(1.9)) }, - { static_cast(-1.0), StdFn(static_cast(-1.0)) }, - { static_cast(-1.5), StdFn(static_cast(-1.5)) }, - { static_cast(-1.9), StdFn(static_cast(-1.9)) }, - { static_cast(0.0), StdFn(static_cast(0.0)) }, - { static_cast(-0.0), StdFn(static_cast(-0.0)) }, - { static_cast(0.5), StdFn(static_cast(0.5)) }, - { static_cast(-0.5), StdFn(static_cast(-0.5)) }, - { static_cast(0.9999999999999999), StdFn(static_cast(0.9999999999999999)) }, - { static_cast(-0.9999999999999999), StdFn(static_cast(-0.9999999999999999)) }, - { std::numeric_limits::infinity(), StdFn(std::numeric_limits::infinity()) }, - { -std::numeric_limits::infinity(), StdFn(-std::numeric_limits::infinity()) }, - { std::numeric_limits::denorm_min(), StdFn(std::numeric_limits::denorm_min()) }, - { -std::numeric_limits::denorm_min(), StdFn(-std::numeric_limits::denorm_min()) }, + {static_cast(1.0), StdFn(static_cast(1.0))}, + {static_cast(1.5), StdFn(static_cast(1.5))}, + {static_cast(1.9), StdFn(static_cast(1.9))}, + {static_cast(-1.0), StdFn(static_cast(-1.0))}, + {static_cast(-1.5), StdFn(static_cast(-1.5))}, + {static_cast(-1.9), StdFn(static_cast(-1.9))}, + {static_cast(0.0), StdFn(static_cast(0.0))}, + {static_cast(-0.0), StdFn(static_cast(-0.0))}, + {static_cast(0.5), StdFn(static_cast(0.5))}, + {static_cast(-0.5), StdFn(static_cast(-0.5))}, + {static_cast(0.9999999999999999), StdFn(static_cast(0.9999999999999999))}, + {static_cast(-0.9999999999999999), StdFn(static_cast(-0.9999999999999999))}, + {std::numeric_limits::infinity(), StdFn(std::numeric_limits::infinity())}, + {-std::numeric_limits::infinity(), StdFn(-std::numeric_limits::infinity())}, + {std::numeric_limits::denorm_min(), StdFn(std::numeric_limits::denorm_min())}, + {-std::numeric_limits::denorm_min(), StdFn(-std::numeric_limits::denorm_min())}, }; return params; } diff --git a/tests/src/math/nearest/floor_test.cpp b/tests/src/math/nearest/floor_test.cpp index 97a6af28..6d0c590e 100644 --- a/tests/src/math/nearest/floor_test.cpp +++ b/tests/src/math/nearest/floor_test.cpp @@ -30,29 +30,29 @@ namespace const std::vector kFloorTestsParams{ // Basic double values - { 1.0, std::floor(1.0) }, - { 1.5, std::floor(1.5) }, - { 1.9, std::floor(1.9) }, - { -1.0, std::floor(-1.0) }, - { -1.5, std::floor(-1.5) }, - { -1.9, std::floor(-1.9) }, + {1.0, std::floor(1.0)}, + {1.5, std::floor(1.5)}, + {1.9, std::floor(1.9)}, + {-1.0, std::floor(-1.0)}, + {-1.5, std::floor(-1.5)}, + {-1.9, std::floor(-1.9)}, // Zero values - { 0.0, std::floor(0.0) }, - { -0.0, std::floor(-0.0) }, + {0.0, std::floor(0.0)}, + {-0.0, std::floor(-0.0)}, // Fractional values - { 0.5, std::floor(0.5) }, - { -0.5, std::floor(-0.5) }, - { 0.9, std::floor(0.9) }, - { -0.9, std::floor(-0.9) }, + {0.5, std::floor(0.5)}, + {-0.5, std::floor(-0.5)}, + {0.9, std::floor(0.9)}, + {-0.9, std::floor(-0.9)}, // Very close to whole numbers - { 0.9999999999999999, std::floor(0.9999999999999999) }, - { -0.9999999999999999, std::floor(-0.9999999999999999) }, - { 1.0000000000000001, std::floor(1.0000000000000001) }, - { -1.0000000000000001, std::floor(-1.0000000000000001) }, - { 1.0000000000000000000000000000000000000000000001, std::floor(1.0000000000000000000000000000000000000000000001) }, + {0.9999999999999999, std::floor(0.9999999999999999)}, + {-0.9999999999999999, std::floor(-0.9999999999999999)}, + {1.0000000000000001, std::floor(1.0000000000000001)}, + {-1.0000000000000001, std::floor(-1.0000000000000001)}, + {1.0000000000000000000000000000000000000000000001, std::floor(1.0000000000000000000000000000000000000000000001)}, }; } // namespace @@ -64,8 +64,8 @@ INSTANTIATE_TEST_SUITE_P(FloorTests, CcmathFloorTests, ValuesIn(kFloorTestsParam TEST_P(CcmathFloorTests, Floor) { - const auto param{ GetParam() }; - const auto actual{ ccm::floor(param.input) }; + const auto param{GetParam()}; + const auto actual{ccm::floor(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -77,7 +77,7 @@ TEST(CcmathNearestTests, CcmFloorTestNanValues) TEST(CcmathNearestTests, CcmFloorCanBeEvaluatedAtCompileTime) { - constexpr auto floor{ ccm::floor(1.0) }; + constexpr auto floor{ccm::floor(1.0)}; static_assert(floor == 1.0); } diff --git a/tests/src/math/nearest/nearbyint_test.cpp b/tests/src/math/nearest/nearbyint_test.cpp index 4e87caf6..aca17c4d 100644 --- a/tests/src/math/nearest/nearbyint_test.cpp +++ b/tests/src/math/nearest/nearbyint_test.cpp @@ -37,130 +37,130 @@ namespace const std::vector> kNearbyIntIntegerTestParams{ // Zero values - { 0, std::nearbyint(0) }, + {0, std::nearbyint(0)}, // Positive values - { 1, std::nearbyint(1) }, - { 2, std::nearbyint(2) }, - { 4, std::nearbyint(4) }, - { 9, std::nearbyint(9) }, - { 123, std::nearbyint(123) }, + {1, std::nearbyint(1)}, + {2, std::nearbyint(2)}, + {4, std::nearbyint(4)}, + {9, std::nearbyint(9)}, + {123, std::nearbyint(123)}, // Negative values - { -1, std::nearbyint(-1) }, - { -2, std::nearbyint(-2) }, - { -4, std::nearbyint(-4) }, - { -9, std::nearbyint(-9) }, - { -123, std::nearbyint(-123) }, + {-1, std::nearbyint(-1)}, + {-2, std::nearbyint(-2)}, + {-4, std::nearbyint(-4)}, + {-9, std::nearbyint(-9)}, + {-123, std::nearbyint(-123)}, // Edge cases - { std::numeric_limits::max(), std::nearbyint(std::numeric_limits::max()) }, - { std::numeric_limits::min(), std::nearbyint(std::numeric_limits::min()) }, + {std::numeric_limits::max(), std::nearbyint(std::numeric_limits::max())}, + {std::numeric_limits::min(), std::nearbyint(std::numeric_limits::min())}, }; const std::vector> kNearbyIntFloatTestParams{ // Zero values - { 0.0f, std::nearbyint(0.0f) }, - { -0.0f, std::nearbyint(-0.0f) }, + {0.0f, std::nearbyint(0.0f)}, + {-0.0f, std::nearbyint(-0.0f)}, // Positive values - { 0.05f, std::nearbyint(0.05f) }, - { 0.5f, std::nearbyint(0.5f) }, - { 1.0f, std::nearbyint(1.0f) }, - { 1.5f, std::nearbyint(1.5f) }, - { 123.0f, std::nearbyint(123.0f) }, - { 123.1f, std::nearbyint(123.1f) }, + {0.05f, std::nearbyint(0.05f)}, + {0.5f, std::nearbyint(0.5f)}, + {1.0f, std::nearbyint(1.0f)}, + {1.5f, std::nearbyint(1.5f)}, + {123.0f, std::nearbyint(123.0f)}, + {123.1f, std::nearbyint(123.1f)}, // Negative values - { -0.05f, std::nearbyint(-0.05f) }, - { -0.5f, std::nearbyint(-0.5f) }, - { -1.0f, std::nearbyint(-1.0f) }, - { -1.5f, std::nearbyint(-1.5f) }, - { -123.0f, std::nearbyint(-123.0f) }, - { -123.1f, std::nearbyint(-123.1f) }, + {-0.05f, std::nearbyint(-0.05f)}, + {-0.5f, std::nearbyint(-0.5f)}, + {-1.0f, std::nearbyint(-1.0f)}, + {-1.5f, std::nearbyint(-1.5f)}, + {-123.0f, std::nearbyint(-123.0f)}, + {-123.1f, std::nearbyint(-123.1f)}, // Edge cases - { std::numeric_limits::max(), std::nearbyint(std::numeric_limits::max()) }, - { std::numeric_limits::min(), std::nearbyint(std::numeric_limits::min()) }, - { std::numeric_limits::denorm_min(), std::nearbyint(std::numeric_limits::denorm_min()) }, - { std::numeric_limits::infinity(), std::nearbyint(std::numeric_limits::infinity()) }, - { std::numeric_limits::quiet_NaN(), std::nearbyint(std::numeric_limits::quiet_NaN()) }, - - { -std::numeric_limits::max(), std::nearbyint(-std::numeric_limits::max()) }, - { -std::numeric_limits::min(), std::nearbyint(-std::numeric_limits::min()) }, - { -std::numeric_limits::denorm_min(), -std::nearbyint(std::numeric_limits::denorm_min()) }, - { -std::numeric_limits::infinity(), -std::nearbyint(std::numeric_limits::infinity()) }, - { -std::numeric_limits::quiet_NaN(), -std::nearbyint(std::numeric_limits::quiet_NaN()) }, + {std::numeric_limits::max(), std::nearbyint(std::numeric_limits::max())}, + {std::numeric_limits::min(), std::nearbyint(std::numeric_limits::min())}, + {std::numeric_limits::denorm_min(), std::nearbyint(std::numeric_limits::denorm_min())}, + {std::numeric_limits::infinity(), std::nearbyint(std::numeric_limits::infinity())}, + {std::numeric_limits::quiet_NaN(), std::nearbyint(std::numeric_limits::quiet_NaN())}, + + {-std::numeric_limits::max(), std::nearbyint(-std::numeric_limits::max())}, + {-std::numeric_limits::min(), std::nearbyint(-std::numeric_limits::min())}, + {-std::numeric_limits::denorm_min(), -std::nearbyint(std::numeric_limits::denorm_min())}, + {-std::numeric_limits::infinity(), -std::nearbyint(std::numeric_limits::infinity())}, + {-std::numeric_limits::quiet_NaN(), -std::nearbyint(std::numeric_limits::quiet_NaN())}, }; const std::vector> kNearbyIntDoubleTestParams{ // Zero values - { 0.0, std::nearbyint(0.0) }, - { -0.0, std::nearbyint(-0.0) }, + {0.0, std::nearbyint(0.0)}, + {-0.0, std::nearbyint(-0.0)}, // Positive values - { 0.05, std::nearbyint(0.05) }, - { 0.5, std::nearbyint(0.5) }, - { 1.0, std::nearbyint(1.0) }, - { 1.5, std::nearbyint(1.5) }, - { 123.0, std::nearbyint(123.0) }, - { 123.1, std::nearbyint(123.1) }, + {0.05, std::nearbyint(0.05)}, + {0.5, std::nearbyint(0.5)}, + {1.0, std::nearbyint(1.0)}, + {1.5, std::nearbyint(1.5)}, + {123.0, std::nearbyint(123.0)}, + {123.1, std::nearbyint(123.1)}, // Negative values - { -0.05, std::nearbyint(-0.05) }, - { -0.5, std::nearbyint(-0.5) }, - { -1.0, std::nearbyint(-1.0) }, - { -1.5, std::nearbyint(-1.5) }, - { -123.0, std::nearbyint(-123.0) }, - { -123.1, std::nearbyint(-123.1) }, + {-0.05, std::nearbyint(-0.05)}, + {-0.5, std::nearbyint(-0.5)}, + {-1.0, std::nearbyint(-1.0)}, + {-1.5, std::nearbyint(-1.5)}, + {-123.0, std::nearbyint(-123.0)}, + {-123.1, std::nearbyint(-123.1)}, // Edge cases - { std::numeric_limits::max(), std::nearbyint(std::numeric_limits::max()) }, - { std::numeric_limits::min(), std::nearbyint(std::numeric_limits::min()) }, - { std::numeric_limits::denorm_min(), std::nearbyint(std::numeric_limits::denorm_min()) }, - { std::numeric_limits::infinity(), std::nearbyint(std::numeric_limits::infinity()) }, - { std::numeric_limits::quiet_NaN(), std::nearbyint(std::numeric_limits::quiet_NaN()) }, - - { -std::numeric_limits::max(), std::nearbyint(-std::numeric_limits::max()) }, - { -std::numeric_limits::min(), std::nearbyint(-std::numeric_limits::min()) }, - { -std::numeric_limits::denorm_min(), -std::nearbyint(std::numeric_limits::denorm_min()) }, - { -std::numeric_limits::infinity(), -std::nearbyint(std::numeric_limits::infinity()) }, - { -std::numeric_limits::quiet_NaN(), -std::nearbyint(std::numeric_limits::quiet_NaN()) }, + {std::numeric_limits::max(), std::nearbyint(std::numeric_limits::max())}, + {std::numeric_limits::min(), std::nearbyint(std::numeric_limits::min())}, + {std::numeric_limits::denorm_min(), std::nearbyint(std::numeric_limits::denorm_min())}, + {std::numeric_limits::infinity(), std::nearbyint(std::numeric_limits::infinity())}, + {std::numeric_limits::quiet_NaN(), std::nearbyint(std::numeric_limits::quiet_NaN())}, + + {-std::numeric_limits::max(), std::nearbyint(-std::numeric_limits::max())}, + {-std::numeric_limits::min(), std::nearbyint(-std::numeric_limits::min())}, + {-std::numeric_limits::denorm_min(), -std::nearbyint(std::numeric_limits::denorm_min())}, + {-std::numeric_limits::infinity(), -std::nearbyint(std::numeric_limits::infinity())}, + {-std::numeric_limits::quiet_NaN(), -std::nearbyint(std::numeric_limits::quiet_NaN())}, }; const std::vector> kNearbyIntLongDoubleTestParams{ // Zero values - { 0.0L, std::nearbyint(0.0L) }, - { -0.0L, std::nearbyint(-0.0L) }, + {0.0L, std::nearbyint(0.0L)}, + {-0.0L, std::nearbyint(-0.0L)}, // Positive values - { 0.05L, std::nearbyint(0.05L) }, - { 0.5L, std::nearbyint(0.5L) }, - { 1.0L, std::nearbyint(1.0L) }, - { 1.5L, std::nearbyint(1.5L) }, - { 123.0L, std::nearbyint(123.0L) }, - { 123.1L, std::nearbyint(123.1L) }, + {0.05L, std::nearbyint(0.05L)}, + {0.5L, std::nearbyint(0.5L)}, + {1.0L, std::nearbyint(1.0L)}, + {1.5L, std::nearbyint(1.5L)}, + {123.0L, std::nearbyint(123.0L)}, + {123.1L, std::nearbyint(123.1L)}, // Negative values - { -0.05L, std::nearbyint(-0.05L) }, - { -0.5L, std::nearbyint(-0.5L) }, - { -1.0L, std::nearbyint(-1.0L) }, - { -1.5L, std::nearbyint(-1.5L) }, - { -123.0L, std::nearbyint(-123.0L) }, - { -123.1L, std::nearbyint(-123.1L) }, + {-0.05L, std::nearbyint(-0.05L)}, + {-0.5L, std::nearbyint(-0.5L)}, + {-1.0L, std::nearbyint(-1.0L)}, + {-1.5L, std::nearbyint(-1.5L)}, + {-123.0L, std::nearbyint(-123.0L)}, + {-123.1L, std::nearbyint(-123.1L)}, // Edge cases - { std::numeric_limits::max(), std::nearbyint(std::numeric_limits::max()) }, - { std::numeric_limits::min(), std::nearbyint(std::numeric_limits::min()) }, - { std::numeric_limits::denorm_min(), std::nearbyint(std::numeric_limits::denorm_min()) }, - { std::numeric_limits::infinity(), std::nearbyint(std::numeric_limits::infinity()) }, - { std::numeric_limits::quiet_NaN(), std::nearbyint(std::numeric_limits::quiet_NaN()) }, - - { -std::numeric_limits::max(), std::nearbyint(-std::numeric_limits::max()) }, - { -std::numeric_limits::min(), std::nearbyint(-std::numeric_limits::min()) }, - { -std::numeric_limits::denorm_min(), -std::nearbyint(std::numeric_limits::denorm_min()) }, - { -std::numeric_limits::infinity(), -std::nearbyint(std::numeric_limits::infinity()) }, - { -std::numeric_limits::quiet_NaN(), -std::nearbyint(std::numeric_limits::quiet_NaN()) }, + {std::numeric_limits::max(), std::nearbyint(std::numeric_limits::max())}, + {std::numeric_limits::min(), std::nearbyint(std::numeric_limits::min())}, + {std::numeric_limits::denorm_min(), std::nearbyint(std::numeric_limits::denorm_min())}, + {std::numeric_limits::infinity(), std::nearbyint(std::numeric_limits::infinity())}, + {std::numeric_limits::quiet_NaN(), std::nearbyint(std::numeric_limits::quiet_NaN())}, + + {-std::numeric_limits::max(), std::nearbyint(-std::numeric_limits::max())}, + {-std::numeric_limits::min(), std::nearbyint(-std::numeric_limits::min())}, + {-std::numeric_limits::denorm_min(), -std::nearbyint(std::numeric_limits::denorm_min())}, + {-std::numeric_limits::infinity(), -std::nearbyint(std::numeric_limits::infinity())}, + {-std::numeric_limits::quiet_NaN(), -std::nearbyint(std::numeric_limits::quiet_NaN())}, }; } // namespace @@ -185,10 +185,10 @@ INSTANTIATE_TEST_SUITE_P(NearbyIntLongDoubleTests, CcmathNearbyIntLongDoubleTest TEST_P(CcmathNearbyIntIntegerTests, NearbyIntForIntegerReturnsExpectedValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::nearbyint(param.input) }; + const auto actual{ccm::nearbyint(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -196,10 +196,10 @@ TEST_P(CcmathNearbyIntIntegerTests, NearbyIntForIntegerReturnsExpectedValue) TEST_P(CcmathNearbyIntDoubleTests, NearbyIntForDoubleReturnsExpectedValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::nearbyint(param.input) }; + const auto actual{ccm::nearbyint(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -207,10 +207,10 @@ TEST_P(CcmathNearbyIntDoubleTests, NearbyIntForDoubleReturnsExpectedValue) TEST_P(CcmathNearbyIntFloatTests, NearbyIntForFloatReturnsExpectedValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::nearbyint(param.input) }; + const auto actual{ccm::nearbyint(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -218,10 +218,10 @@ TEST_P(CcmathNearbyIntFloatTests, NearbyIntForFloatReturnsExpectedValue) TEST_P(CcmathNearbyIntFloatTests, NearbyIntFForFloatReturnsExpectedValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::nearbyintf(param.input) }; + const auto actual{ccm::nearbyintf(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -229,10 +229,10 @@ TEST_P(CcmathNearbyIntFloatTests, NearbyIntFForFloatReturnsExpectedValue) TEST_P(CcmathNearbyIntLongDoubleTests, NearbyIntForLongDoubleReturnsExpectedValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::nearbyint(param.input) }; + const auto actual{ccm::nearbyint(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -240,30 +240,30 @@ TEST_P(CcmathNearbyIntLongDoubleTests, NearbyIntForLongDoubleReturnsExpectedValu TEST_P(CcmathNearbyIntLongDoubleTests, NearbyIntLForLongDoubleReturnsExpectedValue) { // Arrange - const auto & param{ GetParam() }; + const auto & param{GetParam()}; // Act - const auto actual{ ccm::nearbyintl(param.input) }; + const auto actual{ccm::nearbyintl(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } TEST(CcmathNearestTests, CcmNearbyIntCanBeEvaluatedAtCompileTime) { - constexpr auto nearbyint{ ccm::nearbyint(1.0) }; + constexpr auto nearbyint{ccm::nearbyint(1.0)}; static_assert(nearbyint == 1.0); } TEST(CcmathNearestTests, CcmNearbyIntFCanBeEvaluatedAtCompileTime) { - constexpr auto nearbyintf{ ccm::nearbyintf(1.0f) }; + constexpr auto nearbyintf{ccm::nearbyintf(1.0f)}; static_assert(nearbyintf == 1.0); } #ifndef CLANG_LINUX TEST(CcmathNearestTests, CcmNearbyIntLCanBeEvaluatedAtCompileTime) { - constexpr auto nearbyintl{ ccm::nearbyintl(1.0L) }; + constexpr auto nearbyintl{ccm::nearbyintl(1.0L)}; static_assert(nearbyintl == 1.0); } #endif diff --git a/tests/src/math/nearest/trunc_test.cpp b/tests/src/math/nearest/trunc_test.cpp index 4f18e41e..19c8a2f9 100644 --- a/tests/src/math/nearest/trunc_test.cpp +++ b/tests/src/math/nearest/trunc_test.cpp @@ -38,90 +38,89 @@ namespace const std::vector> kTruncDoubleTestsParams{ // Basic double values - { 1.0, std::trunc(1.0) }, - { 1.5, std::trunc(1.5) }, - { 1.9, std::trunc(1.9) }, - { -1.0, std::trunc(-1.0) }, - { -1.5, std::trunc(-1.5) }, - { -1.9, std::trunc(-1.9) }, + {1.0, std::trunc(1.0)}, + {1.5, std::trunc(1.5)}, + {1.9, std::trunc(1.9)}, + {-1.0, std::trunc(-1.0)}, + {-1.5, std::trunc(-1.5)}, + {-1.9, std::trunc(-1.9)}, // Infinity values - { std::numeric_limits::infinity(), std::trunc(std::numeric_limits::infinity()) }, - { -std::numeric_limits::infinity(), std::trunc(-std::numeric_limits::infinity()) }, + {std::numeric_limits::infinity(), std::trunc(std::numeric_limits::infinity())}, + {-std::numeric_limits::infinity(), std::trunc(-std::numeric_limits::infinity())}, // Zero values - { 0.0, std::trunc(0.0) }, - { -0.0, std::trunc(-0.0) }, + {0.0, std::trunc(0.0)}, + {-0.0, std::trunc(-0.0)}, // Fractional values - { 0.5, std::trunc(0.5) }, - { -0.5, std::trunc(-0.5) }, - { 0.9, std::trunc(0.9) }, - { -0.9, std::trunc(-0.9) }, + {0.5, std::trunc(0.5)}, + {-0.5, std::trunc(-0.5)}, + {0.9, std::trunc(0.9)}, + {-0.9, std::trunc(-0.9)}, // Very close to whole numbers - { 0.9999999999999999, std::trunc(0.9999999999999999) }, - { -0.9999999999999999, std::trunc(-0.9999999999999999) }, - { 1.0000000000000001, std::trunc(1.0000000000000001) }, - { -1.0000000000000001, std::trunc(-1.0000000000000001) } - }; + {0.9999999999999999, std::trunc(0.9999999999999999)}, + {-0.9999999999999999, std::trunc(-0.9999999999999999)}, + {1.0000000000000001, std::trunc(1.0000000000000001)}, + {-1.0000000000000001, std::trunc(-1.0000000000000001)}}; const std::vector> kTruncFloatTestParams{ // Basic float values - { 1.0f, std::truncf(1.0f) }, - { 1.5f, std::truncf(1.5f) }, - { 1.9f, std::truncf(1.9f) }, - { -1.0f, std::truncf(-1.0f) }, - { -1.5f, std::truncf(-1.5f) }, - { -1.9f, std::truncf(-1.9f) }, + {1.0f, std::truncf(1.0f)}, + {1.5f, std::truncf(1.5f)}, + {1.9f, std::truncf(1.9f)}, + {-1.0f, std::truncf(-1.0f)}, + {-1.5f, std::truncf(-1.5f)}, + {-1.9f, std::truncf(-1.9f)}, // Infinity values - { std::numeric_limits::infinity(), std::truncf(std::numeric_limits::infinity()) }, - { -std::numeric_limits::infinity(), std::truncf(-std::numeric_limits::infinity()) }, + {std::numeric_limits::infinity(), std::truncf(std::numeric_limits::infinity())}, + {-std::numeric_limits::infinity(), std::truncf(-std::numeric_limits::infinity())}, // Zero values - { 0.0f, std::truncf(0.0f) }, - { -0.0f, std::truncf(-0.0f) }, + {0.0f, std::truncf(0.0f)}, + {-0.0f, std::truncf(-0.0f)}, // Fractional values - { 0.5f, std::truncf(0.5f) }, - { -0.5f, std::truncf(-0.5f) }, - { 0.9f, std::truncf(0.9f) }, - { -0.9f, std::truncf(-0.9f) }, + {0.5f, std::truncf(0.5f)}, + {-0.5f, std::truncf(-0.5f)}, + {0.9f, std::truncf(0.9f)}, + {-0.9f, std::truncf(-0.9f)}, // Very close to whole numbers - { 0.9999999999999999f, std::truncf(0.9999999999999999f) }, - { -0.9999999999999999f, std::truncf(-0.9999999999999999f) }, + {0.9999999999999999f, std::truncf(0.9999999999999999f)}, + {-0.9999999999999999f, std::truncf(-0.9999999999999999f)}, - { 30.508474576271183309F, std::truncf(30.508474576271183309F) }, + {30.508474576271183309F, std::truncf(30.508474576271183309F)}, }; const std::vector> kTruncLongDoubleTestParams{ // Basic long double values - { 1.0L, std::truncl(1.0L) }, - { 1.5L, std::truncl(1.5L) }, - { 1.9L, std::truncl(1.9L) }, - { -1.0L, std::truncl(-1.0L) }, - { -1.5L, std::truncl(-1.5L) }, - { -1.9L, std::truncl(-1.9L) }, + {1.0L, std::truncl(1.0L)}, + {1.5L, std::truncl(1.5L)}, + {1.9L, std::truncl(1.9L)}, + {-1.0L, std::truncl(-1.0L)}, + {-1.5L, std::truncl(-1.5L)}, + {-1.9L, std::truncl(-1.9L)}, // Infinity values - { std::numeric_limits::infinity(), std::truncl(std::numeric_limits::infinity()) }, - { -std::numeric_limits::infinity(), std::truncl(-std::numeric_limits::infinity()) }, + {std::numeric_limits::infinity(), std::truncl(std::numeric_limits::infinity())}, + {-std::numeric_limits::infinity(), std::truncl(-std::numeric_limits::infinity())}, // Fractional values - { 0.0L, std::truncl(0.0L) }, - { -0.0L, std::truncl(-0.0L) }, - { 0.5L, std::truncl(0.5L) }, - { -0.5L, std::truncl(-0.5L) }, - { 0.9L, std::truncl(0.9L) }, - { -0.9L, std::truncl(-0.9L) }, + {0.0L, std::truncl(0.0L)}, + {-0.0L, std::truncl(-0.0L)}, + {0.5L, std::truncl(0.5L)}, + {-0.5L, std::truncl(-0.5L)}, + {0.9L, std::truncl(0.9L)}, + {-0.9L, std::truncl(-0.9L)}, // Very close to whole numbers - { 0.9999999999999999L, std::truncl(0.9999999999999999L) }, - { -0.9999999999999999L, std::truncl(-0.9999999999999999L) }, + {0.9999999999999999L, std::truncl(0.9999999999999999L)}, + {-0.9999999999999999L, std::truncl(-0.9999999999999999L)}, }; } // namespace @@ -141,22 +140,22 @@ INSTANTIATE_TEST_SUITE_P(TruncLongDoubleTests, CcmathTruncLongDoubleTests, Value TEST_P(CcmathTruncDoubleTests, Trunc) { - const auto param{ GetParam() }; - const auto actual{ ccm::trunc(param.input) }; + const auto param{GetParam()}; + const auto actual{ccm::trunc(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } TEST_P(CcmathTruncFloatTests, TruncF) { - const auto param{ GetParam() }; - const auto actual{ ccm::truncf(param.input) }; + const auto param{GetParam()}; + const auto actual{ccm::truncf(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } TEST_P(CcmathTruncLongDoubleTests, TruncL) { - const auto param{ GetParam() }; - const auto actual{ ccm::truncl(param.input) }; + const auto param{GetParam()}; + const auto actual{ccm::truncl(param.input)}; ccm::test::ExpectSameAsStd(actual, param.expected); } @@ -170,20 +169,20 @@ TEST(CcmathNearestTests, CcmTruncTestNanValues) TEST(CcmathNearestTests, CcmTruncCanBeEvaluatedAtCompileTime) { - constexpr auto trunc{ ccm::trunc(1.0) }; + constexpr auto trunc{ccm::trunc(1.0)}; static_assert(trunc == 1.0); } TEST(CcmathNearestTests, CcmTruncfCanBeEvaluatedAtCompileTime) { - constexpr auto truncf{ ccm::truncf(1.0f) }; + constexpr auto truncf{ccm::truncf(1.0f)}; static_assert(truncf == 1.0f); } #ifndef CLANG_LINUX TEST(CcmathNearestTests, CcmTrunclCanBeEvaluatedAtCompileTime) { - constexpr auto truncl{ ccm::truncl(1.0L) }; + constexpr auto truncl{ccm::truncl(1.0L)}; static_assert(truncl == 1.0L); } #endif diff --git a/tests/src/math/power/pow_correct_rounding_test.cpp b/tests/src/math/power/pow_correct_rounding_test.cpp index 5dbb7a5f..d5be0751 100644 --- a/tests/src/math/power/pow_correct_rounding_test.cpp +++ b/tests/src/math/power/pow_correct_rounding_test.cpp @@ -54,35 +54,35 @@ namespace // Goldens generated with MPFR mpfr_pow at 53-bit target precision plus mpfr_subnormalize. constexpr CrCase kCases[] = { - { 0x405162815b601161ULL, 0xc064e4c1f2807ec5ULL, { 0x000885d3ea823897ULL, 0x000885d3ea823897ULL, 0x000885d3ea823898ULL, 0x000885d3ea823897ULL } }, - { 0x3f2e4ddb428b4ea2ULL, 0x4055200000000000ULL, { 0x00248fc4d15a992fULL, 0x00248fc4d15a992fULL, 0x00248fc4d15a9930ULL, 0x00248fc4d15a992fULL } }, - { 0x3ed92a0fe61fea87ULL, 0xc04d800000000000ULL, { 0x7fe5ee51f641fc88ULL, 0x7fe5ee51f641fc88ULL, 0x7fe5ee51f641fc89ULL, 0x7fe5ee51f641fc88ULL } }, - { 0x3fa7ce5b56028880ULL, 0xc06ce00000000000ULL, { 0x7fd7dfa51b860ab3ULL, 0x7fd7dfa51b860ab3ULL, 0x7fd7dfa51b860ab4ULL, 0x7fd7dfa51b860ab3ULL } }, - { 0xbff8652519a8b58aULL, 0xc06de00000000000ULL, { 0xb6d7a6dd226e1be5ULL, 0xb6d7a6dd226e1be4ULL, 0xb6d7a6dd226e1be4ULL, 0xb6d7a6dd226e1be5ULL } }, - { 0xbffc8a7c01dee76eULL, 0x4074700000000000ULL, { 0xd1005d3d0c963798ULL, 0xd1005d3d0c963798ULL, 0xd1005d3d0c963798ULL, 0xd1005d3d0c963799ULL } }, - { 0x4173b2e892108fcaULL, 0x4037000000000000ULL, { 0x62dde05268d268ebULL, 0x62dde05268d268ebULL, 0x62dde05268d268ecULL, 0x62dde05268d268ebULL } }, + {0x405162815b601161ULL, 0xc064e4c1f2807ec5ULL, {0x000885d3ea823897ULL, 0x000885d3ea823897ULL, 0x000885d3ea823898ULL, 0x000885d3ea823897ULL}}, + {0x3f2e4ddb428b4ea2ULL, 0x4055200000000000ULL, {0x00248fc4d15a992fULL, 0x00248fc4d15a992fULL, 0x00248fc4d15a9930ULL, 0x00248fc4d15a992fULL}}, + {0x3ed92a0fe61fea87ULL, 0xc04d800000000000ULL, {0x7fe5ee51f641fc88ULL, 0x7fe5ee51f641fc88ULL, 0x7fe5ee51f641fc89ULL, 0x7fe5ee51f641fc88ULL}}, + {0x3fa7ce5b56028880ULL, 0xc06ce00000000000ULL, {0x7fd7dfa51b860ab3ULL, 0x7fd7dfa51b860ab3ULL, 0x7fd7dfa51b860ab4ULL, 0x7fd7dfa51b860ab3ULL}}, + {0xbff8652519a8b58aULL, 0xc06de00000000000ULL, {0xb6d7a6dd226e1be5ULL, 0xb6d7a6dd226e1be4ULL, 0xb6d7a6dd226e1be4ULL, 0xb6d7a6dd226e1be5ULL}}, + {0xbffc8a7c01dee76eULL, 0x4074700000000000ULL, {0xd1005d3d0c963798ULL, 0xd1005d3d0c963798ULL, 0xd1005d3d0c963798ULL, 0xd1005d3d0c963799ULL}}, + {0x4173b2e892108fcaULL, 0x4037000000000000ULL, {0x62dde05268d268ebULL, 0x62dde05268d268ebULL, 0x62dde05268d268ecULL, 0x62dde05268d268ebULL}}, // nextafter(2^k) bases raised to integer powers: results sit just below a power of two with // a sub-ulp tail the double-double cannot place, so the exponent-tracked ipow must resolve // the directed rounding. Tiny power, reciprocal of a tiny power, and a near-overflow power. - { 0x3c4fffffffffffffULL, 0x4031000000000000ULL, { 0x024fffffffffffefULL, 0x024fffffffffffefULL, 0x024ffffffffffff0ULL, 0x024fffffffffffefULL } }, - { 0x3ca0000000000001ULL, 0xc033000000000000ULL, { 0x7edfffffffffffdaULL, 0x7edfffffffffffdaULL, 0x7edfffffffffffdbULL, 0x7edfffffffffffdaULL } }, - { 0x429fffffffffffffULL, 0x4037000000000000ULL, { 0x7dbfffffffffffe9ULL, 0x7dbfffffffffffe9ULL, 0x7dbfffffffffffeaULL, 0x7dbfffffffffffe9ULL } }, + {0x3c4fffffffffffffULL, 0x4031000000000000ULL, {0x024fffffffffffefULL, 0x024fffffffffffefULL, 0x024ffffffffffff0ULL, 0x024fffffffffffefULL}}, + {0x3ca0000000000001ULL, 0xc033000000000000ULL, {0x7edfffffffffffdaULL, 0x7edfffffffffffdaULL, 0x7edfffffffffffdbULL, 0x7edfffffffffffdaULL}}, + {0x429fffffffffffffULL, 0x4037000000000000ULL, {0x7dbfffffffffffe9ULL, 0x7dbfffffffffffe9ULL, 0x7dbfffffffffffeaULL, 0x7dbfffffffffffe9ULL}}, // Negative base with integer exponent overflowing: directed rounding must keep the sign // (positive even-power overflow vs negative odd-power overflow). - { 0xc4b2b5154aedb961ULL, 0x406dc00000000000ULL, { 0x7ff0000000000000ULL, 0x7fefffffffffffffULL, 0x7ff0000000000000ULL, 0x7fefffffffffffffULL } }, - { 0xc2886f7925646c38ULL, 0x4044800000000000ULL, { 0xfff0000000000000ULL, 0xffefffffffffffffULL, 0xffefffffffffffffULL, 0xfff0000000000000ULL } }, + {0xc4b2b5154aedb961ULL, 0x406dc00000000000ULL, {0x7ff0000000000000ULL, 0x7fefffffffffffffULL, 0x7ff0000000000000ULL, 0x7fefffffffffffffULL}}, + {0xc2886f7925646c38ULL, 0x4044800000000000ULL, {0xfff0000000000000ULL, 0xffefffffffffffffULL, 0xffefffffffffffffULL, 0xfff0000000000000ULL}}, // x^(-1/2) = 1/sqrt(x) just past a power of two: a double-double 1/sqrt is a directed-mode // ULP short, so an exact residual test pins the rounding (cr_rsqrt). - { 0x3370000000000001ULL, 0xbfe0000000000000ULL, { 0x462fffffffffffffULL, 0x462fffffffffffffULL, 0x4630000000000000ULL, 0x462fffffffffffffULL } }, - { 0x336fffffffffffffULL, 0xbfe0000000000000ULL, { 0x4630000000000000ULL, 0x4630000000000000ULL, 0x4630000000000001ULL, 0x4630000000000000ULL } }, - { 0x3ff0000000000001ULL, 0xbfe0000000000000ULL, { 0x3fefffffffffffffULL, 0x3fefffffffffffffULL, 0x3ff0000000000000ULL, 0x3fefffffffffffffULL } }, + {0x3370000000000001ULL, 0xbfe0000000000000ULL, {0x462fffffffffffffULL, 0x462fffffffffffffULL, 0x4630000000000000ULL, 0x462fffffffffffffULL}}, + {0x336fffffffffffffULL, 0xbfe0000000000000ULL, {0x4630000000000000ULL, 0x4630000000000000ULL, 0x4630000000000001ULL, 0x4630000000000000ULL}}, + {0x3ff0000000000001ULL, 0xbfe0000000000000ULL, {0x3fefffffffffffffULL, 0x3fefffffffffffffULL, 0x3ff0000000000000ULL, 0x3fefffffffffffffULL}}, // Integer power whose result is subnormal: the accurate squaring rounds straight onto the // subnormal grid rather than double-rounding through the kernel. - { 0x3b5fffffffffffffULL, 0x402c000000000000ULL, { 0x000ffffffffffff9ULL, 0x000ffffffffffff9ULL, 0x000ffffffffffffaULL, 0x000ffffffffffff9ULL } }, + {0x3b5fffffffffffffULL, 0x402c000000000000ULL, {0x000ffffffffffff9ULL, 0x000ffffffffffff9ULL, 0x000ffffffffffffaULL, 0x000ffffffffffff9ULL}}, }; - constexpr std::array kModes = { FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD, FE_DOWNWARD }; - constexpr std::array kNames = { "FE_TONEAREST", "FE_TOWARDZERO", "FE_UPWARD", "FE_DOWNWARD" }; + constexpr std::array kModes = {FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD, FE_DOWNWARD}; + constexpr std::array kNames = {"FE_TONEAREST", "FE_TOWARDZERO", "FE_UPWARD", "FE_DOWNWARD"}; } // namespace TEST(CcmathPowCorrectRounding, BinaryDoubleAllModes) diff --git a/tests/src/math/power/pow_deterministic_test.cpp b/tests/src/math/power/pow_deterministic_test.cpp index 654957c8..c1647c34 100644 --- a/tests/src/math/power/pow_deterministic_test.cpp +++ b/tests/src/math/power/pow_deterministic_test.cpp @@ -29,8 +29,8 @@ namespace return ccm::support::bit_cast(a) == ccm::support::bit_cast(b); } - constexpr std::array kBases = { 2.0, 0.5, 1.25, 3.0, 10.0, 0.1 }; - constexpr std::array kExponents = { 3.0, -2.0, 0.5, 7.25, -0.75, 100.0 }; + constexpr std::array kBases = {2.0, 0.5, 1.25, 3.0, 10.0, 0.1}; + constexpr std::array kExponents = {3.0, -2.0, 0.5, 7.25, -0.75, 100.0}; } // namespace // Deterministic mode must route the public runtime entry point through the generic kernel rather diff --git a/tests/src/math/power/pow_simd_test.cpp b/tests/src/math/power/pow_simd_test.cpp index 73746771..56d779e7 100644 --- a/tests/src/math/power/pow_simd_test.cpp +++ b/tests/src/math/power/pow_simd_test.cpp @@ -69,11 +69,9 @@ namespace // Exceptional grid: zeros, ones, infinities, NaN, denormals, extremes, negative bases. const double special_bases[] = { - 0.0, -0.0, 1.0, -1.0, 2.0, -2.0, 10.0, 0.5, inf, -inf, qnan, denorm, -denorm, minn, maxd, -maxd, 1.0000000000000002, 0.9999999999999999, 1.5, -1.5 - }; + 0.0, -0.0, 1.0, -1.0, 2.0, -2.0, 10.0, 0.5, inf, -inf, qnan, denorm, -denorm, minn, maxd, -maxd, 1.0000000000000002, 0.9999999999999999, 1.5, -1.5}; const double special_exps[] = { - 0.0, -0.0, 1.0, -1.0, 2.0, 3.0, -3.0, 0.5, -0.5, 2.5, 1023.0, -1074.0, 1025.0, inf, -inf, qnan, 1e300, -1e300, 0.3333333333333333, 5.5e18 - }; + 0.0, -0.0, 1.0, -1.0, 2.0, 3.0, -3.0, 0.5, -0.5, 2.5, 1023.0, -1074.0, 1025.0, inf, -inf, qnan, 1e300, -1e300, 0.3333333333333333, 5.5e18}; for (double b : special_bases) { for (double e : special_exps) @@ -94,7 +92,7 @@ namespace // Hard near-one region with large exponents (stresses the double-double pipeline). for (double b = 0.95; b <= 1.05; b += 0.00037) { - for (double e : { -4000.1, -750.3, -13.7, 13.7, 750.3, 4000.1 }) + for (double e : {-4000.1, -750.3, -13.7, 13.7, 750.3, 4000.1}) { add(b, e); } @@ -125,7 +123,7 @@ namespace for (double b = 2.0; b <= 500.0; b *= 1.6) { const double k = std::log(1.7e308) / std::log(b); - for (double d : { -2.0, -0.5, 0.0, 0.5, 2.0 }) + for (double d : {-2.0, -0.5, 0.0, 0.5, 2.0}) { add(b, k + d); add(b, -(k + d)); @@ -135,14 +133,14 @@ namespace // Subnormal bases. for (int e2 = -1074; e2 <= -1000; e2 += 7) { - for (double e : { -2.5, -1.1, 0.7, 1.3, 2.9 }) + for (double e : {-2.5, -1.1, 0.7, 1.3, 2.9}) { add(std::ldexp(1.2345, e2), e); } } // Huge exponents straddling the clamp threshold 0x43d74910d52d3052. - for (double b : { 0.97, 0.9999999, 1.0000001, 1.03 }) + for (double b : {0.97, 0.9999999, 1.0000001, 1.03}) { for (int e2 = 55; e2 <= 70; ++e2) { @@ -160,7 +158,7 @@ namespace add(base_dist(rng), exp_dist(rng)); } - return { std::move(xs), std::move(ys) }; + return {std::move(xs), std::move(ys)}; } template void expect_matches_scalar(const std::vector & xs, const std::vector & ys, const char * tag) @@ -213,11 +211,11 @@ namespace std::feclearexcept(FE_ALL_EXCEPT); errno = 0; run(); - return { std::fetestexcept(FE_OVERFLOW) != 0, - std::fetestexcept(FE_UNDERFLOW) != 0, - std::fetestexcept(FE_INVALID) != 0, - std::fetestexcept(FE_DIVBYZERO) != 0, - errno }; + return {std::fetestexcept(FE_OVERFLOW) != 0, + std::fetestexcept(FE_UNDERFLOW) != 0, + std::fetestexcept(FE_INVALID) != 0, + std::fetestexcept(FE_DIVBYZERO) != 0, + errno}; } } // namespace @@ -297,17 +295,17 @@ TEST(CcmathPowSimd, FenvAndErrnoParityWithScalarKernel) using V = native_simd; const double cases[][2] = { - { 1e300, 3.0 }, // overflow - { 1e-300, 3.0 }, // underflow - { 2.0, 2000.0 }, // overflow through the scale path - { 2.0, -2000.0 }, // underflow through the scale path - { 0.0, 2.0 }, // exact zero, no flags - { 0.0, -2.0 }, // pole, divide by zero - { -2.0, 0.5 }, // domain error, invalid - { 2.0, 3.0 }, // clean exact - { 1.5, 7.25 }, // clean inexact fast path - { 0.5, 2000.0 }, // underflow - { 1.0000001, 1e15 }, // overflow from a near-one base + {1e300, 3.0}, // overflow + {1e-300, 3.0}, // underflow + {2.0, 2000.0}, // overflow through the scale path + {2.0, -2000.0}, // underflow through the scale path + {0.0, 2.0}, // exact zero, no flags + {0.0, -2.0}, // pole, divide by zero + {-2.0, 0.5}, // domain error, invalid + {2.0, 3.0}, // clean exact + {1.5, 7.25}, // clean inexact fast path + {0.5, 2000.0}, // underflow + {1.0000001, 1e15}, // overflow from a near-one base }; for (const auto & c : cases) diff --git a/tests/src/math/power/pow_test.cpp b/tests/src/math/power/pow_test.cpp index bbab352d..09314842 100644 --- a/tests/src/math/power/pow_test.cpp +++ b/tests/src/math/power/pow_test.cpp @@ -477,7 +477,7 @@ TEST(CcmathPowerTests, PowNegInfBaseNegativeNonIntegerExponent) // (e.g. glibc) return a pow(x, -1) that is one ULP off the IEEE reciprocal. TEST(CcmathPowerTests, PowNegativeOneExponentMatchesDivision) { - for (const std::uint64_t base_bits : { 0x3f4fffffffffffffULL, 0x3fdfffffffffffffULL, 0x3fefffffffffffffULL, 0x3fffffffffffffffULL, 0x408fffffffffffffULL }) + for (const std::uint64_t base_bits : {0x3f4fffffffffffffULL, 0x3fdfffffffffffffULL, 0x3fefffffffffffffULL, 0x3fffffffffffffffULL, 0x408fffffffffffffULL}) { const double base = ccm::support::bit_cast(base_bits); EXPECT_EQ(ccm::support::bit_cast(ccm::gen::pow_gen(base, -1.0)), ccm::support::bit_cast(1.0 / base)); @@ -555,8 +555,7 @@ TEST(CcmathPowerTests, PowLargeExponents) TEST(CcmathPowerTests, PowIdentityExponent) { const double values[] = { - -100.0, -1.0, -0.0, 0.0, 1.0, 100.0, std::numeric_limits::min(), std::numeric_limits::max(), std::numeric_limits::denorm_min() - }; + -100.0, -1.0, -0.0, 0.0, 1.0, 100.0, std::numeric_limits::min(), std::numeric_limits::max(), std::numeric_limits::denorm_min()}; for (double x : values) { @@ -569,7 +568,7 @@ TEST(CcmathPowerTests, PowIdentityExponent) TEST(CcmathPowerTests, PowReciprocalExponent) { - const double values[] = { 0.5, 1.0, 2.0, 3.0, 10.0, 100.0, std::numeric_limits::min() }; + const double values[] = {0.5, 1.0, 2.0, 3.0, 10.0, 100.0, std::numeric_limits::min()}; for (double x : values) { diff --git a/tests/src/math/power/power_ulp_accuracy_test.cpp b/tests/src/math/power/power_ulp_accuracy_test.cpp index 2b84be95..b8f09bdf 100644 --- a/tests/src/math/power/power_ulp_accuracy_test.cpp +++ b/tests/src/math/power/power_ulp_accuracy_test.cpp @@ -76,18 +76,18 @@ TEST(CcmathPowerUlpTests, PowGenDoubleRegressionCases) double exp; }; - constexpr std::array kCases = { { - { 10.0, 4.0 }, - { 30.637028068178267, -7.702539522452998 }, - { 945971881662.053466796875, 15.38309228199631562 }, + constexpr std::array kCases = {{ + {10.0, 4.0}, + {30.637028068178267, -7.702539522452998}, + {945971881662.053466796875, 15.38309228199631562}, // Base just above 1 with a huge exponent lands the result deep in the over/underflow // scaled band (here ~2^-735). That region used to drop to the fast single-double path // and lost ~38 ULP. It must now ride the accurate double-double reconstruction. - { 0x1.00000000000ffp+0, -0x1.0p53 }, - { 0x1.000000000010p+0, -0x1.0p53 }, + {0x1.00000000000ffp+0, -0x1.0p53}, + {0x1.000000000010p+0, -0x1.0p53}, // Symmetric overflow-adjacent band (~2^+735). - { 0x1.00000000000ffp+0, 0x1.0p53 }, - } }; + {0x1.00000000000ffp+0, 0x1.0p53}, + }}; for (const PowCase & test_case : kCases) { @@ -186,7 +186,7 @@ TEST(CcmathPowerUlpTests, PowGenFloatAllMantissaBuckets) // overhead. Only the first failure and the total count are reported. TEST(CcmathPowerUlpTests, DISABLED_PowGenFloatExhaustiveMantissa) { - constexpr std::array exponents = { 2.0F, 0.5F, -1.0F, 3.14159265F }; + constexpr std::array exponents = {2.0F, 0.5F, -1.0F, 3.14159265F}; int64_t fail_count = 0; float first_fail_base = 0.0F; @@ -228,8 +228,8 @@ TEST(CcmathPowerUlpTests, DISABLED_PowGenFloatExhaustiveMantissa) // Covers positive and negative k out to the |2 exp| <= 2048 bound, including saturation parity. TEST(CcmathPowerUlpTests, PowHalfIntegerExponentAccuracy) { - constexpr std::array kBases = { 3.7, 0.083, 1.001, 17.5 }; - constexpr std::array kHalfExps = { 1.5, -1.5, 2.5, -2.5, 7.5, -7.5, 99.5, -99.5, 501.5, -501.5, 1023.5, -1023.5 }; + constexpr std::array kBases = {3.7, 0.083, 1.001, 17.5}; + constexpr std::array kHalfExps = {1.5, -1.5, 2.5, -2.5, 7.5, -7.5, 99.5, -99.5, 501.5, -501.5, 1023.5, -1023.5}; for (double base : kBases) { @@ -248,7 +248,7 @@ TEST(CcmathPowerUlpTests, PowHalfIntegerExponentAccuracy) // including a subnormal base. TEST(CcmathPowerUlpTests, PowHalfIntegerTinySqrtBranch) { - constexpr std::array kTinyBases = { 0x1.0p-1010, 0x1.b333333333333p-1005, 0x1.0p-1040, 0x1.8p-1060 }; + constexpr std::array kTinyBases = {0x1.0p-1010, 0x1.b333333333333p-1005, 0x1.0p-1040, 0x1.8p-1060}; for (double base : kTinyBases) { @@ -265,9 +265,8 @@ TEST(CcmathPowerUlpTests, PowHugeExponentClampThreshold) { const double threshold = ccm::support::bit_cast(0x43d7'4910'd52d'3052ULL); const std::array kExps = { - std::nextafter(threshold, 0.0), threshold, std::nextafter(threshold, std::numeric_limits::infinity()), 1.0e19, 1.0e300 - }; - constexpr std::array kBases = { 1.0000000000000002, 0.9999999999999999, 2.0, 0.5 }; + std::nextafter(threshold, 0.0), threshold, std::nextafter(threshold, std::numeric_limits::infinity()), 1.0e19, 1.0e300}; + constexpr std::array kBases = {1.0000000000000002, 0.9999999999999999, 2.0, 0.5}; for (double base : kBases) { @@ -289,7 +288,7 @@ TEST(CcmathPowerUlpTests, PowHugeExponentClampThreshold) // larger exponents are what actually reach the shortcuts. TEST(CcmathPowerUlpTests, PowfBaseTwoAndTenShortcutAccuracy) { - constexpr std::array kExps = { 0.4F, 2.5F, -3.3F, 7.7F, -11.25F, 19.9F, 25.0F, 30.5F, -35.5F }; + constexpr std::array kExps = {0.4F, 2.5F, -3.3F, 7.7F, -11.25F, 19.9F, 25.0F, 30.5F, -35.5F}; for (float exp : kExps) { @@ -319,8 +318,8 @@ TEST(CcmathPowerUlpTests, PowfBaseTenIntegerExponentAccuracy) TEST(CcmathPowerUlpTests, PowfSmallIntegerLoopBoundary) { // Mantissa widths: 1.5 -> 0 extra bits, 1.25 -> 1, 1 + 2^-8 -> 7, 1 + 2^-16 -> 15. - constexpr std::array kBases = { 1.5F, 1.25F, 1.00390625F, 1.0000152587890625F }; - constexpr std::array kExps = { 3.0F, 4.0F, 5.0F, 8.0F, 12.0F, 24.0F }; + constexpr std::array kBases = {1.5F, 1.25F, 1.00390625F, 1.0000152587890625F}; + constexpr std::array kExps = {3.0F, 4.0F, 5.0F, 8.0F, 12.0F, 24.0F}; for (float base : kBases) { @@ -345,18 +344,18 @@ TEST(CcmathPowerUlpTests, PowfZivFallbackRegressionCases) std::uint32_t expected_bits; }; - constexpr std::array kCases = { { - { 0x42520505U, 0xc13230f3U, 0x1fa430e0U }, // powf(52.5049019, -11.1369505) - { 0x4206bdd9U, 0x3fc4629cU, 0x435c8acbU }, // powf(33.6853981, 1.53425932) - { 0x418d5c87U, 0xc164ebccU, 0x21d2e009U }, // powf(17.6701794, -14.3075676) - { 0x3ea17657U, 0x40375250U, 0x3d163830U }, // powf(0.315355986, 2.86439896) - { 0x3fa1f87aU, 0xc1a6e303U, 0x3bf180f6U }, // powf(1.2653954, -20.8608456) - { 0x3f36eccdU, 0xc36ee3bbU, 0x79646ae2U }, // powf(0.714550793, -238.889572) - { 0x3f7c682cU, 0xc2bee724U, 0x4076ad42U }, // powf(0.985964537, -95.4514465) - { 0x3f7f61dbU, 0xc33977a4U, 0x3fc85c71U }, // powf(0.997586906, -185.467346) - { 0x3faf9dddU, 0xc2d92ea4U, 0x26af067cU }, // powf(1.37200511, -108.591095) - { 0x3f6aeda8U, 0x4390d2efU, 0x2d89c122U }, // powf(0.917688847, 289.647919) - } }; + constexpr std::array kCases = {{ + {0x42520505U, 0xc13230f3U, 0x1fa430e0U}, // powf(52.5049019, -11.1369505) + {0x4206bdd9U, 0x3fc4629cU, 0x435c8acbU}, // powf(33.6853981, 1.53425932) + {0x418d5c87U, 0xc164ebccU, 0x21d2e009U}, // powf(17.6701794, -14.3075676) + {0x3ea17657U, 0x40375250U, 0x3d163830U}, // powf(0.315355986, 2.86439896) + {0x3fa1f87aU, 0xc1a6e303U, 0x3bf180f6U}, // powf(1.2653954, -20.8608456) + {0x3f36eccdU, 0xc36ee3bbU, 0x79646ae2U}, // powf(0.714550793, -238.889572) + {0x3f7c682cU, 0xc2bee724U, 0x4076ad42U}, // powf(0.985964537, -95.4514465) + {0x3f7f61dbU, 0xc33977a4U, 0x3fc85c71U}, // powf(0.997586906, -185.467346) + {0x3faf9dddU, 0xc2d92ea4U, 0x26af067cU}, // powf(1.37200511, -108.591095) + {0x3f6aeda8U, 0x4390d2efU, 0x2d89c122U}, // powf(0.917688847, 289.647919) + }}; for (const ZivCase & test_case : kCases) { diff --git a/tests/src/math/power/powf_simd_test.cpp b/tests/src/math/power/powf_simd_test.cpp index d547cfd0..b86dbdbd 100644 --- a/tests/src/math/power/powf_simd_test.cpp +++ b/tests/src/math/power/powf_simd_test.cpp @@ -63,8 +63,8 @@ namespace const float denorm = std::numeric_limits::denorm_min(); // Exceptional grid: zeros, ones, powers of two, infinities, NaN, denormals, negative bases. - const float special_bases[] = { 0.0f, -0.0f, 1.0f, -1.0f, 2.0f, -2.0f, 4.0f, 10.0f, 0.5f, inf, -inf, qnan, denorm, -denorm, 3.4e38f, -3.4e38f }; - const float special_exps[] = { 0.0f, -0.0f, 1.0f, -1.0f, 2.0f, 3.0f, -3.0f, 0.5f, -0.5f, 2.5f, inf, -inf, qnan, 127.0f, -149.0f, 0.3333333f }; + const float special_bases[] = {0.0f, -0.0f, 1.0f, -1.0f, 2.0f, -2.0f, 4.0f, 10.0f, 0.5f, inf, -inf, qnan, denorm, -denorm, 3.4e38f, -3.4e38f}; + const float special_exps[] = {0.0f, -0.0f, 1.0f, -1.0f, 2.0f, 3.0f, -3.0f, 0.5f, -0.5f, 2.5f, inf, -inf, qnan, 127.0f, -149.0f, 0.3333333f}; for (float b : special_bases) { for (float e : special_exps) @@ -85,7 +85,7 @@ namespace // Hard near-one region with large exponents (stresses the Ziv resolution). for (float b = 0.9f; b <= 1.1f; b += 0.0007f) { - for (float e : { -240.0f, -50.0f, -7.5f, 7.5f, 50.0f, 240.0f }) + for (float e : {-240.0f, -50.0f, -7.5f, 7.5f, 50.0f, 240.0f}) { add(b, e); } @@ -104,7 +104,7 @@ namespace for (float b = 2.0f; b <= 100.0f; b += 1.5f) { const float k = std::log(3.0e38f) / std::log(b); - for (float d : { -1.5f, -0.25f, 0.0f, 0.25f, 1.5f }) + for (float d : {-1.5f, -0.25f, 0.0f, 0.25f, 1.5f}) { add(b, k + d); add(b, -(k + d)); @@ -120,7 +120,7 @@ namespace add(base_dist(rng), exp_dist(rng)); } - return { std::move(xs), std::move(ys) }; + return {std::move(xs), std::move(ys)}; } template void expect_matches_scalar(const std::vector & xs, const std::vector & ys, const char * tag) diff --git a/tests/src/math/power/powl_format_detection_test.cpp b/tests/src/math/power/powl_format_detection_test.cpp index 6f667df4..5d82a760 100644 --- a/tests/src/math/power/powl_format_detection_test.cpp +++ b/tests/src/math/power/powl_format_detection_test.cpp @@ -57,5 +57,5 @@ TEST(PowlFormatDetection, StableFormatNameIsNonEmpty) { const char * name = ccm::config::long_double_format_name(ccm::config::detect_long_double_format()); ASSERT_NE(name, nullptr); - EXPECT_GT(std::string_view{ name }.size(), 0u); + EXPECT_GT(std::string_view{name}.size(), 0u); } diff --git a/tests/src/math/power/powl_ld64_alias_test.cpp b/tests/src/math/power/powl_ld64_alias_test.cpp index c5bba6a6..ef0b660b 100644 --- a/tests/src/math/power/powl_ld64_alias_test.cpp +++ b/tests/src/math/power/powl_ld64_alias_test.cpp @@ -47,8 +47,8 @@ TEST(PowlLd64Alias, PublicPowlMatchesGenPath) GTEST_SKIP() << "long double is not double-shaped on this platform"; } - const std::array bases = { 0.25L, 1.0L, 2.0L, 3.0L }; - const std::array exponents = { -2.0L, 0.5L, 2.0L, 3.0L }; + const std::array bases = {0.25L, 1.0L, 2.0L, 3.0L}; + const std::array exponents = {-2.0L, 0.5L, 2.0L, 3.0L}; for (long double base : bases) { for (long double exponent : exponents) diff --git a/tools/asmlab/golden/poly_estrin/kernel.hpp b/tools/asmlab/golden/poly_estrin/kernel.hpp index 3cdd9a1f..372e4b7f 100644 --- a/tools/asmlab/golden/poly_estrin/kernel.hpp +++ b/tools/asmlab/golden/poly_estrin/kernel.hpp @@ -16,7 +16,7 @@ namespace asmlab::golden::poly_estrin inline float coeff(unsigned index) { - static volatile float table[6] = { 1.125f, -0.25f, 0.03125f, -0.0078125f, 0.00390625f, -0.001953125f }; + static volatile float table[6] = {1.125f, -0.25f, 0.03125f, -0.0078125f, 0.00390625f, -0.001953125f}; return table[index]; } diff --git a/tools/asmlab/golden/poly_horner/kernel.hpp b/tools/asmlab/golden/poly_horner/kernel.hpp index f4459cfb..76df48a4 100644 --- a/tools/asmlab/golden/poly_horner/kernel.hpp +++ b/tools/asmlab/golden/poly_horner/kernel.hpp @@ -16,7 +16,7 @@ namespace asmlab::golden::poly_horner inline float coeff(unsigned index) { - static volatile float table[6] = { 1.125f, -0.25f, 0.03125f, -0.0078125f, 0.00390625f, -0.001953125f }; + static volatile float table[6] = {1.125f, -0.25f, 0.03125f, -0.0078125f, 0.00390625f, -0.001953125f}; return table[index]; }