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

« back to all changes in this revision

Viewing changes to math/w_cosh.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:
1
 
/* @(#)w_cosh.c 5.1 93/09/24 */
 
1
/* Optimizations bu Ulrich Drepper <drepper@gmail.com>, 2011 */
2
2
/*
3
3
 * ====================================================
4
4
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
10
10
 * ====================================================
11
11
 */
12
12
 
13
 
#if defined(LIBM_SCCS) && !defined(lint)
14
 
static char rcsid[] = "$NetBSD: w_cosh.c,v 1.6 1995/05/10 20:48:47 jtc Exp $";
15
 
#endif
16
 
 
17
13
/*
18
14
 * wrapper cosh(x)
19
15
 */
20
16
 
21
17
#include <math.h>
22
 
#include "math_private.h"
 
18
#include <math_private.h>
23
19
 
24
 
#ifdef __STDC__
25
 
        double __cosh(double x)         /* wrapper cosh */
26
 
#else
27
 
        double __cosh(x)                        /* wrapper cosh */
28
 
        double x;
29
 
#endif
 
20
double
 
21
__cosh (double x)
30
22
{
31
 
#ifdef _IEEE_LIBM
32
 
        return __ieee754_cosh(x);
33
 
#else
34
 
        double z;
35
 
        z = __ieee754_cosh(x);
36
 
        if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
37
 
        if(!__finite(z) && __finite(x)) {
38
 
                return __kernel_standard(x,x,5); /* cosh overflow */
39
 
        } else
40
 
            return z;
41
 
#endif
 
23
        double z = __ieee754_cosh (x);
 
24
        if (__builtin_expect (!__finite (z), 0) && __finite (x)
 
25
            && _LIB_VERSION != _IEEE_)
 
26
                return __kernel_standard (x, x, 5); /* cosh overflow */
 
27
 
 
28
        return z;
42
29
}
43
30
weak_alias (__cosh, cosh)
44
31
#ifdef NO_LONG_DOUBLE