diff options
Diffstat (limited to 'math/cosf.c')
-rw-r--r-- | math/cosf.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/math/cosf.c b/math/cosf.c index 6293ce8f1b7d..a9b1f9da16ed 100644 --- a/math/cosf.c +++ b/math/cosf.c @@ -1,7 +1,7 @@ /* * Single-precision cos function. * - * Copyright (c) 2018-2021, Arm Limited. + * Copyright (c) 2018-2024, Arm Limited. * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception */ @@ -9,6 +9,8 @@ #include <math.h> #include "math_config.h" #include "sincosf.h" +#include "test_defs.h" +#include "test_sig.h" /* Fast cosf implementation. Worst-case ULP is 0.5607, maximum relative error is 0.5303 * 2^-23. A single-step range reduction is used for @@ -61,3 +63,9 @@ cosf (float y) else return __math_invalidf (y); } + +TEST_SIG (S, F, 1, cos, -3.1, 3.1) +TEST_ULP (cosf, 0.06) +TEST_ULP_NONNEAREST (cosf, 0.5) +TEST_INTERVAL (cosf, 0, 0xffff0000, 10000) +TEST_SYM_INTERVAL (cosf, 0x1p-14, 0x1p54, 50000) |