]> git.ipfire.org Git - thirdparty/glibc.git/blame - math/w_lgammal_main.c
Fix the inaccuracy of j0f/j1f/y0f/y1f [BZ #14469, #14470, #14471, #14472]
[thirdparty/glibc.git] / math / w_lgammal_main.c
CommitLineData
d709042a
JM
1/* w_lgammal.c -- long double version of w_lgamma.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/* long double lgammal(long double x)
18 * Return the logarithm of the Gamma function of x.
19 *
20 * Method: call __ieee754_lgammal_r
21 */
22
23#include <math.h>
24#include <math_private.h>
813378e9 25#include <math-svid-compat.h>
24b6515d 26#include <libm-alias-ldouble.h>
d709042a
JM
27
28#include <lgamma-compat.h>
29
30#if BUILD_LGAMMA
31long double
32LGFUNC (__lgammal) (long double x)
33{
34 long double y = CALL_LGAMMA (long double, __ieee754_lgammal_r, x);
35 if(__builtin_expect(!isfinite(y), 0)
36 && isfinite(x) && _LIB_VERSION != _IEEE_)
37 return __kernel_standard_l(x, x,
e44acb20 38 floorl(x)==x&&x<=0.0L
d709042a
JM
39 ? 215 /* lgamma pole */
40 : 214); /* lgamma overflow */
41
42 return y;
43}
44# if USE_AS_COMPAT
45compat_symbol (libm, __lgammal_compat, lgammal, LGAMMA_OLD_VER);
46# else
47versioned_symbol (libm, __lgammal, lgammal, LGAMMA_NEW_VER);
24b6515d 48libm_alias_ldouble_other (__lgamma, lgamma)
d709042a
JM
49# endif
50# if GAMMA_ALIAS
51strong_alias (LGFUNC (__lgammal), __gammal)
52weak_alias (__gammal, gammal)
53# endif
54#endif