/* Copyright (C) 1988-1994 Sun Microsystems, Inc. 2550 Garcia Avenue */ /* Mountain View, California 94043 All rights reserved. */ /* */ /* Any person is hereby authorized to download, copy, use, create bug fixes, */ /* and distribute, subject to the following conditions: */ /* */ /* 1. the software may not be redistributed for a fee except as */ /* reasonable to cover media costs; */ /* 2. any copy of the software must include this notice, as well as */ /* any other embedded copyright notices; and */ /* 3. any distribution of this software or derivative works thereof */ /* must comply with all applicable U.S. export control laws. */ /* */ /* THE SOFTWARE IS MADE AVAILABLE "AS IS" AND WITHOUT EXPRESS OR IMPLIED */ /* WARRANTY OF ANY KIND, INCLUDING BUT NOT LIMITED TO THE IMPLIED */ /* WARRANTIES OF DESIGN, MERCHANTIBILITY, FITNESS FOR A PARTICULAR */ /* PURPOSE, NON-INFRINGEMENT, PERFORMANCE OR CONFORMANCE TO */ /* SPECIFICATIONS. */ /* */ /* BY DOWNLOADING AND/OR USING THIS SOFTWARE, THE USER WAIVES ALL CLAIMS */ /* AGAINST SUN MICROSYSTEMS, INC. AND ITS AFFILIATED COMPANIES IN ANY */ /* JURISDICTION, INCLUDING BUT NOT LIMITED TO CLAIMS FOR DAMAGES OR */ /* EQUITABLE RELIEF BASED ON LOSS OF DATA, AND SPECIFICALLY WAIVES EVEN */ /* UNKNOWN OR UNANTICIPATED CLAIMS OR LOSSES, PRESENT AND FUTURE. */ /* */ /* IN NO EVENT WILL SUN MICROSYSTEMS, INC. OR ANY OF ITS AFFILIATED */ /* COMPANIES BE LIABLE FOR ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, */ /* INDIRECT AND CONSEQUENTIAL DAMAGES, EVEN IF IT HAS BEEN ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGES. */ /* */ /* This file is provided with no support and without any obligation on the */ /* part of Sun Microsystems, Inc. ("Sun") or any of its affiliated */ /* companies to assist in its use, correction, modification or */ /* enhancement. Nevertheless, and without creating any obligation on its */ /* part, Sun welcomes your comments concerning the software and requests */ /* that they be sent to fdlibm-comments@sunpro.sun.com. */ /* atan2d(+-0,+anything but nan) is +-0 */ atan2d n eq - 0 0 0 0 0 0 atan2d n eq - 0 0 0 1 0 0 atan2d n eq - 0 0 00100000 0 0 0 atan2d n eq - 0 0 7fefffff ffffffff 0 0 atan2d n eq - 0 0 7ff00000 0 0 0 atan2d n eq - 80000000 0 0 0 80000000 0 atan2d n eq - 80000000 0 0 1 80000000 0 atan2d n eq - 80000000 0 00100000 0 80000000 0 atan2d n eq - 80000000 0 7fefffff ffffffff 80000000 0 atan2d n eq - 80000000 0 7ff00000 0 80000000 0 atan2d z eq - 0 0 0 0 0 0 atan2d z eq - 0 0 0 1 0 0 atan2d z eq - 0 0 00100000 0 0 0 atan2d z eq - 0 0 7fefffff ffffffff 0 0 atan2d z eq - 0 0 7ff00000 0 0 0 atan2d z eq - 80000000 0 0 0 80000000 0 atan2d z eq - 80000000 0 0 1 80000000 0 atan2d z eq - 80000000 0 00100000 0 80000000 0 atan2d z eq - 80000000 0 7fefffff ffffffff 80000000 0 atan2d z eq - 80000000 0 7ff00000 0 80000000 0 atan2d p eq - 0 0 0 0 0 0 atan2d p eq - 0 0 0 1 0 0 atan2d p eq - 0 0 00100000 0 0 0 atan2d p eq - 0 0 7fefffff ffffffff 0 0 atan2d p eq - 0 0 7ff00000 0 0 0 atan2d p eq - 80000000 0 0 0 80000000 0 atan2d p eq - 80000000 0 0 1 80000000 0 atan2d p eq - 80000000 0 00100000 0 80000000 0 atan2d p eq - 80000000 0 7fefffff ffffffff 80000000 0 atan2d p eq - 80000000 0 7ff00000 0 80000000 0 atan2d m eq - 0 0 0 0 0 0 atan2d m eq - 0 0 0 1 0 0 atan2d m eq - 0 0 00100000 0 0 0 atan2d m eq - 0 0 7fefffff ffffffff 0 0 atan2d m eq - 0 0 7ff00000 0 0 0 atan2d m eq - 80000000 0 0 0 80000000 0 atan2d m eq - 80000000 0 0 1 80000000 0 atan2d m eq - 80000000 0 00100000 0 80000000 0 atan2d m eq - 80000000 0 7fefffff ffffffff 80000000 0 atan2d m eq - 80000000 0 7ff00000 0 80000000 0 /* atan2d(+-0,-anything but nan) is +-pi */ atan2d n eq ?x 0 0 fff00000 0 400921fb 54442d18 atan2d n eq ?x 0 0 ffefffff ffffffff 400921fb 54442d18 atan2d n eq ?x 0 0 80100000 0 400921fb 54442d18 atan2d n eq ?x 0 0 80000000 1 400921fb 54442d18 atan2d n eq ?x 0 0 80000000 0 400921fb 54442d18 atan2d n eq ?x 80000000 0 fff00000 0 c00921fb 54442d18 atan2d n eq ?x 80000000 0 ffefffff ffffffff c00921fb 54442d18 atan2d n eq ?x 80000000 0 80100000 0 c00921fb 54442d18 atan2d n eq ?x 80000000 0 80000000 1 c00921fb 54442d18 atan2d n eq ?x 80000000 0 80000000 0 c00921fb 54442d18 /* atan2d(+-anything but 0 and nan, 0) is +- pi/2 */ atan2d n eq ?x 7ff00000 0 0 0 3ff921fb 54442d18 atan2d n eq ?x 7ff00000 0 80000000 0 3ff921fb 54442d18 atan2d n eq ?x 7fefffff ffffffff 0 0 3ff921fb 54442d18 atan2d n eq ?x 7fefffff ffffffff 80000000 0 3ff921fb 54442d18 atan2d n eq ?x 00100000 0 0 0 3ff921fb 54442d18 atan2d n eq ?x 00100000 0 80000000 0 3ff921fb 54442d18 atan2d n eq ?x 0 1 0 0 3ff921fb 54442d18 atan2d n eq ?x 0 1 80000000 0 3ff921fb 54442d18 atan2d n eq ?x fff00000 0 0 0 bff921fb 54442d18 atan2d n eq ?x fff00000 0 80000000 0 bff921fb 54442d18 atan2d n eq ?x ffefffff ffffffff 0 0 bff921fb 54442d18 atan2d n eq ?x ffefffff ffffffff 80000000 0 bff921fb 54442d18 atan2d n eq ?x 80000000 1 0 0 bff921fb 54442d18 atan2d n eq ?x 80000000 1 80000000 0 bff921fb 54442d18 atan2d n eq ?x 80100000 0 0 0 bff921fb 54442d18 atan2d n eq ?x 80100000 0 80000000 0 bff921fb 54442d18 /* atan2d(big,small) :=: +-pi/2 */ atan2d n vn x 7fefffff ffffffff 00100000 0 3ff921fb 54442d18 atan2d n vn x 7fefffff ffffffff 80100000 0 3ff921fb 54442d18 atan2d n vn x ffefffff ffffffff 00100000 0 bff921fb 54442d18 atan2d n vn x ffefffff ffffffff 80100000 0 bff921fb 54442d18 atan2d z vn x 7fefffff ffffffff 00100000 0 3ff921fb 54442d18 atan2d z vn x 7fefffff ffffffff 80100000 0 3ff921fb 54442d18 atan2d z vn x ffefffff ffffffff 00100000 0 bff921fb 54442d18 atan2d z vn x ffefffff ffffffff 80100000 0 bff921fb 54442d18 atan2d p vn x 7fefffff ffffffff 00100000 0 3ff921fb 54442d18 atan2d p vn x 7fefffff ffffffff 80100000 0 3ff921fb 54442d18 atan2d p vn x ffefffff ffffffff 00100000 0 bff921fb 54442d18 atan2d p vn x ffefffff ffffffff 80100000 0 bff921fb 54442d18 atan2d m vn x 7fefffff ffffffff 00100000 0 3ff921fb 54442d18 atan2d m vn x 7fefffff ffffffff 80100000 0 3ff921fb 54442d18 atan2d m vn x ffefffff ffffffff 00100000 0 bff921fb 54442d18 atan2d m vn x ffefffff ffffffff 80100000 0 bff921fb 54442d18 /* atan2d(small,big) = small/big (big>0) else sign(small)(pi - |small/big|) */ atan2d n eq ux 00100000 0 7fefffff ffffffff 0 0 atan2d n eq ux 80100000 0 7fefffff ffffffff 80000000 0 atan2d n vn x 00100000 0 ffefffff ffffffff 400921fb 54442d18 atan2d n vn x 80100000 0 ffefffff ffffffff c00921fb 54442d18 atan2d z eq ux 00100000 0 7fefffff ffffffff 0 0 atan2d z eq ux 80100000 0 7fefffff ffffffff 80000000 0 atan2d z vn x 00100000 0 ffefffff ffffffff 400921fb 54442d18 atan2d z vn x 80100000 0 ffefffff ffffffff c00921fb 54442d18 atan2d p vn ux 00100000 0 7fefffff ffffffff 0 1 atan2d p vn ux 80100000 0 7fefffff ffffffff 80000000 0 atan2d p vn x 00100000 0 ffefffff ffffffff 400921fb 54442d18 atan2d p vn x 80100000 0 ffefffff ffffffff c00921fb 54442d18 atan2d m vn ux 00100000 0 7fefffff ffffffff 0 0 atan2d m vn ux 80100000 0 7fefffff ffffffff 80000000 0 atan2d m vn x 00100000 0 ffefffff ffffffff 400921fb 54442d18 atan2d m vn x 80100000 0 ffefffff ffffffff c00921fb 54442d18 /* atan2d(+-x,+x) = +-pi/4 for normal x */ atan2d n eq x 00100000 0 00100000 0 3fe921fb 54442d18 atan2d n eq x 80100000 0 00100000 0 bfe921fb 54442d18 atan2d n eq x 7fefffff ffffffff 7fefffff ffffffff 3fe921fb 54442d18 atan2d n eq x ffefffff ffffffff 7fefffff ffffffff bfe921fb 54442d18 /* atan2d(+-x,-x) = +-3pi/4 for normal x */ atan2d n eq x 00100000 0 80100000 0 4002d97c 7f3321d2 atan2d n eq x 80100000 0 80100000 0 c002d97c 7f3321d2 atan2d n eq x 3ff00000 0 bff00000 0 4002d97c 7f3321d2 atan2d n eq x bff00000 0 bff00000 0 c002d97c 7f3321d2 atan2d n eq x 7fefffff ffffffff ffefffff ffffffff 4002d97c 7f3321d2 atan2d n eq x ffefffff ffffffff ffefffff ffffffff c002d97c 7f3321d2 /* random arguments between -2.0 and 2.0 */ atan2d n vn x bfe13284 b2b5006d 3ff6ca8d fb825911 bfd716d1 fa13dd60 atan2d n vn x 3ffc2ca6 09de7505 bff55f11 fba96889 4001c206 d50867f2 atan2d n vn x bfe15679 e27084dd bfb41e13 1b093c41 bffb6ff4 3cc0fa04 atan2d n vn x 3ff281b0 d18455f5 3ffb5ce3 4a51b239 3fe30789 aa67a7b0 atan2d n vn x bfd58348 1079de4d bffea822 3103b871 c007be50 87e43d19 atan2d n vn x bfeaae17 f24163e5 3fb7a9da 1468cce9 bff75db7 c098be46 atan2d n vn x bff844ff f258fcbd 3ff6ca32 1ace7da1 bfea237b 131b62af atan2d n vn x bfffe09b efde0ed5 bffff6c7 e8e5e899 c002dc43 c18871b1 atan2d n vn x bfed24c8 1412d02d 3ff29b68 28273bd1 bfe5428a 1a6caecf atan2d n vn x 3fe25ea7 e8b7c6c5 3fef9959 8e193549 3fe0d9c9 60b4dda9 /* atan2d involve nan */ atan2d n uo v 0 0 7ff00000 00000001 0 0 atan2d n uo - 3ff00000 0 fff80000 0 0 0 atan2d n uo v 7ff00000 1 00000000 1 0 0 atan2d n uo - 7ff80000 0 ffefffff ffffffff 0 0 atan2d n uo v 7ff80000 0 fff00000 1 0 0 atan2d n uo - fff80000 0 fff80000 0 0 0 atan2d z uo v 0 0 7ff00000 00000001 0 0 atan2d z uo - 3ff00000 0 fff80000 0 0 0 atan2d z uo v 7ff00000 1 00000000 1 0 0 atan2d z uo - 7ff80000 0 ffefffff ffffffff 0 0 atan2d z uo v 7ff80000 0 fff00000 1 0 0 atan2d z uo - fff80000 0 fff80000 0 0 0 atan2d p uo v 0 0 7ff00000 00000001 0 0 atan2d p uo - 3ff00000 0 fff80000 0 0 0 atan2d p uo v 7ff00000 1 00000000 1 0 0 atan2d p uo - 7ff80000 0 ffefffff ffffffff 0 0 atan2d p uo v 7ff80000 0 fff00000 1 0 0 atan2d p uo - fff80000 0 fff80000 0 0 0 atan2d m uo v 0 0 7ff00000 00000001 0 0 atan2d m uo - 3ff00000 0 fff80000 0 0 0 atan2d m uo v 7ff00000 1 00000000 1 0 0 atan2d m uo - 7ff80000 0 ffefffff ffffffff 0 0 atan2d m uo v 7ff80000 0 fff00000 1 0 0 atan2d m uo - fff80000 0 fff80000 0 0 0 /* atan2d(+-(anything but inf and nan), +inf) is +-0 */ atan2d n eq - 0 0 7ff00000 0 0 0 atan2d n eq - 0 1 7ff00000 0 0 0 atan2d n eq - 7fefffff ffffffff 7ff00000 0 0 0 atan2d n eq - 80000000 0 7ff00000 0 80000000 0 atan2d n eq - 80000000 1 7ff00000 0 80000000 0 atan2d n eq - ffefffff ffffffff 7ff00000 0 80000000 0 atan2d z eq - 0 0 7ff00000 0 0 0 atan2d z eq - 0 1 7ff00000 0 0 0 atan2d z eq - 7fefffff ffffffff 7ff00000 0 0 0 atan2d z eq - 80000000 0 7ff00000 0 80000000 0 atan2d z eq - 80000000 1 7ff00000 0 80000000 0 atan2d z eq - ffefffff ffffffff 7ff00000 0 80000000 0 atan2d p eq - 0 0 7ff00000 0 0 0 atan2d p eq - 0 1 7ff00000 0 0 0 atan2d p eq - 7fefffff ffffffff 7ff00000 0 0 0 atan2d p eq - 80000000 0 7ff00000 0 80000000 0 atan2d p eq - 80000000 1 7ff00000 0 80000000 0 atan2d p eq - ffefffff ffffffff 7ff00000 0 80000000 0 atan2d m eq - 0 0 7ff00000 0 0 0 atan2d m eq - 0 1 7ff00000 0 0 0 atan2d m eq - 7fefffff ffffffff 7ff00000 0 0 0 atan2d m eq - 80000000 0 7ff00000 0 80000000 0 atan2d m eq - 80000000 1 7ff00000 0 80000000 0 atan2d m eq - ffefffff ffffffff 7ff00000 0 80000000 0 /* atan2d(+-(anything but inf and nan), -inf) is +-pi */ atan2d n eq ?x 0 0 fff00000 0 400921fb 54442d18 atan2d n eq ?x 0 1 fff00000 0 400921fb 54442d18 atan2d n eq ?x 7fefffff ffffffff fff00000 0 400921fb 54442d18 atan2d n eq ?x 80000000 0 fff00000 0 c00921fb 54442d18 atan2d n eq ?x 80000000 1 fff00000 0 c00921fb 54442d18 atan2d n eq ?x ffefffff ffffffff fff00000 0 c00921fb 54442d18 /* atan2d(+-inf,+inf ) is +-pi/4 */ atan2d n eq ?x 7ff00000 0 7ff00000 0 3fe921fb 54442d18 atan2d n eq ?x fff00000 0 7ff00000 0 bfe921fb 54442d18 /* atan2d(+-inf,-inf ) is +-3pi/4 */ atan2d n eq ?x 7ff00000 0 fff00000 0 4002d97c 7f3321d2 atan2d n eq ?x fff00000 0 fff00000 0 c002d97c 7f3321d2 /* atan2d(+-inf, (anything but,0,nan, and inf)) is +-pi/2 */ atan2d n eq ?x 7ff00000 0 0 1 3ff921fb 54442d18 atan2d n eq ?x 7ff00000 0 80000000 1 3ff921fb 54442d18 atan2d n eq ?x 7ff00000 0 7fefffff ffffffff 3ff921fb 54442d18 atan2d n eq ?x 7ff00000 0 ffefffff ffffffff 3ff921fb 54442d18 atan2d n eq ?x fff00000 0 0 1 bff921fb 54442d18 atan2d n eq ?x fff00000 0 80000000 1 bff921fb 54442d18 atan2d n eq ?x fff00000 0 7fefffff ffffffff bff921fb 54442d18 atan2d n eq ?x fff00000 0 ffefffff ffffffff bff921fb 54442d18 atan2d m uo - 3ff00000 00000000 fff80000 00000000 00000000 00000000 atan2d m uo - 7ff80000 00000000 ffefffff ffffffff 00000000 00000000 atan2d m uo - fff80000 00000000 fff80000 00000000 00000000 00000000 atan2d m uo v 00000000 00000000 7ff00000 00000001 00000000 00000000 atan2d m uo v 7ff00000 00000001 00000000 00000001 00000000 00000000 atan2d m uo v 7ff80000 00000000 fff00000 00000001 00000000 00000000 atan2d m vn x 00100000 00000000 ffefffff ffffffff 400921fb 54442d18 atan2d m vn x 80100000 00000000 ffefffff ffffffff c00921fb 54442d18 atan2d m vn xu 00100000 00000000 7fefffff ffffffff 00000000 00000000 atan2d m vn xu 80100000 00000000 7fefffff ffffffff 80000000 00000000 atan2d n eq xu 00100000 00000000 7fefffff ffffffff 00000000 00000000 atan2d n eq xu 80100000 00000000 7fefffff ffffffff 80000000 00000000 atan2d n uo - 3ff00000 00000000 fff80000 00000000 00000000 00000000 atan2d n uo - 7ff80000 00000000 ffefffff ffffffff 00000000 00000000 atan2d n uo - fff80000 00000000 fff80000 00000000 00000000 00000000 atan2d n uo v 00000000 00000000 7ff00000 00000001 00000000 00000000 atan2d n uo v 7ff00000 00000001 00000000 00000001 00000000 00000000 atan2d n uo v 7ff80000 00000000 fff00000 00000001 00000000 00000000 atan2d n vn x 00100000 00000000 ffefffff ffffffff 400921fb 54442d18 atan2d n vn x 80100000 00000000 ffefffff ffffffff c00921fb 54442d18 atan2d p uo - 3ff00000 00000000 fff80000 00000000 00000000 00000000 atan2d p uo - 7ff80000 00000000 ffefffff ffffffff 00000000 00000000 atan2d p uo - fff80000 00000000 fff80000 00000000 00000000 00000000 atan2d p uo v 00000000 00000000 7ff00000 00000001 00000000 00000000 atan2d p uo v 7ff00000 00000001 00000000 00000001 00000000 00000000 atan2d p uo v 7ff80000 00000000 fff00000 00000001 00000000 00000000 atan2d p vn x 00100000 00000000 ffefffff ffffffff 400921fb 54442d18 atan2d p vn x 80100000 00000000 ffefffff ffffffff c00921fb 54442d18 atan2d p vn xu 00100000 00000000 7fefffff ffffffff 00000000 00000001 atan2d p vn xu 80100000 00000000 7fefffff ffffffff 80000000 00000000 atan2d z eq xu 00100000 00000000 7fefffff ffffffff 00000000 00000000 atan2d z eq xu 80100000 00000000 7fefffff ffffffff 80000000 00000000 atan2d z uo - 3ff00000 00000000 fff80000 00000000 00000000 00000000 atan2d z uo - 7ff80000 00000000 ffefffff ffffffff 00000000 00000000 atan2d z uo - fff80000 00000000 fff80000 00000000 00000000 00000000 atan2d z uo v 00000000 00000000 7ff00000 00000001 00000000 00000000 atan2d z uo v 7ff00000 00000001 00000000 00000001 00000000 00000000 atan2d z uo v 7ff80000 00000000 fff00000 00000001 00000000 00000000 atan2d z vn x 00100000 00000000 ffefffff ffffffff 400921fb 54442d18 atan2d z vn x 80100000 00000000 ffefffff ffffffff c00921fb 54442d18