1 // Copyright (C) 1988-1994 Sun Microsystems, Inc. 2550 Garcia Avenue
2 // Mountain View, California 94043 All rights reserved.
4 // Any person is hereby authorized to download, copy, use, create bug fixes,
5 // and distribute, subject to the following conditions:
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.
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
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.
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.
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 // log10s(+fmax) is finite
38 T(RN
, 0x1.fffffep
+127, 0x1.344136p
+5, 0x1.f3039ep
-2, INEXACT
)
39 T(RZ
, 0x1.fffffep
+127, 0x1.344134p
+5, -0x1.067e3p
-1, INEXACT
)
40 T(RU
, 0x1.fffffep
+127, 0x1.344136p
+5, 0x1.f3039ep
-2, INEXACT
)
41 T(RD
, 0x1.fffffep
+127, 0x1.344134p
+5, -0x1.067e3p
-1, INEXACT
)
42 // log10s(10**n) == n (n=1,...,10)
43 T(RN
, 0x1.4p
+3, 0x1p
+0, 0x0p
+0, 0)
44 T(RN
, 0x1.9p
+6, 0x1p
+1, 0x0p
+0, 0)
45 T(RN
, 0x1.f4p
+9, 0x1.8p
+1, 0x0p
+0, 0)
46 T(RN
, 0x1.388p
+13, 0x1p
+2, 0x0p
+0, 0)
47 T(RN
, 0x1.86ap
+16, 0x1.4p
+2, 0x0p
+0, 0)
48 T(RN
, 0x1.e848p
+19, 0x1.8p
+2, 0x0p
+0, 0)
49 T(RN
, 0x1.312dp
+23, 0x1.cp
+2, 0x0p
+0, 0)
50 T(RN
, 0x1.7d784p
+26, 0x1p
+3, 0x0p
+0, 0)
51 T(RN
, 0x1.dcd65p
+29, 0x1.2p
+3, 0x0p
+0, 0)
52 T(RN
, 0x1.2a05f2p
+33, 0x1.4p
+3, 0x0p
+0, 0)
53 // log10s(1+tiny) is (tiny - tiny*tiny)/log10
54 T(RN
, 0x1.00004p
+0, 0x1.bcb77ap
-20, 0x1.11fa56p
-3, INEXACT
)
55 T(RN
, 0x1p
+0, 0x0p
+0, 0x0p
+0, 0)
56 T(RN
, 0x1.ffff8p
-1, -0x1.bcb7e8p
-20, 0x1.d2db7ep
-2, INEXACT
)
57 T(RZ
, 0x1.00004p
+0, 0x1.bcb778p
-20, -0x1.bb816ap
-1, INEXACT
)
58 T(RZ
, 0x1p
+0, 0x0p
+0, 0x0p
+0, 0)
59 T(RZ
, 0x1.ffff8p
-1, -0x1.bcb7e8p
-20, 0x1.d2db7ep
-2, INEXACT
)
60 T(RU
, 0x1.00004p
+0, 0x1.bcb77ap
-20, 0x1.11fa56p
-3, INEXACT
)
61 T(RU
, 0x1p
+0, 0x0p
+0, 0x0p
+0, 0)
62 T(RU
, 0x1.ffff8p
-1, -0x1.bcb7e8p
-20, 0x1.d2db7ep
-2, INEXACT
)
63 T(RD
, 0x1.00004p
+0, 0x1.bcb778p
-20, -0x1.bb816ap
-1, INEXACT
)
64 T(RD
, 0x1p
+0, 0x0p
+0, 0x0p
+0, 0)
65 T(RD
, 0x1.ffff8p
-1, -0x1.bcb7eap
-20, -0x1.16924p
-1, INEXACT
)
66 // log10s(min) is finite
67 T(RN
, 0x1p
-126, -0x1.2f703p
+5, 0x1.ae7e0cp
-4, INEXACT
)
68 T(RN
, 0x1p
-149, -0x1.66d3e8p
+5, -0x1.0997p
-3, INEXACT
)
69 T(RZ
, 0x1p
-126, -0x1.2f703p
+5, 0x1.ae7e0cp
-4, INEXACT
)
70 T(RZ
, 0x1p
-149, -0x1.66d3e6p
+5, 0x1.bd9a4p
-1, INEXACT
)
71 T(RU
, 0x1p
-126, -0x1.2f703p
+5, 0x1.ae7e0cp
-4, INEXACT
)
72 T(RU
, 0x1p
-149, -0x1.66d3e6p
+5, 0x1.bd9a4p
-1, INEXACT
)
73 T(RD
, 0x1p
-126, -0x1.2f7032p
+5, -0x1.ca303ep
-1, INEXACT
)
74 T(RD
, 0x1p
-149, -0x1.66d3e8p
+5, -0x1.0997p
-3, INEXACT
)
75 // random arguments between 0 100
76 T(RN
, 0x1.24844cp
+5, 0x1.9024cp
+0, -0x1.7605eap
-2, INEXACT
)
77 T(RN
, 0x1.5672p
+6, 0x1.eeba5ep
+0, 0x1.aaa14cp
-6, INEXACT
)
78 T(RN
, 0x1.7817p
+6, 0x1.f925b6p
+0, 0x1.fb3242p
-2, INEXACT
)
79 T(RN
, 0x1.09b75p
+4, 0x1.38657p
+0, -0x1.0801cap
-3, INEXACT
)
80 T(RN
, 0x1.23a38ep
+5, 0x1.8fcf34p
+0, -0x1.9ea21p
-3, INEXACT
)
81 T(RN
, 0x1.804882p
+5, 0x1.ae7adp
+0, 0x1.60441p
-3, INEXACT
)
82 T(RN
, 0x1.3baa8ep
+6, 0x1.e5acdp
+0, 0x1.e6b71ep
-3, INEXACT
)
83 T(RN
, 0x1.730484p
+6, 0x1.f7a33cp
+0, -0x1.ecfb84p
-2, INEXACT
)
84 T(RN
, 0x1.4cc5b2p
+5, 0x1.9e7a86p
+0, -0x1.ca6cb4p
-2, INEXACT
)
85 T(RN
, 0x1.0ca4d4p
+1, 0x1.49b1b4p
-2, -0x1.9af518p
-4, INEXACT
)
87 T(RN
, nan
, nan
, 0x0p
+0, 0)
88 // log10s(+inf) is inf
89 T(RN
, inf
, inf
, 0x0p
+0, 0)
90 // log10s(+-0) is -inf
91 T(RN
, 0x0p
+0, -inf
, 0x0p
+0, DIVBYZERO
)
92 T(RN
, -0x0p
+0, -inf
, 0x0p
+0, DIVBYZERO
)
94 T(RN
, -0x1p
-149, nan
, 0x0p
+0, INVALID
)
95 T(RN
, -0x1p
-126, nan
, 0x0p
+0, INVALID
)
96 T(RN
,-0x1.fffffep
+127, nan
, 0x0p
+0, INVALID
)
97 T(RN
, -inf
, nan
, 0x0p
+0, INVALID
)
98 T(RD
, inf
, inf
, 0x0p
+0, 0)
99 T(RD
, 0x0p
+0, -inf
, 0x0p
+0, DIVBYZERO
)
100 T(RD
, -0x0p
+0, -inf
, 0x0p
+0, DIVBYZERO
)
101 T(RD
, nan
, nan
, 0x0p
+0, 0)
102 T(RD
, nan
, nan
, 0x0p
+0, 0)
103 T(RD
, -0x1p
-149, nan
, 0x0p
+0, INVALID
)
104 T(RD
, -0x1p
-148, nan
, 0x0p
+0, INVALID
)
105 T(RD
, -0x1.cp
-147, nan
, 0x0p
+0, INVALID
)
106 T(RD
, -0x1p
-128, nan
, 0x0p
+0, INVALID
)
107 T(RD
, -0x1p
-127, nan
, 0x0p
+0, INVALID
)
108 T(RD
,-0x1.fffff8p
-127, nan
, 0x0p
+0, INVALID
)
109 T(RD
,-0x1.fffffcp
-127, nan
, 0x0p
+0, INVALID
)
110 T(RD
, -0x1p
-126, nan
, 0x0p
+0, INVALID
)
111 T(RD
,-0x1.000002p
-126, nan
, 0x0p
+0, INVALID
)
112 T(RD
,-0x1.000004p
-126, nan
, 0x0p
+0, INVALID
)
113 T(RD
, -0x1p
-125, nan
, 0x0p
+0, INVALID
)
114 T(RD
, -0x1p
-124, nan
, 0x0p
+0, INVALID
)
115 T(RD
, -0x1p
-23, nan
, 0x0p
+0, INVALID
)
116 T(RD
, -0x1p
-21, nan
, 0x0p
+0, INVALID
)
117 T(RD
, -0x1p
-2, nan
, 0x0p
+0, INVALID
)
118 T(RD
, -0x1p
-1, nan
, 0x0p
+0, INVALID
)
119 T(RD
, -0x1.fffff4p
-1, nan
, 0x0p
+0, INVALID
)
120 T(RD
, -0x1.fffff8p
-1, nan
, 0x0p
+0, INVALID
)
121 T(RD
, -0x1.fffffcp
-1, nan
, 0x0p
+0, INVALID
)
122 T(RD
, -0x1.fffffep
-1, nan
, 0x0p
+0, INVALID
)
123 T(RD
, -0x1p
+0, nan
, 0x0p
+0, INVALID
)
124 T(RD
, -0x1.000002p
+0, nan
, 0x0p
+0, INVALID
)
125 T(RD
, -0x1.000004p
+0, nan
, 0x0p
+0, INVALID
)
126 T(RD
, -0x1.000008p
+0, nan
, 0x0p
+0, INVALID
)
127 T(RD
, -0x1p
+1, nan
, 0x0p
+0, INVALID
)
128 T(RD
, -0x1.000004p
+1, nan
, 0x0p
+0, INVALID
)
129 T(RD
, -0x1.fffff6p
+1, nan
, 0x0p
+0, INVALID
)
130 T(RD
, -0x1p
+2, nan
, 0x0p
+0, INVALID
)
131 T(RD
, -0x1p
+126, nan
, 0x0p
+0, INVALID
)
132 T(RD
,-0x1.000004p
+126, nan
, 0x0p
+0, INVALID
)
133 T(RD
,-0x1.000008p
+126, nan
, 0x0p
+0, INVALID
)
134 T(RD
, -0x1p
+127, nan
, 0x0p
+0, INVALID
)
135 T(RD
,-0x1.000004p
+127, nan
, 0x0p
+0, INVALID
)
136 T(RD
,-0x1.fffffcp
+127, nan
, 0x0p
+0, INVALID
)
137 T(RD
,-0x1.fffffep
+127, nan
, 0x0p
+0, INVALID
)
138 T(RD
, -inf
, nan
, 0x0p
+0, INVALID
)
139 T(RD
, 0x1.4p
+3, 0x1p
+0, 0x0p
+0, 0)
140 T(RD
, 0x1.9p
+6, 0x1p
+1, 0x0p
+0, 0)
141 T(RD
, 0x1.f4p
+9, 0x1.8p
+1, 0x0p
+0, 0)
142 T(RD
, 0x1.388p
+13, 0x1p
+2, 0x0p
+0, 0)
143 T(RN
, nan
, nan
, 0x0p
+0, 0)
144 T(RN
, -0x1p
-148, nan
, 0x0p
+0, INVALID
)
145 T(RN
, -0x1.cp
-147, nan
, 0x0p
+0, INVALID
)
146 T(RN
, -0x1p
-128, nan
, 0x0p
+0, INVALID
)
147 T(RN
, -0x1p
-127, nan
, 0x0p
+0, INVALID
)
148 T(RN
,-0x1.fffff8p
-127, nan
, 0x0p
+0, INVALID
)
149 T(RN
,-0x1.fffffcp
-127, nan
, 0x0p
+0, INVALID
)
150 T(RN
,-0x1.000002p
-126, nan
, 0x0p
+0, INVALID
)
151 T(RN
,-0x1.000004p
-126, nan
, 0x0p
+0, INVALID
)
152 T(RN
, -0x1p
-125, nan
, 0x0p
+0, INVALID
)
153 T(RN
, -0x1p
-124, nan
, 0x0p
+0, INVALID
)
154 T(RN
, -0x1p
-23, nan
, 0x0p
+0, INVALID
)
155 T(RN
, -0x1p
-21, nan
, 0x0p
+0, INVALID
)
156 T(RN
, -0x1p
-2, nan
, 0x0p
+0, INVALID
)
157 T(RN
, -0x1p
-1, nan
, 0x0p
+0, INVALID
)
158 T(RN
, -0x1.fffff4p
-1, nan
, 0x0p
+0, INVALID
)
159 T(RN
, -0x1.fffff8p
-1, nan
, 0x0p
+0, INVALID
)
160 T(RN
, -0x1.fffffcp
-1, nan
, 0x0p
+0, INVALID
)
161 T(RN
, -0x1.fffffep
-1, nan
, 0x0p
+0, INVALID
)
162 T(RN
, -0x1p
+0, nan
, 0x0p
+0, INVALID
)
163 T(RN
, -0x1.000002p
+0, nan
, 0x0p
+0, INVALID
)
164 T(RN
, -0x1.000004p
+0, nan
, 0x0p
+0, INVALID
)
165 T(RN
, -0x1.000008p
+0, nan
, 0x0p
+0, INVALID
)
166 T(RN
, -0x1p
+1, nan
, 0x0p
+0, INVALID
)
167 T(RN
, -0x1.000004p
+1, nan
, 0x0p
+0, INVALID
)
168 T(RN
, -0x1.fffff6p
+1, nan
, 0x0p
+0, INVALID
)
169 T(RN
, -0x1p
+2, nan
, 0x0p
+0, INVALID
)
170 T(RN
, -0x1p
+126, nan
, 0x0p
+0, INVALID
)
171 T(RN
,-0x1.000004p
+126, nan
, 0x0p
+0, INVALID
)
172 T(RN
,-0x1.000008p
+126, nan
, 0x0p
+0, INVALID
)
173 T(RN
, -0x1p
+127, nan
, 0x0p
+0, INVALID
)
174 T(RN
,-0x1.000004p
+127, nan
, 0x0p
+0, INVALID
)
175 T(RN
,-0x1.fffffcp
+127, nan
, 0x0p
+0, INVALID
)
176 T(RU
, inf
, inf
, 0x0p
+0, 0)
177 T(RU
, 0x0p
+0, -inf
, 0x0p
+0, DIVBYZERO
)
178 T(RU
, -0x0p
+0, -inf
, 0x0p
+0, DIVBYZERO
)
179 T(RU
, nan
, nan
, 0x0p
+0, 0)
180 T(RU
, nan
, nan
, 0x0p
+0, 0)
181 T(RU
, -0x1p
-149, nan
, 0x0p
+0, INVALID
)
182 T(RU
, -0x1p
-148, nan
, 0x0p
+0, INVALID
)
183 T(RU
, -0x1.cp
-147, nan
, 0x0p
+0, INVALID
)
184 T(RU
, -0x1p
-128, nan
, 0x0p
+0, INVALID
)
185 T(RU
, -0x1p
-127, nan
, 0x0p
+0, INVALID
)
186 T(RU
,-0x1.fffff8p
-127, nan
, 0x0p
+0, INVALID
)
187 T(RU
,-0x1.fffffcp
-127, nan
, 0x0p
+0, INVALID
)
188 T(RU
, -0x1p
-126, nan
, 0x0p
+0, INVALID
)
189 T(RU
,-0x1.000002p
-126, nan
, 0x0p
+0, INVALID
)
190 T(RU
,-0x1.000004p
-126, nan
, 0x0p
+0, INVALID
)
191 T(RU
, -0x1p
-125, nan
, 0x0p
+0, INVALID
)
192 T(RU
, -0x1p
-124, nan
, 0x0p
+0, INVALID
)
193 T(RU
, -0x1p
-23, nan
, 0x0p
+0, INVALID
)
194 T(RU
, -0x1p
-21, nan
, 0x0p
+0, INVALID
)
195 T(RU
, -0x1p
-2, nan
, 0x0p
+0, INVALID
)
196 T(RU
, -0x1p
-1, nan
, 0x0p
+0, INVALID
)
197 T(RU
, -0x1.fffff4p
-1, nan
, 0x0p
+0, INVALID
)
198 T(RU
, -0x1.fffff8p
-1, nan
, 0x0p
+0, INVALID
)
199 T(RU
, -0x1.fffffcp
-1, nan
, 0x0p
+0, INVALID
)
200 T(RU
, -0x1.fffffep
-1, nan
, 0x0p
+0, INVALID
)
201 T(RU
, -0x1p
+0, nan
, 0x0p
+0, INVALID
)
202 T(RU
, -0x1.000002p
+0, nan
, 0x0p
+0, INVALID
)
203 T(RU
, -0x1.000004p
+0, nan
, 0x0p
+0, INVALID
)
204 T(RU
, -0x1.000008p
+0, nan
, 0x0p
+0, INVALID
)
205 T(RU
, -0x1p
+1, nan
, 0x0p
+0, INVALID
)
206 T(RU
, -0x1.000004p
+1, nan
, 0x0p
+0, INVALID
)
207 T(RU
, -0x1.fffff6p
+1, nan
, 0x0p
+0, INVALID
)
208 T(RU
, -0x1p
+2, nan
, 0x0p
+0, INVALID
)
209 T(RU
, -0x1p
+126, nan
, 0x0p
+0, INVALID
)
210 T(RU
,-0x1.000004p
+126, nan
, 0x0p
+0, INVALID
)
211 T(RU
,-0x1.000008p
+126, nan
, 0x0p
+0, INVALID
)
212 T(RU
, -0x1p
+127, nan
, 0x0p
+0, INVALID
)
213 T(RU
,-0x1.000004p
+127, nan
, 0x0p
+0, INVALID
)
214 T(RU
,-0x1.fffffcp
+127, nan
, 0x0p
+0, INVALID
)
215 T(RU
,-0x1.fffffep
+127, nan
, 0x0p
+0, INVALID
)
216 T(RU
, -inf
, nan
, 0x0p
+0, INVALID
)
217 T(RU
, 0x1.4p
+3, 0x1p
+0, 0x0p
+0, 0)
218 T(RU
, 0x1.9p
+6, 0x1p
+1, 0x0p
+0, 0)
219 T(RU
, 0x1.f4p
+9, 0x1.8p
+1, 0x0p
+0, 0)
220 T(RU
, 0x1.388p
+13, 0x1p
+2, 0x0p
+0, 0)
221 T(RZ
, inf
, inf
, 0x0p
+0, 0)
222 T(RZ
, 0x0p
+0, -inf
, 0x0p
+0, DIVBYZERO
)
223 T(RZ
, -0x0p
+0, -inf
, 0x0p
+0, DIVBYZERO
)
224 T(RZ
, nan
, nan
, 0x0p
+0, 0)
225 T(RZ
, nan
, nan
, 0x0p
+0, 0)
226 T(RZ
, -0x1p
-149, nan
, 0x0p
+0, INVALID
)
227 T(RZ
, -0x1p
-148, nan
, 0x0p
+0, INVALID
)
228 T(RZ
, -0x1.cp
-147, nan
, 0x0p
+0, INVALID
)
229 T(RZ
, -0x1p
-128, nan
, 0x0p
+0, INVALID
)
230 T(RZ
, -0x1p
-127, nan
, 0x0p
+0, INVALID
)
231 T(RZ
,-0x1.fffff8p
-127, nan
, 0x0p
+0, INVALID
)
232 T(RZ
,-0x1.fffffcp
-127, nan
, 0x0p
+0, INVALID
)
233 T(RZ
, -0x1p
-126, nan
, 0x0p
+0, INVALID
)
234 T(RZ
,-0x1.000002p
-126, nan
, 0x0p
+0, INVALID
)
235 T(RZ
,-0x1.000004p
-126, nan
, 0x0p
+0, INVALID
)
236 T(RZ
, -0x1p
-125, nan
, 0x0p
+0, INVALID
)
237 T(RZ
, -0x1p
-124, nan
, 0x0p
+0, INVALID
)
238 T(RZ
, -0x1p
-23, nan
, 0x0p
+0, INVALID
)
239 T(RZ
, -0x1p
-21, nan
, 0x0p
+0, INVALID
)
240 T(RZ
, -0x1p
-2, nan
, 0x0p
+0, INVALID
)
241 T(RZ
, -0x1p
-1, nan
, 0x0p
+0, INVALID
)
242 T(RZ
, -0x1.fffff4p
-1, nan
, 0x0p
+0, INVALID
)
243 T(RZ
, -0x1.fffff8p
-1, nan
, 0x0p
+0, INVALID
)
244 T(RZ
, -0x1.fffffcp
-1, nan
, 0x0p
+0, INVALID
)
245 T(RZ
, -0x1.fffffep
-1, nan
, 0x0p
+0, INVALID
)
246 T(RZ
, -0x1p
+0, nan
, 0x0p
+0, INVALID
)
247 T(RZ
, -0x1.000002p
+0, nan
, 0x0p
+0, INVALID
)
248 T(RZ
, -0x1.000004p
+0, nan
, 0x0p
+0, INVALID
)
249 T(RZ
, -0x1.000008p
+0, nan
, 0x0p
+0, INVALID
)
250 T(RZ
, -0x1p
+1, nan
, 0x0p
+0, INVALID
)
251 T(RZ
, -0x1.000004p
+1, nan
, 0x0p
+0, INVALID
)
252 T(RZ
, -0x1.fffff6p
+1, nan
, 0x0p
+0, INVALID
)
253 T(RZ
, -0x1p
+2, nan
, 0x0p
+0, INVALID
)
254 T(RZ
, -0x1p
+126, nan
, 0x0p
+0, INVALID
)
255 T(RZ
,-0x1.000004p
+126, nan
, 0x0p
+0, INVALID
)
256 T(RZ
,-0x1.000008p
+126, nan
, 0x0p
+0, INVALID
)
257 T(RZ
, -0x1p
+127, nan
, 0x0p
+0, INVALID
)
258 T(RZ
,-0x1.000004p
+127, nan
, 0x0p
+0, INVALID
)
259 T(RZ
,-0x1.fffffcp
+127, nan
, 0x0p
+0, INVALID
)
260 T(RZ
,-0x1.fffffep
+127, nan
, 0x0p
+0, INVALID
)
261 T(RZ
, -inf
, nan
, 0x0p
+0, INVALID
)
262 T(RZ
, 0x1.4p
+3, 0x1p
+0, 0x0p
+0, 0)
263 T(RZ
, 0x1.9p
+6, 0x1p
+1, 0x0p
+0, 0)
264 T(RZ
, 0x1.f4p
+9, 0x1.8p
+1, 0x0p
+0, 0)
265 T(RZ
, 0x1.388p
+13, 0x1p
+2, 0x0p
+0, 0)