]> git.ipfire.org Git - thirdparty/glibc.git/blame - math/w_expl_compat.c
Improve the accuracy of tgamma (BZ #26983)
[thirdparty/glibc.git] / math / w_expl_compat.c
CommitLineData
bcea7ad6
SN
1/* w_expl.c -- long double version of w_exp.c.
2 * Conversion to long double by Ulrich Drepper,
3 * Cygnus Support, drepper@cygnus.com.
4 */
5
6/*
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9 *
10 * Developed at SunPro, a Sun Microsystems, Inc. business.
11 * Permission to use, copy, modify, and distribute this
12 * software is freely granted, provided that this notice
13 * is preserved.
14 * ====================================================
15 */
16
17#if defined(LIBM_SCCS) && !defined(lint)
18static char rcsid[] = "$NetBSD: $";
19#endif
20
21/*
22 * wrapper expl(x)
23 */
24
abfbdde1 25#include <math.h>
bcea7ad6
SN
26#include <math_private.h>
27#include <math-svid-compat.h>
92892fdb 28#include <libm-alias-ldouble.h>
abfbdde1 29
bcea7ad6
SN
30#if LIBM_SVID_COMPAT
31long double __expl(long double x) /* wrapper exp */
abfbdde1 32{
bcea7ad6
SN
33# ifdef _IEEE_LIBM
34 return __ieee754_expl(x);
35# else
36 long double z = __ieee754_expl (x);
37 if (__glibc_unlikely (!isfinite (z) || z == 0)
38 && isfinite (x) && _LIB_VERSION != _IEEE_)
39 return __kernel_standard_l (x, x, 206 + !!signbit (x));
abfbdde1 40
bcea7ad6
SN
41 return z;
42# endif
43}
dc115e1c 44libm_hidden_def (__expl)
92892fdb 45libm_alias_ldouble (__exp, exp)
bcea7ad6 46#endif