// 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.
// log10d(+fmax) is finite
T(RN, 0x1.fffffffffffffp+1023, 0x1.34413509f79ffp+8, 0x1.a4b4bap-5, INEXACT)
T(RZ, 0x1.fffffffffffffp+1023, 0x1.34413509f79fep+8, -0x1.e5b4b4p-1, INEXACT)
T(RU, 0x1.fffffffffffffp+1023, 0x1.34413509f79ffp+8, 0x1.a4b4bap-5, INEXACT)
T(RD, 0x1.fffffffffffffp+1023, 0x1.34413509f79fep+8, -0x1.e5b4b4p-1, INEXACT)
// log10d(10**n) == n (n=1,...,22)
T(RN, 0x1.4p+3, 0x1p+0, 0x0p+0, 0)
T(RN, 0x1.9p+6, 0x1p+1, 0x0p+0, 0)
T(RN, 0x1.f4p+9, 0x1.8p+1, 0x0p+0, 0)
T(RN, 0x1.388p+13, 0x1p+2, 0x0p+0, 0)
T(RN, 0x1.86ap+16, 0x1.4p+2, 0x0p+0, 0)
T(RN, 0x1.e848p+19, 0x1.8p+2, 0x0p+0, 0)
T(RN, 0x1.312dp+23, 0x1.cp+2, 0x0p+0, 0)
T(RN, 0x1.7d784p+26, 0x1p+3, 0x0p+0, 0)
T(RN, 0x1.dcd65p+29, 0x1.2p+3, 0x0p+0, 0)
T(RN, 0x1.2a05f2p+33, 0x1.4p+3, 0x0p+0, 0)
T(RN, 0x1.74876e8p+36, 0x1.6p+3, 0x0p+0, 0)
T(RN, 0x1.d1a94a2p+39, 0x1.8p+3, 0x0p+0, 0)
T(RN, 0x1.2309ce54p+43, 0x1.ap+3, 0x0p+0, 0)
T(RN, 0x1.6bcc41e9p+46, 0x1.cp+3, 0x0p+0, 0)
T(RN, 0x1.c6bf52634p+49, 0x1.ep+3, 0x0p+0, 0)
T(RN, 0x1.1c37937e08p+53, 0x1p+4, 0x0p+0, 0)
T(RN, 0x1.6345785d8ap+56, 0x1.1p+4, 0x0p+0, 0)
T(RN, 0x1.bc16d674ec8p+59, 0x1.2p+4, 0x0p+0, 0)
T(RN, 0x1.158e460913dp+63, 0x1.3p+4, 0x0p+0, 0)
T(RN, 0x1.5af1d78b58c4p+66, 0x1.4p+4, 0x0p+0, 0)
T(RN, 0x1.b1ae4d6e2ef5p+69, 0x1.5p+4, 0x0p+0, 0)
T(RN, 0x1.0f0cf064dd592p+73, 0x1.6p+4, 0x0p+0, 0)
// log10d(1+tiny) is (tiny - tiny*tiny)/log10d
T(RN, 0x1.000000000002p+0, 0x1.bcb7b1526e4f2p-49, -0x1.9cae5ap-2, INEXACT)
T(RN, 0x1p+0, 0x0p+0, 0x0p+0, 0)
T(RN, 0x1.fffffffffffcp-1, -0x1.bcb7b1526e52ap-49, -0x1.de3f64p-8, INEXACT)
T(RZ, 0x1.000000000002p+0, 0x1.bcb7b1526e4f2p-49, -0x1.9cae5ap-2, INEXACT)
T(RZ, 0x1p+0, 0x0p+0, 0x0p+0, 0)
T(RZ, 0x1.fffffffffffcp-1, -0x1.bcb7b1526e529p-49, 0x1.fc4382p-1, INEXACT)
T(RU, 0x1.000000000002p+0, 0x1.bcb7b1526e4f3p-49, 0x1.31a8d4p-1, INEXACT)
T(RU, 0x1p+0, 0x0p+0, 0x0p+0, 0)
T(RU, 0x1.fffffffffffcp-1, -0x1.bcb7b1526e529p-49, 0x1.fc4382p-1, INEXACT)
T(RD, 0x1.000000000002p+0, 0x1.bcb7b1526e4f2p-49, -0x1.9cae5ap-2, INEXACT)
T(RD, 0x1p+0, 0x0p+0, 0x0p+0, 0)
T(RD, 0x1.fffffffffffcp-1, -0x1.bcb7b1526e52ap-49, -0x1.de3f64p-8, INEXACT)
// log10d(min) is finite
T(RN, 0x1p-1022, -0x1.33a7146f72a42p+8, -0x1.8cf2fap-5, INEXACT)
T(RN, 0x1p-1074, -0x1.434e6420f4374p+8, -0x1.a0fae8p-4, INEXACT)
T(RZ, 0x1p-1022, -0x1.33a7146f72a41p+8, 0x1.e730dp-1, INEXACT)
T(RZ, 0x1p-1074, -0x1.434e6420f4373p+8, 0x1.cbe0a2p-1, INEXACT)
T(RU, 0x1p-1022, -0x1.33a7146f72a41p+8, 0x1.e730dp-1, INEXACT)
T(RU, 0x1p-1074, -0x1.434e6420f4373p+8, 0x1.cbe0a2p-1, INEXACT)
T(RD, 0x1p-1022, -0x1.33a7146f72a42p+8, -0x1.8cf2fap-5, INEXACT)
T(RD, 0x1p-1074, -0x1.434e6420f4374p+8, -0x1.a0fae8p-4, INEXACT)
// random arguments between 0 100
T(RN, 0x1.24844b2b5006dp+5, 0x1.9024c06a2c714p+0, 0x1.aef3p-2, INEXACT)
T(RN, 0x1.5671ffb825911p+6, 0x1.eeba5ddb56f6dp+0, -0x1.9e833ep-7, INEXACT)
T(RN, 0x1.7817009de7505p+6, 0x1.f925b53114c7fp+0, 0x1.a6fc5ep-3, INEXACT)
T(RN, 0x1.09b74fba96889p+4, 0x1.38657024f572dp+0, 0x1.e4ad62p-2, INEXACT)
T(RN, 0x1.23a38e27084ddp+5, 0x1.8fcf347689cf5p+0, 0x1.5d3c72p-2, INEXACT)
T(RN, 0x1.804881b093c41p+5, 0x1.ae7acf90f48a1p+0, 0x1.e587b8p-4, INEXACT)
T(RN, 0x1.3baa8d18455f5p+6, 0x1.e5accf34b476ap+0, 0x1.554422p-3, INEXACT)
T(RN, 0x1.730484a51b239p+6, 0x1.f7a33d27f78e2p+0, 0x1.291502p-2, INEXACT)
T(RN, 0x1.4cc5b1079de4dp+5, 0x1.9e7a86923a334p+0, -0x1.b9e4c4p-5, INEXACT)
T(RN, 0x1.0ca4d3103b871p+1, 0x1.49b1b2a6745efp-2, 0x1.b949bep-2, INEXACT)
// log10d(nan) is nan
T(RN, nan, nan, 0x0p+0, 0)
// log10d(+inf) is inf
T(RN, inf, inf, 0x0p+0, 0)
// log10d(+-0) is -inf
T(RN, 0x0p+0, -inf, 0x0p+0, DIVBYZERO)
T(RN, -0x0p+0, -inf, 0x0p+0, DIVBYZERO)
// log10d(-ve) is nan
T(RN, -0x1p-1074, nan, 0x0p+0, INVALID)
T(RN, -0x1p-1022, nan, 0x0p+0, INVALID)
T(RN,-0x1.fffffffffffffp+1023, nan, 0x0p+0, INVALID)
T(RN, -inf, nan, 0x0p+0, INVALID)
T(RD, inf, inf, 0x0p+0, 0)
T(RD, 0x0p+0, -inf, 0x0p+0, DIVBYZERO)
T(RD, -0x0p+0, -inf, 0x0p+0, DIVBYZERO)
T(RD, nan, nan, 0x0p+0, 0)
T(RD, nan, nan, 0x0p+0, 0)
T(RD, -0x1p-1074, nan, 0x0p+0, INVALID)
T(RD, -0x1p-1073, nan, 0x0p+0, INVALID)
T(RD, -0x1.cp-1072, nan, 0x0p+0, INVALID)
T(RD, -0x1p-1024, nan, 0x0p+0, INVALID)
T(RD, -0x1p-1023, nan, 0x0p+0, INVALID)
T(RD,-0x1.ffffffffffffcp-1023, nan, 0x0p+0, INVALID)
T(RD,-0x1.ffffffffffffep-1023, nan, 0x0p+0, INVALID)
T(RD, -0x1p-1022, nan, 0x0p+0, INVALID)
T(RD,-0x1.0000000000001p-1022, nan, 0x0p+0, INVALID)
T(RD,-0x1.0000000000002p-1022, nan, 0x0p+0, INVALID)
T(RD, -0x1p-1021, nan, 0x0p+0, INVALID)
T(RD, -0x1p-1020, nan, 0x0p+0, INVALID)
T(RD, -0x1p-52, nan, 0x0p+0, INVALID)
T(RD, -0x1p-50, nan, 0x0p+0, INVALID)
T(RD, -0x1p-2, nan, 0x0p+0, INVALID)
T(RD, -0x1p-1, nan, 0x0p+0, INVALID)
T(RD, -0x1.ffffffffffffap-1, nan, 0x0p+0, INVALID)
T(RD, -0x1.ffffffffffffcp-1, nan, 0x0p+0, INVALID)
T(RD, -0x1.ffffffffffffep-1, nan, 0x0p+0, INVALID)
T(RD, -0x1.fffffffffffffp-1, nan, 0x0p+0, INVALID)
T(RD, -0x1p+0, nan, 0x0p+0, INVALID)
T(RD, -0x1.0000000000001p+0, nan, 0x0p+0, INVALID)
T(RD, -0x1.0000000000002p+0, nan, 0x0p+0, INVALID)
T(RD, -0x1.0000000000004p+0, nan, 0x0p+0, INVALID)
T(RD, -0x1p+1, nan, 0x0p+0, INVALID)
T(RD, -0x1.0000000000002p+1, nan, 0x0p+0, INVALID)
T(RD, -0x1.ffffffffffffbp+1, nan, 0x0p+0, INVALID)
T(RD, -0x1p+2, nan, 0x0p+0, INVALID)
T(RD, -0x1p+1022, nan, 0x0p+0, INVALID)
T(RD,-0x1.0000000000002p+1022, nan, 0x0p+0, INVALID)
T(RD,-0x1.0000000000004p+1022, nan, 0x0p+0, INVALID)
T(RD, -0x1p+1023, nan, 0x0p+0, INVALID)
T(RD,-0x1.0000000000002p+1023, nan, 0x0p+0, INVALID)
T(RD,-0x1.ffffffffffffep+1023, nan, 0x0p+0, INVALID)
T(RD,-0x1.fffffffffffffp+1023, nan, 0x0p+0, INVALID)
T(RD, -inf, nan, 0x0p+0, INVALID)
T(RD, 0x1.4p+3, 0x1p+0, 0x0p+0, 0)
T(RD, 0x1.9p+6, 0x1p+1, 0x0p+0, 0)
T(RD, 0x1.f4p+9, 0x1.8p+1, 0x0p+0, 0)
T(RD, 0x1.388p+13, 0x1p+2, 0x0p+0, 0)
T(RN, nan, nan, 0x0p+0, 0)
T(RN, -0x1p-1073, nan, 0x0p+0, INVALID)
T(RN, -0x1.cp-1072, nan, 0x0p+0, INVALID)
T(RN, -0x1p-1024, nan, 0x0p+0, INVALID)
T(RN, -0x1p-1023, nan, 0x0p+0, INVALID)
T(RN,-0x1.ffffffffffffcp-1023, nan, 0x0p+0, INVALID)
T(RN,-0x1.ffffffffffffep-1023, nan, 0x0p+0, INVALID)
T(RN,-0x1.0000000000001p-1022, nan, 0x0p+0, INVALID)
T(RN,-0x1.0000000000002p-1022, nan, 0x0p+0, INVALID)
T(RN, -0x1p-1021, nan, 0x0p+0, INVALID)
T(RN, -0x1p-1020, nan, 0x0p+0, INVALID)
T(RN, -0x1p-52, nan, 0x0p+0, INVALID)
T(RN, -0x1p-50, nan, 0x0p+0, INVALID)
T(RN, -0x1p-2, nan, 0x0p+0, INVALID)
T(RN, -0x1p-1, nan, 0x0p+0, INVALID)
T(RN, -0x1.ffffffffffffap-1, nan, 0x0p+0, INVALID)
T(RN, -0x1.ffffffffffffcp-1, nan, 0x0p+0, INVALID)
T(RN, -0x1.ffffffffffffep-1, nan, 0x0p+0, INVALID)
T(RN, -0x1.fffffffffffffp-1, nan, 0x0p+0, INVALID)
T(RN, -0x1p+0, nan, 0x0p+0, INVALID)
T(RN, -0x1.0000000000001p+0, nan, 0x0p+0, INVALID)
T(RN, -0x1.0000000000002p+0, nan, 0x0p+0, INVALID)
T(RN, -0x1.0000000000004p+0, nan, 0x0p+0, INVALID)
T(RN, -0x1p+1, nan, 0x0p+0, INVALID)
T(RN, -0x1.0000000000002p+1, nan, 0x0p+0, INVALID)
T(RN, -0x1.ffffffffffffbp+1, nan, 0x0p+0, INVALID)
T(RN, -0x1p+2, nan, 0x0p+0, INVALID)
T(RN, -0x1p+1022, nan, 0x0p+0, INVALID)
T(RN,-0x1.0000000000002p+1022, nan, 0x0p+0, INVALID)
T(RN,-0x1.0000000000004p+1022, nan, 0x0p+0, INVALID)
T(RN, -0x1p+1023, nan, 0x0p+0, INVALID)
T(RN,-0x1.0000000000002p+1023, nan, 0x0p+0, INVALID)
T(RN,-0x1.ffffffffffffep+1023, nan, 0x0p+0, INVALID)
T(RU, inf, inf, 0x0p+0, 0)
T(RU, 0x0p+0, -inf, 0x0p+0, DIVBYZERO)
T(RU, -0x0p+0, -inf, 0x0p+0, DIVBYZERO)
T(RU, nan, nan, 0x0p+0, 0)
T(RU, nan, nan, 0x0p+0, 0)
T(RU, -0x1p-1074, nan, 0x0p+0, INVALID)
T(RU, -0x1p-1073, nan, 0x0p+0, INVALID)
T(RU, -0x1.cp-1072, nan, 0x0p+0, INVALID)
T(RU, -0x1p-1024, nan, 0x0p+0, INVALID)
T(RU, -0x1p-1023, nan, 0x0p+0, INVALID)
T(RU,-0x1.ffffffffffffcp-1023, nan, 0x0p+0, INVALID)
T(RU,-0x1.ffffffffffffep-1023, nan, 0x0p+0, INVALID)
T(RU, -0x1p-1022, nan, 0x0p+0, INVALID)
T(RU,-0x1.0000000000001p-1022, nan, 0x0p+0, INVALID)
T(RU,-0x1.0000000000002p-1022, nan, 0x0p+0, INVALID)
T(RU, -0x1p-1021, nan, 0x0p+0, INVALID)
T(RU, -0x1p-1020, nan, 0x0p+0, INVALID)
T(RU, -0x1p-52, nan, 0x0p+0, INVALID)
T(RU, -0x1p-50, nan, 0x0p+0, INVALID)
T(RU, -0x1p-2, nan, 0x0p+0, INVALID)
T(RU, -0x1p-1, nan, 0x0p+0, INVALID)
T(RU, -0x1.ffffffffffffap-1, nan, 0x0p+0, INVALID)
T(RU, -0x1.ffffffffffffcp-1, nan, 0x0p+0, INVALID)
T(RU, -0x1.ffffffffffffep-1, nan, 0x0p+0, INVALID)
T(RU, -0x1.fffffffffffffp-1, nan, 0x0p+0, INVALID)
T(RU, -0x1p+0, nan, 0x0p+0, INVALID)
T(RU, -0x1.0000000000001p+0, nan, 0x0p+0, INVALID)
T(RU, -0x1.0000000000002p+0, nan, 0x0p+0, INVALID)
T(RU, -0x1.0000000000004p+0, nan, 0x0p+0, INVALID)
T(RU, -0x1p+1, nan, 0x0p+0, INVALID)
T(RU, -0x1.0000000000002p+1, nan, 0x0p+0, INVALID)
T(RU, -0x1.ffffffffffffbp+1, nan, 0x0p+0, INVALID)
T(RU, -0x1p+2, nan, 0x0p+0, INVALID)
T(RU, -0x1p+1022, nan, 0x0p+0, INVALID)
T(RU,-0x1.0000000000002p+1022, nan, 0x0p+0, INVALID)
T(RU,-0x1.0000000000004p+1022, nan, 0x0p+0, INVALID)
T(RU, -0x1p+1023, nan, 0x0p+0, INVALID)
T(RU,-0x1.0000000000002p+1023, nan, 0x0p+0, INVALID)
T(RU,-0x1.ffffffffffffep+1023, nan, 0x0p+0, INVALID)
T(RU,-0x1.fffffffffffffp+1023, nan, 0x0p+0, INVALID)
T(RU, -inf, nan, 0x0p+0, INVALID)
T(RU, 0x1.4p+3, 0x1p+0, 0x0p+0, 0)
T(RU, 0x1.9p+6, 0x1p+1, 0x0p+0, 0)
T(RU, 0x1.f4p+9, 0x1.8p+1, 0x0p+0, 0)
T(RU, 0x1.388p+13, 0x1p+2, 0x0p+0, 0)
T(RZ, inf, inf, 0x0p+0, 0)
T(RZ, 0x0p+0, -inf, 0x0p+0, DIVBYZERO)
T(RZ, -0x0p+0, -inf, 0x0p+0, DIVBYZERO)
T(RZ, nan, nan, 0x0p+0, 0)
T(RZ, nan, nan, 0x0p+0, 0)
T(RZ, -0x1p-1074, nan, 0x0p+0, INVALID)
T(RZ, -0x1p-1073, nan, 0x0p+0, INVALID)
T(RZ, -0x1.cp-1072, nan, 0x0p+0, INVALID)
T(RZ, -0x1p-1024, nan, 0x0p+0, INVALID)
T(RZ, -0x1p-1023, nan, 0x0p+0, INVALID)
T(RZ,-0x1.ffffffffffffcp-1023, nan, 0x0p+0, INVALID)
T(RZ,-0x1.ffffffffffffep-1023, nan, 0x0p+0, INVALID)
T(RZ, -0x1p-1022, nan, 0x0p+0, INVALID)
T(RZ,-0x1.0000000000001p-1022, nan, 0x0p+0, INVALID)
T(RZ,-0x1.0000000000002p-1022, nan, 0x0p+0, INVALID)
T(RZ, -0x1p-1021, nan, 0x0p+0, INVALID)
T(RZ, -0x1p-1020, nan, 0x0p+0, INVALID)
T(RZ, -0x1p-52, nan, 0x0p+0, INVALID)
T(RZ, -0x1p-50, nan, 0x0p+0, INVALID)
T(RZ, -0x1p-2, nan, 0x0p+0, INVALID)
T(RZ, -0x1p-1, nan, 0x0p+0, INVALID)
T(RZ, -0x1.ffffffffffffap-1, nan, 0x0p+0, INVALID)
T(RZ, -0x1.ffffffffffffcp-1, nan, 0x0p+0, INVALID)
T(RZ, -0x1.ffffffffffffep-1, nan, 0x0p+0, INVALID)
T(RZ, -0x1.fffffffffffffp-1, nan, 0x0p+0, INVALID)
T(RZ, -0x1p+0, nan, 0x0p+0, INVALID)
T(RZ, -0x1.0000000000001p+0, nan, 0x0p+0, INVALID)
T(RZ, -0x1.0000000000002p+0, nan, 0x0p+0, INVALID)
T(RZ, -0x1.0000000000004p+0, nan, 0x0p+0, INVALID)
T(RZ, -0x1p+1, nan, 0x0p+0, INVALID)
T(RZ, -0x1.0000000000002p+1, nan, 0x0p+0, INVALID)
T(RZ, -0x1.ffffffffffffbp+1, nan, 0x0p+0, INVALID)
T(RZ, -0x1p+2, nan, 0x0p+0, INVALID)
T(RZ, -0x1p+1022, nan, 0x0p+0, INVALID)
T(RZ,-0x1.0000000000002p+1022, nan, 0x0p+0, INVALID)
T(RZ,-0x1.0000000000004p+1022, nan, 0x0p+0, INVALID)
T(RZ, -0x1p+1023, nan, 0x0p+0, INVALID)
T(RZ,-0x1.0000000000002p+1023, nan, 0x0p+0, INVALID)
T(RZ,-0x1.ffffffffffffep+1023, nan, 0x0p+0, INVALID)
T(RZ,-0x1.fffffffffffffp+1023, nan, 0x0p+0, INVALID)
T(RZ, -inf, nan, 0x0p+0, INVALID)
T(RZ, 0x1.4p+3, 0x1p+0, 0x0p+0, 0)
T(RZ, 0x1.9p+6, 0x1p+1, 0x0p+0, 0)
T(RZ, 0x1.f4p+9, 0x1.8p+1, 0x0p+0, 0)
T(RZ, 0x1.388p+13, 0x1p+2, 0x0p+0, 0)