1 // Copyright (C) 1988-1994 Sun Microsystems, Inc. 2550 Garcia Avenue 2 // Mountain View, California 94043 All rights reserved. 3 // 4 // Any person is hereby authorized to download, copy, use, create bug fixes, 5 // and distribute, subject to the following conditions: 6 // 7 // 1. the software may not be redistributed for a fee except as 8 // reasonable to cover media costs; 9 // 2. any copy of the software must include this notice, as well as 10 // any other embedded copyright notices; and 11 // 3. any distribution of this software or derivative works thereof 12 // must comply with all applicable U.S. export control laws. 13 // 14 // THE SOFTWARE IS MADE AVAILABLE "AS IS" AND WITHOUT EXPRESS OR IMPLIED 15 // WARRANTY OF ANY KIND, INCLUDING BUT NOT LIMITED TO THE IMPLIED 16 // WARRANTIES OF DESIGN, MERCHANTIBILITY, FITNESS FOR A PARTICULAR 17 // PURPOSE, NON-INFRINGEMENT, PERFORMANCE OR CONFORMANCE TO 18 // SPECIFICATIONS. 19 // 20 // BY DOWNLOADING AND/OR USING THIS SOFTWARE, THE USER WAIVES ALL CLAIMS 21 // AGAINST SUN MICROSYSTEMS, INC. AND ITS AFFILIATED COMPANIES IN ANY 22 // JURISDICTION, INCLUDING BUT NOT LIMITED TO CLAIMS FOR DAMAGES OR 23 // EQUITABLE RELIEF BASED ON LOSS OF DATA, AND SPECIFICALLY WAIVES EVEN 24 // UNKNOWN OR UNANTICIPATED CLAIMS OR LOSSES, PRESENT AND FUTURE. 25 // 26 // IN NO EVENT WILL SUN MICROSYSTEMS, INC. OR ANY OF ITS AFFILIATED 27 // COMPANIES BE LIABLE FOR ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, 28 // INDIRECT AND CONSEQUENTIAL DAMAGES, EVEN IF IT HAS BEEN ADVISED OF THE 29 // POSSIBILITY OF SUCH DAMAGES. 30 // 31 // This file is provided with no support and without any obligation on the 32 // part of Sun Microsystems, Inc. ("Sun") or any of its affiliated 33 // companies to assist in its use, correction, modification or 34 // enhancement. Nevertheless, and without creating any obligation on its 35 // part, Sun welcomes your comments concerning the software and requests 36 // that they be sent to fdlibm-comments@sunpro.sun.com. 37 // atan2s(+-0,+anything but nan) is +-0 38 T(RN, 0x0p+0, 0x0p+0, 0x0p+0, 0x0p+0, 0) 39 T(RN, 0x0p+0, 0x1p-149, 0x0p+0, 0x0p+0, 0) 40 T(RN, 0x0p+0, 0x1p-129, 0x0p+0, 0x0p+0, 0) 41 T(RN, 0x0p+0, 0x1.fffffep+127, 0x0p+0, 0x0p+0, 0) 42 T(RN, 0x0p+0, inf, 0x0p+0, 0x0p+0, 0) 43 T(RN, -0x0p+0, 0x0p+0, -0x0p+0, 0x0p+0, 0) 44 T(RN, -0x0p+0, 0x1p-149, -0x0p+0, 0x0p+0, 0) 45 T(RN, -0x0p+0, 0x1p-129, -0x0p+0, 0x0p+0, 0) 46 T(RN, -0x0p+0, 0x1.fffffep+127, -0x0p+0, 0x0p+0, 0) 47 T(RN, -0x0p+0, inf, -0x0p+0, 0x0p+0, 0) 48 // atan2s(+-0,-anything but nan) is +-pi 49 T(RN, 0x0p+0, -inf, 0x1.921fb6p+1, 0x1.777a5cp-2, INEXACT) 50 T(RN, 0x0p+0,-0x1.fffffep+127, 0x1.921fb6p+1, 0x1.777a5cp-2, INEXACT) 51 T(RN, 0x0p+0, -0x1p-129, 0x1.921fb6p+1, 0x1.777a5cp-2, INEXACT) 52 T(RN, 0x0p+0, -0x1p-149, 0x1.921fb6p+1, 0x1.777a5cp-2, INEXACT) 53 T(RN, 0x0p+0, -0x0p+0, 0x1.921fb6p+1, 0x1.777a5cp-2, INEXACT) 54 T(RN, -0x0p+0, -inf, -0x1.921fb6p+1, -0x1.777a5cp-2, INEXACT) 55 T(RN, -0x0p+0,-0x1.fffffep+127, -0x1.921fb6p+1, -0x1.777a5cp-2, INEXACT) 56 T(RN, -0x0p+0, -0x1p-129, -0x1.921fb6p+1, -0x1.777a5cp-2, INEXACT) 57 T(RN, -0x0p+0, -0x1p-149, -0x1.921fb6p+1, -0x1.777a5cp-2, INEXACT) 58 T(RN, -0x0p+0, -0x0p+0, -0x1.921fb6p+1, -0x1.777a5cp-2, INEXACT) 59 // atan2s(+-anything but 0 and nan, 0) is +- pi/2 60 T(RN, inf, 0x0p+0, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 61 T(RN, inf, -0x0p+0, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 62 T(RN, 0x1.fffffep+127, 0x0p+0, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 63 T(RN, 0x1.fffffep+127, -0x0p+0, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 64 T(RN, 0x1p-126, 0x0p+0, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 65 T(RN, 0x1p-126, -0x0p+0, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 66 T(RN, 0x1p-149, 0x0p+0, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 67 T(RN, 0x1p-149, -0x0p+0, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 68 T(RN, -inf, 0x0p+0, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 69 T(RN, -inf, -0x0p+0, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 70 T(RN,-0x1.fffffep+127, 0x0p+0, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 71 T(RN,-0x1.fffffep+127, -0x0p+0, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 72 T(RN, -0x1p-126, 0x0p+0, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 73 T(RN, -0x1p-126, -0x0p+0, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 74 T(RN, -0x1p-149, 0x0p+0, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 75 T(RN, -0x1p-149, -0x0p+0, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 76 // atan2s(big,small) :=: +-pi/2 77 T(RN, 0x1.fffffep+127, 0x1p-126, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 78 T(RN, 0x1.fffffep+127, -0x1p-126, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 79 T(RN,-0x1.fffffep+127, 0x1p-126, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 80 T(RN,-0x1.fffffep+127, -0x1p-126, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 81 T(RZ, 0x1.fffffep+127, 0x1p-126, 0x1.921fb4p+0, -0x1.4442d2p-1, INEXACT) 82 T(RZ, 0x1.fffffep+127, -0x1p-126, 0x1.921fb4p+0, -0x1.4442d2p-1, INEXACT) 83 T(RZ,-0x1.fffffep+127, 0x1p-126, -0x1.921fb4p+0, 0x1.4442d2p-1, INEXACT) 84 T(RZ,-0x1.fffffep+127, -0x1p-126, -0x1.921fb4p+0, 0x1.4442d2p-1, INEXACT) 85 T(RU, 0x1.fffffep+127, 0x1p-126, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 86 T(RU, 0x1.fffffep+127, -0x1p-126, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 87 T(RU,-0x1.fffffep+127, 0x1p-126, -0x1.921fb4p+0, 0x1.4442d2p-1, INEXACT) 88 T(RU,-0x1.fffffep+127, -0x1p-126, -0x1.921fb4p+0, 0x1.4442d2p-1, INEXACT) 89 T(RD, 0x1.fffffep+127, 0x1p-126, 0x1.921fb4p+0, -0x1.4442d2p-1, INEXACT) 90 T(RD, 0x1.fffffep+127, -0x1p-126, 0x1.921fb4p+0, -0x1.4442d2p-1, INEXACT) 91 T(RD,-0x1.fffffep+127, 0x1p-126, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 92 T(RD,-0x1.fffffep+127, -0x1p-126, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 93 // atan2s(small,big) = small/big (big>0) 94 T(RN, 0x1p-126, 0x1.fffffep+127, 0x0p+0,-0x1.000002p-105, INEXACT|UNDERFLOW) 95 T(RN, -0x1p-126, 0x1.fffffep+127, -0x0p+0, 0x1.000002p-105, INEXACT|UNDERFLOW) 96 T(RN, 0x1p-126,-0x1.fffffep+127, 0x1.921fb6p+1, 0x1.777a5cp-2, INEXACT) 97 T(RN, -0x1p-126,-0x1.fffffep+127, -0x1.921fb6p+1, -0x1.777a5cp-2, INEXACT) 98 T(RZ, 0x1p-126, 0x1.fffffep+127, 0x0p+0,-0x1.000002p-105, INEXACT|UNDERFLOW) 99 T(RZ, -0x1p-126, 0x1.fffffep+127, -0x0p+0, 0x1.000002p-105, INEXACT|UNDERFLOW) 100 T(RZ, 0x1p-126,-0x1.fffffep+127, 0x1.921fb4p+1, -0x1.4442d2p-1, INEXACT) 101 T(RZ, -0x1p-126,-0x1.fffffep+127, -0x1.921fb4p+1, 0x1.4442d2p-1, INEXACT) 102 T(RU, 0x1p-126, 0x1.fffffep+127, 0x1p-149, 0x1p+0, INEXACT|UNDERFLOW) 103 T(RU, -0x1p-126, 0x1.fffffep+127, -0x0p+0, 0x1.000002p-105, INEXACT|UNDERFLOW) 104 T(RU, 0x1p-126,-0x1.fffffep+127, 0x1.921fb6p+1, 0x1.777a5cp-2, INEXACT) 105 T(RU, -0x1p-126,-0x1.fffffep+127, -0x1.921fb4p+1, 0x1.4442d2p-1, INEXACT) 106 T(RD, 0x1p-126, 0x1.fffffep+127, 0x0p+0,-0x1.000002p-105, INEXACT|UNDERFLOW) 107 T(RD, -0x1p-126, 0x1.fffffep+127, -0x1p-149, -0x1p+0, INEXACT|UNDERFLOW) 108 T(RD, 0x1p-126,-0x1.fffffep+127, 0x1.921fb4p+1, -0x1.4442d2p-1, INEXACT) 109 T(RD, -0x1p-126,-0x1.fffffep+127, -0x1.921fb6p+1, -0x1.777a5cp-2, INEXACT) 110 // atan2s(+-x,+x) = +-pi/4 for normal x 111 T(RN, 0x1p-126, 0x1p-126, 0x1.921fb6p-1, 0x1.777a5cp-2, INEXACT) 112 T(RN, -0x1p-126, 0x1p-126, -0x1.921fb6p-1, -0x1.777a5cp-2, INEXACT) 113 T(RN, 0x1.fffffep+127, 0x1.fffffep+127, 0x1.921fb6p-1, 0x1.777a5cp-2, INEXACT) 114 T(RN,-0x1.fffffep+127, 0x1.fffffep+127, -0x1.921fb6p-1, -0x1.777a5cp-2, INEXACT) 115 // atan2s(+-x,-x) = +-3pi/4 for normal x 116 T(RN, 0x1p-126, -0x1p-126, 0x1.2d97c8p+1, 0x1.99bc5cp-6, INEXACT) 117 T(RN, -0x1p-126, -0x1p-126, -0x1.2d97c8p+1, -0x1.99bc5cp-6, INEXACT) 118 T(RN, 0x1p+0, -0x1p+0, 0x1.2d97c8p+1, 0x1.99bc5cp-6, INEXACT) 119 T(RN, -0x1p+0, -0x1p+0, -0x1.2d97c8p+1, -0x1.99bc5cp-6, INEXACT) 120 T(RN, 0x1.fffffep+127,-0x1.fffffep+127, 0x1.2d97c8p+1, 0x1.99bc5cp-6, INEXACT) 121 T(RN,-0x1.fffffep+127,-0x1.fffffep+127, -0x1.2d97c8p+1, -0x1.99bc5cp-6, INEXACT) 122 // random arguments between -2.0 and 2.0 123 T(RN, -0x1.13284cp-1, 0x1.6ca8ep+0, -0x1.716d2p-2, 0x1.90111p-3, INEXACT) 124 T(RN, 0x1.c2ca6p+0, -0x1.55f12p+0, 0x1.1c206ep+1, 0x1.1ac042p-2, INEXACT) 125 T(RN, -0x1.15679ep-1, -0x1.41e132p-4, -0x1.b6ff44p+0, -0x1.2ecaf4p-4, INEXACT) 126 T(RN, 0x1.281b0ep+0, 0x1.b5ce34p+0, 0x1.30789cp-1, 0x1.17e61ap-3, INEXACT) 127 T(RN, -0x1.583482p-2, -0x1.ea8224p+0, -0x1.7be508p+1, 0x1.e4c608p-3, INEXACT) 128 T(RN, -0x1.aae18p-1, 0x1.7a9da2p-4, -0x1.75db7cp+0, 0x1.483b7cp-6, INEXACT) 129 T(RN, -0x1.845p+0, 0x1.6ca322p+0, -0x1.a237b2p-1, -0x1.e3262p-3, INEXACT) 130 T(RN, -0x1.fe09bep+0, -0x1.ff6c7ep+0, -0x1.2dc43cp+1, 0x1.348c12p-4, INEXACT) 131 T(RN, -0x1.d24c82p-1, 0x1.29b682p+0, -0x1.5428a2p-1, 0x1.e59fe4p-3, INEXACT) 132 T(RN, 0x1.25ea7ep-1, 0x1.f99598p-1, 0x1.0d9c96p-1, -0x1.3ef8ecp-7, INEXACT) 133 // atan2s involve nan 134 T(RN, 0x0p+0, nan, nan, 0x0p+0, 0) 135 T(RN, 0x1p+0, nan, nan, 0x0p+0, 0) 136 T(RN, nan, 0x1p-149, nan, 0x0p+0, 0) 137 T(RN, nan,-0x1.fffffep+127, nan, 0x0p+0, 0) 138 T(RN, nan, nan, nan, 0x0p+0, 0) 139 T(RN, nan, nan, nan, 0x0p+0, 0) 140 T(RZ, 0x0p+0, nan, nan, 0x0p+0, 0) 141 T(RZ, 0x1p+0, nan, nan, 0x0p+0, 0) 142 T(RZ, nan, 0x1p-149, nan, 0x0p+0, 0) 143 T(RZ, nan,-0x1.fffffep+127, nan, 0x0p+0, 0) 144 T(RZ, nan, nan, nan, 0x0p+0, 0) 145 T(RZ, nan, nan, nan, 0x0p+0, 0) 146 T(RU, 0x0p+0, nan, nan, 0x0p+0, 0) 147 T(RU, 0x1p+0, nan, nan, 0x0p+0, 0) 148 T(RU, nan, 0x1p-149, nan, 0x0p+0, 0) 149 T(RU, nan,-0x1.fffffep+127, nan, 0x0p+0, 0) 150 T(RU, nan, nan, nan, 0x0p+0, 0) 151 T(RU, nan, nan, nan, 0x0p+0, 0) 152 T(RD, 0x0p+0, nan, nan, 0x0p+0, 0) 153 T(RD, 0x1p+0, nan, nan, 0x0p+0, 0) 154 T(RD, nan, 0x1p-149, nan, 0x0p+0, 0) 155 T(RD, nan,-0x1.fffffep+127, nan, 0x0p+0, 0) 156 T(RD, nan, nan, nan, 0x0p+0, 0) 157 T(RD, nan, nan, nan, 0x0p+0, 0) 158 // atan2s(+-(anything but inf and nan), +inf) is +-0 159 T(RN, 0x1p-149, inf, 0x0p+0, 0x0p+0, 0) 160 T(RN, 0x1.fffffep+127, inf, 0x0p+0, 0x0p+0, 0) 161 T(RN, -0x1p-149, inf, -0x0p+0, 0x0p+0, 0) 162 T(RN,-0x1.fffffep+127, inf, -0x0p+0, 0x0p+0, 0) 163 // atan2s(+-(anything but inf and nan), -inf) is +-pi 164 T(RN, 0x1p-149, -inf, 0x1.921fb6p+1, 0x1.777a5cp-2, INEXACT) 165 T(RN, 0x1.fffffep+127, -inf, 0x1.921fb6p+1, 0x1.777a5cp-2, INEXACT) 166 T(RN, -0x1p-149, -inf, -0x1.921fb6p+1, -0x1.777a5cp-2, INEXACT) 167 T(RN,-0x1.fffffep+127, -inf, -0x1.921fb6p+1, -0x1.777a5cp-2, INEXACT) 168 // atan2s(+-inf,+inf ) is +-pi/4 169 T(RN, inf, inf, 0x1.921fb6p-1, 0x1.777a5cp-2, INEXACT) 170 T(RN, -inf, inf, -0x1.921fb6p-1, -0x1.777a5cp-2, INEXACT) 171 // atan2s(+-inf,-inf ) is +-3pi/4 172 T(RN, inf, -inf, 0x1.2d97c8p+1, 0x1.99bc5cp-6, INEXACT) 173 T(RN, -inf, -inf, -0x1.2d97c8p+1, -0x1.99bc5cp-6, INEXACT) 174 // atan2s(+-inf, (anything but,0,nan, and inf)) is +-pi/2 175 T(RN, inf, 0x1p-149, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 176 T(RN, inf, -0x1p-149, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 177 T(RN, inf, 0x1.fffffep+127, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 178 T(RN, inf,-0x1.fffffep+127, 0x1.921fb6p+0, 0x1.777a5cp-2, INEXACT) 179 T(RN, -inf, 0x1p-149, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 180 T(RN, -inf, -0x1p-149, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 181 T(RN, -inf, 0x1.fffffep+127, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 182 T(RN, -inf,-0x1.fffffep+127, -0x1.921fb6p+0, -0x1.777a5cp-2, INEXACT) 183