1 /* @(#)w_lgamma.c 5.1 93/09/24 */
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
10 * ====================================================
13 /* double lgamma(double x)
14 * Return the logarithm of the Gamma function of x.
16 * Method: call __ieee754_lgamma_r
20 #include <math_private.h>
22 #include <lgamma-compat.h>
26 LGFUNC (__lgamma
) (double x
)
28 double y
= CALL_LGAMMA (double, __ieee754_lgamma_r
, x
);
29 if(__builtin_expect(!isfinite(y
), 0)
30 && isfinite(x
) && _LIB_VERSION
!= _IEEE_
)
31 return __kernel_standard(x
, x
,
33 ? 15 /* lgamma pole */
34 : 14); /* lgamma overflow */
39 compat_symbol (libm
, __lgamma_compat
, lgamma
, LGAMMA_OLD_VER
);
40 # ifdef NO_LONG_DOUBLE
41 strong_alias (__lgamma_compat
, __lgammal_compat
)
42 compat_symbol (libm
, __lgammal_compat
, lgammal
, LGAMMA_OLD_VER
);
45 versioned_symbol (libm
, __lgamma
, lgamma
, LGAMMA_NEW_VER
);
46 # ifdef NO_LONG_DOUBLE
47 strong_alias (__lgamma
, __lgammal
)
48 versioned_symbol (libm
, __lgammal
, lgammal
, LGAMMA_NEW_VER
);
52 strong_alias (LGFUNC (__lgamma
), __gamma
)
53 weak_alias (__gamma
, gamma
)
54 # ifdef NO_LONG_DOUBLE
55 strong_alias (__gamma
, __gammal
)
56 weak_alias (__gamma
, gammal
)