Lines Matching +full:y +full:- +full:axis

2  * Double-precision scalar atan2(x) function.
4 * Copyright (c) 2021-2023, Arm Limited.
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
17 #define PiOver4 (0x1.921fb54442d18p-1)
25 and d for which P underflows, and is used to special-case such inputs. */
35 /* Fast implementation of scalar atan2. Largest errors are when y and x are
37 atan2(-0x1.5915b1498e82fp+732, 0x1.54d11ef838826p+732)
38 got -0x1.954f42f1fa841p-1 want -0x1.954f42f1fa843p-1. */
40 atan2 (double y, double x) in atan2() argument
43 uint64_t iy = asuint64 (y); in atan2()
52 if (unlikely (isnan (y) && !xisnan)) in atan2()
53 return __math_invalid (y); in atan2()
57 /* m = 2 * sign(x) + sign(y). */ in atan2()
60 int64_t exp_diff = biased_exponent (x) - biased_exponent (y); in atan2()
62 /* y = 0. */ in atan2()
69 return y; /* atan(+-0,+anything)=+-0. */ in atan2()
71 return Pi; /* atan(+0,-anything) = pi. */ in atan2()
73 return -Pi; /* atan(-0,-anything) =-pi. */ in atan2()
76 /* Special case for (x, y) either on or very close to the y axis. Either x = in atan2()
77 0, or y is much larger than x (difference in exponents >= in atan2()
79 if (unlikely (iax == 0 || exp_diff <= -POW8_EXP_UFLOW_BOUND)) in atan2()
80 return sign_y ? -PiOver2 : PiOver2; in atan2()
82 /* Special case for either x is INF or (x, y) is very close to x axis and x is in atan2()
94 return -PiOver4; /* atan(-INF,+INF). */ in atan2()
96 return 3.0 * PiOver4; /* atan(+INF,-INF). */ in atan2()
98 return -3.0 * PiOver4; /* atan(-INF,-INF). */ in atan2()
108 return -0.0; /* atan(-...,+INF). */ in atan2()
110 return Pi; /* atan(+...,-INF). */ in atan2()
112 return -Pi; /* atan(-...,-INF). */ in atan2()
116 /* y is INF. */ in atan2()
118 return sign_y ? -PiOver2 : PiOver2; in atan2()
127 double n = pred_aygtax ? -ax : ay; in atan2()
134 /* If (x, y) is very close to x axis and x is positive, the polynomial in atan2()
141 double shift = sign_x ? -2.0 : 0.0; in atan2()
148 /* Account for the sign of x and y. */ in atan2()
155 PL_TEST_INTERVAL (atan2, -10.0, 10.0, 50000)
156 PL_TEST_INTERVAL (atan2, -1.0, 1.0, 40000)