1 /* file: libm_error.c */
4 // Copyright (c) 2000 - 2005, Intel Corporation
5 // All rights reserved.
7 // Contributed 2000 by the Intel Numerics Group, Intel Corporation
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are
13 // * Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
16 // * Redistributions in binary form must reproduce the above copyright
17 // notice, this list of conditions and the following disclaimer in the
18 // documentation and/or other materials provided with the distribution.
20 // * The name of Intel Corporation may not be used to endorse or promote
21 // products derived from this software without specific prior written
25 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
33 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 // Intel Corporation is the author of this code, and requests that all
38 // problem reports or change requests be submitted to it directly at
39 // http://www.intel.com/software/products/opensource/libraries/num.htm.
42 //==============================================================
43 // 2/02/00: Initial version
44 // 3/22/00: Updated to support flexible and dynamic error handling.
45 // 8/16/00: Changed all matherr function-calls to use the pmatherr
47 // 10/03/00: Corrected a scalb type.
48 // 11/28/00: Changed INPUT_XL to INPUT_XD for scalb_underflow case.
49 // 12/07/00: Added code to make scalbn error support equivalent to ldexp.
50 // 2/07/01: Added __declspec(align(16)) to long double constants to correct
52 // 4/23/01: Added code for remquo
53 // 6/07/01: Added code for fdim, lrint, lround, llrint, llround
54 // Deleted code for remquo
55 // 8/15/01: Added code for scalbln, nexttoward
56 // 12/10/01: Added code for erfc
57 // 12/27/01: Added code for degree argument functions
58 // 01/02/02: Added code for tand, cotd
59 // 01/15/02: Corrected SVID/XOPEN code for log1p, pow, and acosh
60 // 01/25/02: Corrected ISOC for lgamma and gamma to return EDOM for neg ints
61 // 01/28/02: Corrected SVID/XOPEN stderr message for log2
62 // 05/20/02: Added code for cot
63 // 07/01/02: Added code for sinhcosh
64 // 10/04/02: Underflow detection in ISOC path redefined to
65 // be zero rather than tiny and inexact
66 // 12/06/02: Added code for annuity and compound
67 // 01/30/03: Corrected test for underflow in ISOC path to not set denormal
68 // 04/10/03: Corrected ISOC branch for gamma/lgamma to return ERANGE for neg ints.
69 // Added code for tgamma
70 // 04/11/03: Corrected POSIX/SVID/XOPEN branches for gamma/lgamma
71 // to return EDOM for neg ints.
72 // 09/08/03: Corrected XOPEN/SVID result for pow overflow with neg x, pos y.
73 // 10/14/03: Added ILP32 ifdef
74 // 12/12/03: Corrected XOPEN/SVID results for powf_zero_to_negative,
75 // powl_neg_to_non_integer, atan2f_zero, atan2df_zero,
76 // acoshf_lt_one, acosh_lt_one.
77 // 12/07/04: Cast name strings as char *.
78 // 12/08/04: Corrected POSIX behavior for atan2_zero, acos_gt_one, asin_gt_one,
79 // log_negative, log10_negative, log1p_negative, and log2_negative.
80 // Added SVID and XOPEN case log2l_zero.
81 // 12/13/04: Corrected POSIX behavior for exp2_overflow, exp2_underflow,
82 // exp10_overflow, exp10_underflow. Added ISOC to set errno for
84 // 12/14/04: Corrected POSIX behavior for nextafter_overflow,
85 // nextafter_underflow, nexttoward_overflow, nexttoward_underflow.
86 // Added ISOC to set errno for nextafter and nexttoward underflow.
87 // 12/15/04: Corrected POSIX behavior for exp, exp2, and exp10 underflow.
88 // 03/31/05: Added missing ALIGNIT statement to 6 float constants.
93 #include "libm_support.h"
96 # define pmatherr matherr
97 # define pmatherrf matherrf
98 # define pmatherrl matherrl
101 #if defined( __POSIX__ )
102 _LIB_VERSIONIMF
= _POSIX_
;
103 #elif defined( __XOPEN__ )
104 _LIB_VERSIONIMF
= _XOPEN_
;
105 #elif defined( __SVID__ )
106 _LIB_VERSIONIMF
= _SVID_
;
107 #elif defined( __IEEE__ )
108 _LIB_VERSIONIMF
= _IEEE_
;
110 _LIB_VERSIONIMF
= _ISOC_
;
113 /************************************************************/
114 /* matherrX function pointers and setusermatherrX functions */
115 /************************************************************/
116 int (*pmatherrf
)(struct exceptionf
*) = MATHERR_F
;
117 int (*pmatherr
)(struct EXC_DECL_D
*) = MATHERR_D
;
118 int (*pmatherrl
)(struct exceptionl
*) = matherrl
;
120 void __libm_setusermatherrf( int(*user_merrf
)(struct exceptionf
*) )
121 { pmatherrf
= ( (user_merrf
==NULL
)? (MATHERR_F
) : (user_merrf
) ); }
123 void __libm_setusermatherr( int(*user_merr
)(struct EXC_DECL_D
*) )
124 { pmatherr
= ( (user_merr
==NULL
)? (MATHERR_D
) : (user_merr
) ); }
126 void __libm_setusermatherrl( int(*user_merrl
)(struct exceptionl
*) )
127 { pmatherrl
= ( (user_merrl
==NULL
)? (matherrl
) : (user_merrl
) ); }
131 /***********************************************/
132 /* error-handling function, libm_error_support */
133 /***********************************************/
134 void __libm_error_support(void *arg1
,void *arg2
,void *retval
,error_types input_tag
)
138 struct __exception exc
;
140 struct exception exc
;
143 struct exceptionf excf
;
144 struct exceptionl excl
;
147 #define ALIGNIT __attribute__ ((__aligned__ (16)))
148 # elif defined opensource
151 #define ALIGNIT __declspec(align(16))
154 # ifdef SIZE_LONG_INT_64
155 #define __INT_64__ signed long
158 #define __INT_64__ signed long long
160 #define __INT_64__ __int64
165 #define STATIC static
168 STATIC
const char float_inf
[4] = {0x00,0x00,0x80,0x7F};
170 STATIC
const char float_huge
[4] = {0xFF,0xFF,0x7F,0x7F};
172 STATIC
const char float_zero
[4] = {0x00,0x00,0x00,0x00};
174 STATIC
const char float_neg_inf
[4] = {0x00,0x00,0x80,0xFF};
176 STATIC
const char float_neg_huge
[4] = {0xFF,0xFF,0x7F,0xFF};
178 STATIC
const char float_neg_zero
[4] = {0x00,0x00,0x00,0x80};
180 STATIC
const char double_inf
[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x7F};
183 STATIC
const char double_huge
[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0x7F};
186 STATIC
const char double_zero
[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
188 STATIC
const char double_neg_inf
[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xFF};
191 STATIC
const char double_neg_huge
[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF};
194 STATIC
const char double_neg_zero
[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80};
196 STATIC
const char long_double_inf
[16] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0x7F,0x00,0x00,0x00,0x00,0x00,0x00};
199 STATIC
const char long_double_huge
[16] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x7F,0x00,0x00,0x00,0x00,0x00,0x00};
202 STATIC
const char long_double_zero
[16] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
204 STATIC
const char long_double_neg_inf
[16] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00};
207 STATIC
const char long_double_neg_huge
[16] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x00,0x00,0x00,0x00,0x00,0x00};
210 STATIC
const char long_double_neg_zero
[16] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00};
213 #define RETVAL_HUGE_VALL *(long double *)retval = *(long double *)long_double_inf
214 #define RETVAL_NEG_HUGE_VALL *(long double *)retval = *(long double *)long_double_neg_inf
215 #define RETVAL_HUGEL *(long double *)retval = (long double)*(float *)float_huge
216 #define RETVAL_NEG_HUGEL *(long double *)retval =(long double)*(float*)float_neg_huge
218 #define RETVAL_HUGE_VALD *(double *)retval = *(double *) double_inf
219 #define RETVAL_NEG_HUGE_VALD *(double *)retval = *(double *) double_neg_inf
220 #define RETVAL_HUGED *(double *)retval = (double) *(float *)float_huge
221 #define RETVAL_NEG_HUGED *(double *)retval = (double) *(float *) float_neg_huge
223 #define RETVAL_HUGE_VALF *(float *)retval = *(float *) float_inf
224 #define RETVAL_NEG_HUGE_VALF *(float *)retval = *(float *) float_neg_inf
225 #define RETVAL_HUGEF *(float *)retval = *(float *) float_huge
226 #define RETVAL_NEG_HUGEF *(float *)retval = *(float *) float_neg_huge
228 #define ZEROL_VALUE *(long double *)long_double_zero
229 #define ZEROD_VALUE *(double *)double_zero
230 #define ZEROF_VALUE *(float *)float_zero
232 #define RETVAL_ZEROL *(long double *)retval = *(long double *)long_double_zero
233 #define RETVAL_ZEROD *(double *)retval = *(double *)double_zero
234 #define RETVAL_ZEROF *(float *)retval = *(float *)float_zero
236 #define RETVAL_NEG_ZEROL *(long double *)retval = *(long double *)long_double_neg_zero
237 #define RETVAL_NEG_ZEROD *(double *)retval = *(double *)double_neg_zero
238 #define RETVAL_NEG_ZEROF *(float *)retval = *(float *)float_neg_zero
240 #define RETVAL_ONEL *(long double *)retval = (long double) 1.0
241 #define RETVAL_ONED *(double *)retval = 1.0
242 #define RETVAL_ONEF *(float *)retval = 1.0f
244 #define NOT_MATHERRL excl.arg1=*(long double *)arg1;excl.arg2=*(long double *)arg2;excl.retval=*(long double *)retval;if(!pmatherrl(&excl))
245 #define NOT_MATHERRD exc.arg1=*(double *)arg1;exc.arg2=*(double *)arg2;exc.retval=*(double *)retval;if(!pmatherr(&exc))
246 #define NOT_MATHERRF excf.arg1=*(float *)arg1;excf.arg2=*(float *)arg2;excf.retval=*(float *)retval;if(!pmatherrf(&excf))
248 #define ifSVID if(_LIB_VERSIONIMF==_SVID_)
250 #define NAMEL excl.name
251 #define NAMED exc.name
252 #define NAMEF excf.name
255 // These should work OK for MS because they are ints -
256 // leading underbars are not necessary.
266 #define SINGL excl.type = SING
267 #define DOMAINL excl.type = DOMAIN
268 #define OVERFLOWL excl.type = OVERFLOW
269 #define UNDERFLOWL excl.type = UNDERFLOW
270 #define TLOSSL excl.type = TLOSS
271 #define SINGD exc.type = SING
272 #define DOMAIND exc.type = DOMAIN
273 #define OVERFLOWD exc.type = OVERFLOW
274 #define UNDERFLOWD exc.type = UNDERFLOW
275 #define TLOSSD exc.type = TLOSS
276 #define SINGF excf.type = SING
277 #define DOMAINF excf.type = DOMAIN
278 #define OVERFLOWF excf.type = OVERFLOW
279 #define UNDERFLOWF excf.type = UNDERFLOW
280 #define TLOSSF excf.type = TLOSS
282 #define INPUT_XL (excl.arg1=*(long double*)arg1)
283 #define INPUT_XD (exc.arg1=*(double*)arg1)
284 #define INPUT_XF (excf.arg1=*(float*)arg1)
285 #define INPUT_YL (excl.arg2=*(long double*)arg2)
286 #define INPUT_YD (exc.arg2=*(double*)arg2)
287 #define INPUT_YF (excf.arg2=*(float*)arg2)
288 #define INPUT_RESL (*(long double *)retval)
289 #define INPUT_RESD (*(double *)retval)
290 #define INPUT_RESF (*(float *)retval)
291 #define INPUT_RESI64 (*(__INT_64__ *)retval)
293 #define WRITEL_LOG_ZERO fputs("logl: SING error\n",stderr)
294 #define WRITED_LOG_ZERO fputs("log: SING error\n",stderr)
295 #define WRITEF_LOG_ZERO fputs("logf: SING error\n",stderr)
296 #define WRITEL_LOG_NEGATIVE fputs("logl: DOMAIN error\n",stderr)
297 #define WRITED_LOG_NEGATIVE fputs("log: DOMAIN error\n",stderr)
298 #define WRITEF_LOG_NEGATIVE fputs("logf: DOMAIN error\n",stderr)
299 #define WRITEL_Y0_ZERO fputs("y0l: DOMAIN error\n",stderr)
300 #define WRITED_Y0_ZERO fputs("y0: DOMAIN error\n",stderr)
301 #define WRITEF_Y0_ZERO fputs("y0f: DOMAIN error\n",stderr)
302 #define WRITEL_Y0_NEGATIVE fputs("y0l: DOMAIN error\n",stderr)
303 #define WRITED_Y0_NEGATIVE fputs("y0: DOMAIN error\n",stderr)
304 #define WRITEF_Y0_NEGATIVE fputs("y0f: DOMAIN error\n",stderr)
305 #define WRITEL_Y1_ZERO fputs("y1l: DOMAIN error\n",stderr)
306 #define WRITED_Y1_ZERO fputs("y1: DOMAIN error\n",stderr)
307 #define WRITEF_Y1_ZERO fputs("y1f: DOMAIN error\n",stderr)
308 #define WRITEL_Y1_NEGATIVE fputs("y1l: DOMAIN error\n",stderr)
309 #define WRITED_Y1_NEGATIVE fputs("y1: DOMAIN error\n",stderr)
310 #define WRITEF_Y1_NEGATIVE fputs("y1f: DOMAIN error\n",stderr)
311 #define WRITEL_YN_ZERO fputs("ynl: DOMAIN error\n",stderr)
312 #define WRITED_YN_ZERO fputs("yn: DOMAIN error\n",stderr)
313 #define WRITEF_YN_ZERO fputs("ynf: DOMAIN error\n",stderr)
314 #define WRITEL_YN_NEGATIVE fputs("ynl: DOMAIN error\n",stderr)
315 #define WRITED_YN_NEGATIVE fputs("yn: DOMAIN error\n",stderr)
316 #define WRITEF_YN_NEGATIVE fputs("ynf: DOMAIN error\n",stderr)
317 #define WRITEL_LOG1P_ZERO fputs("log1pl: SING error\n",stderr)
318 #define WRITED_LOG1P_ZERO fputs("log1p: SING error\n",stderr)
319 #define WRITEF_LOG1P_ZERO fputs("log1pf: SING error\n",stderr)
320 #define WRITEL_LOG1P_NEGATIVE fputs("log1pl: DOMAIN error\n",stderr)
321 #define WRITED_LOG1P_NEGATIVE fputs("log1p: DOMAIN error\n",stderr)
322 #define WRITEF_LOG1P_NEGATIVE fputs("log1pf: DOMAIN error\n",stderr)
323 #define WRITEL_LOG10_ZERO fputs("log10l: SING error\n",stderr)
324 #define WRITED_LOG10_ZERO fputs("log10: SING error\n",stderr)
325 #define WRITEF_LOG10_ZERO fputs("log10f: SING error\n",stderr)
326 #define WRITEL_LOG10_NEGATIVE fputs("log10l: DOMAIN error\n",stderr)
327 #define WRITED_LOG10_NEGATIVE fputs("log10: DOMAIN error\n",stderr)
328 #define WRITEF_LOG10_NEGATIVE fputs("log10f: DOMAIN error\n",stderr)
329 #define WRITEL_LOG2_ZERO fputs("log2l: SING error\n",stderr)
330 #define WRITED_LOG2_ZERO fputs("log2: SING error\n",stderr)
331 #define WRITEF_LOG2_ZERO fputs("log2f: SING error\n",stderr)
332 #define WRITEL_LOG2_NEGATIVE fputs("log2l: DOMAIN error\n",stderr)
333 #define WRITED_LOG2_NEGATIVE fputs("log2: DOMAIN error\n",stderr)
334 #define WRITEF_LOG2_NEGATIVE fputs("log2f: DOMAIN error\n",stderr)
335 #define WRITEL_POW_ZERO_TO_ZERO fputs("powl(0,0): DOMAIN error\n",stderr)
336 #define WRITED_POW_ZERO_TO_ZERO fputs("pow(0,0): DOMAIN error\n",stderr)
337 #define WRITEF_POW_ZERO_TO_ZERO fputs("powf(0,0): DOMAIN error\n",stderr)
338 #define WRITEL_POW_ZERO_TO_NEGATIVE fputs("powl(0,negative): DOMAIN error\n",stderr)
339 #define WRITED_POW_ZERO_TO_NEGATIVE fputs("pow(0,negative): DOMAIN error\n",stderr)
340 #define WRITEF_POW_ZERO_TO_NEGATIVE fputs("powf(0,negative): DOMAIN error\n",stderr)
341 #define WRITEL_POW_NEG_TO_NON_INTEGER fputs("powl(negative,non-integer): DOMAIN error\n",stderr)
342 #define WRITED_POW_NEG_TO_NON_INTEGER fputs("pow(negative,non-integer): DOMAIN error\n",stderr)
343 #define WRITEF_POW_NEG_TO_NON_INTEGER fputs("powf(negative,non-integer): DOMAIN error\n",stderr)
344 #define WRITEL_ATAN2_ZERO_BY_ZERO fputs("atan2l: DOMAIN error\n",stderr)
345 #define WRITED_ATAN2_ZERO_BY_ZERO fputs("atan2: DOMAIN error\n",stderr)
346 #define WRITEF_ATAN2_ZERO_BY_ZERO fputs("atan2f: DOMAIN error\n",stderr)
347 #define WRITEL_SQRT fputs("sqrtl: DOMAIN error\n",stderr)
348 #define WRITED_SQRT fputs("sqrt: DOMAIN error\n",stderr)
349 #define WRITEF_SQRT fputs("sqrtf: DOMAIN error\n",stderr)
350 #define WRITEL_FMOD fputs("fmodl: DOMAIN error\n",stderr)
351 #define WRITED_FMOD fputs("fmod: DOMAIN error\n",stderr)
352 #define WRITEF_FMOD fputs("fmodf: DOMAIN error\n",stderr)
353 #define WRITEL_REM fputs("remainderl: DOMAIN error\n",stderr)
354 #define WRITED_REM fputs("remainder: DOMAIN error\n",stderr)
355 #define WRITEF_REM fputs("remainderf: DOMAIN error\n",stderr)
356 #define WRITEL_ACOS fputs("acosl: DOMAIN error\n",stderr)
357 #define WRITED_ACOS fputs("acos: DOMAIN error\n",stderr)
358 #define WRITEF_ACOS fputs("acosf: DOMAIN error\n",stderr)
359 #define WRITEL_ASIN fputs("asinl: DOMAIN error\n",stderr)
360 #define WRITED_ASIN fputs("asin: DOMAIN error\n",stderr)
361 #define WRITEF_ASIN fputs("asinf: DOMAIN error\n",stderr)
362 #define WRITEL_ACOSH fputs("acoshl: DOMAIN error\n",stderr)
363 #define WRITED_ACOSH fputs("acosh: DOMAIN error\n",stderr)
364 #define WRITEF_ACOSH fputs("acoshf: DOMAIN error\n",stderr)
365 #define WRITEL_ATANH_GT_ONE fputs("atanhl: DOMAIN error\n",stderr)
366 #define WRITED_ATANH_GT_ONE fputs("atanh: DOMAIN error\n",stderr)
367 #define WRITEF_ATANH_GT_ONE fputs("atanhf: DOMAIN error\n",stderr)
368 #define WRITEL_ATANH_EQ_ONE fputs("atanhl: SING error\n",stderr)
369 #define WRITED_ATANH_EQ_ONE fputs("atanh: SING error\n",stderr)
370 #define WRITEF_ATANH_EQ_ONE fputs("atanhf: SING error\n",stderr)
371 #define WRITEL_LGAMMA_NEGATIVE fputs("lgammal: SING error\n",stderr)
372 #define WRITED_LGAMMA_NEGATIVE fputs("lgamma: SING error\n",stderr)
373 #define WRITEF_LGAMMA_NEGATIVE fputs("lgammaf: SING error\n",stderr)
374 #define WRITEL_GAMMA_NEGATIVE fputs("gammal: SING error\n",stderr)
375 #define WRITED_GAMMA_NEGATIVE fputs("gamma: SING error\n",stderr)
376 #define WRITEF_GAMMA_NEGATIVE fputs("gammaf: SING error\n",stderr)
377 #define WRITEL_TGAMMA_NEGATIVE fputs("tgammal: SING error\n",stderr)
378 #define WRITED_TGAMMA_NEGATIVE fputs("tgamma: SING error\n",stderr)
379 #define WRITEF_TGAMMA_NEGATIVE fputs("tgammaf: SING error\n",stderr)
380 #define WRITEL_J0_TLOSS fputs("j0l: TLOSS error\n",stderr)
381 #define WRITEL_Y0_TLOSS fputs("y0l: TLOSS error\n",stderr)
382 #define WRITEL_J1_TLOSS fputs("j1l: TLOSS error\n",stderr)
383 #define WRITEL_Y1_TLOSS fputs("y1l: TLOSS error\n",stderr)
384 #define WRITEL_JN_TLOSS fputs("jnl: TLOSS error\n",stderr)
385 #define WRITEL_YN_TLOSS fputs("ynl: TLOSS error\n",stderr)
386 #define WRITED_J0_TLOSS fputs("j0: TLOSS error\n",stderr)
387 #define WRITED_Y0_TLOSS fputs("y0: TLOSS error\n",stderr)
388 #define WRITED_J1_TLOSS fputs("j1: TLOSS error\n",stderr)
389 #define WRITED_Y1_TLOSS fputs("y1: TLOSS error\n",stderr)
390 #define WRITED_JN_TLOSS fputs("jn: TLOSS error\n",stderr)
391 #define WRITED_YN_TLOSS fputs("yn: TLOSS error\n",stderr)
392 #define WRITEF_J0_TLOSS fputs("j0f: TLOSS error\n",stderr)
393 #define WRITEF_Y0_TLOSS fputs("y0f: TLOSS error\n",stderr)
394 #define WRITEF_J1_TLOSS fputs("j1f: TLOSS error\n",stderr)
395 #define WRITEF_Y1_TLOSS fputs("y1f: TLOSS error\n",stderr)
396 #define WRITEF_JN_TLOSS fputs("jnf: TLOSS error\n",stderr)
397 #define WRITEF_YN_TLOSS fputs("ynf: TLOSS error\n",stderr)
398 #define WRITEL_ACOSD fputs("acosdl: DOMAIN error\n",stderr)
399 #define WRITED_ACOSD fputs("acosd: DOMAIN error\n",stderr)
400 #define WRITEF_ACOSD fputs("acosdf: DOMAIN error\n",stderr)
401 #define WRITEL_ASIND fputs("asindl: DOMAIN error\n",stderr)
402 #define WRITED_ASIND fputs("asind: DOMAIN error\n",stderr)
403 #define WRITEF_ASIND fputs("asindf: DOMAIN error\n",stderr)
404 #define WRITEL_ATAN2D_ZERO_BY_ZERO fputs("atan2dl: DOMAIN error\n",stderr)
405 #define WRITED_ATAN2D_ZERO_BY_ZERO fputs("atan2d: DOMAIN error\n",stderr)
406 #define WRITEF_ATAN2D_ZERO_BY_ZERO fputs("atan2df: DOMAIN error\n",stderr)
409 /***********************/
411 /***********************/
412 if(_LIB_VERSIONIMF
==_IEEE_
) return;
414 /***********************/
416 /***********************/
417 else if(_LIB_VERSIONIMF
==_ISOC_
)
442 case exp10l_overflow
:
444 case exp10f_overflow
:
445 case expm1l_overflow
:
447 case expm1f_overflow
:
448 case hypotl_overflow
:
450 case hypotf_overflow
:
457 case scalbl_overflow
:
459 case scalbf_overflow
:
463 case nextafterl_overflow
:
464 case nextafter_overflow
:
465 case nextafterf_overflow
:
466 case nextafterl_underflow
:
467 case nextafter_underflow
:
468 case nextafterf_underflow
:
469 case nexttowardl_overflow
:
470 case nexttoward_overflow
:
471 case nexttowardf_overflow
:
472 case nexttowardl_underflow
:
473 case nexttoward_underflow
:
474 case nexttowardf_underflow
:
475 case scalbnl_overflow
:
476 case scalbn_overflow
:
477 case scalbnf_overflow
:
478 case scalblnl_overflow
:
479 case scalbln_overflow
:
480 case scalblnf_overflow
:
481 case ldexpl_overflow
:
483 case ldexpf_overflow
:
484 case lgammal_overflow
:
485 case lgamma_overflow
:
486 case lgammaf_overflow
:
487 case gammal_overflow
:
489 case gammaf_overflow
:
490 case lgammal_negative
:
491 case lgamma_negative
:
492 case lgammaf_negative
:
493 case gammal_negative
:
495 case gammaf_negative
:
523 case sinhcoshl_overflow
:
524 case sinhcosh_overflow
:
525 case sinhcoshf_overflow
:
526 case annuityl_overflow
:
527 case annuity_overflow
:
528 case annuityf_overflow
:
529 case compoundl_overflow
:
530 case compound_overflow
:
531 case compoundf_overflow
:
532 case tgammal_overflow
:
533 case tgamma_overflow
:
534 case tgammaf_overflow
:
540 case exp10l_underflow
:
541 case exp2l_underflow
:
542 case scalbl_underflow
:
543 case scalbnl_underflow
:
544 case scalblnl_underflow
:
545 case ldexpl_underflow
:
546 case erfcl_underflow
:
547 case annuityl_underflow
:
548 case compoundl_underflow
:
550 /* Test for zero by testing 64 significand bits for zero. An integer
551 test is needed so denormal flag is not set by a floating-point test */
552 if ( INPUT_RESI64
== 0 ) ERRNO_RANGE
;
557 case exp10_underflow
:
559 case scalb_underflow
:
560 case scalbn_underflow
:
561 case scalbln_underflow
:
562 case ldexp_underflow
:
564 case annuity_underflow
:
565 case compound_underflow
:
567 /* Test for zero by testing exp and significand bits for zero. An integer
568 test is needed so denormal flag is not set by a floating-point test */
569 if ( (INPUT_RESI64
<< 1) == 0 ) ERRNO_RANGE
;
574 case exp10f_underflow
:
575 case exp2f_underflow
:
576 case scalbf_underflow
:
577 case scalbnf_underflow
:
578 case scalblnf_underflow
:
579 case ldexpf_underflow
:
580 case erfcf_underflow
:
581 case annuityf_underflow
:
582 case compoundf_underflow
:
584 /* Test for zero by testing exp and significand bits for zero. An integer
585 test is needed so denormal flag is not set by a floating-point test */
586 if ( (INPUT_RESI64
<< 33) == 0 ) ERRNO_RANGE
;
592 case log10l_negative
:
594 case log10f_negative
:
598 case log1pl_negative
:
600 case log1pf_negative
:
607 case powl_zero_to_negative
:
608 case powl_neg_to_non_integer
:
609 case pow_zero_to_negative
:
610 case pow_neg_to_non_integer
:
611 case powf_zero_to_negative
:
612 case powf_neg_to_non_integer
:
658 case annuityl_by_zero
:
659 case annuity_by_zero
:
660 case annuityf_by_zero
:
661 case annuityl_less_m1
:
662 case annuity_less_m1
:
663 case annuityf_less_m1
:
664 case compoundl_by_zero
:
665 case compound_by_zero
:
666 case compoundf_by_zero
:
667 case compoundl_less_m1
:
668 case compound_less_m1
:
669 case compoundf_less_m1
:
670 case tgammal_negative
:
671 case tgamma_negative
:
672 case tgammaf_negative
:
682 /***********************/
684 /***********************/
686 else if(_LIB_VERSIONIMF
==_POSIX_
)
690 case gammal_overflow
:
691 case lgammal_overflow
:
692 case tgammal_overflow
:
694 RETVAL_HUGE_VALL
; ERRNO_RANGE
; break;
697 case lgamma_overflow
:
698 case tgamma_overflow
:
700 RETVAL_HUGE_VALD
; ERRNO_RANGE
; break;
702 case gammaf_overflow
:
703 case lgammaf_overflow
:
704 case tgammaf_overflow
:
706 RETVAL_HUGE_VALF
; ERRNO_RANGE
; break;
708 case gammal_negative
:
710 case gammaf_negative
:
711 case lgammal_negative
:
712 case lgamma_negative
:
713 case lgammaf_negative
:
714 case tgammal_negative
:
715 case tgamma_negative
:
716 case tgammaf_negative
:
720 case ldexpl_overflow
:
721 case ldexpl_underflow
:
723 case ldexp_underflow
:
724 case ldexpf_overflow
:
725 case ldexpf_underflow
:
726 case scalbnl_overflow
:
727 case scalbnl_underflow
:
728 case scalbn_overflow
:
729 case scalbn_underflow
:
730 case scalbnf_overflow
:
731 case scalbnf_underflow
:
732 case scalblnl_overflow
:
733 case scalblnl_underflow
:
734 case scalbln_overflow
:
735 case scalbln_underflow
:
736 case scalblnf_overflow
:
737 case scalblnf_underflow
:
747 case sinhcoshl_overflow
:
748 case sinhcosh_overflow
:
749 case sinhcoshf_overflow
:
750 case nextafterl_overflow
:
751 case nextafter_overflow
:
752 case nextafterf_overflow
:
753 case nextafterl_underflow
:
754 case nextafter_underflow
:
755 case nextafterf_underflow
:
756 case nexttowardl_overflow
:
757 case nexttoward_overflow
:
758 case nexttowardf_overflow
:
759 case nexttowardl_underflow
:
760 case nexttoward_underflow
:
761 case nexttowardf_underflow
:
767 /* atanhl(|x| >= 1) */
773 /* atanh(|x| >= 1) */
779 /* atanhf(|x| >= 1) */
805 RETVAL_NEG_HUGE_VALL
; ERRNO_DOMAIN
; break;
814 RETVAL_NEG_HUGE_VALD
; ERRNO_DOMAIN
; break;
823 RETVAL_NEG_HUGE_VALF
; ERRNO_DOMAIN
; break;
833 RETVAL_NEG_HUGE_VALL
;
844 RETVAL_NEG_HUGE_VALD
; ERRNO_DOMAIN
; break;
853 RETVAL_NEG_HUGE_VALF
; ERRNO_DOMAIN
; break;
864 RETVAL_NEG_HUGE_VALL
; ERRNO_RANGE
; break;
875 RETVAL_NEG_HUGE_VALD
; ERRNO_RANGE
; break;
886 RETVAL_NEG_HUGE_VALF
; ERRNO_RANGE
; break;
889 case log1pl_negative
:
890 case log10l_negative
:
911 case log1pf_negative
:
912 case log10f_negative
:
922 case exp10l_overflow
:
925 /* exp10l overflow */
928 RETVAL_HUGE_VALL
; ERRNO_RANGE
; break;
937 RETVAL_HUGE_VALD
; ERRNO_RANGE
; break;
940 case exp10f_overflow
:
944 RETVAL_HUGE_VALF
; ERRNO_RANGE
; break;
947 case exp10l_underflow
:
948 case exp2l_underflow
:
950 /* exp10l underflow */
951 /* exp2l underflow */
956 case exp10_underflow
:
959 /* exp10 underflow */
965 case exp10f_underflow
:
966 case exp2f_underflow
:
968 /* exp10f underflow */
969 /* exp2f underflow */
979 /* jn and yn doubl-extended> XLOSS */
981 RETVAL_ZEROL
; ERRNO_RANGE
; break;
989 /* jn and yn double > XLOSS */
991 RETVAL_ZEROD
; ERRNO_RANGE
; break;
999 /* j0n and y0n > XLOSS */
1001 RETVAL_ZEROF
; ERRNO_RANGE
; break;
1003 case powl_zero_to_zero
:
1008 case pow_zero_to_zero
:
1013 case powf_zero_to_zero
:
1019 case annuityl_overflow
:
1020 case compoundl_overflow
:
1021 /* powl(x,y) overflow */
1023 if (INPUT_RESL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_HUGE_VALL
;
1024 else RETVAL_HUGE_VALL
;
1028 case annuity_overflow
:
1029 case compound_overflow
:
1030 /* pow(x,y) overflow */
1032 if (INPUT_RESD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_HUGE_VALD
;
1033 else RETVAL_HUGE_VALD
;
1037 case annuityf_overflow
:
1038 case compoundf_overflow
:
1039 /* powf(x,y) overflow */
1041 if (INPUT_RESF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_HUGE_VALF
;
1042 else RETVAL_HUGE_VALF
;
1045 case powl_underflow
:
1046 case annuityl_underflow
:
1047 case compoundl_underflow
:
1048 /* powl(x,y) underflow */
1050 RETVAL_ZEROL
; ERRNO_RANGE
; break;
1053 case annuity_underflow
:
1054 case compound_underflow
:
1055 /* pow(x,y) underflow */
1057 RETVAL_ZEROD
; ERRNO_RANGE
; break;
1059 case powf_underflow
:
1060 case annuityf_underflow
:
1061 case compoundf_underflow
:
1062 /* powf(x,y) underflow */
1064 RETVAL_ZEROF
; ERRNO_RANGE
; break;
1066 case annuityl_by_zero
:
1067 case annuityl_less_m1
:
1068 case compoundl_by_zero
:
1069 case compoundl_less_m1
:
1070 case annuity_by_zero
:
1071 case annuity_less_m1
:
1072 case compound_by_zero
:
1073 case compound_less_m1
:
1074 case annuityf_by_zero
:
1075 case annuityf_less_m1
:
1076 case compoundf_by_zero
:
1077 case compoundf_less_m1
:
1079 ERRNO_DOMAIN
; break;
1081 case powl_zero_to_negative
:
1084 ERRNO_DOMAIN
; break;
1086 case pow_zero_to_negative
:
1089 ERRNO_DOMAIN
; break;
1091 case powf_zero_to_negative
:
1094 ERRNO_DOMAIN
; break;
1096 case powl_neg_to_non_integer
:
1097 /* neg**non_integral */
1099 ERRNO_DOMAIN
; break;
1101 case pow_neg_to_non_integer
:
1102 /* neg**non_integral */
1104 ERRNO_DOMAIN
; break;
1106 case powf_neg_to_non_integer
:
1107 /* neg**non-integral */
1109 ERRNO_DOMAIN
; break;
1111 case powl_nan_to_zero
:
1117 case pow_nan_to_zero
:
1122 case powf_nan_to_zero
:
1148 case expm1l_overflow
:
1149 /* expm1 overflow */
1153 case expm1_overflow
:
1154 /* expm1 overflow */
1158 case expm1f_overflow
:
1159 /* expm1f overflow */
1163 case expm1l_underflow
:
1164 /* expm1 underflow */
1168 case expm1_underflow
:
1169 /* expm1 underflow */
1173 case expm1f_underflow
:
1174 /* expm1f underflow */
1178 case hypotl_overflow
:
1179 /* hypotl overflow */
1181 RETVAL_HUGE_VALL
; ERRNO_RANGE
; break;
1183 case hypot_overflow
:
1184 /* hypot overflow */
1186 RETVAL_HUGE_VALD
; ERRNO_RANGE
; break;
1188 case hypotf_overflow
:
1189 /* hypotf overflow */
1191 RETVAL_HUGE_VALF
; ERRNO_RANGE
; break;
1193 case scalbl_underflow
:
1194 /* scalbl underflow */
1196 if (INPUT_XL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_ZEROL
;
1200 case scalb_underflow
:
1201 /* scalb underflow */
1203 if (INPUT_XD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_ZEROD
;
1207 case scalbf_underflow
:
1208 /* scalbf underflow */
1210 if (INPUT_XF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_ZEROF
;
1214 case scalbl_overflow
:
1215 /* scalbl overflow */
1217 if (INPUT_XL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_HUGE_VALL
;
1218 else RETVAL_HUGE_VALL
;
1221 case scalb_overflow
:
1222 /* scalb overflow */
1224 if (INPUT_XD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_HUGE_VALD
;
1225 else RETVAL_HUGE_VALD
;
1228 case scalbf_overflow
:
1229 /* scalbf overflow */
1231 if (INPUT_XF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_HUGE_VALF
;
1232 else RETVAL_HUGE_VALF
;
1238 ERRNO_DOMAIN
; break;
1243 ERRNO_DOMAIN
; break;
1248 ERRNO_DOMAIN
; break;
1255 ERRNO_DOMAIN
; break;
1262 ERRNO_DOMAIN
; break;
1269 ERRNO_DOMAIN
; break;
1276 ERRNO_DOMAIN
; break;
1283 ERRNO_DOMAIN
; break;
1290 ERRNO_DOMAIN
; break;
1292 case remainderl_by_zero
:
1296 ERRNO_DOMAIN
; break;
1298 case remainder_by_zero
:
1302 ERRNO_DOMAIN
; break;
1304 case remainderf_by_zero
:
1308 ERRNO_DOMAIN
; break;
1310 case coshl_overflow
:
1311 /* coshl overflows */
1313 RETVAL_HUGE_VALL
; ERRNO_RANGE
; break;
1316 /* cosh overflows */
1318 RETVAL_HUGE_VALD
; ERRNO_RANGE
; break;
1320 case coshf_overflow
:
1321 /* coshf overflows */
1323 RETVAL_HUGE_VALF
; ERRNO_RANGE
; break;
1325 case sinhl_overflow
:
1326 /* sinhl overflows */
1328 if (INPUT_XL
> ZEROL_VALUE
/*0*/) RETVAL_HUGE_VALL
;
1329 else RETVAL_NEG_HUGE_VALL
;
1333 /* sinh overflows */
1335 if (INPUT_XD
> ZEROD_VALUE
/*0*/) RETVAL_HUGE_VALD
;
1336 else RETVAL_NEG_HUGE_VALD
;
1339 case sinhf_overflow
:
1340 /* sinhf overflows */
1342 if (INPUT_XF
> ZEROF_VALUE
/*0*/) RETVAL_HUGE_VALF
;
1343 else RETVAL_NEG_HUGE_VALF
;
1349 ERRNO_DOMAIN
; break;
1354 ERRNO_DOMAIN
; break;
1359 ERRNO_DOMAIN
; break;
1383 /*******************************/
1384 /* __SVID__ and __XOPEN__ Path */
1385 /*******************************/
1390 case ldexpl_overflow
:
1391 case ldexpl_underflow
:
1392 case ldexp_overflow
:
1393 case ldexp_underflow
:
1394 case ldexpf_overflow
:
1395 case ldexpf_underflow
:
1396 case scalbnl_overflow
:
1397 case scalbnl_underflow
:
1398 case scalbn_overflow
:
1399 case scalbn_underflow
:
1400 case scalbnf_overflow
:
1401 case scalbnf_underflow
:
1402 case scalblnl_overflow
:
1403 case scalblnl_underflow
:
1404 case scalbln_overflow
:
1405 case scalbln_underflow
:
1406 case scalblnf_overflow
:
1407 case scalblnf_underflow
:
1408 case tandl_overflow
:
1410 case tandf_overflow
:
1411 case cotdl_overflow
:
1413 case cotdf_overflow
:
1417 case annuityl_overflow
:
1418 case annuityl_underflow
:
1419 case annuity_overflow
:
1420 case annuity_underflow
:
1421 case annuityf_overflow
:
1422 case annuityf_underflow
:
1423 case compoundl_overflow
:
1424 case compoundl_underflow
:
1425 case compound_overflow
:
1426 case compound_underflow
:
1427 case compoundf_overflow
:
1428 case compoundf_underflow
:
1432 case annuityl_by_zero
:
1433 case annuityl_less_m1
:
1434 case annuity_by_zero
:
1435 case annuity_less_m1
:
1436 case annuityf_by_zero
:
1437 case annuityf_less_m1
:
1438 case compoundl_by_zero
:
1439 case compoundl_less_m1
:
1440 case compound_by_zero
:
1441 case compound_less_m1
:
1442 case compoundf_by_zero
:
1443 case compoundf_less_m1
:
1445 ERRNO_DOMAIN
; break;
1447 case sqrtl_negative
:
1450 DOMAINL
; NAMEL
= (char *) "sqrtl";
1461 { /* NaN already computed */
1462 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1464 *(long double *)retval
= excl
.retval
;
1470 DOMAIND
; NAMED
= (char *) "sqrt";
1482 { /* NaN already computed */
1483 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1485 *(double *)retval
= exc
.retval
;
1488 case sqrtf_negative
:
1491 DOMAINF
; NAMEF
= (char *) "sqrtf";
1503 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1505 *(float *)retval
= excf
.retval
;
1511 SINGL
; NAMEL
= (char *) "logl";
1523 RETVAL_NEG_HUGE_VALL
;
1524 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1526 *(long double *)retval
= excl
.retval
;
1532 SINGD
; NAMED
= (char *) "log";
1544 RETVAL_NEG_HUGE_VALD
;
1545 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1547 *(double *)retval
= exc
.retval
;
1553 SINGF
; NAMEF
= (char *) "logf";
1565 RETVAL_NEG_HUGE_VALF
;
1566 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1568 *(float *)retval
= excf
.retval
;
1575 DOMAINL
; NAMEL
= (char *) "logl";
1581 WRITEL_LOG_NEGATIVE
;
1587 RETVAL_NEG_HUGE_VALL
;
1588 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1590 *(long double *)retval
= excl
.retval
;
1596 DOMAIND
; NAMED
= (char *) "log";
1602 WRITED_LOG_NEGATIVE
;
1608 RETVAL_NEG_HUGE_VALD
;
1609 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1611 *(double *)retval
= exc
.retval
;
1617 DOMAINF
; NAMEF
= (char *) "logf";
1623 WRITEF_LOG_NEGATIVE
;
1629 RETVAL_NEG_HUGE_VALF
;
1630 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1632 *(float *)retval
= excf
.retval
;
1638 SINGL
; NAMEL
= (char *) "log1pl";
1650 RETVAL_NEG_HUGE_VALL
;
1651 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1653 *(long double *)retval
= excl
.retval
;
1659 SINGD
; NAMED
= (char *) "log1p";
1671 RETVAL_NEG_HUGE_VALD
;
1672 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1674 *(double *)retval
= exc
.retval
;
1680 SINGF
; NAMEF
= (char *) "log1pf";
1692 RETVAL_NEG_HUGE_VALF
;
1693 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1695 *(float *)retval
= excf
.retval
;
1698 case log1pl_negative
:
1699 /* log1pl(x < -1) */
1701 DOMAINL
; NAMEL
= (char *) "log1pl";
1707 WRITEL_LOG1P_NEGATIVE
;
1713 RETVAL_NEG_HUGE_VALL
;
1714 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1716 *(long double *)retval
= excl
.retval
;
1719 case log1p_negative
:
1722 DOMAIND
; NAMED
= (char *) "log1p";
1728 WRITED_LOG1P_NEGATIVE
;
1734 RETVAL_NEG_HUGE_VALD
;
1735 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1737 *(double *)retval
= exc
.retval
;
1740 case log1pf_negative
:
1741 /* log1pf(x < -1) */
1743 DOMAINF
; NAMEF
= (char *) "log1pf";
1749 WRITEF_LOG1P_NEGATIVE
;
1755 RETVAL_NEG_HUGE_VALF
;
1756 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1758 *(float *)retval
= excf
.retval
;
1764 SINGL
; NAMEL
= (char *) "log10l";
1776 RETVAL_NEG_HUGE_VALL
;
1777 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1779 *(long double *)retval
= excl
.retval
;
1785 SINGD
; NAMED
= (char *) "log10";
1797 RETVAL_NEG_HUGE_VALD
;
1798 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1800 *(double *)retval
= exc
.retval
;
1806 SINGF
; NAMEF
= (char *) "log10f";
1818 RETVAL_NEG_HUGE_VALF
;
1819 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1821 *(float *)retval
= excf
.retval
;
1824 case log10l_negative
:
1827 DOMAINL
; NAMEL
= (char *) "log10l";
1833 WRITEL_LOG10_NEGATIVE
;
1839 RETVAL_NEG_HUGE_VALL
;
1840 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1842 *(long double *)retval
= excl
.retval
;
1845 case log10_negative
:
1848 DOMAIND
; NAMED
= (char *) "log10";
1854 WRITED_LOG10_NEGATIVE
;
1860 RETVAL_NEG_HUGE_VALD
;
1861 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1863 *(double *)retval
= exc
.retval
;
1866 case log10f_negative
:
1869 DOMAINF
; NAMEF
= (char *) "log10f";
1875 WRITEF_LOG10_NEGATIVE
;
1881 RETVAL_NEG_HUGE_VALF
;
1882 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1884 *(float *)retval
= excf
.retval
;
1890 SINGL
; NAMEL
= (char *) "log2l";
1902 RETVAL_NEG_HUGE_VALL
;
1903 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1905 *(long double *)retval
= excl
.retval
;
1911 SINGD
; NAMED
= (char *) "log2";
1923 RETVAL_NEG_HUGE_VALD
;
1924 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1926 *(double *)retval
= exc
.retval
;
1932 SINGF
; NAMEF
= (char *) "log2f";
1944 RETVAL_NEG_HUGE_VALF
;
1945 NOT_MATHERRF
{ERRNO_DOMAIN
;}
1947 *(float *)retval
= excf
.retval
;
1950 case log2l_negative
:
1953 DOMAINL
; NAMEL
= (char *) "log2l";
1959 WRITEL_LOG2_NEGATIVE
;
1965 RETVAL_NEG_HUGE_VALL
;
1966 NOT_MATHERRL
{ERRNO_DOMAIN
;}
1968 *(long double *)retval
= excl
.retval
;
1974 DOMAIND
; NAMED
= (char *) "log2";
1980 WRITED_LOG2_NEGATIVE
;
1986 RETVAL_NEG_HUGE_VALD
;
1987 NOT_MATHERRD
{ERRNO_DOMAIN
;}
1989 *(double *)retval
= exc
.retval
;
1992 case log2f_negative
:
1995 DOMAINF
; NAMEF
= (char *) "log2f";
2001 WRITEF_LOG2_NEGATIVE
;
2007 RETVAL_NEG_HUGE_VALF
;
2008 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2010 *(float *)retval
= excf
.retval
;
2016 OVERFLOWL
; NAMEL
= (char *) "expl";
2025 NOT_MATHERRL
{ERRNO_RANGE
;}
2026 *(long double *)retval
= excl
.retval
;
2032 OVERFLOWD
; NAMED
= (char *) "exp";
2041 NOT_MATHERRD
{ERRNO_RANGE
;}
2042 *(double *)retval
= exc
.retval
;
2048 OVERFLOWF
; NAMEF
= (char *) "expf";
2057 NOT_MATHERRF
{ERRNO_RANGE
;}
2058 *(float *)retval
= excf
.retval
;
2061 case expl_underflow
:
2062 /* expl underflow */
2064 UNDERFLOWL
; NAMEL
= (char *) "expl"; RETVAL_ZEROL
;
2065 NOT_MATHERRL
{ERRNO_RANGE
;}
2066 *(long double *)retval
= excl
.retval
;
2072 UNDERFLOWD
; NAMED
= (char *) "exp"; RETVAL_ZEROD
;
2073 NOT_MATHERRD
{ERRNO_RANGE
;}
2074 *(double *)retval
= exc
.retval
;
2077 case expf_underflow
:
2078 /* expf underflow */
2080 UNDERFLOWF
; NAMEF
= (char *) "expf"; RETVAL_ZEROF
;
2081 NOT_MATHERRF
{ERRNO_RANGE
;}
2082 *(float *)retval
= excf
.retval
;
2085 case powl_zero_to_zero
:
2088 DOMAINL
; NAMEL
= (char *) "powl";
2094 WRITEL_POW_ZERO_TO_ZERO
;
2097 *(long double *)retval
= excl
.retval
;
2102 case pow_zero_to_zero
:
2105 DOMAIND
; NAMED
= (char *) "pow";
2111 WRITED_POW_ZERO_TO_ZERO
;
2114 *(double *)retval
= exc
.retval
;
2119 case powf_zero_to_zero
:
2122 DOMAINF
; NAMEF
= (char *) "powf";
2128 WRITEF_POW_ZERO_TO_ZERO
;
2131 *(float *)retval
= excf
.retval
;
2137 /* powl(x,y) overflow */
2139 OVERFLOWL
; NAMEL
= (char *) "powl";
2142 if (INPUT_RESL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_HUGEL
;
2147 if (INPUT_RESL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_HUGE_VALL
;
2148 else RETVAL_HUGE_VALL
;
2150 NOT_MATHERRL
{ERRNO_RANGE
;}
2151 *(long double *)retval
= excl
.retval
;
2155 /* pow(x,y) overflow */
2157 OVERFLOWD
; NAMED
= (char *) "pow";
2160 if (INPUT_RESD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_HUGED
;
2165 if (INPUT_RESD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_HUGE_VALD
;
2166 else RETVAL_HUGE_VALD
;
2168 NOT_MATHERRD
{ERRNO_RANGE
;}
2169 *(double *)retval
= exc
.retval
;
2173 /* powf(x,y) overflow */
2175 OVERFLOWF
; NAMEF
= (char *) "powf";
2178 if (INPUT_RESF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_HUGEF
;
2183 if (INPUT_RESF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_HUGE_VALF
;
2184 else RETVAL_HUGE_VALF
;
2186 NOT_MATHERRF
{ERRNO_RANGE
;}
2187 *(float *)retval
= excf
.retval
;
2190 case powl_underflow
:
2191 /* powl(x,y) underflow */
2193 UNDERFLOWL
; NAMEL
= (char *) "powl"; RETVAL_ZEROL
;
2194 NOT_MATHERRL
{ERRNO_RANGE
;}
2195 *(long double *)retval
= excl
.retval
;
2199 /* pow(x,y) underflow */
2201 UNDERFLOWD
; NAMED
= (char *) "pow"; RETVAL_ZEROD
;
2202 NOT_MATHERRD
{ERRNO_RANGE
;}
2203 *(double *)retval
= exc
.retval
;
2206 case powf_underflow
:
2207 /* powf(x,y) underflow */
2209 UNDERFLOWF
; NAMEF
= (char *) "powf"; RETVAL_ZEROF
;
2210 NOT_MATHERRF
{ERRNO_RANGE
;}
2211 *(float *)retval
= excf
.retval
;
2214 case powl_zero_to_negative
:
2217 DOMAINL
; NAMEL
= (char *) "powl";
2223 WRITEL_POW_ZERO_TO_NEGATIVE
;
2229 RETVAL_NEG_HUGE_VALL
;
2230 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2232 *(long double *)retval
= excl
.retval
;
2235 case pow_zero_to_negative
:
2238 DOMAIND
; NAMED
= (char *) "pow";
2244 WRITED_POW_ZERO_TO_NEGATIVE
;
2250 RETVAL_NEG_HUGE_VALD
;
2251 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2253 *(double *)retval
= exc
.retval
;
2256 case powf_zero_to_negative
:
2259 DOMAINF
; NAMEF
= (char *) "powf";
2265 WRITEF_POW_ZERO_TO_NEGATIVE
;
2271 RETVAL_NEG_HUGE_VALF
;
2272 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2274 *(float *)retval
= excf
.retval
;
2277 case powl_neg_to_non_integer
:
2278 /* neg**non_integral */
2280 DOMAINL
; NAMEL
= (char *) "powl";
2286 WRITEL_POW_NEG_TO_NON_INTEGER
;
2292 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2294 *(long double *)retval
= excl
.retval
;
2297 case pow_neg_to_non_integer
:
2298 /* neg**non_integral */
2300 DOMAIND
; NAMED
= (char *) "pow";
2306 WRITED_POW_NEG_TO_NON_INTEGER
;
2312 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2314 *(double *)retval
= exc
.retval
;
2317 case powf_neg_to_non_integer
:
2318 /* neg**non-integral */
2320 DOMAINF
; NAMEF
= (char *) "powf";
2326 WRITEF_POW_NEG_TO_NON_INTEGER
;
2332 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2334 *(float *)retval
= excf
.retval
;
2337 case powl_nan_to_zero
:
2341 DOMAINL
; NAMEL
= (char *) "powl";
2342 *(long double *)retval
= *(long double *)arg1
;
2343 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2344 *(long double *)retval
= excl
.retval
;
2347 case pow_nan_to_zero
:
2351 DOMAIND
; NAMED
= (char *) "pow";
2352 *(double *)retval
= *(double *)arg1
;
2353 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2354 *(double *)retval
= exc
.retval
;
2357 case powf_nan_to_zero
:
2361 DOMAINF
; NAMEF
= (char *) "powf";
2362 *(float *)retval
= *(float *)arg1
;
2363 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2364 *(float *)retval
= excf
.retval
;
2368 /* atan2l(0.0,0.0) */
2370 DOMAINL
; NAMEL
= (char *) "atan2l";
2376 WRITEL_ATAN2_ZERO_BY_ZERO
;
2380 *(long double *)retval
= excl
.retval
;
2384 /* atan2(0.0,0.0) */
2386 DOMAIND
; NAMED
= (char *) "atan2";
2392 WRITED_ATAN2_ZERO_BY_ZERO
;
2396 *(double *)retval
= exc
.retval
;
2400 /* atan2f(0.0,0.0) */
2402 DOMAINF
; NAMEF
= (char *) "atan2f";
2408 WRITEF_ATAN2_ZERO_BY_ZERO
;
2412 *(float *)retval
= excf
.retval
;
2416 /* atan2dl(0.0,0.0) */
2418 DOMAINL
; NAMEL
= (char *) "atan2dl";
2424 WRITEL_ATAN2D_ZERO_BY_ZERO
;
2428 *(long double *)retval
= excl
.retval
;
2432 /* atan2d(0.0,0.0) */
2434 DOMAIND
; NAMED
= (char *) "atan2d";
2440 WRITED_ATAN2D_ZERO_BY_ZERO
;
2444 *(double *)retval
= exc
.retval
;
2448 /* atan2df(0.0,0.0) */
2450 DOMAINF
; NAMEF
= (char *) "atan2df";
2456 WRITEF_ATAN2D_ZERO_BY_ZERO
;
2460 *(float *)retval
= excf
.retval
;
2463 case expm1_overflow
:
2464 /* expm1(finite) overflow */
2465 /* Overflow is the only documented */
2466 /* special value. */
2471 case expm1f_overflow
:
2472 /* expm1f(finite) overflow */
2477 case expm1_underflow
:
2478 /* expm1(finite) underflow */
2479 /* Underflow is not documented */
2480 /* special value. */
2485 case expm1f_underflow
:
2486 /* expm1f(finite) underflow */
2491 case scalbl_underflow
:
2492 /* scalbl underflow */
2494 UNDERFLOWL
; NAMEL
= (char *) "scalbl";
2495 if (INPUT_XL
< ZEROL_VALUE
/*0.0L*/) RETVAL_NEG_ZEROL
;
2497 NOT_MATHERRL
{ERRNO_RANGE
;}
2498 *(long double *)retval
= excl
.retval
;
2501 case scalb_underflow
:
2502 /* scalb underflow */
2504 UNDERFLOWD
; NAMED
= (char *) "scalb";
2505 if (INPUT_XD
< ZEROD_VALUE
/*0.0*/) RETVAL_NEG_ZEROD
;
2507 NOT_MATHERRD
{ERRNO_RANGE
;}
2508 *(double *)retval
= exc
.retval
;
2511 case scalbf_underflow
:
2512 /* scalbf underflow */
2514 UNDERFLOWF
; NAMEF
= (char *) "scalbf";
2515 if (INPUT_XF
< ZEROF_VALUE
/*0.0*/) RETVAL_NEG_ZEROF
;
2517 NOT_MATHERRF
{ERRNO_RANGE
;}
2518 *(float *)retval
= excf
.retval
;
2521 case scalbl_overflow
:
2522 /* scalbl overflow */
2524 OVERFLOWL
; NAMEL
= (char *) "scalbl";
2525 if (INPUT_XL
< ZEROL_VALUE
/*0*/) RETVAL_NEG_HUGE_VALL
;
2526 else RETVAL_HUGE_VALL
;
2527 NOT_MATHERRL
{ERRNO_RANGE
;}
2528 *(long double *)retval
= excl
.retval
;
2531 case scalb_overflow
:
2532 /* scalb overflow */
2534 OVERFLOWD
; NAMED
= (char *) "scalb";
2535 if (INPUT_XD
< ZEROD_VALUE
/*0*/) RETVAL_NEG_HUGE_VALD
;
2536 else RETVAL_HUGE_VALD
;
2537 NOT_MATHERRD
{ERRNO_RANGE
;}
2538 *(double *)retval
= exc
.retval
;
2541 case scalbf_overflow
:
2542 /* scalbf overflow */
2544 OVERFLOWF
; NAMEF
= (char *) "scalbf";
2545 if (INPUT_XF
< ZEROF_VALUE
/*0*/) RETVAL_NEG_HUGE_VALF
;
2546 else RETVAL_HUGE_VALF
;
2547 NOT_MATHERRF
{ERRNO_RANGE
;}
2548 *(float *)retval
= excf
.retval
;
2551 case hypotl_overflow
:
2552 /* hypotl overflow */
2554 OVERFLOWL
; NAMEL
= (char *) "hypotl";
2563 NOT_MATHERRL
{ERRNO_RANGE
;}
2564 *(long double *)retval
= excl
.retval
;
2567 case hypot_overflow
:
2568 /* hypot overflow */
2570 OVERFLOWD
; NAMED
= (char *) "hypot";
2579 NOT_MATHERRD
{ERRNO_RANGE
;}
2580 *(double *)retval
= exc
.retval
;
2583 case hypotf_overflow
:
2584 /* hypotf overflow */
2586 OVERFLOWF
; NAMEF
= (char *) "hypotf";
2595 NOT_MATHERRF
{ERRNO_RANGE
;}
2596 *(float *)retval
= excf
.retval
;
2602 DOMAINL
; NAMEL
= (char *) "acosl";
2614 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2616 *(long double *)retval
= excl
.retval
;
2622 DOMAIND
; NAMED
= (char *) "acos";
2634 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2636 *(double *)retval
= exc
.retval
;
2642 DOMAINF
; NAMEF
= (char *) "acosf";
2654 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2656 *(float *)retval
= excf
.retval
;
2662 DOMAINL
; NAMEL
= (char *) "asinl";
2674 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2676 *(long double *)retval
= excl
.retval
;
2682 DOMAIND
; NAMED
= (char *) "asin";
2694 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2696 *(double *)retval
= exc
.retval
;
2702 DOMAINF
; NAMEF
= (char *) "asinf";
2714 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2716 *(float *)retval
= excf
.retval
;
2722 DOMAINL
; NAMEL
= (char *) "acosdl";
2734 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2736 *(long double *)retval
= excl
.retval
;
2742 DOMAIND
; NAMED
= (char *) "acosd";
2754 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2756 *(double *)retval
= exc
.retval
;
2762 DOMAINF
; NAMEF
= (char *) "acosdf";
2774 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2776 *(float *)retval
= excf
.retval
;
2782 DOMAINL
; NAMEL
= (char *) "asindl";
2794 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2796 *(long double *)retval
= excl
.retval
;
2802 DOMAIND
; NAMED
= (char *) "asind";
2814 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2816 *(double *)retval
= exc
.retval
;
2822 DOMAINF
; NAMEF
= (char *) "asindf";
2834 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2836 *(float *)retval
= excf
.retval
;
2839 case coshl_overflow
:
2840 /* coshl overflow */
2842 OVERFLOWL
; NAMEL
= (char *) "coshl";
2851 NOT_MATHERRL
{ERRNO_RANGE
;}
2852 *(long double *)retval
= excl
.retval
;
2858 OVERFLOWD
; NAMED
= (char *) "cosh";
2867 NOT_MATHERRD
{ERRNO_RANGE
;}
2868 *(double *)retval
= exc
.retval
;
2871 case coshf_overflow
:
2872 /* coshf overflow */
2874 OVERFLOWF
; NAMEF
= (char *) "coshf";
2883 NOT_MATHERRF
{ERRNO_RANGE
;}
2884 *(float *)retval
= excf
.retval
;
2887 case sinhl_overflow
:
2888 /* sinhl overflow */
2890 OVERFLOWL
; NAMEL
= (char *) "sinhl";
2893 if (INPUT_XL
> ZEROL_VALUE
/*0.0*/) RETVAL_HUGEL
;
2894 else RETVAL_NEG_HUGEL
;
2898 if (INPUT_XL
> ZEROL_VALUE
/*0.0*/) RETVAL_HUGE_VALL
;
2899 else RETVAL_NEG_HUGE_VALL
;
2901 NOT_MATHERRL
{ERRNO_RANGE
;}
2902 *(long double *)retval
= excl
.retval
;
2908 OVERFLOWD
; NAMED
= (char *) "sinh";
2911 if (INPUT_XD
> ZEROD_VALUE
/*0.0*/) RETVAL_HUGED
;
2912 else RETVAL_NEG_HUGED
;
2916 if (INPUT_XD
> ZEROD_VALUE
/*0.0*/) RETVAL_HUGE_VALD
;
2917 else RETVAL_NEG_HUGE_VALD
;
2919 NOT_MATHERRD
{ERRNO_RANGE
;}
2920 *(double *)retval
= exc
.retval
;
2923 case sinhf_overflow
:
2924 /* sinhf overflow */
2926 OVERFLOWF
; NAMEF
= (char *) "sinhf";
2929 if (INPUT_XF
> ZEROF_VALUE
/*0.0*/) RETVAL_HUGEF
;
2930 else RETVAL_NEG_HUGEF
;
2934 if (INPUT_XF
> ZEROF_VALUE
/*0.0*/) RETVAL_HUGE_VALF
;
2935 else RETVAL_NEG_HUGE_VALF
;
2937 NOT_MATHERRF
{ERRNO_RANGE
;}
2938 *(float *)retval
= excf
.retval
;
2944 DOMAINL
; NAMEL
= (char *) "acoshl";
2955 NOT_MATHERRL
{ERRNO_DOMAIN
;}
2957 *(long double *)retval
= excl
.retval
;
2963 DOMAIND
; NAMED
= (char *) "acosh";
2974 NOT_MATHERRD
{ERRNO_DOMAIN
;}
2976 *(double *)retval
= exc
.retval
;
2982 DOMAINF
; NAMEF
= (char *) "acoshf";
2993 NOT_MATHERRF
{ERRNO_DOMAIN
;}
2995 *(float *)retval
= excf
.retval
;
2999 /* atanhl(|x| > 1) */
3001 DOMAINL
; NAMEL
= (char *) "atanhl";
3006 WRITEL_ATANH_GT_ONE
;
3012 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3017 /* atanh(|x| > 1) */
3019 DOMAIND
; NAMED
= (char *) "atanh";
3024 WRITED_ATANH_GT_ONE
;
3030 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3035 /* atanhf(|x| > 1) */
3037 DOMAINF
; NAMEF
= (char *) "atanhf";
3042 WRITEF_ATANH_GT_ONE
;
3048 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3053 /* atanhl(|x| == 1) */
3055 SINGL
; NAMEL
= (char *) "atanhl";
3060 WRITEL_ATANH_EQ_ONE
;
3066 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3071 /* atanh(|x| == 1) */
3073 SINGD
; NAMED
= (char *) "atanh";
3078 WRITED_ATANH_EQ_ONE
;
3084 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3089 /* atanhf(|x| == 1) */
3091 SINGF
; NAMEF
= (char *) "atanhf";
3096 WRITEF_ATANH_EQ_ONE
;
3102 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3106 case gammal_overflow
:
3107 /* gammal overflow */
3109 OVERFLOWL
; NAMEL
= (char *) "gammal";
3118 NOT_MATHERRL
{ERRNO_RANGE
;}
3119 *(long double *)retval
= excl
.retval
;
3122 case gamma_overflow
:
3123 /* gamma overflow */
3125 OVERFLOWD
; NAMED
= (char *) "gamma";
3134 NOT_MATHERRD
{ERRNO_RANGE
;}
3135 *(double *)retval
= exc
.retval
;
3138 case gammaf_overflow
:
3139 /* gammaf overflow */
3141 OVERFLOWF
; NAMEF
= (char *) "gammaf";
3150 NOT_MATHERRF
{ERRNO_RANGE
;}
3151 *(float *)retval
= excf
.retval
;
3154 case gammal_negative
:
3155 /* gammal -int or 0 */
3157 SINGL
; NAMEL
= (char *) "gammal";
3163 WRITEL_GAMMA_NEGATIVE
;
3170 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3172 *(long double *)retval
= excl
.retval
;
3175 case gamma_negative
:
3176 /* gamma -int or 0 */
3178 SINGD
; NAMED
= (char *) "gamma";
3184 WRITED_GAMMA_NEGATIVE
;
3191 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3193 *(double *)retval
= exc
.retval
;
3196 case gammaf_negative
:
3197 /* gammaf -int or 0 */
3199 SINGF
; NAMEF
= (char *) "gammaf";
3205 WRITEF_GAMMA_NEGATIVE
;
3212 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3214 *(float *)retval
= excf
.retval
;
3217 case lgammal_overflow
:
3218 /* lgammal overflow */
3220 OVERFLOWL
; NAMEL
= (char *) "lgammal";
3229 NOT_MATHERRL
{ERRNO_RANGE
;}
3230 *(long double *)retval
= excl
.retval
;
3233 case lgamma_overflow
:
3234 /* lgamma overflow */
3236 OVERFLOWD
; NAMED
= (char *) "lgamma";
3245 NOT_MATHERRD
{ERRNO_RANGE
;}
3246 *(double *)retval
= exc
.retval
;
3249 case lgammaf_overflow
:
3250 /* lgammaf overflow */
3252 OVERFLOWF
; NAMEF
= (char *) "lgammaf";
3261 NOT_MATHERRF
{ERRNO_RANGE
;}
3262 *(float *)retval
= excf
.retval
;
3265 case lgammal_negative
:
3266 /* lgammal -int or 0 */
3268 SINGL
; NAMEL
= (char *) "lgammal";
3274 WRITEL_LGAMMA_NEGATIVE
;
3281 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3283 *(long double *)retval
= excl
.retval
;
3286 case lgamma_negative
:
3287 /* lgamma -int or 0 */
3289 SINGD
; NAMED
= (char *) "lgamma";
3295 WRITED_LGAMMA_NEGATIVE
;
3302 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3304 *(double *)retval
= exc
.retval
;
3307 case lgammaf_negative
:
3308 /* lgammaf -int or 0 */
3310 SINGF
; NAMEF
= (char *) "lgammaf";
3316 WRITEF_LGAMMA_NEGATIVE
;
3323 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3325 *(float *)retval
= excf
.retval
;
3328 case tgammal_overflow
:
3329 /* tgammal overflow */
3331 OVERFLOWL
; NAMEL
= (char *) "tgammal";
3340 NOT_MATHERRL
{ERRNO_RANGE
;}
3341 *(long double *)retval
= excl
.retval
;
3344 case tgamma_overflow
:
3345 /* tgamma overflow */
3347 OVERFLOWD
; NAMED
= (char *) "tgamma";
3356 NOT_MATHERRD
{ERRNO_RANGE
;}
3357 *(double *)retval
= exc
.retval
;
3360 case tgammaf_overflow
:
3361 /* tgammaf overflow */
3363 OVERFLOWF
; NAMEF
= (char *) "tgammaf";
3372 NOT_MATHERRF
{ERRNO_RANGE
;}
3373 *(float *)retval
= excf
.retval
;
3376 case tgammal_negative
:
3377 /* tgammal -int or 0 */
3379 SINGL
; NAMEL
= (char *) "tgammal";
3384 WRITEL_TGAMMA_NEGATIVE
;
3390 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3392 *(long double *)retval
= excl
.retval
;
3395 case tgamma_negative
:
3396 /* tgamma -int or 0 */
3398 SINGD
; NAMED
= (char *) "tgamma";
3403 WRITED_TGAMMA_NEGATIVE
;
3409 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3411 *(double *)retval
= exc
.retval
;
3414 case tgammaf_negative
:
3415 /* tgammaf -int or 0 */
3417 SINGF
; NAMEF
= (char *) "tgammaf";
3422 WRITEF_TGAMMA_NEGATIVE
;
3428 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3430 *(float *)retval
= excf
.retval
;
3436 TLOSSL
; NAMEL
= (char *) "j0l";
3448 NOT_MATHERRL
{ERRNO_RANGE
;}
3450 *(long double *)retval
= excl
.retval
;
3456 TLOSSD
; NAMED
= (char *) "j0";
3468 NOT_MATHERRD
{ERRNO_RANGE
;}
3470 *(double*)retval
= exc
.retval
;
3476 TLOSSF
; NAMEF
= (char *) "j0f";
3488 NOT_MATHERRF
{ERRNO_RANGE
;}
3490 *(float*)retval
= excf
.retval
;
3496 TLOSSL
; NAMEL
= (char *) "j1l";
3508 NOT_MATHERRL
{ERRNO_RANGE
;}
3510 *(long double *)retval
= excl
.retval
;
3516 TLOSSD
; NAMED
= (char *) "j1";
3528 NOT_MATHERRD
{ERRNO_RANGE
;}
3530 *(double*)retval
= exc
.retval
;
3536 TLOSSF
; NAMEF
= (char *) "j1f";
3548 NOT_MATHERRF
{ERRNO_RANGE
;}
3550 *(float*)retval
= excf
.retval
;
3556 TLOSSL
; NAMEL
= (char *) "jnl";
3568 NOT_MATHERRL
{ERRNO_RANGE
;}
3570 *(long double *)retval
= excl
.retval
;
3576 TLOSSD
; NAMED
= (char *) "jn";
3588 NOT_MATHERRD
{ERRNO_RANGE
;}
3590 *(double*)retval
= exc
.retval
;
3596 TLOSSF
; NAMEF
= (char *) "jnf";
3608 NOT_MATHERRF
{ERRNO_RANGE
;}
3610 *(float*)retval
= excf
.retval
;
3616 TLOSSL
; NAMEL
= (char *) "y0l";
3628 NOT_MATHERRL
{ERRNO_RANGE
;}
3630 *(long double *)retval
= excl
.retval
;
3636 TLOSSD
; NAMED
= (char *) "y0";
3648 NOT_MATHERRD
{ERRNO_RANGE
;}
3650 *(double*)retval
= exc
.retval
;
3656 TLOSSF
; NAMEF
= (char *) "y0f";
3668 NOT_MATHERRF
{ERRNO_RANGE
;}
3670 *(float*)retval
= excf
.retval
;
3676 DOMAINL
; NAMEL
= (char *) "y0l";
3688 RETVAL_NEG_HUGE_VALL
;
3689 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3691 *(long double *)retval
= excl
.retval
;
3697 DOMAIND
; NAMED
= (char *) "y0";
3709 RETVAL_NEG_HUGE_VALD
;
3710 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3712 *(double *)retval
= exc
.retval
;
3718 DOMAINF
; NAMEF
= (char *) "y0f";
3730 RETVAL_NEG_HUGE_VALF
;
3731 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3733 *(float *)retval
= excf
.retval
;
3739 TLOSSL
; NAMEL
= (char *) "y1l";
3751 NOT_MATHERRL
{ERRNO_RANGE
;}
3753 *(long double *)retval
= excl
.retval
;
3759 TLOSSD
; NAMED
= (char *) "y1";
3771 NOT_MATHERRD
{ERRNO_RANGE
;}
3773 *(double*)retval
= exc
.retval
;
3779 TLOSSF
; NAMEF
= (char *) "y1f";
3791 NOT_MATHERRF
{ERRNO_RANGE
;}
3793 *(float*)retval
= excf
.retval
;
3799 DOMAINL
; NAMEL
= (char *) "y1l";
3811 RETVAL_NEG_HUGE_VALL
;
3812 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3814 *(long double *)retval
= excl
.retval
;
3820 DOMAIND
; NAMED
= (char *) "y1";
3832 RETVAL_NEG_HUGE_VALD
;
3833 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3835 *(double *)retval
= exc
.retval
;
3841 DOMAINF
; NAMEF
= (char *) "y1f";
3853 RETVAL_NEG_HUGE_VALF
;
3854 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3856 *(float *)retval
= excf
.retval
;
3862 TLOSSL
; NAMEL
= (char *) "ynl";
3874 NOT_MATHERRL
{ERRNO_RANGE
;}
3876 *(long double *)retval
= excl
.retval
;
3882 TLOSSD
; NAMED
= (char *) "yn";
3894 NOT_MATHERRD
{ERRNO_RANGE
;}
3896 *(double*)retval
= exc
.retval
;
3902 TLOSSF
; NAMEF
= (char *) "ynf";
3914 NOT_MATHERRF
{ERRNO_RANGE
;}
3916 *(float*)retval
= excf
.retval
;
3922 DOMAINL
; NAMEL
= (char *) "ynl";
3934 RETVAL_NEG_HUGE_VALL
;
3935 NOT_MATHERRL
{ERRNO_DOMAIN
;}
3937 *(long double *)retval
= excl
.retval
;
3943 DOMAIND
; NAMED
= (char *) "yn";
3955 RETVAL_NEG_HUGE_VALD
;
3956 NOT_MATHERRD
{ERRNO_DOMAIN
;}
3958 *(double *)retval
= exc
.retval
;
3964 DOMAINF
; NAMEF
= (char *) "ynf";
3976 RETVAL_NEG_HUGE_VALF
;
3977 NOT_MATHERRF
{ERRNO_DOMAIN
;}
3979 *(float *)retval
= excf
.retval
;
3985 DOMAINL
; NAMEL
= (char *) "y0l";
3997 RETVAL_NEG_HUGE_VALL
;
3998 NOT_MATHERRL
{ERRNO_DOMAIN
;}
4000 *(long double *)retval
= excl
.retval
;
4006 DOMAIND
; NAMED
= (char *) "y0";
4018 RETVAL_NEG_HUGE_VALD
;
4019 NOT_MATHERRD
{ERRNO_DOMAIN
;}
4021 *(double *)retval
= exc
.retval
;
4027 DOMAINF
; NAMEF
= (char *) "y0f";
4039 RETVAL_NEG_HUGE_VALF
;
4040 NOT_MATHERRF
{ERRNO_DOMAIN
;}
4042 *(float *)retval
= excf
.retval
;
4048 DOMAINL
; NAMEL
= (char *) "y1l";
4060 RETVAL_NEG_HUGE_VALL
;
4061 NOT_MATHERRL
{ERRNO_DOMAIN
;}
4063 *(long double *)retval
= excl
.retval
;
4069 DOMAIND
; NAMED
= (char *) "y1";
4081 RETVAL_NEG_HUGE_VALD
;
4082 NOT_MATHERRD
{ERRNO_DOMAIN
;}
4084 *(double *)retval
= exc
.retval
;
4090 DOMAINF
; NAMEF
= (char *) "y1f";
4102 RETVAL_NEG_HUGE_VALF
;
4103 NOT_MATHERRF
{ERRNO_DOMAIN
;}
4105 *(float *)retval
= excf
.retval
;
4111 DOMAINL
; NAMEL
= (char *) "ynl";
4123 RETVAL_NEG_HUGE_VALL
;
4124 NOT_MATHERRL
{ERRNO_DOMAIN
;}
4126 *(long double *)retval
= excl
.retval
;
4132 DOMAIND
; NAMED
= (char *) "yn";
4144 RETVAL_NEG_HUGE_VALD
;
4145 NOT_MATHERRD
{ERRNO_DOMAIN
;}
4147 *(double *)retval
= exc
.retval
;
4153 DOMAINF
; NAMEF
= (char *) "ynf";
4165 RETVAL_NEG_HUGE_VALF
;
4166 NOT_MATHERRF
{ERRNO_DOMAIN
;}
4168 *(float *)retval
= excf
.retval
;
4174 DOMAINL
; NAMEL
= (char *) "fmodl";
4177 *(long double *)retval
= *(long double *)arg1
;
4185 { /* NaN already computed */
4186 NOT_MATHERRL
{ERRNO_DOMAIN
;}
4188 *(long double *)retval
= excl
.retval
;
4194 DOMAIND
; NAMED
= (char *) "fmod";
4197 *(double *)retval
= *(double *)arg1
;
4205 { /* NaN already computed */
4206 NOT_MATHERRD
{ERRNO_DOMAIN
;}
4208 *(double *)retval
= exc
.retval
;
4214 DOMAINF
; NAMEF
= (char *) "fmodf";
4217 *(float *)retval
= *(float *)arg1
;
4226 NOT_MATHERRF
{ERRNO_DOMAIN
;}
4228 *(float *)retval
= excf
.retval
;
4231 case remainderl_by_zero
:
4232 /* remainderl(x,0) */
4234 DOMAINL
; NAMEL
= (char *) "remainderl";
4244 { /* NaN already computed */
4245 NOT_MATHERRL
{ERRNO_DOMAIN
;}
4247 *(long double *)retval
= excl
.retval
;
4250 case remainder_by_zero
:
4251 /* remainder(x,0) */
4253 DOMAIND
; NAMED
= (char *) "remainder";
4263 { /* NaN already computed */
4264 NOT_MATHERRD
{ERRNO_DOMAIN
;}
4266 *(double *)retval
= exc
.retval
;
4269 case remainderf_by_zero
:
4270 /* remainderf(x,0) */
4272 DOMAINF
; NAMEF
= (char *) "remainderf";
4283 NOT_MATHERRF
{ERRNO_DOMAIN
;}
4285 *(float *)retval
= excf
.retval
;
4289 /* We don't want to abort () since SVID doesn't cover all math
4290 library functions. */