[libc-commits] [libc] [libc][math] Integer-only, statically rounded implementation of exp (PR #225803)

Hoàng Minh Thiên via libc-commits libc-commits at lists.llvm.org
Sun Nov 8 03:54:11 PST 2026


================
@@ -185,7 +191,19 @@ class ExpTest : public LIBC_NAMESPACE::testing::FPTest<double> {
 
 LIST_EXP_TESTS(Default, LIBC_NAMESPACE::exp,
                /*ulp_tolerance=*/TOLERANCE + 0.5,
-               /*all_rounding=*/ALL_ROUNDING);
+               /*all_rounding=*/ALL_ROUNDING, /*check_exception=*/true);
 LIST_EXP_TESTS(DoubleEval, exp_double_eval,
                /*ulp_tolerance=*/TOLERANCE + 0.5,
-               /*all_rounding=*/ALL_ROUNDING);
+               /*all_rounding=*/ALL_ROUNDING, /*check_exception=*/true);
+LIST_EXP_TESTS(IntegerEval, LIBC_NAMESPACE::math::integer_eval::exp,
+               /*ulp_tolerance=*/1.0, /*all_rounding=*/false,
+               /*check_exception=*/false);
+
+static double exp_static_rounding(double x) {
+  return LIBC_NAMESPACE::math::static_rounding::exp(
+      x, LIBC_NAMESPACE::fputil::quick_get_round());
+}
+
+LIST_EXP_TESTS(StaticRounding, exp_static_rounding,
+               /*ulp_tolerance=*/1.0, /*all_rounding=*/true,
----------------
hmthien050209 wrote:

Not yet. Will try to improve as much as I can.

https://github.com/llvm/llvm-project/pull/225803


More information about the libc-commits mailing list