Lines Matching +full:x +full:- +full:axis
2 * Single-precision scalar atan2(x) function.
4 * Copyright (c) 2021-2024, Arm Limited.
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
17 #define PiOver4 (0x1.921fb6p-1f)
23 d for which P underflows, and is used to special-case such inputs. */
33 /* Subnormal case - we still need to get the exponent right for subnormal in biased_exponent()
35 return ex - __builtin_clz (fi << 9); in biased_exponent()
41 2.88ulps in [99.0, 101.0] x [99.0, 101.0]:
42 atan2f(0x1.9332d8p+6, 0x1.8cb6c4p+6) got 0x1.964646p-1
43 want 0x1.964640p-1. */
45 atan2f (float y, float x) in atan2f() argument
47 uint32_t ix = asuint (x); in atan2f()
56 /* x or y is NaN. */ in atan2f()
58 return x + y; in atan2f()
60 /* m = 2 * sign(x) + sign(y). */ in atan2f()
64 that we do not use +-tiny shifts (non-nearest rounding mode). */ in atan2f()
66 int32_t exp_diff = biased_exponent (x) - biased_exponent (y); in atan2f()
68 /* Special case for (x, y) either on or very close to the x axis. Either y = in atan2f()
69 0, or y is tiny and x is huge (difference in exponents >= in atan2f()
71 case when x is negative (i.e. quadrants 2 or 3). */ in atan2f()
78 return y; /* atan(+-0,+anything)=+-0. */ in atan2f()
80 return Pi; /* atan(+0,-anything) = pi. */ in atan2f()
82 return -Pi; /* atan(-0,-anything) =-pi. */ in atan2f()
85 /* Special case for (x, y) either on or very close to the y axis. Either x = in atan2f()
86 0, or x is tiny and y is huge (difference in exponents >= in atan2f()
88 if (unlikely (iax == 0 || exp_diff <= -POLY_UFLOW_BOUND)) in atan2f()
89 return sign_y ? -PiOver2 : PiOver2; in atan2f()
91 /* x is INF. */ in atan2f()
101 return -PiOver4; /* atan(-INF,+INF). */ in atan2f()
103 return 3.0f * PiOver4; /* atan(+INF,-INF). */ in atan2f()
105 return -3.0f * PiOver4; /* atan(-INF,-INF). */ in atan2f()
115 return -0.0f; /* atan(-...,+INF). */ in atan2f()
117 return Pi; /* atan(+...,-INF). */ in atan2f()
119 return -Pi; /* atan(-...,-INF). */ in atan2f()
125 return sign_y ? -PiOver2 : PiOver2; in atan2f()
135 float n = pred_aygtax ? -ax : ay; in atan2f()
142 /* If (x, y) is very close to x axis and x is positive, the polynomial in atan2f()
149 float shift = sign_x ? -2.0f : 0.0f; in atan2f()
156 /* Account for the sign of x and y. */ in atan2f()
163 TEST_INTERVAL (atan2f, -10.0, 10.0, 50000)
164 TEST_INTERVAL (atan2f, -1.0, 1.0, 40000)