11/*
22 * Double-precision vector asin(x) function.
33 *
4- * Copyright (c) 2023-2024 , Arm Limited.
4+ * Copyright (c) 2023-2025 , Arm Limited.
55 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
66 */
77
@@ -27,25 +27,8 @@ static const struct data
2727 .pi_over_2 = V2 (0x1.921fb54442d18p+0 ), .abs_mask = V2 (0x7fffffffffffffff ),
2828};
2929
30- #define AllMask v_u64 (0xffffffffffffffff)
31- #define One 0x3ff0000000000000
32- #define Small 0x3e50000000000000 /* 2^-12. */
33-
34- #if WANT_SIMD_EXCEPT
35- static float64x2_t VPCS_ATTR NOINLINE
36- special_case (float64x2_t x , float64x2_t y , uint64x2_t special )
37- {
38- return v_call_f64 (asin , x , y , special );
39- }
40- #endif
41-
4230/* Double-precision implementation of vector asin(x).
43-
44- For |x| < Small, approximate asin(x) by x. Small = 2^-12 for correct
45- rounding. If WANT_SIMD_EXCEPT = 0, Small = 0 and we proceed with the
46- following approximation.
47-
48- For |x| in [Small, 0.5], use an order 11 polynomial P such that the final
31+ For |x| in [0, 0.5], use an order 11 polynomial P such that the final
4932 approximation is an odd polynomial: asin(x) ~ x + x^3 P(x^2).
5033
5134 The largest observed error in this region is 1.01 ulps,
@@ -64,16 +47,6 @@ float64x2_t VPCS_ATTR V_NAME_D1 (asin) (float64x2_t x)
6447 const struct data * d = ptr_barrier (& data );
6548 float64x2_t ax = vabsq_f64 (x );
6649
67- #if WANT_SIMD_EXCEPT
68- /* Special values need to be computed with scalar fallbacks so
69- that appropriate exceptions are raised. */
70- uint64x2_t special
71- = vcgtq_u64 (vsubq_u64 (vreinterpretq_u64_f64 (ax ), v_u64 (Small )),
72- v_u64 (One - Small ));
73- if (unlikely (v_any_u64 (special )))
74- return special_case (x , x , AllMask );
75- #endif
76-
7750 uint64x2_t a_lt_half = vcaltq_f64 (x , v_f64 (0.5 ));
7851
7952 /* Evaluate polynomial Q(x) = y + y * z * P(z) with
@@ -121,9 +94,8 @@ float64x2_t VPCS_ATTR V_NAME_D1 (asin) (float64x2_t x)
12194
12295TEST_SIG (V , D , 1 , asin , -1.0 , 1.0 )
12396TEST_ULP (V_NAME_D1 (asin ), 2.20 )
124- TEST_DISABLE_FENV_IF_NOT (V_NAME_D1 (asin ), WANT_SIMD_EXCEPT )
125- TEST_INTERVAL (V_NAME_D1 (asin ), 0 , Small , 5000 )
126- TEST_INTERVAL (V_NAME_D1 (asin ), Small , 0.5 , 50000 )
97+ TEST_INTERVAL (V_NAME_D1 (asin ), 0 , 0x1p-12 , 5000 )
98+ TEST_INTERVAL (V_NAME_D1 (asin ), 0x1p-12 , 0.5 , 50000 )
12799TEST_INTERVAL (V_NAME_D1 (asin ), 0.5 , 1.0 , 50000 )
128100TEST_INTERVAL (V_NAME_D1 (asin ), 1.0 , 0x1p11 , 50000 )
129101TEST_INTERVAL (V_NAME_D1 (asin ), 0x1p11 , inf , 20000 )
0 commit comments