Optimize tr_freehook
[glibc.git] / math / w_lgammal.c
blob7df38e761b0c11545f7f9cf02ea4aaa7618b6f01
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 */
6 /*
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
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 * ====================================================
17 /* long double lgammal(long double x)
18 * Return the logarithm of the Gamma function of x.
20 * Method: call __ieee754_lgammal_r
23 #include <math.h>
24 #include <math_private.h>
26 long double
27 __lgammal(long double x)
29 int local_signgam = 0;
30 long double y = __ieee754_lgammal_r(x,
31 _LIB_VERSION != _ISOC_
32 /* ISO C99 does not define the
33 global variable. */
34 ? &signgam
35 : &local_signgam);
36 if(__builtin_expect(!__finitel(y), 0)
37 && __finitel(x) && _LIB_VERSION != _IEEE_)
38 return __kernel_standard(x, x,
39 __floorl(x)==x&&x<=0.0L
40 ? 215 /* lgamma pole */
41 : 214); /* lgamma overflow */
43 return y;
45 weak_alias (__lgammal, lgammal)
46 strong_alias (__lgammal, __gammal)
47 weak_alias (__gammal, gammal)