aboutsummaryrefslogtreecommitdiff
path: root/contrib/arm-optimized-routines/math/logf.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/arm-optimized-routines/math/logf.c')
-rw-r--r--contrib/arm-optimized-routines/math/logf.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/contrib/arm-optimized-routines/math/logf.c b/contrib/arm-optimized-routines/math/logf.c
index cfbaee12df10..f2c26deaff19 100644
--- a/contrib/arm-optimized-routines/math/logf.c
+++ b/contrib/arm-optimized-routines/math/logf.c
@@ -1,13 +1,15 @@
/*
* Single-precision log function.
*
- * Copyright (c) 2017-2019, Arm Limited.
- * SPDX-License-Identifier: MIT
+ * Copyright (c) 2017-2024, Arm Limited.
+ * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
*/
#include <math.h>
#include <stdint.h>
#include "math_config.h"
+#include "test_defs.h"
+#include "test_sig.h"
/*
LOGF_TABLE_BITS = 4
@@ -57,7 +59,7 @@ logf (float x)
tmp = ix - OFF;
i = (tmp >> (23 - LOGF_TABLE_BITS)) % N;
k = (int32_t) tmp >> 23; /* arithmetic shift */
- iz = ix - (tmp & 0x1ff << 23);
+ iz = ix - (tmp & 0xff800000);
invc = T[i].invc;
logc = T[i].logc;
z = (double_t) asfloat (iz);
@@ -77,3 +79,10 @@ logf (float x)
strong_alias (logf, __logf_finite)
hidden_alias (logf, __ieee754_logf)
#endif
+
+TEST_SIG (S, F, 1, log, 0.01, 11.1)
+TEST_ULP (logf, 0.32)
+TEST_ULP_NONNEAREST (logf, 0.5)
+TEST_INTERVAL (logf, 0, 0xffff0000, 10000)
+TEST_INTERVAL (logf, 0x1p-4, 0x1p4, 500000)
+TEST_INTERVAL (logf, 0, inf, 50000)