diff --git a/kleidicv/src/arithmetics/exp_neon.cpp b/kleidicv/src/arithmetics/exp_neon.cpp index 274dc5ee3344b83cd6c2ffc47997730fc1e9343d..9a4b19ccc0e48a1e609b0aeab43b44abf1cad255 100644 --- a/kleidicv/src/arithmetics/exp_neon.cpp +++ b/kleidicv/src/arithmetics/exp_neon.cpp @@ -60,7 +60,7 @@ class Exp final : public UnrollOnce { float32x4_t s2 = vreinterpretq_f32_u32(e - b); uint32x4_t cmp = vcagtq_f32(n, vdupq_n(192.0F)); float32x4_t r1 = s1 * s1; - float32x4_t r0 = poly * s1 * s2; + float32x4_t r0 = (poly * s1) * s2; return vreinterpretq_f32_u32((cmp & vreinterpretq_u32_f32(r1)) | (~cmp & vreinterpretq_u32_f32(r0))); } diff --git a/kleidicv/src/arithmetics/exp_sc.h b/kleidicv/src/arithmetics/exp_sc.h index fea6b6ad9921bacb27ed10034e7ff8c30f51f976..41f9f813ec0048df8b480f3488f82cd8b4db068f 100644 --- a/kleidicv/src/arithmetics/exp_sc.h +++ b/kleidicv/src/arithmetics/exp_sc.h @@ -64,7 +64,7 @@ class Exp final : public UnrollOnce { svfloat32_t s2 = svreinterpret_f32(svsub_x(pg, e, b)); svbool_t cmp = svacgt(pg, n, 192.0F); svfloat32_t r1 = svmul_x(pg, s1, s1); - svfloat32_t r0 = svmul_x(pg, poly, svmul_x(pg, s1, s2)); + svfloat32_t r0 = svmul_x(pg, s2, svmul_x(pg, poly, s1)); return svsel(cmp, r1, r0); } diff --git a/test/api/test_exp.cpp b/test/api/test_exp.cpp index f4f7b2af139884d205c9114a83b56a667a60e28b..0b87c7aba4ce04024ee1369d2ee0421524154229 100644 --- a/test/api/test_exp.cpp +++ b/test/api/test_exp.cpp @@ -61,7 +61,7 @@ class ExpTestSpecial final : public UnaryOperationTest { static const std::vector& input_values() { static const std::vector kInputValues = { -105.31, -100.07, -81.012, -47.66, -3.1088, -0.21, - 0.7, 6.2, 39.7201, 86.11, 88.947}; + 0.7, 6.2, 39.7201, 86.11, 88.7, 88.947}; return kInputValues; }