diff options
author | Andrew Turner <andrew@FreeBSD.org> | 2025-01-10 10:34:52 +0000 |
---|---|---|
committer | Andrew Turner <andrew@FreeBSD.org> | 2025-01-10 10:39:34 +0000 |
commit | 9d1de25930735261c16ed874a933b4c1f1d9041e (patch) | |
tree | b0cac1c933cc1ecb885c7e757b89ffbf13f1f012 /pl/math/trigpi_references.c | |
parent | edc5c0de794f521eb620d2b6cbaee2434442a8f3 (diff) |
Update the Arm Optimized Routinesvendor/arm-optimized-routines/v25.01vendor/arm-optimized-routines
Import the v25.01 release of the Arm Optimized Routines [1].
[1] https://github.com/ARM-software/optimized-routines/tree/v25.01
Sponsored by: Arm Ltd
Diffstat (limited to 'pl/math/trigpi_references.c')
-rw-r--r-- | pl/math/trigpi_references.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/pl/math/trigpi_references.c b/pl/math/trigpi_references.c deleted file mode 100644 index 4b0514b6766a..000000000000 --- a/pl/math/trigpi_references.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Extended precision scalar reference functions for trigpi. - * - * Copyright (c) 2023, Arm Limited. - * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception - */ - -#define _GNU_SOURCE -#include "math_config.h" -#include "mathlib.h" - -long double -sinpil (long double x) -{ - /* sin(inf) should return nan, as defined by C23. */ - if (isinf (x)) - return __math_invalid (x); - - long double ax = fabsl (x); - - /* Return 0 for all values above 2^64 to prevent - overflow when casting to uint64_t. */ - if (ax >= 0x1p64) - return 0; - - /* All integer cases should return 0. */ - if (ax == (uint64_t) ax) - return 0; - - return sinl (x * M_PIl); -} - -long double -cospil (long double x) -{ - /* cos(inf) should return nan, as defined by C23. */ - if (isinf (x)) - return __math_invalid (x); - - long double ax = fabsl (x); - - if (ax >= 0x1p64) - return 1; - - uint64_t m = (uint64_t) ax; - - /* Integer values of cospi(x) should return +/-1. - The sign depends on if x is odd or even. */ - if (m == ax) - return (m & 1) ? -1 : 1; - - /* Values of Integer + 0.5 should always return 0. */ - if (ax - 0.5 == m || ax + 0.5 == m) - return 0; - - return cosl (ax * M_PIl); -}
\ No newline at end of file |