~ubuntu-branches/ubuntu/precise/eglibc/precise-201308281639

« back to all changes in this revision

Viewing changes to math/w_tgammal.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-02-08 01:58:09 UTC
  • mfrom: (1.5.3) (288.1.12 precise)
  • Revision ID: package-import@ubuntu.com-20120208015809-ulscst7uteq3e22z
Tags: 2.15~pre6-0ubuntu10
Merge from Debian (r5151, 2.13-26).

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 * ====================================================
15
15
 */
16
16
 
17
 
#if defined(LIBM_SCCS) && !defined(lint)
18
 
static char rcsid[] = "$NetBSD: $";
19
 
#endif
20
 
 
21
17
/* long double gammal(double x)
22
18
 * Return the Gamma function of x.
23
19
 */
24
20
 
25
21
#include <math.h>
26
 
#include "math_private.h"
 
22
#include <math_private.h>
27
23
 
28
 
#ifdef __STDC__
29
 
        long double __tgammal(long double x)
30
 
#else
31
 
        long double __tgammal(x)
32
 
        long double x;
33
 
#endif
 
24
long double
 
25
__tgammal(long double x)
34
26
{
35
 
        long double y;
36
27
        int local_signgam;
37
 
        y = __ieee754_gammal_r(x,&local_signgam);
38
 
        if (local_signgam < 0) y = -y;
39
 
#ifdef _IEEE_LIBM
40
 
        return y;
41
 
#else
42
 
        if(_LIB_VERSION == _IEEE_) return y;
 
28
        long double y = __ieee754_gammal_r(x,&local_signgam);
43
29
 
44
 
        if(!__finitel(y)&&__finitel(x)) {
 
30
        if(__builtin_expect(!__finitel(y), 0) && __finitel(x)
 
31
           && _LIB_VERSION != _IEEE_) {
45
32
          if(x==0.0)
46
33
            return __kernel_standard(x,x,250); /* tgamma pole */
47
 
          else if(__floorl(x)==x&&x<0.0)
 
34
          else if(__floorl(x)==x&&x<0.0L)
48
35
            return __kernel_standard(x,x,241); /* tgamma domain */
49
36
          else
50
37
            return __kernel_standard(x,x,240); /* tgamma overflow */
51
38
        }
52
 
        return y;
53
 
#endif
 
39
        return local_signgam < 0 ? - y : y;
54
40
}
55
41
weak_alias (__tgammal, tgammal)