1 /* file: libm_error.c */
4 // Copyright (c) 2000 - 2005, Intel Corporation
5 // All rights reserved.
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are
12 // * Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
15 // * Redistributions in binary form must reproduce the above copyright
16 // notice, this list of conditions and the following disclaimer in the
17 // documentation and/or other materials provided with the distribution.
19 // * The name of Intel Corporation may not be used to endorse or promote
20 // products derived from this software without specific prior written
24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
28 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
32 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
33 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 // Intel Corporation is the author of this code, and requests that all
37 // problem reports or change requests be submitted to it directly at
38 // http://www.intel.com/software/products/opensource/libraries/num.htm.
41 //==============================================================
42 // 2/02/00: Initial version
43 // 3/22/00: Updated to support flexible and dynamic error handling.
44 // 8/16/00: Changed all matherr function-calls to use the pmatherr
46 // 10/03/00: Corrected a scalb type.
47 // 11/28/00: Changed INPUT_XL to INPUT_XD for scalb_underflow case.
48 // 12/07/00: Added code to make scalbn error support equivalent to ldexp.
49 // 2/07/01: Added __declspec(align(16)) to long double constants to correct
51 // 4/23/01: Added code for remquo
52 // 6/07/01: Added code for fdim, lrint, lround, llrint, llround
53 // Deleted code for remquo
54 // 8/15/01: Added code for scalbln, nexttoward
55 // 12/10/01: Added code for erfc
56 // 12/27/01: Added code for degree argument functions
57 // 01/02/02: Added code for tand, cotd
58 // 01/15/02: Corrected SVID/XOPEN code for log1p, pow, and acosh
59 // 01/25/02: Corrected ISOC for lgamma and gamma to return EDOM for neg ints
60 // 01/28/02: Corrected SVID/XOPEN stderr message for log2
61 // 05/20/02: Added code for cot
62 // 07/01/02: Added code for sinhcosh
63 // 10/04/02: Underflow detection in ISOC path redefined to
64 // be zero rather than tiny and inexact
65 // 12/06/02: Added code for annuity and compound
66 // 01/30/03: Corrected test for underflow in ISOC path to not set denormal
67 // 04/10/03: Corrected ISOC branch for gamma/lgamma to return ERANGE for neg ints.
68 // Added code for tgamma
69 // 04/11/03: Corrected POSIX/SVID/XOPEN branches for gamma/lgamma
70 // to return EDOM for neg ints.
71 // 09/08/03: Corrected XOPEN/SVID result for pow overflow with neg x, pos y.
72 // 10/14/03: Added ILP32 ifdef
73 // 12/12/03: Corrected XOPEN/SVID results for powf_zero_to_negative,
74 // powl_neg_to_non_integer, atan2f_zero, atan2df_zero,
75 // acoshf_lt_one, acosh_lt_one.
76 // 12/07/04: Cast name strings as char *.
77 // 12/08/04: Corrected POSIX behavior for atan2_zero, acos_gt_one, asin_gt_one,
78 // log_negative, log10_negative, log1p_negative, and log2_negative.
79 // Added SVID and XOPEN case log2l_zero.
80 // 12/13/04: Corrected POSIX behavior for exp2_overflow, exp2_underflow,
81 // exp10_overflow, exp10_underflow. Added ISOC to set errno for
83 // 12/14/04: Corrected POSIX behavior for nextafter_overflow,
84 // nextafter_underflow, nexttoward_overflow, nexttoward_underflow.
85 // Added ISOC to set errno for nextafter and nexttoward underflow.
86 // 12/15/04: Corrected POSIX behavior for exp, exp2, and exp10 underflow.
87 // 03/31/05: Added missing ALIGNIT statement to 6 float constants.
92 #include "libm_support.h"
93 #include <math-svid-compat.h>
96 # define pmatherr matherr
97 # define pmatherrf matherrf
98 # define pmatherrl matherrl
100 compat_symbol_reference (libm
, matherrf
, matherrf
, GLIBC_2_2_3
);
101 compat_symbol_reference (libm
, matherrl
, matherrl
, GLIBC_2_2_3
);
103 # define matherrf(EXC) ((void) (EXC), 0)
104 # define matherrl(EXC) ((void) (EXC), 0)
108 #if defined( __POSIX__ )
109 _LIB_VERSIONIMF
= _POSIX_
;
110 #elif defined( __XOPEN__ )
111 _LIB_VERSIONIMF
= _XOPEN_
;
112 #elif defined( __SVID__ )
113 _LIB_VERSIONIMF
= _SVID_
;
114 #elif defined( __IEEE__ )
115 _LIB_VERSIONIMF
= _IEEE_
;
117 _LIB_VERSIONIMF
= _ISOC_
;
120 /************************************************************/
121 /* matherrX function pointers and setusermatherrX functions */
122 /************************************************************/
123 int (*pmatherrf
)(struct exceptionf
*) = MATHERR_F
;
124 int (*pmatherr
)(struct EXC_DECL_D
*) = MATHERR_D
;
125 int (*pmatherrl
)(struct exceptionl
*) = matherrl
;
127 void __libm_setusermatherrf( int(*user_merrf
)(struct exceptionf
*) )
128 { pmatherrf
= ( (user_merrf
==NULL
)? (MATHERR_F
) : (user_merrf
) ); }
130 void __libm_setusermatherr( int(*user_merr
)(struct EXC_DECL_D
*) )
131 { pmatherr
= ( (user_merr
==NULL
)? (MATHERR_D
) : (user_merr
) ); }
133 void __libm_setusermatherrl( int(*user_merrl
)(struct exceptionl
*) )
134 { pmatherrl
= ( (user_merrl
==NULL
)? (matherrl
) : (user_merrl
) ); }
138 /***********************************************/
139 /* error-handling function, libm_error_support */
140 /***********************************************/
141 void __libm_error_support(void *arg1
,void *arg2
,void *retval
,error_types input_tag
)
145 struct __exception exc
;
147 struct exception exc
;
150 struct exceptionf excf
;
151 struct exceptionl excl
;
154 #define ALIGNIT __attribute__ ((__aligned__ (16)))
155 # elif defined opensource
158 #define ALIGNIT __declspec(align(16))
161 # ifdef SIZE_LONG_INT_64
162 #define __INT_64__ signed long
165 #define __INT_64__ signed long long
167 #define __INT_64__ __int64
172 #define _DECL_NUM(type, prefix, var, bytes...) \
173 ALIGNIT static const union { \
174 const char _bytes[sizeof (type)]; \
176 } prefix ## var = { \
180 #define DECL_FLOAT(var, bytes...) \
181 _DECL_NUM (float, float_, var, ##bytes)
183 DECL_FLOAT(inf
, {0x00,0x00,0x80,0x7F});
184 DECL_FLOAT(huge
, {0xFF,0xFF,0x7F,0x7F});
185 DECL_FLOAT(zero
, {0x00,0x00,0x00,0x00});
186 DECL_FLOAT(neg_inf
, {0x00,0x00,0x80,0xFF});
187 DECL_FLOAT(neg_huge
, {0xFF,0xFF,0x7F,0xFF});
188 DECL_FLOAT(neg_zero
, {0x00,0x00,0x00,0x80});
190 #define DECL_DOUBLE(var, bytes...) \
191 _DECL_NUM (double, double_, var, ##bytes)
193 DECL_DOUBLE(inf
, {0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x7F});
195 DECL_DOUBLE(huge
, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0x7F});
197 DECL_DOUBLE(zero
, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
198 DECL_DOUBLE(neg_inf
, {0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xFF});
200 DECL_DOUBLE(neg_huge
, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF});
202 DECL_DOUBLE(neg_zero
, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80});
204 #define DECL_LONG_DOUBLE(var, bytes...) \
205 _DECL_NUM (long double, long_double_, var, ##bytes)
207 DECL_LONG_DOUBLE(inf
, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0x7F,0x00,0x00,0x00,0x00,0x00,0x00});
209 DECL_LONG_DOUBLE(huge
, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x7F,0x00,0x00,0x00,0x00,0x00,0x00});
211 DECL_LONG_DOUBLE(zero
, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
212 DECL_LONG_DOUBLE(neg_inf
, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00});
214 DECL_LONG_DOUBLE(neg_huge
, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x00,0x00,0x00,0x00,0x00,0x00});
216 DECL_LONG_DOUBLE(neg_zero
, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00});
219 #define RETVAL_HUGE_VALL *(long double *)retval = long_double_inf.num
220 #define RETVAL_NEG_HUGE_VALL *(long double *)retval = long_double_neg_inf.num
221 #define RETVAL_HUGEL *(long double *)retval = (long double)float_huge.num
222 #define RETVAL_NEG_HUGEL *(long double *)retval = (long double)float_neg_huge.num
224 #define RETVAL_HUGE_VALD *(double *)retval = double_inf.num
225 #define RETVAL_NEG_HUGE_VALD *(double *)retval = double_neg_inf.num
226 #define RETVAL_HUGED *(double *)retval = (double)float_huge.num
227 #define RETVAL_NEG_HUGED *(double *)retval = (double)float_neg_huge.num
229 #define RETVAL_HUGE_VALF *(float *)retval = float_inf.num
230 #define RETVAL_NEG_HUGE_VALF *(float *)retval = float_neg_inf.num
231 #define RETVAL_HUGEF *(float *)retval = float_huge.num
232 #define RETVAL_NEG_HUGEF *(float *)retval = float_neg_huge.num
234 #define ZEROL_VALUE long_double_zero.num
235 #define ZEROD_VALUE double_zero.num
236 #define ZEROF_VALUE float_zero.num
238 #define RETVAL_ZEROL *(long double *)retval = long_double_zero.num
239 #define RETVAL_ZEROD *(double *)retval = double_zero.num
240 #define RETVAL_ZEROF *(float *)retval = float_zero.num
242 #define RETVAL_NEG_ZEROL *(long double *)retval = long_double_neg_zero.num
243 #define RETVAL_NEG_ZEROD *(double *)retval = double_neg_zero.num
244 #define RETVAL_NEG_ZEROF *(float *)retval = float_neg_zero.num
246 #define RETVAL_ONEL *(long double *)retval = (long double) 1.0
247 #define RETVAL_ONED *(double *)retval = 1.0
248 #define RETVAL_ONEF *(float *)retval = 1.0f
250 #define NOT_MATHERRL excl.arg1=*(long double *)arg1;excl.arg2=*(long double *)arg2;excl.retval=*(long double *)retval;if(!pmatherrl(&excl))
251 #define NOT_MATHERRD exc.arg1=*(double *)arg1;exc.arg2=*(double *)arg2;exc.retval=*(double *)retval;if(!pmatherr(&exc))
252 #define NOT_MATHERRF excf.arg1=*(float *)arg1;excf.arg2=*(float *)arg2;excf.retval=*(float *)retval;if(!pmatherrf(&excf))
254 #define ifSVID if(_LIB_VERSIONIMF==_SVID_)
256 #define NAMEL excl.name
257 #define NAMED exc.name
258 #define NAMEF excf.name
261 // These should work OK for MS because they are ints -
262 // leading underbars are not necessary.
272 #define SINGL excl.type = SING
273 #define DOMAINL excl.type = DOMAIN
274 #define OVERFLOWL excl.type = OVERFLOW
275 #define UNDERFLOWL excl.type = UNDERFLOW
276 #define TLOSSL excl.type = TLOSS
277 #define SINGD exc.type = SING
278 #define DOMAIND exc.type = DOMAIN
279 #define OVERFLOWD exc.type = OVERFLOW
280 #define UNDERFLOWD exc.type = UNDERFLOW
281 #define TLOSSD exc.type = TLOSS
282 #define SINGF excf.type = SING
283 #define DOMAINF excf.type = DOMAIN
284 #define OVERFLOWF excf.type = OVERFLOW
285 #define UNDERFLOWF excf.type = UNDERFLOW
286 #define TLOSSF excf.type = TLOSS
288 #define INPUT_XL (excl.arg1=*(long double*)arg1)
289 #define INPUT_XD (exc.arg1=*(double*)arg1)
290 #define INPUT_XF (excf.arg1=*(float*)arg1)
291 #define INPUT_YL (excl.arg2=*(long double*)arg2)
292 #define INPUT_YD (exc.arg2=*(double*)arg2)
293 #define INPUT_YF (excf.arg2=*(float*)arg2)
294 #define INPUT_RESL (*(long double *)retval)
295 #define INPUT_RESD (*(double *)retval)
296 #define INPUT_RESF (*(float *)retval)
297 #define INPUT_RESI64 (*(__INT_64__ *)retval)
299 #define WRITEL_LOG_ZERO fputs("logl: SING error\n",stderr)
300 #define WRITED_LOG_ZERO fputs("log: SING error\n",stderr)
301 #define WRITEF_LOG_ZERO fputs("logf: SING error\n",stderr)
302 #define WRITEL_LOG_NEGATIVE fputs("logl: DOMAIN error\n",stderr)
303 #define WRITED_LOG_NEGATIVE fputs("log: DOMAIN error\n",stderr)
304 #define WRITEF_LOG_NEGATIVE fputs("logf: DOMAIN error\n",stderr)
305 #define WRITEL_Y0_ZERO fputs("y0l: DOMAIN error\n",stderr)
306 #define WRITED_Y0_ZERO fputs("y0: DOMAIN error\n",stderr)
307 #define WRITEF_Y0_ZERO fputs("y0f: DOMAIN error\n",stderr)
308 #define WRITEL_Y0_NEGATIVE fputs("y0l: DOMAIN error\n",stderr)
309 #define WRITED_Y0_NEGATIVE fputs("y0: DOMAIN error\n",stderr)
310 #define WRITEF_Y0_NEGATIVE fputs("y0f: DOMAIN error\n",stderr)
311 #define WRITEL_Y1_ZERO fputs("y1l: DOMAIN error\n",stderr)
312 #define WRITED_Y1_ZERO fputs("y1: DOMAIN error\n",stderr)
313 #define WRITEF_Y1_ZERO fputs("y1f: DOMAIN error\n",stderr)
314 #define WRITEL_Y1_NEGATIVE fputs("y1l: DOMAIN error\n",stderr)
315 #define WRITED_Y1_NEGATIVE fputs("y1: DOMAIN error\n",stderr)
316 #define WRITEF_Y1_NEGATIVE fputs("y1f: DOMAIN error\n",stderr)
317 #define WRITEL_YN_ZERO fputs("ynl: DOMAIN error\n",stderr)
318 #define WRITED_YN_ZERO fputs("yn: DOMAIN error\n",stderr)
319 #define WRITEF_YN_ZERO fputs("ynf: DOMAIN error\n",stderr)
320 #define WRITEL_YN_NEGATIVE fputs("ynl: DOMAIN error\n",stderr)
321 #define WRITED_YN_NEGATIVE fputs("yn: DOMAIN error\n",stderr)
322 #define WRITEF_YN_NEGATIVE fputs("ynf: DOMAIN error\n",stderr)
323 #define WRITEL_LOG1P_ZERO fputs("log1pl: SING error\n",stderr)
324 #define WRITED_LOG1P_ZERO fputs("log1p: SING error\n",stderr)
325 #define WRITEF_LOG1P_ZERO fputs("log1pf: SING error\n",stderr)
326 #define WRITEL_LOG1P_NEGATIVE fputs("log1pl: DOMAIN error\n",stderr)
327 #define WRITED_LOG1P_NEGATIVE fputs("log1p: DOMAIN error\n",stderr)
328 #define WRITEF_LOG1P_NEGATIVE fputs("log1pf: DOMAIN error\n",stderr)
329 #define WRITEL_LOG10_ZERO fputs("log10l: SING error\n",stderr)
330 #define WRITED_LOG10_ZERO fputs("log10: SING error\n",stderr)
331 #define WRITEF_LOG10_ZERO fputs("log10f: SING error\n",stderr)
332 #define WRITEL_LOG10_NEGATIVE fputs("log10l: DOMAIN error\n",stderr)
333 #define WRITED_LOG10_NEGATIVE fputs("log10: DOMAIN error\n",stderr)
334 #define WRITEF_LOG10_NEGATIVE fputs("log10f: DOMAIN error\n",stderr)
335 #define WRITEL_LOG2_ZERO fputs("log2l: SING error\n",stderr)
336 #define WRITED_LOG2_ZERO fputs("log2: SING error\n",stderr)
337 #define WRITEF_LOG2_ZERO fputs("log2f: SING error\n",stderr)
338 #define WRITEL_LOG2_NEGATIVE fputs("log2l: DOMAIN error\n",stderr)
339 #define WRITED_LOG2_NEGATIVE fputs("log2: DOMAIN error\n",stderr)
340 #define WRITEF_LOG2_NEGATIVE fputs("log2f: DOMAIN error\n",stderr)
341 #define WRITEL_POW_ZERO_TO_ZERO fputs("powl(0,0): DOMAIN error\n",stderr)
342 #define WRITED_POW_ZERO_TO_ZERO fputs("pow(0,0): DOMAIN error\n",stderr)
343 #define WRITEF_POW_ZERO_TO_ZERO fputs("powf(0,0): DOMAIN error\n",stderr)
344 #define WRITEL_POW_ZERO_TO_NEGATIVE fputs("powl(0,negative): DOMAIN error\n",stderr)
345 #define WRITED_POW_ZERO_TO_NEGATIVE fputs("pow(0,negative): DOMAIN error\n",stderr)
346 #define WRITEF_POW_ZERO_TO_NEGATIVE fputs("powf(0,negative): DOMAIN error\n",stderr)
347 #define WRITEL_POW_NEG_TO_NON_INTEGER fputs("powl(negative,non-integer): DOMAIN error\n",stderr)
348 #define WRITED_POW_NEG_TO_NON_INTEGER fputs("pow(negative,non-integer): DOMAIN error\n",stderr)
349 #define WRITEF_POW_NEG_TO_NON_INTEGER fputs("powf(negative,non-integer): DOMAIN error\n",stderr)
350 #define WRITEL_ATAN2_ZERO_BY_ZERO fputs("atan2l: DOMAIN error\n",stderr)
351 #define WRITED_ATAN2_ZERO_BY_ZERO fputs("atan2: DOMAIN error\n",stderr)
352 #define WRITEF_ATAN2_ZERO_BY_ZERO fputs("atan2f: DOMAIN error\n",stderr)
353 #define WRITEL_SQRT fputs("sqrtl: DOMAIN error\n",stderr)
354 #define WRITED_SQRT fputs("sqrt: DOMAIN error\n",stderr)
355 #define WRITEF_SQRT fputs("sqrtf: DOMAIN error\n",stderr)
356 #define WRITEL_FMOD fputs("fmodl: DOMAIN error\n",stderr)
357 #define WRITED_FMOD fputs("fmod: DOMAIN error\n",stderr)
358 #define WRITEF_FMOD fputs("fmodf: DOMAIN error\n",stderr)
359 #define WRITEL_REM fputs("remainderl: DOMAIN error\n",stderr)
360 #define WRITED_REM fputs("remainder: DOMAIN error\n",stderr)
361 #define WRITEF_REM fputs("remainderf: DOMAIN error\n",stderr)
362 #define WRITEL_ACOS fputs("acosl: DOMAIN error\n",stderr)
363 #define WRITED_ACOS fputs("acos: DOMAIN error\n",stderr)
364 #define WRITEF_ACOS fputs("acosf: DOMAIN error\n",stderr)
365 #define WRITEL_ASIN fputs("asinl: DOMAIN error\n",stderr)
366 #define WRITED_ASIN fputs("asin: DOMAIN error\n",stderr)
367 #define WRITEF_ASIN fputs("asinf: DOMAIN error\n",stderr)
368 #define WRITEL_ACOSH fputs("acoshl: DOMAIN error\n",stderr)
369 #define WRITED_ACOSH fputs("acosh: DOMAIN error\n",stderr)
370 #define WRITEF_ACOSH fputs("acoshf: DOMAIN error\n",stderr)
371 #define WRITEL_ATANH_GT_ONE fputs("atanhl: DOMAIN error\n",stderr)
372 #define WRITED_ATANH_GT_ONE fputs("atanh: DOMAIN error\n",stderr)
373 #define WRITEF_ATANH_GT_ONE fputs("atanhf: DOMAIN error\n",stderr)
374 #define WRITEL_ATANH_EQ_ONE fputs("atanhl: SING error\n",stderr)
375 #define WRITED_ATANH_EQ_ONE fputs("atanh: SING error\n",stderr)
376 #define WRITEF_ATANH_EQ_ONE fputs("atanhf: SING error\n",stderr)
377 #define WRITEL_LGAMMA_NEGATIVE fputs("lgammal: SING error\n",stderr)
378 #define WRITED_LGAMMA_NEGATIVE fputs("lgamma: SING error\n",stderr)
379 #define WRITEF_LGAMMA_NEGATIVE fputs("lgammaf: SING error\n",stderr)
380 #define WRITEL_GAMMA_NEGATIVE fputs("gammal: SING error\n",stderr)
381 #define WRITED_GAMMA_NEGATIVE fputs("gamma: SING error\n",stderr)
382 #define WRITEF_GAMMA_NEGATIVE fputs("gammaf: SING error\n",stderr)
383 #define WRITEL_TGAMMA_NEGATIVE fputs("tgammal: SING error\n",stderr)
384 #define WRITED_TGAMMA_NEGATIVE fputs("tgamma: SING error\n",stderr)
385 #define WRITEF_TGAMMA_NEGATIVE fputs("tgammaf: SING error\n",stderr)
386 #define WRITEL_J0_TLOSS fputs("j0l: TLOSS error\n",stderr)
387 #define WRITEL_Y0_TLOSS fputs("y0l: TLOSS error\n",stderr)
388 #define WRITEL_J1_TLOSS fputs("j1l: TLOSS error\n",stderr)
389 #define WRITEL_Y1_TLOSS fputs("y1l: TLOSS error\n",stderr)
390 #define WRITEL_JN_TLOSS fputs("jnl: TLOSS error\n",stderr)
391 #define WRITEL_YN_TLOSS fputs("ynl: TLOSS error\n",stderr)
392 #define WRITED_J0_TLOSS fputs("j0: TLOSS error\n",stderr)
393 #define WRITED_Y0_TLOSS fputs("y0: TLOSS error\n",stderr)
394 #define WRITED_J1_TLOSS fputs("j1: TLOSS error\n",stderr)
395 #define WRITED_Y1_TLOSS fputs("y1: TLOSS error\n",stderr)
396 #define WRITED_JN_TLOSS fputs("jn: TLOSS error\n",stderr)
397 #define WRITED_YN_TLOSS fputs("yn: TLOSS error\n",stderr)
398 #define WRITEF_J0_TLOSS fputs("j0f: TLOSS error\n",stderr)
399 #define WRITEF_Y0_TLOSS fputs("y0f: TLOSS error\n",stderr)
400 #define WRITEF_J1_TLOSS fputs("j1f: TLOSS error\n",stderr)
401 #define WRITEF_Y1_TLOSS fputs("y1f: TLOSS error\n",stderr)
402 #define WRITEF_JN_TLOSS fputs("jnf: TLOSS error\n",stderr)
403 #define WRITEF_YN_TLOSS fputs("ynf: TLOSS error\n",stderr)
404 #define WRITEL_ACOSD fputs("acosdl: DOMAIN error\n",stderr)
405 #define WRITED_ACOSD fputs("acosd: DOMAIN error\n",stderr)
406 #define WRITEF_ACOSD fputs("acosdf: DOMAIN error\n",stderr)
407 #define WRITEL_ASIND fputs("asindl: DOMAIN error\n",stderr)
408 #define WRITED_ASIND fputs("asind: DOMAIN error\n",stderr)
409 #define WRITEF_ASIND fputs("asindf: DOMAIN error\n",stderr)
410 #define WRITEL_ATAN2D_ZERO_BY_ZERO fputs("atan2dl: DOMAIN error\n",stderr)
411 #define WRITED_ATAN2D_ZERO_BY_ZERO fputs("atan2d: DOMAIN error\n",stderr)
412 #define WRITEF_ATAN2D_ZERO_BY_ZERO fputs("atan2df: DOMAIN error\n",stderr)
415 /***********************/
417 /***********************/
418 if(_LIB_VERSIONIMF
==_IEEE_
) return;
420 /***********************/
422 /***********************/
423 else if(_LIB_VERSIONIMF
==_ISOC_
)
448 case exp10l_overflow
:
450 case exp10f_overflow
:
451 case expm1l_overflow
:
453 case expm1f_overflow
:
454 case hypotl_overflow
:
456 case hypotf_overflow
:
463 case scalbl_overflow
:
465 case scalbf_overflow
:
469 case nextafterl_overflow
:
470 case nextafter_overflow
:
471 case nextafterf_overflow
:
472 case nextafterl_underflow
:
473 case nextafter_underflow
:
474 case nextafterf_underflow
:
475 case nexttowardl_overflow
:
476 case nexttoward_overflow
:
477 case nexttowardf_overflow
:
478 case nexttowardl_underflow
:
479 case nexttoward_underflow
:
480 case nexttowardf_underflow
:
481 case scalbnl_overflow
:
482 case scalbn_overflow
:
483 case scalbnf_overflow
:
484 case scalblnl_overflow
:
485 case scalbln_overflow
:
486 case scalblnf_overflow
:
487 case ldexpl_overflow
:
489 case ldexpf_overflow
:
490 case lgammal_overflow
:
491 case lgamma_overflow
:
492 case lgammaf_overflow
:
493 case gammal_overflow
:
495 case gammaf_overflow
:
496 case lgammal_negative
:
497 case lgamma_negative
:
498 case lgammaf_negative
:
499 case gammal_negative
:
501 case gammaf_negative
:
529 case sinhcoshl_overflow
:
530 case sinhcosh_overflow
:
531 case sinhcoshf_overflow
:
532 case annuityl_overflow
:
533 case annuity_overflow
:
534 case annuityf_overflow
:
535 case compoundl_overflow
:
536 case compound_overflow
:
537 case compoundf_overflow
:
538 case tgammal_overflow
:
539 case tgamma_overflow
:
540 case tgammaf_overflow
:
546 case exp10l_underflow
:
547 case exp2l_underflow
:
548 case scalbl_underflow
:
549 case scalbnl_underflow
:
550 case scalblnl_underflow
:
551 case ldexpl_underflow
:
552 case erfcl_underflow
:
553 case annuityl_underflow
:
554 case compoundl_underflow
:
556 /* Test for zero by testing 64 significand bits for zero. An integer
557 test is needed so denormal flag is not set by a floating-point test */
558 if ( INPUT_RESI64
== 0 ) ERRNO_RANGE
;
563 case exp10_underflow
:
565 case scalb_underflow
:
566 case scalbn_underflow
:
567 case scalbln_underflow
:
568 case ldexp_underflow
:
570 case annuity_underflow
:
571 case compound_underflow
:
573 /* Test for zero by testing exp and significand bits for zero. An integer
574 test is needed so denormal flag is not set by a floating-point test */
575 if ( (INPUT_RESI64
<< 1) == 0 ) ERRNO_RANGE
;
580 case exp10f_underflow
:
581 case exp2f_underflow
:
582 case scalbf_underflow
:
583 case scalbnf_underflow
:
584 case scalblnf_underflow
:
585 case ldexpf_underflow
:
586 case erfcf_underflow
:
587 case annuityf_underflow
:
588 case compoundf_underflow
:
590 /* Test for zero by testing exp and significand bits for zero. An integer
591 test is needed so denormal flag is not set by a floating-point test */
592 if ( (INPUT_RESI64
<< 33) == 0 ) ERRNO_RANGE
;
598 case log10l_negative
:
600 case log10f_negative
:
604 case log1pl_negative
:
606 case log1pf_negative
:
613 case powl_zero_to_negative
:
614 case powl_neg_to_non_integer
:
615 case pow_zero_to_negative
:
616 case pow_neg_to_non_integer
:
617 case powf_zero_to_negative
:
618 case powf_neg_to_non_integer
:
664 case annuityl_by_zero
:
665 case annuity_by_zero
:
666 case annuityf_by_zero
:
667 case annuityl_less_m1
:
668 case annuity_less_m1
:
669 case annuityf_less_m1
:
670 case compoundl_by_zero
:
671 case compound_by_zero
:
672 case compoundf_by_zero
:
673 case compoundl_less_m1
:
674 case compound_less_m1
:
675 case compoundf_less_m1
:
676 case tgammal_negative
:
677 case tgamma_negative
:
678 case tgammaf_negative
:
688 /***********************/
690 /***********************/
692 else if(_LIB_VERSIONIMF
==_POSIX_
)
696 case gammal_overflow
:
697 case lgammal_overflow
:
698 case tgammal_overflow
:
700 RETVAL_HUGE_VALL
; ERRNO_RANGE
; break;
703 case lgamma_overflow
:
704 case tgamma_overflow
:
706 RETVAL_HUGE_VALD
; ERRNO_RANGE
; break;
708 case gammaf_overflow
:
709 case lgammaf_overflow
:
710 case tgammaf_overflow
:
712 RETVAL_HUGE_VALF
; ERRNO_RANGE
; break;
714 case gammal_negative
:
716 case gammaf_negative
:
717 case lgammal_negative
:
718 case lgamma_negative
:
719 case lgammaf_negative
:
720 case tgammal_negative
:
721 case tgamma_negative
:
722 case tgammaf_negative
:
726 case ldexpl_overflow
:
727 case ldexpl_underflow
:
729 case ldexp_underflow
:
730 case ldexpf_overflow
:
731 case ldexpf_underflow
:
732 case scalbnl_overflow
:
733 case scalbnl_underflow
:
734 case scalbn_overflow
:
735 case scalbn_underflow
:
736 case scalbnf_overflow
:
737 case scalbnf_underflow
:
738 case scalblnl_overflow
:
739 case scalblnl_underflow
:
740 case scalbln_overflow
:
741 case scalbln_underflow
:
742 case scalblnf_overflow
:
743 case scalblnf_underflow
:
753 case sinhcoshl_overflow
:
754 case sinhcosh_overflow
:
755 case sinhcoshf_overflow
:
756 case nextafterl_overflow
:
757 case nextafter_overflow
:
758 case nextafterf_overflow
:
759 case nextafterl_underflow
:
760 case nextafter_underflow
:
761 case nextafterf_underflow
:
762 case nexttowardl_overflow
:
763 case nexttoward_overflow
:
764 case nexttowardf_overflow
:
765 case nexttowardl_underflow
:
766 case nexttoward_underflow
:
767 case nexttowardf_underflow
:
773 /* atanhl(|x| >= 1) */
779 /* atanh(|x| >= 1) */
785 /* atanhf(|x| >= 1) */
811 RETVAL_NEG_HUGE_VALL
; ERRNO_DOMAIN
; break;
820 RETVAL_NEG_HUGE_VALD
; ERRNO_DOMAIN
; break;
829 RETVAL_NEG_HUGE_VALF
; ERRNO_DOMAIN
; break;
839 RETVAL_NEG_HUGE_VALL
;
850 RETVAL_NEG_HUGE_VALD
; ERRNO_DOMAIN
; break;
859 RETVAL_NEG_HUGE_VALF
; ERRNO_DOMAIN
; break;
870 RETVAL_NEG_HUGE_VALL
; ERRNO_RANGE
; break;
881 RETVAL_NEG_HUGE_VALD
; ERRNO_RANGE
; break;
892 RETVAL_NEG_HUGE_VALF
; ERRNO_RANGE
; break;
895 case log1pl_negative
:
896 case log10l_negative
:
917 case log1pf_negative
:
918 case log10f_negative
:
928 case exp10l_overflow
:
931 /* exp10l overflow */
934 RETVAL_HUGE_VALL
; ERRNO_RANGE
; break;
943 RETVAL_HUGE_VALD
; ERRNO_RANGE
; break;
946 case exp10f_overflow
:
950 RETVAL_HUGE_VALF
; ERRNO_RANGE
; break;
953 case exp10l_underflow
:
954 case exp2l_underflow
:
956 /* exp10l underflow */
957 /* exp2l underflow */
962 case exp10_underflow
:
965 /* exp10 underflow */
971 case exp10f_underflow
:
972 case exp2f_underflow
:
974 /* exp10f underflow */
975 /* exp2f underflow */
985 /* jn and yn doubl-extended> XLOSS */
987 RETVAL_ZEROL
; ERRNO_RANGE
; break;
995 /* jn and yn double > XLOSS */
997 RETVAL_ZEROD
; ERRNO_RANGE
; break;
1005 /* j0n and y0n > XLOSS */
1007 RETVAL_ZEROF
; ERRNO_RANGE
; break;
1009 case powl_zero_to_zero
:
1014 case pow_zero_to_zero
:
1019 case powf_zero_to_zero
:
1025 case annuityl_overflow
:
1026 case compoundl_overflow
:
1027 /* powl(x,y) overflow */
1029 if (INPUT_RESL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_HUGE_VALL
;
1030 else RETVAL_HUGE_VALL
;
1034 case annuity_overflow
:
1035 case compound_overflow
:
1036 /* pow(x,y) overflow */
1038 if (INPUT_RESD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_HUGE_VALD
;
1039 else RETVAL_HUGE_VALD
;
1043 case annuityf_overflow
:
1044 case compoundf_overflow
:
1045 /* powf(x,y) overflow */
1047 if (INPUT_RESF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_HUGE_VALF
;
1048 else RETVAL_HUGE_VALF
;
1051 case powl_underflow
:
1052 case annuityl_underflow
:
1053 case compoundl_underflow
:
1054 /* powl(x,y) underflow */
1056 RETVAL_ZEROL
; ERRNO_RANGE
; break;
1059 case annuity_underflow
:
1060 case compound_underflow
:
1061 /* pow(x,y) underflow */
1063 RETVAL_ZEROD
; ERRNO_RANGE
; break;
1065 case powf_underflow
:
1066 case annuityf_underflow
:
1067 case compoundf_underflow
:
1068 /* powf(x,y) underflow */
1070 RETVAL_ZEROF
; ERRNO_RANGE
; break;
1072 case annuityl_by_zero
:
1073 case annuityl_less_m1
:
1074 case compoundl_by_zero
:
1075 case compoundl_less_m1
:
1076 case annuity_by_zero
:
1077 case annuity_less_m1
:
1078 case compound_by_zero
:
1079 case compound_less_m1
:
1080 case annuityf_by_zero
:
1081 case annuityf_less_m1
:
1082 case compoundf_by_zero
:
1083 case compoundf_less_m1
:
1085 ERRNO_DOMAIN
; break;
1087 case powl_zero_to_negative
:
1090 ERRNO_DOMAIN
; break;
1092 case pow_zero_to_negative
:
1095 ERRNO_DOMAIN
; break;
1097 case powf_zero_to_negative
:
1100 ERRNO_DOMAIN
; break;
1102 case powl_neg_to_non_integer
:
1103 /* neg**non_integral */
1105 ERRNO_DOMAIN
; break;
1107 case pow_neg_to_non_integer
:
1108 /* neg**non_integral */
1110 ERRNO_DOMAIN
; break;
1112 case powf_neg_to_non_integer
:
1113 /* neg**non-integral */
1115 ERRNO_DOMAIN
; break;
1117 case powl_nan_to_zero
:
1123 case pow_nan_to_zero
:
1128 case powf_nan_to_zero
:
1154 case expm1l_overflow
:
1155 /* expm1 overflow */
1159 case expm1_overflow
:
1160 /* expm1 overflow */
1164 case expm1f_overflow
:
1165 /* expm1f overflow */
1169 case expm1l_underflow
:
1170 /* expm1 underflow */
1174 case expm1_underflow
:
1175 /* expm1 underflow */
1179 case expm1f_underflow
:
1180 /* expm1f underflow */
1184 case hypotl_overflow
:
1185 /* hypotl overflow */
1187 RETVAL_HUGE_VALL
; ERRNO_RANGE
; break;
1189 case hypot_overflow
:
1190 /* hypot overflow */
1192 RETVAL_HUGE_VALD
; ERRNO_RANGE
; break;
1194 case hypotf_overflow
:
1195 /* hypotf overflow */
1197 RETVAL_HUGE_VALF
; ERRNO_RANGE
; break;
1199 case scalbl_underflow
:
1200 /* scalbl underflow */
1202 if (INPUT_XL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_ZEROL
;
1206 case scalb_underflow
:
1207 /* scalb underflow */
1209 if (INPUT_XD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_ZEROD
;
1213 case scalbf_underflow
:
1214 /* scalbf underflow */
1216 if (INPUT_XF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_ZEROF
;
1220 case scalbl_overflow
:
1221 /* scalbl overflow */
1223 if (INPUT_XL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_HUGE_VALL
;
1224 else RETVAL_HUGE_VALL
;
1227 case scalb_overflow
:
1228 /* scalb overflow */
1230 if (INPUT_XD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_HUGE_VALD
;
1231 else RETVAL_HUGE_VALD
;
1234 case scalbf_overflow
:
1235 /* scalbf overflow */
1237 if (INPUT_XF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_HUGE_VALF
;
1238 else RETVAL_HUGE_VALF
;
1244 ERRNO_DOMAIN
; break;
1249 ERRNO_DOMAIN
; break;
1254 ERRNO_DOMAIN
; break;
1261 ERRNO_DOMAIN
; break;
1268 ERRNO_DOMAIN
; break;
1275 ERRNO_DOMAIN
; break;
1282 ERRNO_DOMAIN
; break;
1289 ERRNO_DOMAIN
; break;
1296 ERRNO_DOMAIN
; break;
1298 case remainderl_by_zero
:
1302 ERRNO_DOMAIN
; break;
1304 case remainder_by_zero
:
1308 ERRNO_DOMAIN
; break;
1310 case remainderf_by_zero
:
1314 ERRNO_DOMAIN
; break;
1316 case coshl_overflow
:
1317 /* coshl overflows */
1319 RETVAL_HUGE_VALL
; ERRNO_RANGE
; break;
1322 /* cosh overflows */
1324 RETVAL_HUGE_VALD
; ERRNO_RANGE
; break;
1326 case coshf_overflow
:
1327 /* coshf overflows */
1329 RETVAL_HUGE_VALF
; ERRNO_RANGE
; break;
1331 case sinhl_overflow
:
1332 /* sinhl overflows */
1334 if (INPUT_XL
> ZEROL_VALUE
/*0*/) RETVAL_HUGE_VALL
;
1335 else RETVAL_NEG_HUGE_VALL
;
1339 /* sinh overflows */
1341 if (INPUT_XD
> ZEROD_VALUE
/*0*/) RETVAL_HUGE_VALD
;
1342 else RETVAL_NEG_HUGE_VALD
;
1345 case sinhf_overflow
:
1346 /* sinhf overflows */
1348 if (INPUT_XF
> ZEROF_VALUE
/*0*/) RETVAL_HUGE_VALF
;
1349 else RETVAL_NEG_HUGE_VALF
;
1355 ERRNO_DOMAIN
; break;
1360 ERRNO_DOMAIN
; break;
1365 ERRNO_DOMAIN
; break;
1389 /*******************************/
1390 /* __SVID__ and __XOPEN__ Path */
1391 /*******************************/
1396 case ldexpl_overflow
:
1397 case ldexpl_underflow
:
1398 case ldexp_overflow
:
1399 case ldexp_underflow
:
1400 case ldexpf_overflow
:
1401 case ldexpf_underflow
:
1402 case scalbnl_overflow
:
1403 case scalbnl_underflow
:
1404 case scalbn_overflow
:
1405 case scalbn_underflow
:
1406 case scalbnf_overflow
:
1407 case scalbnf_underflow
:
1408 case scalblnl_overflow
:
1409 case scalblnl_underflow
:
1410 case scalbln_overflow
:
1411 case scalbln_underflow
:
1412 case scalblnf_overflow
:
1413 case scalblnf_underflow
:
1414 case tandl_overflow
:
1416 case tandf_overflow
:
1417 case cotdl_overflow
:
1419 case cotdf_overflow
:
1423 case annuityl_overflow
:
1424 case annuityl_underflow
:
1425 case annuity_overflow
:
1426 case annuity_underflow
:
1427 case annuityf_overflow
:
1428 case annuityf_underflow
:
1429 case compoundl_overflow
:
1430 case compoundl_underflow
:
1431 case compound_overflow
:
1432 case compound_underflow
:
1433 case compoundf_overflow
:
1434 case compoundf_underflow
:
1438 case annuityl_by_zero
:
1439 case annuityl_less_m1
:
1440 case annuity_by_zero
:
1441 case annuity_less_m1
:
1442 case annuityf_by_zero
:
1443 case annuityf_less_m1
:
1444 case compoundl_by_zero
:
1445 case compoundl_less_m1
:
1446 case compound_by_zero
:
1447 case compound_less_m1
:
1448 case compoundf_by_zero
:
1449 case compoundf_less_m1
:
1451 ERRNO_DOMAIN
; break;
1453 case sqrtl_negative
:
1456 DOMAINL
; NAMEL
= (char *) "sqrtl";
1467 { /* NaN already computed */
1468 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1470 *(long double *)retval
= excl
.retval
;
1476 DOMAIND
; NAMED
= (char *) "sqrt";
1488 { /* NaN already computed */
1489 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1491 *(double *)retval
= exc
.retval
;
1494 case sqrtf_negative
:
1497 DOMAINF
; NAMEF
= (char *) "sqrtf";
1509 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1511 *(float *)retval
= excf
.retval
;
1517 SINGL
; NAMEL
= (char *) "logl";
1529 RETVAL_NEG_HUGE_VALL
;
1530 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1532 *(long double *)retval
= excl
.retval
;
1538 SINGD
; NAMED
= (char *) "log";
1550 RETVAL_NEG_HUGE_VALD
;
1551 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1553 *(double *)retval
= exc
.retval
;
1559 SINGF
; NAMEF
= (char *) "logf";
1571 RETVAL_NEG_HUGE_VALF
;
1572 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1574 *(float *)retval
= excf
.retval
;
1581 DOMAINL
; NAMEL
= (char *) "logl";
1587 WRITEL_LOG_NEGATIVE
;
1593 RETVAL_NEG_HUGE_VALL
;
1594 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1596 *(long double *)retval
= excl
.retval
;
1602 DOMAIND
; NAMED
= (char *) "log";
1608 WRITED_LOG_NEGATIVE
;
1614 RETVAL_NEG_HUGE_VALD
;
1615 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1617 *(double *)retval
= exc
.retval
;
1623 DOMAINF
; NAMEF
= (char *) "logf";
1629 WRITEF_LOG_NEGATIVE
;
1635 RETVAL_NEG_HUGE_VALF
;
1636 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1638 *(float *)retval
= excf
.retval
;
1644 SINGL
; NAMEL
= (char *) "log1pl";
1656 RETVAL_NEG_HUGE_VALL
;
1657 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1659 *(long double *)retval
= excl
.retval
;
1665 SINGD
; NAMED
= (char *) "log1p";
1677 RETVAL_NEG_HUGE_VALD
;
1678 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1680 *(double *)retval
= exc
.retval
;
1686 SINGF
; NAMEF
= (char *) "log1pf";
1698 RETVAL_NEG_HUGE_VALF
;
1699 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1701 *(float *)retval
= excf
.retval
;
1704 case log1pl_negative
:
1705 /* log1pl(x < -1) */
1707 DOMAINL
; NAMEL
= (char *) "log1pl";
1713 WRITEL_LOG1P_NEGATIVE
;
1719 RETVAL_NEG_HUGE_VALL
;
1720 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1722 *(long double *)retval
= excl
.retval
;
1725 case log1p_negative
:
1728 DOMAIND
; NAMED
= (char *) "log1p";
1734 WRITED_LOG1P_NEGATIVE
;
1740 RETVAL_NEG_HUGE_VALD
;
1741 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1743 *(double *)retval
= exc
.retval
;
1746 case log1pf_negative
:
1747 /* log1pf(x < -1) */
1749 DOMAINF
; NAMEF
= (char *) "log1pf";
1755 WRITEF_LOG1P_NEGATIVE
;
1761 RETVAL_NEG_HUGE_VALF
;
1762 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1764 *(float *)retval
= excf
.retval
;
1770 SINGL
; NAMEL
= (char *) "log10l";
1782 RETVAL_NEG_HUGE_VALL
;
1783 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1785 *(long double *)retval
= excl
.retval
;
1791 SINGD
; NAMED
= (char *) "log10";
1803 RETVAL_NEG_HUGE_VALD
;
1804 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1806 *(double *)retval
= exc
.retval
;
1812 SINGF
; NAMEF
= (char *) "log10f";
1824 RETVAL_NEG_HUGE_VALF
;
1825 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1827 *(float *)retval
= excf
.retval
;
1830 case log10l_negative
:
1833 DOMAINL
; NAMEL
= (char *) "log10l";
1839 WRITEL_LOG10_NEGATIVE
;
1845 RETVAL_NEG_HUGE_VALL
;
1846 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1848 *(long double *)retval
= excl
.retval
;
1851 case log10_negative
:
1854 DOMAIND
; NAMED
= (char *) "log10";
1860 WRITED_LOG10_NEGATIVE
;
1866 RETVAL_NEG_HUGE_VALD
;
1867 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1869 *(double *)retval
= exc
.retval
;
1872 case log10f_negative
:
1875 DOMAINF
; NAMEF
= (char *) "log10f";
1881 WRITEF_LOG10_NEGATIVE
;
1887 RETVAL_NEG_HUGE_VALF
;
1888 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1890 *(float *)retval
= excf
.retval
;
1896 SINGL
; NAMEL
= (char *) "log2l";
1908 RETVAL_NEG_HUGE_VALL
;
1909 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1911 *(long double *)retval
= excl
.retval
;
1917 SINGD
; NAMED
= (char *) "log2";
1929 RETVAL_NEG_HUGE_VALD
;
1930 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1932 *(double *)retval
= exc
.retval
;
1938 SINGF
; NAMEF
= (char *) "log2f";
1950 RETVAL_NEG_HUGE_VALF
;
1951 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1953 *(float *)retval
= excf
.retval
;
1956 case log2l_negative
:
1959 DOMAINL
; NAMEL
= (char *) "log2l";
1965 WRITEL_LOG2_NEGATIVE
;
1971 RETVAL_NEG_HUGE_VALL
;
1972 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1974 *(long double *)retval
= excl
.retval
;
1980 DOMAIND
; NAMED
= (char *) "log2";
1986 WRITED_LOG2_NEGATIVE
;
1992 RETVAL_NEG_HUGE_VALD
;
1993 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1995 *(double *)retval
= exc
.retval
;
1998 case log2f_negative
:
2001 DOMAINF
; NAMEF
= (char *) "log2f";
2007 WRITEF_LOG2_NEGATIVE
;
2013 RETVAL_NEG_HUGE_VALF
;
2014 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2016 *(float *)retval
= excf
.retval
;
2022 OVERFLOWL
; NAMEL
= (char *) "expl";
2031 NOT_MATHERRL
{ERRNO_RANGE
;}
2032 *(long double *)retval
= excl
.retval
;
2038 OVERFLOWD
; NAMED
= (char *) "exp";
2047 NOT_MATHERRD
{ERRNO_RANGE
;}
2048 *(double *)retval
= exc
.retval
;
2054 OVERFLOWF
; NAMEF
= (char *) "expf";
2063 NOT_MATHERRF
{ERRNO_RANGE
;}
2064 *(float *)retval
= excf
.retval
;
2067 case expl_underflow
:
2068 /* expl underflow */
2070 UNDERFLOWL
; NAMEL
= (char *) "expl"; RETVAL_ZEROL
;
2071 NOT_MATHERRL
{ERRNO_RANGE
;}
2072 *(long double *)retval
= excl
.retval
;
2078 UNDERFLOWD
; NAMED
= (char *) "exp"; RETVAL_ZEROD
;
2079 NOT_MATHERRD
{ERRNO_RANGE
;}
2080 *(double *)retval
= exc
.retval
;
2083 case expf_underflow
:
2084 /* expf underflow */
2086 UNDERFLOWF
; NAMEF
= (char *) "expf"; RETVAL_ZEROF
;
2087 NOT_MATHERRF
{ERRNO_RANGE
;}
2088 *(float *)retval
= excf
.retval
;
2091 case powl_zero_to_zero
:
2094 DOMAINL
; NAMEL
= (char *) "powl";
2100 WRITEL_POW_ZERO_TO_ZERO
;
2103 *(long double *)retval
= excl
.retval
;
2108 case pow_zero_to_zero
:
2111 DOMAIND
; NAMED
= (char *) "pow";
2117 WRITED_POW_ZERO_TO_ZERO
;
2120 *(double *)retval
= exc
.retval
;
2125 case powf_zero_to_zero
:
2128 DOMAINF
; NAMEF
= (char *) "powf";
2134 WRITEF_POW_ZERO_TO_ZERO
;
2137 *(float *)retval
= excf
.retval
;
2143 /* powl(x,y) overflow */
2145 OVERFLOWL
; NAMEL
= (char *) "powl";
2148 if (INPUT_RESL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_HUGEL
;
2153 if (INPUT_RESL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_HUGE_VALL
;
2154 else RETVAL_HUGE_VALL
;
2156 NOT_MATHERRL
{ERRNO_RANGE
;}
2157 *(long double *)retval
= excl
.retval
;
2161 /* pow(x,y) overflow */
2163 OVERFLOWD
; NAMED
= (char *) "pow";
2166 if (INPUT_RESD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_HUGED
;
2171 if (INPUT_RESD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_HUGE_VALD
;
2172 else RETVAL_HUGE_VALD
;
2174 NOT_MATHERRD
{ERRNO_RANGE
;}
2175 *(double *)retval
= exc
.retval
;
2179 /* powf(x,y) overflow */
2181 OVERFLOWF
; NAMEF
= (char *) "powf";
2184 if (INPUT_RESF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_HUGEF
;
2189 if (INPUT_RESF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_HUGE_VALF
;
2190 else RETVAL_HUGE_VALF
;
2192 NOT_MATHERRF
{ERRNO_RANGE
;}
2193 *(float *)retval
= excf
.retval
;
2196 case powl_underflow
:
2197 /* powl(x,y) underflow */
2199 UNDERFLOWL
; NAMEL
= (char *) "powl"; RETVAL_ZEROL
;
2200 NOT_MATHERRL
{ERRNO_RANGE
;}
2201 *(long double *)retval
= excl
.retval
;
2205 /* pow(x,y) underflow */
2207 UNDERFLOWD
; NAMED
= (char *) "pow"; RETVAL_ZEROD
;
2208 NOT_MATHERRD
{ERRNO_RANGE
;}
2209 *(double *)retval
= exc
.retval
;
2212 case powf_underflow
:
2213 /* powf(x,y) underflow */
2215 UNDERFLOWF
; NAMEF
= (char *) "powf"; RETVAL_ZEROF
;
2216 NOT_MATHERRF
{ERRNO_RANGE
;}
2217 *(float *)retval
= excf
.retval
;
2220 case powl_zero_to_negative
:
2223 DOMAINL
; NAMEL
= (char *) "powl";
2229 WRITEL_POW_ZERO_TO_NEGATIVE
;
2235 RETVAL_NEG_HUGE_VALL
;
2236 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2238 *(long double *)retval
= excl
.retval
;
2241 case pow_zero_to_negative
:
2244 DOMAIND
; NAMED
= (char *) "pow";
2250 WRITED_POW_ZERO_TO_NEGATIVE
;
2256 RETVAL_NEG_HUGE_VALD
;
2257 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2259 *(double *)retval
= exc
.retval
;
2262 case powf_zero_to_negative
:
2265 DOMAINF
; NAMEF
= (char *) "powf";
2271 WRITEF_POW_ZERO_TO_NEGATIVE
;
2277 RETVAL_NEG_HUGE_VALF
;
2278 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2280 *(float *)retval
= excf
.retval
;
2283 case powl_neg_to_non_integer
:
2284 /* neg**non_integral */
2286 DOMAINL
; NAMEL
= (char *) "powl";
2292 WRITEL_POW_NEG_TO_NON_INTEGER
;
2298 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2300 *(long double *)retval
= excl
.retval
;
2303 case pow_neg_to_non_integer
:
2304 /* neg**non_integral */
2306 DOMAIND
; NAMED
= (char *) "pow";
2312 WRITED_POW_NEG_TO_NON_INTEGER
;
2318 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2320 *(double *)retval
= exc
.retval
;
2323 case powf_neg_to_non_integer
:
2324 /* neg**non-integral */
2326 DOMAINF
; NAMEF
= (char *) "powf";
2332 WRITEF_POW_NEG_TO_NON_INTEGER
;
2338 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2340 *(float *)retval
= excf
.retval
;
2343 case powl_nan_to_zero
:
2347 DOMAINL
; NAMEL
= (char *) "powl";
2348 *(long double *)retval
= *(long double *)arg1
;
2349 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2350 *(long double *)retval
= excl
.retval
;
2353 case pow_nan_to_zero
:
2357 DOMAIND
; NAMED
= (char *) "pow";
2358 *(double *)retval
= *(double *)arg1
;
2359 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2360 *(double *)retval
= exc
.retval
;
2363 case powf_nan_to_zero
:
2367 DOMAINF
; NAMEF
= (char *) "powf";
2368 *(float *)retval
= *(float *)arg1
;
2369 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2370 *(float *)retval
= excf
.retval
;
2374 /* atan2l(0.0,0.0) */
2376 DOMAINL
; NAMEL
= (char *) "atan2l";
2382 WRITEL_ATAN2_ZERO_BY_ZERO
;
2386 *(long double *)retval
= excl
.retval
;
2390 /* atan2(0.0,0.0) */
2392 DOMAIND
; NAMED
= (char *) "atan2";
2398 WRITED_ATAN2_ZERO_BY_ZERO
;
2402 *(double *)retval
= exc
.retval
;
2406 /* atan2f(0.0,0.0) */
2408 DOMAINF
; NAMEF
= (char *) "atan2f";
2414 WRITEF_ATAN2_ZERO_BY_ZERO
;
2418 *(float *)retval
= excf
.retval
;
2422 /* atan2dl(0.0,0.0) */
2424 DOMAINL
; NAMEL
= (char *) "atan2dl";
2430 WRITEL_ATAN2D_ZERO_BY_ZERO
;
2434 *(long double *)retval
= excl
.retval
;
2438 /* atan2d(0.0,0.0) */
2440 DOMAIND
; NAMED
= (char *) "atan2d";
2446 WRITED_ATAN2D_ZERO_BY_ZERO
;
2450 *(double *)retval
= exc
.retval
;
2454 /* atan2df(0.0,0.0) */
2456 DOMAINF
; NAMEF
= (char *) "atan2df";
2462 WRITEF_ATAN2D_ZERO_BY_ZERO
;
2466 *(float *)retval
= excf
.retval
;
2469 case expm1_overflow
:
2470 /* expm1(finite) overflow */
2471 /* Overflow is the only documented */
2472 /* special value. */
2477 case expm1f_overflow
:
2478 /* expm1f(finite) overflow */
2483 case expm1_underflow
:
2484 /* expm1(finite) underflow */
2485 /* Underflow is not documented */
2486 /* special value. */
2491 case expm1f_underflow
:
2492 /* expm1f(finite) underflow */
2497 case scalbl_underflow
:
2498 /* scalbl underflow */
2500 UNDERFLOWL
; NAMEL
= (char *) "scalbl";
2501 if (INPUT_XL
< ZEROL_VALUE
/*0.0L*/) RETVAL_NEG_ZEROL
;
2503 NOT_MATHERRL
{ERRNO_RANGE
;}
2504 *(long double *)retval
= excl
.retval
;
2507 case scalb_underflow
:
2508 /* scalb underflow */
2510 UNDERFLOWD
; NAMED
= (char *) "scalb";
2511 if (INPUT_XD
< ZEROD_VALUE
/*0.0*/) RETVAL_NEG_ZEROD
;
2513 NOT_MATHERRD
{ERRNO_RANGE
;}
2514 *(double *)retval
= exc
.retval
;
2517 case scalbf_underflow
:
2518 /* scalbf underflow */
2520 UNDERFLOWF
; NAMEF
= (char *) "scalbf";
2521 if (INPUT_XF
< ZEROF_VALUE
/*0.0*/) RETVAL_NEG_ZEROF
;
2523 NOT_MATHERRF
{ERRNO_RANGE
;}
2524 *(float *)retval
= excf
.retval
;
2527 case scalbl_overflow
:
2528 /* scalbl overflow */
2530 OVERFLOWL
; NAMEL
= (char *) "scalbl";
2531 if (INPUT_XL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_HUGE_VALL
;
2532 else RETVAL_HUGE_VALL
;
2533 NOT_MATHERRL
{ERRNO_RANGE
;}
2534 *(long double *)retval
= excl
.retval
;
2537 case scalb_overflow
:
2538 /* scalb overflow */
2540 OVERFLOWD
; NAMED
= (char *) "scalb";
2541 if (INPUT_XD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_HUGE_VALD
;
2542 else RETVAL_HUGE_VALD
;
2543 NOT_MATHERRD
{ERRNO_RANGE
;}
2544 *(double *)retval
= exc
.retval
;
2547 case scalbf_overflow
:
2548 /* scalbf overflow */
2550 OVERFLOWF
; NAMEF
= (char *) "scalbf";
2551 if (INPUT_XF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_HUGE_VALF
;
2552 else RETVAL_HUGE_VALF
;
2553 NOT_MATHERRF
{ERRNO_RANGE
;}
2554 *(float *)retval
= excf
.retval
;
2557 case hypotl_overflow
:
2558 /* hypotl overflow */
2560 OVERFLOWL
; NAMEL
= (char *) "hypotl";
2569 NOT_MATHERRL
{ERRNO_RANGE
;}
2570 *(long double *)retval
= excl
.retval
;
2573 case hypot_overflow
:
2574 /* hypot overflow */
2576 OVERFLOWD
; NAMED
= (char *) "hypot";
2585 NOT_MATHERRD
{ERRNO_RANGE
;}
2586 *(double *)retval
= exc
.retval
;
2589 case hypotf_overflow
:
2590 /* hypotf overflow */
2592 OVERFLOWF
; NAMEF
= (char *) "hypotf";
2601 NOT_MATHERRF
{ERRNO_RANGE
;}
2602 *(float *)retval
= excf
.retval
;
2608 DOMAINL
; NAMEL
= (char *) "acosl";
2620 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2622 *(long double *)retval
= excl
.retval
;
2628 DOMAIND
; NAMED
= (char *) "acos";
2640 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2642 *(double *)retval
= exc
.retval
;
2648 DOMAINF
; NAMEF
= (char *) "acosf";
2660 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2662 *(float *)retval
= excf
.retval
;
2668 DOMAINL
; NAMEL
= (char *) "asinl";
2680 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2682 *(long double *)retval
= excl
.retval
;
2688 DOMAIND
; NAMED
= (char *) "asin";
2700 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2702 *(double *)retval
= exc
.retval
;
2708 DOMAINF
; NAMEF
= (char *) "asinf";
2720 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2722 *(float *)retval
= excf
.retval
;
2728 DOMAINL
; NAMEL
= (char *) "acosdl";
2740 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2742 *(long double *)retval
= excl
.retval
;
2748 DOMAIND
; NAMED
= (char *) "acosd";
2760 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2762 *(double *)retval
= exc
.retval
;
2768 DOMAINF
; NAMEF
= (char *) "acosdf";
2780 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2782 *(float *)retval
= excf
.retval
;
2788 DOMAINL
; NAMEL
= (char *) "asindl";
2800 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2802 *(long double *)retval
= excl
.retval
;
2808 DOMAIND
; NAMED
= (char *) "asind";
2820 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2822 *(double *)retval
= exc
.retval
;
2828 DOMAINF
; NAMEF
= (char *) "asindf";
2840 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2842 *(float *)retval
= excf
.retval
;
2845 case coshl_overflow
:
2846 /* coshl overflow */
2848 OVERFLOWL
; NAMEL
= (char *) "coshl";
2857 NOT_MATHERRL
{ERRNO_RANGE
;}
2858 *(long double *)retval
= excl
.retval
;
2864 OVERFLOWD
; NAMED
= (char *) "cosh";
2873 NOT_MATHERRD
{ERRNO_RANGE
;}
2874 *(double *)retval
= exc
.retval
;
2877 case coshf_overflow
:
2878 /* coshf overflow */
2880 OVERFLOWF
; NAMEF
= (char *) "coshf";
2889 NOT_MATHERRF
{ERRNO_RANGE
;}
2890 *(float *)retval
= excf
.retval
;
2893 case sinhl_overflow
:
2894 /* sinhl overflow */
2896 OVERFLOWL
; NAMEL
= (char *) "sinhl";
2899 if (INPUT_XL
> ZEROL_VALUE
/*0.0*/) RETVAL_HUGEL
;
2900 else RETVAL_NEG_HUGEL
;
2904 if (INPUT_XL
> ZEROL_VALUE
/*0.0*/) RETVAL_HUGE_VALL
;
2905 else RETVAL_NEG_HUGE_VALL
;
2907 NOT_MATHERRL
{ERRNO_RANGE
;}
2908 *(long double *)retval
= excl
.retval
;
2914 OVERFLOWD
; NAMED
= (char *) "sinh";
2917 if (INPUT_XD
> ZEROD_VALUE
/*0.0*/) RETVAL_HUGED
;
2918 else RETVAL_NEG_HUGED
;
2922 if (INPUT_XD
> ZEROD_VALUE
/*0.0*/) RETVAL_HUGE_VALD
;
2923 else RETVAL_NEG_HUGE_VALD
;
2925 NOT_MATHERRD
{ERRNO_RANGE
;}
2926 *(double *)retval
= exc
.retval
;
2929 case sinhf_overflow
:
2930 /* sinhf overflow */
2932 OVERFLOWF
; NAMEF
= (char *) "sinhf";
2935 if (INPUT_XF
> ZEROF_VALUE
/*0.0*/) RETVAL_HUGEF
;
2936 else RETVAL_NEG_HUGEF
;
2940 if (INPUT_XF
> ZEROF_VALUE
/*0.0*/) RETVAL_HUGE_VALF
;
2941 else RETVAL_NEG_HUGE_VALF
;
2943 NOT_MATHERRF
{ERRNO_RANGE
;}
2944 *(float *)retval
= excf
.retval
;
2950 DOMAINL
; NAMEL
= (char *) "acoshl";
2961 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2963 *(long double *)retval
= excl
.retval
;
2969 DOMAIND
; NAMED
= (char *) "acosh";
2980 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2982 *(double *)retval
= exc
.retval
;
2988 DOMAINF
; NAMEF
= (char *) "acoshf";
2999 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3001 *(float *)retval
= excf
.retval
;
3005 /* atanhl(|x| > 1) */
3007 DOMAINL
; NAMEL
= (char *) "atanhl";
3012 WRITEL_ATANH_GT_ONE
;
3018 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3023 /* atanh(|x| > 1) */
3025 DOMAIND
; NAMED
= (char *) "atanh";
3030 WRITED_ATANH_GT_ONE
;
3036 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3041 /* atanhf(|x| > 1) */
3043 DOMAINF
; NAMEF
= (char *) "atanhf";
3048 WRITEF_ATANH_GT_ONE
;
3054 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3059 /* atanhl(|x| == 1) */
3061 SINGL
; NAMEL
= (char *) "atanhl";
3066 WRITEL_ATANH_EQ_ONE
;
3072 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3077 /* atanh(|x| == 1) */
3079 SINGD
; NAMED
= (char *) "atanh";
3084 WRITED_ATANH_EQ_ONE
;
3090 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3095 /* atanhf(|x| == 1) */
3097 SINGF
; NAMEF
= (char *) "atanhf";
3102 WRITEF_ATANH_EQ_ONE
;
3108 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3112 case gammal_overflow
:
3113 /* gammal overflow */
3115 OVERFLOWL
; NAMEL
= (char *) "gammal";
3124 NOT_MATHERRL
{ERRNO_RANGE
;}
3125 *(long double *)retval
= excl
.retval
;
3128 case gamma_overflow
:
3129 /* gamma overflow */
3131 OVERFLOWD
; NAMED
= (char *) "gamma";
3140 NOT_MATHERRD
{ERRNO_RANGE
;}
3141 *(double *)retval
= exc
.retval
;
3144 case gammaf_overflow
:
3145 /* gammaf overflow */
3147 OVERFLOWF
; NAMEF
= (char *) "gammaf";
3156 NOT_MATHERRF
{ERRNO_RANGE
;}
3157 *(float *)retval
= excf
.retval
;
3160 case gammal_negative
:
3161 /* gammal -int or 0 */
3163 SINGL
; NAMEL
= (char *) "gammal";
3169 WRITEL_GAMMA_NEGATIVE
;
3176 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3178 *(long double *)retval
= excl
.retval
;
3181 case gamma_negative
:
3182 /* gamma -int or 0 */
3184 SINGD
; NAMED
= (char *) "gamma";
3190 WRITED_GAMMA_NEGATIVE
;
3197 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3199 *(double *)retval
= exc
.retval
;
3202 case gammaf_negative
:
3203 /* gammaf -int or 0 */
3205 SINGF
; NAMEF
= (char *) "gammaf";
3211 WRITEF_GAMMA_NEGATIVE
;
3218 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3220 *(float *)retval
= excf
.retval
;
3223 case lgammal_overflow
:
3224 /* lgammal overflow */
3226 OVERFLOWL
; NAMEL
= (char *) "lgammal";
3235 NOT_MATHERRL
{ERRNO_RANGE
;}
3236 *(long double *)retval
= excl
.retval
;
3239 case lgamma_overflow
:
3240 /* lgamma overflow */
3242 OVERFLOWD
; NAMED
= (char *) "lgamma";
3251 NOT_MATHERRD
{ERRNO_RANGE
;}
3252 *(double *)retval
= exc
.retval
;
3255 case lgammaf_overflow
:
3256 /* lgammaf overflow */
3258 OVERFLOWF
; NAMEF
= (char *) "lgammaf";
3267 NOT_MATHERRF
{ERRNO_RANGE
;}
3268 *(float *)retval
= excf
.retval
;
3271 case lgammal_negative
:
3272 /* lgammal -int or 0 */
3274 SINGL
; NAMEL
= (char *) "lgammal";
3280 WRITEL_LGAMMA_NEGATIVE
;
3287 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3289 *(long double *)retval
= excl
.retval
;
3292 case lgamma_negative
:
3293 /* lgamma -int or 0 */
3295 SINGD
; NAMED
= (char *) "lgamma";
3301 WRITED_LGAMMA_NEGATIVE
;
3308 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3310 *(double *)retval
= exc
.retval
;
3313 case lgammaf_negative
:
3314 /* lgammaf -int or 0 */
3316 SINGF
; NAMEF
= (char *) "lgammaf";
3322 WRITEF_LGAMMA_NEGATIVE
;
3329 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3331 *(float *)retval
= excf
.retval
;
3334 case tgammal_overflow
:
3335 /* tgammal overflow */
3337 OVERFLOWL
; NAMEL
= (char *) "tgammal";
3346 NOT_MATHERRL
{ERRNO_RANGE
;}
3347 *(long double *)retval
= excl
.retval
;
3350 case tgamma_overflow
:
3351 /* tgamma overflow */
3353 OVERFLOWD
; NAMED
= (char *) "tgamma";
3362 NOT_MATHERRD
{ERRNO_RANGE
;}
3363 *(double *)retval
= exc
.retval
;
3366 case tgammaf_overflow
:
3367 /* tgammaf overflow */
3369 OVERFLOWF
; NAMEF
= (char *) "tgammaf";
3378 NOT_MATHERRF
{ERRNO_RANGE
;}
3379 *(float *)retval
= excf
.retval
;
3382 case tgammal_negative
:
3383 /* tgammal -int or 0 */
3385 SINGL
; NAMEL
= (char *) "tgammal";
3390 WRITEL_TGAMMA_NEGATIVE
;
3396 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3398 *(long double *)retval
= excl
.retval
;
3401 case tgamma_negative
:
3402 /* tgamma -int or 0 */
3404 SINGD
; NAMED
= (char *) "tgamma";
3409 WRITED_TGAMMA_NEGATIVE
;
3415 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3417 *(double *)retval
= exc
.retval
;
3420 case tgammaf_negative
:
3421 /* tgammaf -int or 0 */
3423 SINGF
; NAMEF
= (char *) "tgammaf";
3428 WRITEF_TGAMMA_NEGATIVE
;
3434 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3436 *(float *)retval
= excf
.retval
;
3442 TLOSSL
; NAMEL
= (char *) "j0l";
3454 NOT_MATHERRL
{ERRNO_RANGE
;}
3456 *(long double *)retval
= excl
.retval
;
3462 TLOSSD
; NAMED
= (char *) "j0";
3474 NOT_MATHERRD
{ERRNO_RANGE
;}
3476 *(double*)retval
= exc
.retval
;
3482 TLOSSF
; NAMEF
= (char *) "j0f";
3494 NOT_MATHERRF
{ERRNO_RANGE
;}
3496 *(float*)retval
= excf
.retval
;
3502 TLOSSL
; NAMEL
= (char *) "j1l";
3514 NOT_MATHERRL
{ERRNO_RANGE
;}
3516 *(long double *)retval
= excl
.retval
;
3522 TLOSSD
; NAMED
= (char *) "j1";
3534 NOT_MATHERRD
{ERRNO_RANGE
;}
3536 *(double*)retval
= exc
.retval
;
3542 TLOSSF
; NAMEF
= (char *) "j1f";
3554 NOT_MATHERRF
{ERRNO_RANGE
;}
3556 *(float*)retval
= excf
.retval
;
3562 TLOSSL
; NAMEL
= (char *) "jnl";
3574 NOT_MATHERRL
{ERRNO_RANGE
;}
3576 *(long double *)retval
= excl
.retval
;
3582 TLOSSD
; NAMED
= (char *) "jn";
3594 NOT_MATHERRD
{ERRNO_RANGE
;}
3596 *(double*)retval
= exc
.retval
;
3602 TLOSSF
; NAMEF
= (char *) "jnf";
3614 NOT_MATHERRF
{ERRNO_RANGE
;}
3616 *(float*)retval
= excf
.retval
;
3622 TLOSSL
; NAMEL
= (char *) "y0l";
3634 NOT_MATHERRL
{ERRNO_RANGE
;}
3636 *(long double *)retval
= excl
.retval
;
3642 TLOSSD
; NAMED
= (char *) "y0";
3654 NOT_MATHERRD
{ERRNO_RANGE
;}
3656 *(double*)retval
= exc
.retval
;
3662 TLOSSF
; NAMEF
= (char *) "y0f";
3674 NOT_MATHERRF
{ERRNO_RANGE
;}
3676 *(float*)retval
= excf
.retval
;
3682 DOMAINL
; NAMEL
= (char *) "y0l";
3694 RETVAL_NEG_HUGE_VALL
;
3695 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3697 *(long double *)retval
= excl
.retval
;
3703 DOMAIND
; NAMED
= (char *) "y0";
3715 RETVAL_NEG_HUGE_VALD
;
3716 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3718 *(double *)retval
= exc
.retval
;
3724 DOMAINF
; NAMEF
= (char *) "y0f";
3736 RETVAL_NEG_HUGE_VALF
;
3737 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3739 *(float *)retval
= excf
.retval
;
3745 TLOSSL
; NAMEL
= (char *) "y1l";
3757 NOT_MATHERRL
{ERRNO_RANGE
;}
3759 *(long double *)retval
= excl
.retval
;
3765 TLOSSD
; NAMED
= (char *) "y1";
3777 NOT_MATHERRD
{ERRNO_RANGE
;}
3779 *(double*)retval
= exc
.retval
;
3785 TLOSSF
; NAMEF
= (char *) "y1f";
3797 NOT_MATHERRF
{ERRNO_RANGE
;}
3799 *(float*)retval
= excf
.retval
;
3805 DOMAINL
; NAMEL
= (char *) "y1l";
3817 RETVAL_NEG_HUGE_VALL
;
3818 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3820 *(long double *)retval
= excl
.retval
;
3826 DOMAIND
; NAMED
= (char *) "y1";
3838 RETVAL_NEG_HUGE_VALD
;
3839 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3841 *(double *)retval
= exc
.retval
;
3847 DOMAINF
; NAMEF
= (char *) "y1f";
3859 RETVAL_NEG_HUGE_VALF
;
3860 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3862 *(float *)retval
= excf
.retval
;
3868 TLOSSL
; NAMEL
= (char *) "ynl";
3880 NOT_MATHERRL
{ERRNO_RANGE
;}
3882 *(long double *)retval
= excl
.retval
;
3888 TLOSSD
; NAMED
= (char *) "yn";
3900 NOT_MATHERRD
{ERRNO_RANGE
;}
3902 *(double*)retval
= exc
.retval
;
3908 TLOSSF
; NAMEF
= (char *) "ynf";
3920 NOT_MATHERRF
{ERRNO_RANGE
;}
3922 *(float*)retval
= excf
.retval
;
3928 DOMAINL
; NAMEL
= (char *) "ynl";
3940 RETVAL_NEG_HUGE_VALL
;
3941 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3943 *(long double *)retval
= excl
.retval
;
3949 DOMAIND
; NAMED
= (char *) "yn";
3961 RETVAL_NEG_HUGE_VALD
;
3962 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3964 *(double *)retval
= exc
.retval
;
3970 DOMAINF
; NAMEF
= (char *) "ynf";
3982 RETVAL_NEG_HUGE_VALF
;
3983 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3985 *(float *)retval
= excf
.retval
;
3991 DOMAINL
; NAMEL
= (char *) "y0l";
4003 RETVAL_NEG_HUGE_VALL
;
4004 NOT_MATHERRL
{ERRNO_DOMAIN
;}
4006 *(long double *)retval
= excl
.retval
;
4012 DOMAIND
; NAMED
= (char *) "y0";
4024 RETVAL_NEG_HUGE_VALD
;
4025 NOT_MATHERRD
{ERRNO_DOMAIN
;}
4027 *(double *)retval
= exc
.retval
;
4033 DOMAINF
; NAMEF
= (char *) "y0f";
4045 RETVAL_NEG_HUGE_VALF
;
4046 NOT_MATHERRF
{ERRNO_DOMAIN
;}
4048 *(float *)retval
= excf
.retval
;
4054 DOMAINL
; NAMEL
= (char *) "y1l";
4066 RETVAL_NEG_HUGE_VALL
;
4067 NOT_MATHERRL
{ERRNO_DOMAIN
;}
4069 *(long double *)retval
= excl
.retval
;
4075 DOMAIND
; NAMED
= (char *) "y1";
4087 RETVAL_NEG_HUGE_VALD
;
4088 NOT_MATHERRD
{ERRNO_DOMAIN
;}
4090 *(double *)retval
= exc
.retval
;
4096 DOMAINF
; NAMEF
= (char *) "y1f";
4108 RETVAL_NEG_HUGE_VALF
;
4109 NOT_MATHERRF
{ERRNO_DOMAIN
;}
4111 *(float *)retval
= excf
.retval
;
4117 DOMAINL
; NAMEL
= (char *) "ynl";
4129 RETVAL_NEG_HUGE_VALL
;
4130 NOT_MATHERRL
{ERRNO_DOMAIN
;}
4132 *(long double *)retval
= excl
.retval
;
4138 DOMAIND
; NAMED
= (char *) "yn";
4150 RETVAL_NEG_HUGE_VALD
;
4151 NOT_MATHERRD
{ERRNO_DOMAIN
;}
4153 *(double *)retval
= exc
.retval
;
4159 DOMAINF
; NAMEF
= (char *) "ynf";
4171 RETVAL_NEG_HUGE_VALF
;
4172 NOT_MATHERRF
{ERRNO_DOMAIN
;}
4174 *(float *)retval
= excf
.retval
;
4180 DOMAINL
; NAMEL
= (char *) "fmodl";
4183 *(long double *)retval
= *(long double *)arg1
;
4191 { /* NaN already computed */
4192 NOT_MATHERRL
{ERRNO_DOMAIN
;}
4194 *(long double *)retval
= excl
.retval
;
4200 DOMAIND
; NAMED
= (char *) "fmod";
4203 *(double *)retval
= *(double *)arg1
;
4211 { /* NaN already computed */
4212 NOT_MATHERRD
{ERRNO_DOMAIN
;}
4214 *(double *)retval
= exc
.retval
;
4220 DOMAINF
; NAMEF
= (char *) "fmodf";
4223 *(float *)retval
= *(float *)arg1
;
4232 NOT_MATHERRF
{ERRNO_DOMAIN
;}
4234 *(float *)retval
= excf
.retval
;
4237 case remainderl_by_zero
:
4238 /* remainderl(x,0) */
4240 DOMAINL
; NAMEL
= (char *) "remainderl";
4250 { /* NaN already computed */
4251 NOT_MATHERRL
{ERRNO_DOMAIN
;}
4253 *(long double *)retval
= excl
.retval
;
4256 case remainder_by_zero
:
4257 /* remainder(x,0) */
4259 DOMAIND
; NAMED
= (char *) "remainder";
4269 { /* NaN already computed */
4270 NOT_MATHERRD
{ERRNO_DOMAIN
;}
4272 *(double *)retval
= exc
.retval
;
4275 case remainderf_by_zero
:
4276 /* remainderf(x,0) */
4278 DOMAINF
; NAMEF
= (char *) "remainderf";
4289 NOT_MATHERRF
{ERRNO_DOMAIN
;}
4291 *(float *)retval
= excf
.retval
;
4295 /* We don't want to abort () since SVID doesn't cover all math
4296 library functions. */